Label_AddUser.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div v-if="labelForm.labelFlag == 1" >
  3. <div v-if="labelForm.labelArr.length == 0">
  4. 你未添加标签,请先添加标签后再来设置规则
  5. </div>
  6. <el-collapse v-model="activeNames" @change="handleChange" class="collapse" accordion>
  7. <el-collapse-item title="标签2" name="2">
  8. <div>
  9. 控制反馈:通过界面样式和交互动效让用户可以清晰的感知自己的操作;
  10. </div>
  11. <div>页面反馈:操作后,通过页面元素的变化清晰地展现当前状态。</div>
  12. </el-collapse-item>
  13. <el-collapse-item title="标签3" name="3">
  14. <div>简化流程:设计简洁直观的操作流程;</div>
  15. <div>
  16. 清晰明确:语言表达清晰且表意明确,让用户快速理解进而作出决策;
  17. </div>
  18. <div>
  19. 帮助用户识别:界面简单直白,让用户快速识别而非回忆,减少用户记忆负担。
  20. </div>
  21. </el-collapse-item>
  22. </el-collapse>
  23. </div>
  24. <div v-else>你未启用标签功能</div>
  25. </template>
  26. <script>
  27. import { sysDeptDemoList, labelRulelist } from "@/api/label/label";
  28. import { listPrice } from "@/api/station/price";
  29. export default {
  30. name:"Label_SetLabel",
  31. data() {
  32. return {
  33. activeNames: ["1"],
  34. discountList: [
  35. {
  36. searchValue: null,
  37. createBy: "13",
  38. createTime: "2021-06-16 09:40:39",
  39. updateBy: null,
  40. updateTime: null,
  41. remark: null,
  42. params: {},
  43. stationIdList: null,
  44. id: 26,
  45. grade: "92#",
  46. discountTerm: "2",
  47. discountAmt: "100",
  48. gasoilDiscountAmt: "1",
  49. vipDiscountyPlus: "0",
  50. couponPlus: "0",
  51. discountPlanType: "3",
  52. oilName: "92#",
  53. stationId: 123,
  54. stationName: "智慧易加-西站",
  55. status: "0",
  56. },
  57. {
  58. searchValue: null,
  59. createBy: "13",
  60. createTime: "2021-06-16 09:40:58",
  61. updateBy: null,
  62. updateTime: null,
  63. remark: null,
  64. params: {},
  65. stationIdList: null,
  66. id: 27,
  67. grade: "95#",
  68. discountTerm: "2",
  69. discountAmt: "100",
  70. gasoilDiscountAmt: "1",
  71. vipDiscountyPlus: "0",
  72. couponPlus: "0",
  73. discountPlanType: "3",
  74. oilName: "95#",
  75. stationId: 123,
  76. stationName: "智慧易加-西站",
  77. status: "0",
  78. },
  79. {
  80. searchValue: null,
  81. createBy: "13",
  82. createTime: "2021-06-16 09:45:56",
  83. updateBy: null,
  84. updateTime: null,
  85. remark: null,
  86. params: {},
  87. stationIdList: null,
  88. id: 28,
  89. grade: "98#",
  90. discountTerm: "2",
  91. discountAmt: "100",
  92. gasoilDiscountAmt: "0.5",
  93. vipDiscountyPlus: "0",
  94. couponPlus: "0",
  95. discountPlanType: "3",
  96. oilName: "98#",
  97. stationId: 123,
  98. stationName: "智慧易加-西站",
  99. status: "0",
  100. },
  101. ],
  102. openDialog: false,
  103. updateForm: {},
  104. labelForm: {},
  105. oilNameOptions: [],
  106. };
  107. },
  108. created() {
  109. this.init();
  110. // setTimeout(() => {
  111. // console.log("哈哈");
  112. // console.log(this.oilNameOptions);
  113. // const arr = this.filterOilNameOptions([
  114. // {
  115. // oilName: "92#",
  116. // },
  117. // ]);
  118. // console.log(arr);
  119. // }, 1000);
  120. },
  121. methods: {
  122. init() {
  123. this.getList();
  124. listPrice().then((response) => {
  125. this.oilNameOptions = response.rows;
  126. console.log(this.oilNameOptions);
  127. });
  128. },
  129. handleChange(val) {
  130. console.log(val);
  131. },
  132. addRule(e) {
  133. e.stopPropagation();
  134. console.log(1);
  135. this.openDialog = true;
  136. },
  137. handleSubmit() {},
  138. cancelSubmit() {},
  139. getList() {
  140. return sysDeptDemoList().then((res) => {
  141. if (res.code == 200) {
  142. this.labelForm = res.data;
  143. console.log(this.labelForm);
  144. } else {
  145. this.msgError("初始化数据失败");
  146. }
  147. });
  148. },
  149. filterOilNameOptions(arr) {
  150. return this.oilNameOptions.filter((ele) => {
  151. let flag = true;
  152. arr.forEach((item) => {
  153. if (ele.oilName == item.oilName) {
  154. flag = false;
  155. }
  156. });
  157. return flag;
  158. });
  159. },
  160. },
  161. };
  162. </script>
  163. <style lang="scss">
  164. .collapse {
  165. width: 600px;
  166. margin: 0 auto;
  167. .el-collapse-item__wrap {
  168. // border-bottom: 1px solid;
  169. }
  170. }
  171. </style>