ProductManageRnav.cshtml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. 
  2. <div id="ProductManageDiv">
  3. <form action="" method="post" class="config-form">
  4. <div class="config-form-group">
  5. <label class="config-form-label">油品编号</label>
  6. <label class="config-form-label">标注</label>
  7. </div>
  8. <div class="config-form-hint-group">
  9. <label class="config-form-hint">填写油品编号</label>
  10. <label class="config-form-hint">填写油品标准,实际油品的名称</label>
  11. </div>
  12. <div v-for="r in rows">
  13. <div class="config-form-group">
  14. <input class="config-form-input" v-model="r.ProductCode" />
  15. <label class="config-form-padding">p</label>
  16. <input class="config-form-input" v-model="r.ProductLabel" />
  17. </div>
  18. <div class="config-form-hint-group">
  19. <label class="config-form-hint" style="color: transparent;">p</label>
  20. </div>
  21. </div>
  22. <button class="config-form-add" type="button" @@click="addrow()" />
  23. <div class="config-form-submit-group">
  24. <label :class="show ? (result ? 'config-form-result' : 'config-form-result-fail') : 'color-transparent'">{{ result ? '提交完成' : '提交失败' }}</label>
  25. </div>
  26. <div class="config-form-submit-group">
  27. <label class="config-form-label"></label>
  28. <button class="config-form-submit" type="button" @@click="submit(event)" id="ProductConfig" />
  29. </div>
  30. </form>
  31. </div>
  32. <script type="text/javascript">
  33. var vm = new Vue({
  34. el: '#ProductManageDiv',
  35. data: {
  36. rows: [{ 'ProductCode': '0', 'ProductLabel': '0#' }, { 'ProductCode': '2', 'ProductLabel': '92#' }],
  37. show: false,
  38. result: false
  39. },
  40. mounted: function () {
  41. let path = '/sys/atg_classic_App/Application.ATG_Classic_App.App/thing/service/GetConfigAsync'
  42. Publish1(path)
  43. },
  44. methods: {
  45. addrow() {
  46. this.rows[this.rows.length] = { 'ProductCode': '', 'ProductLabel': '' }
  47. this.$forceUpdate()
  48. return false
  49. },
  50. submit(e) {
  51. let path = '/sys/atg_classic_App/Application.ATG_Classic_App.App/thing/service/UpsertConfigAsync'
  52. Publish(e.target.id, JSON.stringify(this.rows), path)
  53. //Publish(e.target.id, JSON.stringify({ 'ProductCode': '2', 'ProductLabel': '92#' }), path)
  54. return false
  55. }
  56. }
  57. })
  58. function OnReply(jsonObj) {
  59. console.log(JSON.stringify(jsonObj));
  60. //vm.rows = jsonObj
  61. }
  62. </script>