other.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="app-container">
  3. <el-radio-group v-model="formType" size="small" @change="changeType">
  4. <el-radio-button label="first">订单日期设置</el-radio-button>
  5. <el-radio-button label="second">工程登录二次引用设置</el-radio-button>
  6. <el-radio-button label="third">自动预留单生成</el-radio-button>
  7. <el-radio-button label="fourth">库存显示规则设置</el-radio-button>
  8. </el-radio-group>
  9. <div v-show="formType === 'first'">
  10. <div style="margin: 40px 0 30px;">
  11. <span>下单时间超过当天</span>
  12. <el-time-picker v-model="firstForm.input1.dictValue" placeholder="选择时间点" size="small" format="HH:mm" style="width: 150px; margin: 0 10px;"></el-time-picker>
  13. <span>的订单,订单日期计为下一天的日期</span>
  14. </div>
  15. <el-button type="primary" size="small" @click="submitForm('first')">确 定</el-button>
  16. </div>
  17. <div v-show="formType === 'second'">
  18. <div style="margin: 40px 0 30px;">
  19. <div>工程登录二次引用密码设置</div>
  20. <div><el-input v-model="secondForm.input1.dictValue" placeholder="请输入密码" size="small" style="width: 150px; margin-top: 20px;"></el-input></div>
  21. </div>
  22. <el-button type="primary" size="small" @click="submitForm('second')">确 定</el-button>
  23. </div>
  24. <div v-show="formType === 'third'">
  25. <div style="margin: 40px 0 30px;">
  26. <div>预留单自动生成时间,从订单审单后,第</div>
  27. <el-input v-model="thirdForm.input1.dictValue" type="number" size="small" style="width: 150px; margin-top: 20px; margin-right: 10px"></el-input>
  28. <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
  29. </div>
  30. <el-button type="primary" size="small" @click="submitForm('third')">确 定</el-button>
  31. </div>
  32. <div v-show="formType === 'fourth'">
  33. <div style="margin: 40px 0 30px;">
  34. <div>总可发货数 = 总库存数-总预留数-总发货申请暂扣</div>
  35. <div style="margin-top: 20px">订单查询库存时:</div>
  36. <div style="margin-top: 10px">总可发货数为0,显示无货</div>
  37. <div style="margin-top: 10px">
  38. <span>总可发货数</span>
  39. <el-input v-model="fourthForm.input1.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  40. <span>到</span>
  41. <el-input v-model="fourthForm.input2.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  42. <span>,总库存显示具体数量</span>
  43. </div>
  44. <div style="margin-top: 10px">
  45. <span>总可发货数</span>
  46. <el-input v-model="fourthForm.input3.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  47. <span>到</span>
  48. <el-input v-model="fourthForm.input4.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  49. <span>,总库存显示有货</span>
  50. </div>
  51. <div style="margin-top: 10px">
  52. <span>总可发货数大于</span>
  53. <el-input v-model="fourthForm.input5.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  54. <span>,总库存显示充足</span>
  55. </div>
  56. <div style="margin-top: 30px">发货申请查询库存时:</div>
  57. <div style="margin-top: 10px">
  58. <span>可发货数大于</span>
  59. <el-input v-model="fourthForm.input6.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
  60. <span>显示充足</span>
  61. </div>
  62. </div>
  63. <el-button type="primary" size="small" @click="submitForm('fourth')">确 定</el-button>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import { getDictList, editDictList } from '@/api/common'
  69. export default {
  70. data() {
  71. return {
  72. formType: 'first',
  73. firstForm: {
  74. input1: {},
  75. },
  76. secondForm: {
  77. input1: {},
  78. },
  79. thirdForm: {
  80. input1: {},
  81. },
  82. fourthForm: {
  83. input1: {},
  84. input2: {},
  85. input3: {},
  86. input4: {},
  87. input5: {},
  88. input6: {},
  89. }
  90. }
  91. },
  92. created() {
  93. this.getDetail('first');
  94. },
  95. methods: {
  96. // 查询按钮权限
  97. checkBtnRole(value) {
  98. // let btnRole = this.$route.meta.roles;
  99. // if(!btnRole) {return true}
  100. // let index = btnRole.indexOf(value);
  101. // return index >= 0 ? true : false;
  102. return true;
  103. },
  104. changeType(val) {
  105. this.getDetail(val);
  106. },
  107. getDetail(type) {
  108. const MAP = {
  109. first :'ORDER_TIME_LIMIT',
  110. second :'ENGIN_TWO_PWD',
  111. third :'RESERVED_DAY',
  112. fourth :'STOCK_ORDER',
  113. };
  114. getDictList({sysDictEnum: MAP[type]}).then(res => {
  115. let data = res.data.map(item => {
  116. return {
  117. sysDictId: item.sysDictId,
  118. dictValue: item.dictValue,
  119. }
  120. })
  121. if(type != 'fourth') {
  122. this[type+'Form'].input1 = data[0];
  123. }else {
  124. this[type+'Form'].input1 = data[0];
  125. this[type+'Form'].input2 = data[1];
  126. this[type+'Form'].input3 = data[2];
  127. this[type+'Form'].input4 = data[3];
  128. this[type+'Form'].input5 = data[4];
  129. this[type+'Form'].input6 = data[5];
  130. }
  131. })
  132. },
  133. submitForm(type) {
  134. let list = [];
  135. for(var key in this[type+'Form']) {
  136. console.log(this[type+'Form'], this[type+'Form'][key].dictValue);
  137. if(!this[type+'Form'][key].dictValue) {
  138. return this.$errorMsg('请完善信息');
  139. }
  140. list.push(this[type+'Form'][key]);
  141. }
  142. editDictList(list).then(res => {
  143. this.$successMsg('保存成功');
  144. this.getDetail(type);
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style scoped lang="scss">
  151. .app-container {
  152. color: #333333;
  153. font-size: 14px;
  154. }
  155. </style>
  156. <style>
  157. .demo-table-expand {
  158. font-size: 0;
  159. }
  160. .demo-table-expand label {
  161. width: 80px;
  162. color: #99a9bf;
  163. }
  164. .demo-table-expand .el-form-item {
  165. margin-right: 0;
  166. margin-bottom: 0;
  167. width: 100%;
  168. }
  169. </style>