lilei 4 سال پیش
والد
کامیت
6350dea06e

+ 109 - 73
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -4,70 +4,79 @@
     class="merchantInfoManagement-modal"
     :footer="null"
     :maskClosable="false"
-    title="详情"
+    :title="title"
     v-model="isShow"
     @cancle="isShow=false"
     width="80%">
-    <div>
-      <a-collapse :activeKey="['1']" class="merchantInfoManagement-cont-m">
+    <div v-if="form">
+      <a-collapse :activeKey="['1','2','3']" class="merchantInfoManagement-cont-m">
         <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions bordered :column="3">
-            <a-descriptions-item label="经销商名称:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="经销商别名:">阿大撒</a-descriptions-item>
-            <a-descriptions-item label="商户类型:">双方发生的</a-descriptions-item>
-            <a-descriptions-item label="联系人1:">士大夫</a-descriptions-item>
-            <a-descriptions-item label="联系手机1:">的大多数</a-descriptions-item>
-            <a-descriptions-item label="联系角色1:">是否得到释放</a-descriptions-item>
-            <a-descriptions-item label="联系电话:">价格变更</a-descriptions-item>
-            <a-descriptions-item label="地址:">价格变更</a-descriptions-item>
-            <a-descriptions-item label="是否可用:">价格变更</a-descriptions-item>
+          <a-descriptions :column="4" bordered>
+            <a-descriptions-item label="经销商名称">{{ form.dealerName }}</a-descriptions-item>
+            <a-descriptions-item label="经销商别名">{{ form.dealerAlias }}</a-descriptions-item>
+            <a-descriptions-item label="商户类型">{{ form.dealerTypeDictValue }}</a-descriptions-item>
+            <a-descriptions-item label="联系人1">{{ form.contact }}</a-descriptions-item>
+            <a-descriptions-item label="联系手机1">{{ form.contactMobile }}</a-descriptions-item>
+            <a-descriptions-item label="联系角色1">{{ form.contactRole }}</a-descriptions-item>
+            <a-descriptions-item label="联系电话">{{ form.dealerTelephone }}</a-descriptions-item>
+            <a-descriptions-item label="地址">{{ form.provinceName }}-{{ form.cityName }}-{{ form.districtName }} {{ form.address }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
       <a-collapse class="merchantInfoManagement-cont-m">
-        <a-collapse-panel key="1" header="公司信息">
-          <a-descriptions bordered :column="3">
-            <a-descriptions-item label="经营方式:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="经营项目:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="公司规模:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="成立时间:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="一般纳税人:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="身份证号码:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="生日:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="籍贯:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="邮箱:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="联系人2:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="联系角色2:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="联系手机2:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="邮政编码:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="收货人:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="收货人电话:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="收货地址:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="银行账户:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="开户行:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="银行账号:">啊实打实的撒</a-descriptions-item>
+        <a-collapse-panel key="2" header="公司信息">
+          <a-descriptions :column="4" bordered>
+            <a-descriptions-item label="经营方式">{{ form.busniessMode }}</a-descriptions-item>
+            <a-descriptions-item label="经营项目">{{ form.busniessItmes }}</a-descriptions-item>
+            <a-descriptions-item label="公司规模">{{ form.busniessScope }}</a-descriptions-item>
+            <a-descriptions-item label="成立时间">{{ form.buildDate }}</a-descriptions-item>
+            <a-descriptions-item label="一般纳税人">{{ form.isTaxpayer == 1 ? '是':'否' }}</a-descriptions-item>
+            <a-descriptions-item label="身份证号码">{{ form.indentityCard }}</a-descriptions-item>
+            <a-descriptions-item label="生日">{{ form.brithday }}</a-descriptions-item>
+            <a-descriptions-item label="籍贯">{{ form.nativePlace }}</a-descriptions-item>
+            <a-descriptions-item label="邮箱">{{ form.mail }}</a-descriptions-item>
+            <a-descriptions-item label="联系人2">{{ form.contact2 }}</a-descriptions-item>
+            <a-descriptions-item label="联系角色2">{{ form.contractRole2 }}</a-descriptions-item>
+            <a-descriptions-item label="联系手机2">{{ form.contactMobile2 }}</a-descriptions-item>
+            <a-descriptions-item label="邮政编码">{{ form.zipCode }}</a-descriptions-item>
+            <a-descriptions-item label="收货人">{{ form.receiveContact }}</a-descriptions-item>
+            <a-descriptions-item label="收货人电话">{{ form.receiveMobile }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址">{{ form.receiveProvinceName }}-{{ form.receiveCityName }}-{{ form.receiveDistrictName }} {{ form.receiveAddress }}</a-descriptions-item>
+            <a-descriptions-item label="银行账户">{{ form.tradeAccountName }}</a-descriptions-item>
+            <a-descriptions-item label="开户行">{{ form.tradeBankName }}</a-descriptions-item>
+            <a-descriptions-item label="银行账号">{{ form.tradeBankAccount }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
       <a-collapse class="merchantInfoManagement-cont-m">
-        <a-collapse-panel key="1" header="总部信息">
-          <a-descriptions bordered :column="3">
-            <a-descriptions-item label="箭冠汽配代码:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="门头更换日期:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="特约价是否可见:">啊实打实的撒</a-descriptions-item>
-            <a-descriptions-item label="备注:">啊实打实的撒</a-descriptions-item>
+        <a-collapse-panel key="3" header="总部信息">
+          <a-descriptions :column="4" bordered>
+            <a-descriptions-item label="箭冠汽配代码">{{ form.jgAutoPartsCode }}</a-descriptions-item>
+            <a-descriptions-item label="门头更换日期">{{ form.jgDoorHeaderChangeTime }}</a-descriptions-item>
+            <a-descriptions-item label="特约价是否可见">{{ form.isShowSpecialPrice == 1 ? '是':'否' }}</a-descriptions-item>
+            <a-descriptions-item label="备注">{{ form.remark }}</a-descriptions-item>
           </a-descriptions>
         </a-collapse-panel>
       </a-collapse>
       <div class="btn-cont">
-        <a-button id="merchantInfoManagement-back" @click="isShow = false" style="margin-left: 100px;">返回列表</a-button>
+        <a-button
+          id="merchantInfoManagement-audit"
+          size="large"
+          v-if="isAudit"
+          type="primary"
+          style="margin-right: 50px;"
+          @click="handleAudit">审核</a-button>
+        <a-button id="merchantInfoManagement-back" size="large" @click="isShow = false">返回列表</a-button>
       </div>
     </div>
+    <div style="padding: 50px;text-align: center;" v-else>
+      <a-spin />
+    </div>
   </a-modal>
 </template>
 
 <script>
-// import { dealerProductDetail } from '@/api/dealerProduct'
+import { dealerAudit, dealerDetailBySn, dealerFindUpdateInfoBySn } from '@/api/dealer'
 export default {
   name: 'MerchantInfoManagementModal',
   props: {
@@ -78,45 +87,66 @@ export default {
     itemId: {
       type: [Number, String],
       default: ''
-    }
-  },
-  computed: {
-    productTypeName () {
-      const productTypeName1 = this.detailsData.productTypeName1 ? this.detailsData.productTypeName1 : ''
-      const productTypeName2 = this.detailsData.productTypeName2 ? ' > ' + this.detailsData.productTypeName2 : ''
-      const productTypeName3 = this.detailsData.productTypeName3 ? ' > ' + this.detailsData.productTypeName3 : ''
-      return productTypeName1 + productTypeName2 + productTypeName3
-    }
+    },
+    isAudit: Boolean
   },
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      formItemLayout: {
-        labelCol: { span: 4 },
-        wrapperCol: { span: 16 }
-      },
-      detailsData: null, //  详情数据
-      form: {
-        storageQuantity: ''
-      },
-      rules: {
-        supplierName: [
-          { required: true, message: '请输入供应商名称', trigger: 'blur' }
-        ]
-      },
-      brandData: []
+      form: null,
+      title: ''
     }
   },
   methods: {
-    //  获取详情
+    // 审核
+    auditOrder (dealerAuditSn, auditState) {
+      dealerAudit({
+        dealerAuditSn,
+        auditState
+      }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$emit('ok')
+        }
+      })
+    },
+    //  审核确认
+    handleAudit () {
+      const _this = this
+      const row = this.form
+      this.$confirm({
+        title: '提示',
+        content: '请点击下方按钮确认操作?',
+        centered: true,
+        closable: true,
+        okText: '审核通过',
+        cancelText: '审核不通过',
+        onOk () {
+          _this.auditOrder(row.dealerAuditSn, 'PASS')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            _this.auditOrder(row.dealerAuditSn, 'REJECT')
+          }
+          _this.$destroyAll()
+        }
+      })
+    },
+    // 详情编辑
     getDetail () {
-      // dealerProductDetail({ id: this.itemId }).then(res => {
-      //   if (res.status == 200) {
-      //     this.detailsData = res.data
-      //   } else {
-      //     this.detailsData = null
-      //   }
-      // })
+      if (this.isAudit) {
+        dealerFindUpdateInfoBySn({ sn: this.itemId }).then(res => {
+          if (res.status == 200) {
+            this.form = res.data
+          }
+        })
+      } else {
+        dealerDetailBySn({ sn: this.itemId }).then(res => {
+          if (res.status == 200) {
+            this.form = res.data
+          }
+        })
+      }
     }
   },
   watch: {
@@ -128,6 +158,9 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.form = null
+      } else {
+        this.title = this.isAudit ? '审核资料' : '查看详细'
       }
     },
     itemId (newValue, oldValue) {
@@ -150,6 +183,9 @@ export default {
     .btn-cont {
       text-align: center;
       margin: 35px 0 30px;
+      button{
+        width: 150px;
+      }
     }
   }
 </style>

+ 80 - 36
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -50,7 +50,7 @@
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                 <a-form-model-item label="联系电话" prop="dealerTelephone">
-                  <a-input v-model.trim="form.dealerTelephone" id="merchantInfoManagementEdit-dealerTelephone" :maxLength="11" allowClear placeholder="请输入联系电话(最多11个字符)" />
+                  <a-input v-model.trim="form.dealerTelephone" id="merchantInfoManagementEdit-dealerTelephone" :maxLength="13" allowClear placeholder="请输入联系电话" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
@@ -60,21 +60,21 @@
                     <a-col span="8">
                       <a-form-model-item prop="provinceSn">
                         <a-select id="merchantInfoManagementEdit-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="8">
                       <a-form-model-item prop="citySn">
                         <a-select id="merchantInfoManagementEdit-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="8">
                       <a-form-model-item prop="districtSn">
                         <a-select id="merchantInfoManagementEdit-districtSn" @change="areaCharged" v-model="form.districtSn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
@@ -91,17 +91,6 @@
                     allowClear />
                 </a-form-model-item>
               </a-col>
-              <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="是否可用" prop="enableFlag">
-                  <a-radio-group
-                    name="radioGroup"
-                    v-model="form.enableFlag"
-                    id="merchantInfoManagementEdit-enableFlag" >
-                    <a-radio :value="1">是</a-radio>
-                    <a-radio :value="0">否</a-radio>
-                  </a-radio-group>
-                </a-form-model-item>
-              </a-col>
             </a-row>
           </a-collapse-panel>
         </a-collapse>
@@ -233,7 +222,7 @@
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                 <a-form-model-item label="收货电话" prop="receiveMobile">
-                  <a-input v-model.trim="form.receiveMobile" id="merchantInfoManagementEdit-receiveMobile" :maxLength="30" allowClear placeholder="请输入收货电话(最多30个字符)" />
+                  <a-input v-model.trim="form.receiveMobile" id="merchantInfoManagementEdit-receiveMobile" :maxLength="13" allowClear placeholder="请输入收货电话" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
@@ -243,21 +232,21 @@
                     <a-col span="8">
                       <a-form-model-item prop="receiveProvinceSn">
                         <a-select id="merchantInfoManagementEdit-receiveProvinceSn" @change="getCityList1" v-model="form.receiveProvinceSn" placeholder="请选择省">
-                          <a-select-option v-for="item in addrProvinceList1" :value="item.sn" :key="item.sn + 'a'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrProvinceList1" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="8">
                       <a-form-model-item prop="receiveCitySn">
                         <a-select id="merchantInfoManagementEdit-receiveCitySn" @change="getAreaList1" v-model="form.receiveCitySn" placeholder="请选择市">
-                          <a-select-option v-for="item in addrCityList1" :value="item.sn" :key="item.sn + 'b'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrCityList1" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
                     <a-col span="8">
                       <a-form-model-item prop="receiveDistrictSn">
                         <a-select id="merchantInfoManagementEdit-receiveDistrictSn" @change="areaCharged1" v-model="form.receiveDistrictSn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList1" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                          <a-select-option v-for="item in addrDistrictList1" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                         </a-select>
                       </a-form-model-item>
                     </a-col>
@@ -371,7 +360,7 @@
 <script>
 import { getArea } from '@/api/data'
 import { VSelect } from '@/components'
-import { dealerSave } from '@/api/dealer'
+import { dealerSave, dealerFindUpdateInfoBySn } from '@/api/dealer'
 export default {
   components: { VSelect },
   data () {
@@ -385,7 +374,43 @@ export default {
         }
       },
       form: {
-        isShowSpecialPrice: 0
+        dealerName: '',
+        dealerAlias: '',
+        dealerType: undefined,
+        contact: '',
+        contactMobile: '',
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        address: '',
+        contactRole: '',
+        dealerTelephone: '',
+        busniessMode: '',
+        busniessItmes: '',
+        busniessScope: '',
+        buildDate: '',
+        isTaxpayer: undefined,
+        indentityCard: '',
+        brithday: '',
+        nativePlace: '',
+        mail: '',
+        contact2: '',
+        contactMobile2: '',
+        contractRole2: '',
+        zipCode: '',
+        receiveContact: '',
+        receiveMobile: '',
+        receiveProvinceSn: undefined,
+        receiveCitySn: undefined,
+        receiveDistrictSn: undefined,
+        receiveAddress: '',
+        tradeAccountName: '',
+        tradeBankName: '',
+        tradeBankAccount: '',
+        jgAutoPartsCode: '',
+        jgDoorHeaderChangeTime: '',
+        isShowSpecialPrice: 0,
+        remark: ''
       },
       rules: {
         dealerName: [
@@ -401,7 +426,8 @@ export default {
           { required: true, message: '请输入联系人1', trigger: 'change' }
         ],
         contactMobile: [
-          { required: true, message: '请输入联系手机1', trigger: 'change' }
+          { required: true, message: '请输入联系手机1', trigger: 'change' },
+          { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
         ],
         provinceSn: [
           { required: true, message: '请选择省', trigger: 'change' }
@@ -414,6 +440,15 @@ export default {
         ],
         address: [
           { required: true, message: '请输入详细地址', trigger: 'change' }
+        ],
+        dealerTelephone: [
+          { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
+        ],
+        contactMobile2: [
+          { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
+        ],
+        receiveMobile: [
+          { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
         ]
       },
       brandData: [],
@@ -431,6 +466,19 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
+    // 详情编辑
+    getDetail () {
+      dealerFindUpdateInfoBySn({ sn: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.form = Object.assign(this.form, res.data)
+          this.form.isShowSpecialPrice = Number(this.form.isShowSpecialPrice)
+          this.getArea('city', this.form.provinceSn, 0)
+          this.getArea('district', this.form.citySn, 0)
+          this.getArea('city', this.form.receiveProvinceSn, 1)
+          this.getArea('district', this.form.receiveCitySn, 1)
+        }
+      })
+    },
     // 提交
     handleSubmit () {
       this.$refs.ruleForm.validate(valid => {
@@ -453,7 +501,7 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
-      const index = this.addrProvinceList.findIndex(item => item.sn == val)
+      const index = this.addrProvinceList.findIndex(item => item.areaSn == val)
       if (index >= 0) {
         this.form.provinceName = this.addrProvinceList[index].name
       }
@@ -466,7 +514,7 @@ export default {
     },
     // 获取区县列表
     getAreaList (val) {
-      const index = this.addrCityList.findIndex(item => item.sn == val)
+      const index = this.addrCityList.findIndex(item => item.areaSn == val)
       if (index >= 0) {
         this.form.cityName = this.addrCityList[index].name
       }
@@ -477,7 +525,7 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      const index = this.addrDistrictList.findIndex(item => item.sn == val)
+      const index = this.addrDistrictList.findIndex(item => item.areaSn == val)
       if (index >= 0) {
         this.form.districtName = this.addrDistrictList[index].name
       }
@@ -485,9 +533,9 @@ export default {
     },
     // 获取城市列表
     getCityList1 (val) {
-      const index = this.addrProvinceList1.findIndex(item => item.sn == val)
+      const index = this.addrProvinceList1.findIndex(item => item.areaSn == val)
       if (index >= 0) {
-        this.form.receiveProvinceName = this.addrProvinceList[index].name
+        this.form.receiveProvinceName = this.addrProvinceList1[index].name
       }
       this.addrCityList1 = []
       this.addrDistrictList1 = []
@@ -498,7 +546,7 @@ export default {
     },
     // 获取区县列表
     getAreaList1 (val) {
-      const index = this.addrCityList1.findIndex(item => item.sn == val)
+      const index = this.addrCityList1.findIndex(item => item.areaSn == val)
       if (index >= 0) {
         this.form.receiveCityName = this.addrCityList1[index].name
       }
@@ -509,7 +557,7 @@ export default {
     },
     // 区县变更
     areaCharged1 (val) {
-      const index = this.addrDistrictList1.findIndex(item => item.sn == val)
+      const index = this.addrDistrictList1.findIndex(item => item.areaSn == val)
       if (index >= 0) {
         this.form.receiveDistrictName = this.addrDistrictList1[index].name
       }
@@ -527,9 +575,7 @@ export default {
         if (res.status == 200) {
           if (leve == 'province') {
             this.addrProvinceList = JSON.parse(JSON.stringify(res.data || []))
-            if (index == 1) {
-              this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
-            }
+            this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
           } else if (leve == 'city') {
             this.addrCityList = JSON.parse(JSON.stringify(res.data || []))
             if (index == 1) {
@@ -544,9 +590,7 @@ export default {
         } else {
           if (leve == 'province') {
             this.addrProvinceList = []
-            if (index == 1) {
-              this.addrProvinceList1 = []
-            }
+            this.addrProvinceList1 = []
           } else if (leve == 'city') {
             this.addrCityList = []
             if (index == 1) {
@@ -567,7 +611,7 @@ export default {
       vm.getArea('province')
       vm.$refs.ruleForm.resetFields()
       if (vm.$route.params.id) { //  编辑页
-        // vm.getGoodsDetail()
+        vm.getDetail()
       }
     })
   }

+ 46 - 64
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -48,7 +48,7 @@
     </div>
     <!-- 总计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div slot="message">合计:<strong>300</strong>条</div>
+      <div slot="message">合计:<strong>{{ total }}</strong>条</div>
     </a-alert>
     <!-- 列表 -->
     <s-table
@@ -72,21 +72,27 @@
         <a-button size="small" type="link" class="button-primary" @click="handleLevel(record)">价格级别</a-button>
         <a-button size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
         <a-button size="small" type="link" class="button-success" @click="handleDetail(record)">详情</a-button>
-        <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'PASS'" @click="handleDel(record)">删除</a-button>
+        <!-- <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'PASS'" @click="handleDel(record)">删除</a-button> -->
       </template>
     </s-table>
     <!-- 产品详情 -->
-    <merchant-info-management-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <merchant-info-management-detail-modal :openModal="openModal" :isAudit="isAudit" :itemId="itemId" @ok="resetForm" @close="closeModal" />
+    <!-- 合作设置 -->
+    <UpdateCooperate ref="updateCooperate" :openUcModal="openUcModal" @ok="resetForm" @close="openUcModal=false"></UpdateCooperate>
+    <!-- 级别设置 -->
+    <UpdateDealerLeve ref="updateDealerLevel" :openUdModal="openUdModal" @ok="resetForm" @close="openUdModal=false"></UpdateDealerLeve>
   </a-card>
 </template>
 
 <script>
-import { dealerQueryList, dealerAudit } from '@/api/dealer'
+import { dealerQueryList } from '@/api/dealer'
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import merchantInfoManagementDetailModal from './detailModal.vue'
+import UpdateCooperate from './updateCooperate.vue'
+import UpdateDealerLeve from './updateDealerLevel.vue'
 export default {
-  components: { STable, VSelect, merchantInfoManagementDetailModal, subarea },
+  components: { STable, VSelect, merchantInfoManagementDetailModal, subarea, UpdateCooperate, UpdateDealerLeve },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -100,16 +106,17 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       dateFormat: 'YYYY-MM-DD',
+      total: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '区域', scopedSlots: { customRender: 'area' }, width: 140, align: 'center' },
         { title: '商户名称', dataIndex: 'dealerName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '商户别名', dataIndex: 'dealerAlias', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户别名', dataIndex: 'dealerAlias', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系人', dataIndex: 'contact', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系电话', dataIndex: 'dealerTelephone', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contact', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系电话', dataIndex: 'dealerTelephone', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '绑定手机号码', dataIndex: 'contactMobile', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核状态', dataIndex: 'auditStateDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '合作状态', dataIndex: 'cooperateFlagDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
@@ -124,6 +131,7 @@ export default {
         return dealerQueryList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
+          this.total = data.count
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
@@ -132,11 +140,14 @@ export default {
         })
       },
       openModal: false, //  查看详情  弹框
-      itemId: '' //  当前商户sn
+      openUcModal: false, // 合作设置 弹框
+      openUdModal: false, // 级别设置 弹框
+      itemId: '', //  当前商户sn
+      isAudit: false
     }
   },
   methods: {
-    //  重置
+    //  重置列表
     resetSearchForm () {
       this.queryParam = {
         nameLike: '', //  商户名称、别名
@@ -147,74 +158,45 @@ export default {
       }
       this.$refs.table.refresh(true)
     },
+    // 刷新当前列表
+    resetForm () {
+      this.$refs.table.refresh()
+      this.openModal = false
+      this.isAudit = false
+      this.openUcModal = false
+      this.openUdModal = false
+    },
     // 新增
     handleAdd () {
-      this.$router.push({ path: '/dealerManagement/merchantInfoManagement/add' })
+      this.$router.push({ name: `merchantInfoManagementAdd` })
     },
     // 编辑
     handleEdit (row) {
-      this.$router.push({ path: `/dealerManagement/merchantInfoManagement/edit/${row.id}` })
+      this.$router.push({ name: `merchantInfoManagementEdit`, params: { id: row.dealerSn } })
     },
     // 合作设置
-    handleCooperation () {},
+    handleCooperation (row) {
+      this.openUcModal = true
+      this.$refs.updateCooperate.setData(row)
+    },
+    // 价格级别
+    handleLevel (row) {
+      this.openUdModal = true
+      this.$refs.updateDealerLevel.setData(row)
+    },
     // 经销权
     handleDistribution () {},
-    // 价格级别
-    handleLevel () {},
     // 审核
-    auditOrder (id, billStatus) {
-      dealerAudit({
-        id,
-        billStatus
-      }).then(res => {
-        if (res.status == 200) {
-          this.$message.success(res.message)
-          this.$refs.table.refresh()
-        }
-      })
-    },
-    //  审核确认
     handleAudit (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '请点击下方按钮确认操作?',
-        centered: true,
-        closable: true,
-        okText: '审核通过',
-        cancelText: '审核不通过',
-        onOk () {
-          _this.auditOrder(row.id, 'WAIT_OUT_WAREHOUSE')
-        },
-        onCancel (e) {
-          if (!e.triggerCancel) {
-            _this.auditOrder(row.id, 'AUDIT_REJECT')
-          }
-          _this.$destroyAll()
-        }
-      })
-    },
-    // 删除
-    handleDel (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要删除吗?',
-        centered: true,
-        onOk () {
-          // salesDel({ id: row.id }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //   }
-          // })
-        }
-      })
+      this.itemId = row.dealerSn
+      this.openModal = true
+      this.isAudit = true
     },
     //  详情
     handleDetail (row) {
-      this.itemId = row.id
+      this.itemId = row.dealerSn
       this.openModal = true
+      this.isAudit = false
     },
     //  关闭弹框
     closeModal () {

+ 136 - 0
src/views/dealerManagement/merchantInfoManagement/updateCooperate.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-modal
+    centered
+    class="merchantInfoManagement-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="40%">
+    <div>
+      <a-form-model
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="labelCol"
+        :wrapper-col="wrapperCol"
+      >
+        <a-form-model-item label="商户名称">
+          {{ form.dealerName }}
+        </a-form-model-item>
+        <a-form-model-item label="合作状态" prop="cooperateFlag">
+          <v-select code="DEALER_COOPERATE_FLAG" id="ucModal-cooperateFlag" v-model="form.cooperateFlag" allowClear placeholder="请选择合作状态"></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="生效时间" prop="cooperateEffectiveTime">
+          <a-date-picker
+            style="width:100%"
+            id="ucModal-cooperateEffectiveTime"
+            :disabledDate="disabledDate"
+            v-model="form.cooperateEffectiveTime"
+            :format="dateFormat"
+            placeholder="请选择日期" />
+        </a-form-model-item>
+        <div style="display: flex;justify-content: center;padding: 30px 0;">
+          <a-button size="large" type="primary" @click="onSubmit">
+            确定
+          </a-button>
+          <a-button size="large" style="margin-left: 50px;" @click="cansel">
+            取消
+          </a-button>
+        </div>
+      </a-form-model>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { updateCooperate } from '@/api/dealer'
+import moment from 'moment'
+export default {
+  name: 'UpdateCooperate',
+  components: { VSelect },
+  props: {
+    openUcModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openUcModal, //  是否打开弹框
+      title: '合作设置',
+      dateFormat: 'YYYY-MM-DD hh:mm:ss',
+      labelCol: { span: 6 },
+      wrapperCol: { span: 14 },
+      other: '',
+      form: {
+        dealerName: '',
+        cooperateFlag: undefined,
+        cooperateEffectiveTime: null
+      },
+      rules: {
+        cooperateFlag: [
+          { required: true, message: '请选择合作状态', trigger: 'change' }
+        ],
+        cooperateEffectiveTime: [
+          { required: true, message: '请选择生效时间', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    setData (row) {
+      this.form.dealerSn = row.dealerSn
+      this.form.dealerName = row.dealerName
+      this.form.cooperateFlag = row.cooperateFlag
+      this.form.cooperateEffectiveTime = row.cooperateEffectiveTime
+    },
+    onSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(this.form))
+          params.cooperateEffectiveTime = moment(params.cooperateEffectiveTime).format('YYYY-MM-DD hh:mm:ss')
+          updateCooperate(params).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.$emit('ok')
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    cansel () {
+      this.$emit('close')
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openUcModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .merchantInfoManagement-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+  }
+</style>

+ 123 - 0
src/views/dealerManagement/merchantInfoManagement/updateDealerLevel.vue

@@ -0,0 +1,123 @@
+<template>
+  <a-modal
+    centered
+    class="merchantInfoManagement-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="40%">
+    <div>
+      <a-form-model
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="labelCol"
+        :wrapper-col="wrapperCol"
+      >
+        <a-form-model-item label="商户名称">
+          {{ form.dealerName }}
+        </a-form-model-item>
+        <a-form-model-item label="商户级别" prop="dealerLevel">
+          <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="form.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+        </a-form-model-item>
+        <div style="display: flex;justify-content: center;padding: 30px 0;">
+          <a-button size="large" type="primary" @click="onSubmit">
+            确定
+          </a-button>
+          <a-button size="large" style="margin-left: 50px;" @click="cansel">
+            取消
+          </a-button>
+        </div>
+      </a-form-model>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { updateDealerLevel } from '@/api/dealer'
+export default {
+  name: 'UpdateDealerLevel',
+  components: { VSelect },
+  props: {
+    openUdModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openUdModal, //  是否打开弹框
+      title: '价格级别设置',
+      labelCol: { span: 6 },
+      wrapperCol: { span: 14 },
+      other: '',
+      form: {
+        dealerName: '',
+        dealerLevel: undefined
+      },
+      rules: {
+        dealerLevel: [
+          { required: true, message: '请选择商户级别', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    setData (row) {
+      this.form.dealerSn = row.dealerSn
+      this.form.dealerName = row.dealerName
+      this.form.dealerLevel = row.dealerLevel
+    },
+    onSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$confirm({
+            title: '提示',
+            content: '商户价格级别变更后,该商户关联的经销商关系绑定将同步解除,确定变更该商户级别吗?',
+            centered: true,
+            onOk () {
+              const params = JSON.parse(JSON.stringify(_this.form))
+              updateDealerLevel(params).then(res => {
+                if (res.status == 200) {
+                  _this.$message.success(res.message)
+                  _this.$emit('ok')
+                }
+              })
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    cansel () {
+      this.$emit('close')
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openUdModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .merchantInfoManagement-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+  }
+</style>