linwenxin 7 місяців тому
батько
коміт
7ca0f24237
2 змінених файлів з 32 додано та 1 видалено
  1. 8 0
      src/api/parts-config.js
  2. 24 1
      src/views/commonPage/parts-config/index.vue

+ 8 - 0
src/api/parts-config.js

@@ -39,3 +39,11 @@ export function partsRefundConfigDetail(params) {
     params
   })
 }
+
+export function partsRefundConfigGetDefault(params) {
+  return request({
+    url: '/parts/refund/config/get/default',
+    method: 'post',
+    params
+  })
+}

+ 24 - 1
src/views/commonPage/parts-config/index.vue

@@ -43,7 +43,8 @@ import {
   partsRefundConfigAdd,
   partsRefundConfigEdit,
   partsRefundConfigBatchDel,
-  partsRefundConfigDetail
+  partsRefundConfigDetail,
+  partsRefundConfigGetDefault
 } from '@/api/parts-config'
 import operation_mixin from '@/components/template/operation_mixin.js'
 import { required, requiredValueMin } from '@/components/template/rules_verify.js'
@@ -95,6 +96,22 @@ export default {
                 })
               }
             })
+          ],
+          [
+            this.optionsEvensAuth('defaultConfig', {
+              click: () => {
+                getWebsit({ type: 'C', status: true, queryPartsWebsit: true }).then(res => {
+                  this.websitList = res.data
+                  this.formType = this.$route.name == 'website-refund-config' ? 2 : 1
+                  partsRefundConfigGetDefault().then(res => {
+                    this.formData = res.data
+                    this.$nextTick(() => {
+                      this.formBool = true
+                    })
+                  })
+                })
+              }
+            })
           ]
         ]
       ]
@@ -116,6 +133,12 @@ export default {
             label: '配置网点',
             prop: 'websitId',
             rules: this.formData.isDefault ? [] : [...required]
+          },
+          events: {
+            change: val => {
+              var data = this.websitList.find(item => item.websitId === val)
+              this.formData.websitName = data?.websitName || ''
+            }
           }
         },
         {