lilei 4 سال پیش
والد
کامیت
94b7f819d3

+ 0 - 1
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -451,7 +451,6 @@ export default {
           { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
         ]
       },
-      brandData: [],
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉

+ 166 - 107
src/views/supplierManagement/supplierInfo/edit.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="supplierInfoEdit-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="supplierInfoEdit-cont">
+    <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="merchantInfoManagementEdit-cont">
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
+        <a id="merchantInfoManagement-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
       </template>
     </a-page-header>
     <a-form-model
@@ -29,23 +29,23 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系人1" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系人1(最多30个字符)" />
+                <a-form-model-item label="联系人1" prop="contact">
+                  <a-input v-model.trim="form.contact" id="supplierInfoEdit-contact" :maxLength="30" allowClear placeholder="请输入联系人1(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系手机1" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系手机1(最多11个字符)" />
+                <a-form-model-item label="联系手机1" prop="contactMobile">
+                  <a-input v-model.trim="form.contactMobile" id="supplierInfoEdit-contactMobile" :maxLength="11" allowClear placeholder="请输入联系手机1(最多11个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系角色1" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系角色1(最多30个字符)" />
+                <a-form-model-item label="联系角色1" prop="contactRole">
+                  <a-input v-model.trim="form.contactRole" id="supplierInfoEdit-contactRole" :maxLength="30" allowClear placeholder="请输入联系角色1(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系电话" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系电话(最多11个字符)" />
+                <a-form-model-item label="联系电话" prop="supplierTelephone">
+                  <a-input v-model.trim="form.supplierTelephone" id="supplierInfoEdit-supplierTelephone" :maxLength="13" allowClear placeholder="请输入联系电话" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
@@ -55,21 +55,21 @@
                     <a-col span="8">
                       <a-form-model-item prop="provinceSn">
                         <a-select id="supplierInfoEdit-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="supplierInfoEdit-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="countySn">
-                        <a-select id="supplierInfoEdit-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
-                          <a-select-option v-for="item in addrDistrictList" :value="item.sn" :key="item.sn + 'c'">{{ item.name }}</a-select-option>
+                      <a-form-model-item prop="districtSn">
+                        <a-select id="supplierInfoEdit-districtSn" @change="areaCharged" v-model="form.districtSn" placeholder="请选择区/县">
+                          <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>
@@ -77,20 +77,20 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="详细地址" prop="supplierAddress">
+                <a-form-model-item label="详细地址" prop="address">
                   <a-input
-                    id="supplierInfoEdit-supplierAddress"
+                    id="supplierInfoEdit-address"
                     :maxLength="60"
-                    v-model="form.supplierAddress"
+                    v-model="form.address"
                     placeholder="请输入详细地址(最多60个字符)"
                     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="supplierAddress">
+                <a-form-model-item label="生产周期(天)" prop="produceCycle">
                   <a-input-number
-                    id="supplierInfoEdit-name"
-                    v-model="form.storageQuantity"
+                    id="supplierInfoEdit-produceCycle"
+                    v-model="form.produceCycle"
                     :precision="0"
                     :min="1"
                     :max="999999"
@@ -99,10 +99,10 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="配送周期(天)" prop="supplierAddress">
+                <a-form-model-item label="配送周期(天)" prop="deliveryCycle">
                   <a-input-number
-                    id="supplierInfoEdit-name"
-                    v-model="form.storageQuantity"
+                    id="supplierInfoEdit-deliveryCycle"
+                    v-model="form.deliveryCycle"
                     :precision="0"
                     :min="1"
                     :max="999999"
@@ -111,10 +111,10 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="贷款结算周期(天)" prop="supplierAddress">
+                <a-form-model-item label="贷款结算周期(天)" prop="settleCycle">
                   <a-input-number
-                    id="supplierInfoEdit-name"
-                    v-model="form.storageQuantity"
+                    id="supplierInfoEdit-settleCycle"
+                    v-model="form.settleCycle"
                     :precision="0"
                     :min="1"
                     :max="999999"
@@ -123,11 +123,11 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="是否合作" prop="enabledFlag">
+                <a-form-model-item label="是否合作" prop="cooperateFlag">
                   <a-radio-group
                     name="radioGroup"
-                    v-model="form.enabledFlag"
-                    id="supplierInfoEdit-enabledFlag" >
+                    v-model="form.cooperateFlag"
+                    id="supplierInfoEdit-cooperateFlag" >
                     <a-radio :value="1">是</a-radio>
                     <a-radio :value="0">否</a-radio>
                   </a-radio-group>
@@ -143,20 +143,20 @@
           <a-collapse-panel key="1" header="扩展信息">
             <a-row>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="经营方式" prop="productTypeName" help="(例:国有企业)">
+                <a-form-model-item label="经营方式" prop="busniessMode" help="(例:国有企业)">
                   <a-input
-                    v-model.trim="form.productTypeName"
-                    id="supplierInfoEdit-name"
+                    v-model.trim="form.busniessMode"
+                    id="supplierInfoEdit-busniessMode"
                     :maxLength="30"
                     allowClear
                     placeholder="请输入经营方式(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="公司规模" prop="productTypeName" help="(例:100-999人)">
+                <a-form-model-item label="公司规模" prop="busniessScope" help="(例:100-999人)">
                   <a-input-number
-                    id="supplierInfoEdit-name"
-                    v-model="form.storageQuantity"
+                    id="supplierInfoEdit-busniessScope"
+                    v-model="form.busniessScope"
                     :precision="0"
                     :min="1"
                     :max="999999"
@@ -165,68 +165,68 @@
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="成立时间" prop="productTypeName">
+                <a-form-model-item label="成立时间" prop="buildDate">
                   <a-date-picker
                     style="width:100%"
-                    id="supplierInfoEdit-time"
+                    id="supplierInfoEdit-buildDate"
                     :disabledDate="disabledDate"
-                    v-model="form.time"
+                    v-model="form.buildDate"
                     :format="dateFormat"
                     placeholder="请选择日期" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="银行账户" prop="productTypeName" help="(例:张三)">
+                <a-form-model-item label="银行账户" prop="tradeAccountName" help="(例:张三)">
                   <a-input
-                    v-model.trim="form.productTypeName"
-                    id="supplierInfoEdit-name"
+                    v-model.trim="form.tradeAccountName"
+                    id="supplierInfoEdit-tradeAccountName"
                     :maxLength="30"
                     allowClear
                     placeholder="请输入银行账户(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="开户行" prop="productTypeName" help="(例:交通银行)">
+                <a-form-model-item label="开户行" prop="tradeBankName" help="(例:交通银行)">
                   <a-input
-                    v-model.trim="form.productTypeName"
-                    id="supplierInfoEdit-name"
+                    v-model.trim="form.tradeBankName"
+                    id="supplierInfoEdit-tradeBankName"
                     :maxLength="30"
                     allowClear
                     placeholder="请输入开户行(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="银行账号" prop="productTypeName" help="(例:1123 5677 1112 22342 1123)">
+                <a-form-model-item label="银行账号" prop="tradeBankAccount" help="(例:1123 5677 1112 22342 1123)">
                   <a-input
-                    v-model.trim="form.productTypeName"
-                    id="supplierInfoEdit-name"
+                    v-model.trim="form.tradeBankAccount"
+                    id="supplierInfoEdit-tradeBankAccount"
                     :maxLength="30"
                     allowClear
                     placeholder="请输入银行账号(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系人2" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系人2(最多30个字符)" />
+                <a-form-model-item label="联系人2" prop="contact2">
+                  <a-input v-model.trim="form.contact2" id="supplierInfoEdit-contact2" :maxLength="30" allowClear placeholder="请输入联系人2(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系手机2" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="11" allowClear placeholder="请输入联系手机2(最多11个字符)" />
+                <a-form-model-item label="联系手机2" prop="contactMobile2">
+                  <a-input v-model.trim="form.contactMobile2" id="supplierInfoEdit-contactMobile2" :maxLength="11" allowClear placeholder="请输入联系手机2(最多11个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                <a-form-model-item label="联系角色2" prop="productTypeName">
-                  <a-input v-model.trim="form.productTypeName" id="supplierInfoEdit-name" :maxLength="30" allowClear placeholder="请输入联系角色2(最多30个字符)" />
+                <a-form-model-item label="联系角色2" prop="contactRole2">
+                  <a-input v-model.trim="form.contactRole2" id="supplierInfoEdit-contactRole2" :maxLength="30" allowClear placeholder="请输入联系角色2(最多30个字符)" />
                 </a-form-model-item>
               </a-col>
               <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
-                <a-form-model-item label="备注" prop="enabledFlag" :label-col="{span:4}" :wrapper-col="{span:20}">
+                <a-form-model-item label="备注" prop="remark" :label-col="{span:4}" :wrapper-col="{span:20}">
                   <a-textarea
-                    id="merchantInfoManagementEdit-supplierAddress"
-                    :maxLength="30"
-                    v-model="form.supplierAddress"
-                    placeholder="请输入箭冠汽配代码(最多30个字符)"
+                    id="merchantInfoManagementEdit-remark"
+                    :maxLength="300"
+                    v-model="form.remark"
+                    placeholder="请输入备注(最多300字符)"
                     allowClear />
                 </a-form-model-item>
               </a-col>
@@ -245,10 +245,10 @@
 
 <script>
 import { getArea } from '@/api/data'
-import { VSelect, Upload } from '@/components'
-import Editor from '@/components/WEeditor'
+import { VSelect } from '@/components'
+import { supplierDetail, supplierSave } from '@/api/supplier.js'
 export default {
-  components: { VSelect, Upload, Editor },
+  components: { VSelect },
   data () {
     return {
       formItemLayout: {
@@ -260,16 +260,67 @@ export default {
         }
       },
       form: {
-        time: ''
+        supplierName: '',
+        contact: '',
+        contactMobile: '',
+        contactRole: '',
+        supplierTelephone: '',
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        address: '',
+        produceCycle: '',
+        deliveryCycle: '',
+        settleCycle: '',
+        cooperateFlag: undefined,
+        busniessMode: '',
+        busniessScope: '',
+        buildDate: '',
+        tradeAccountName: '',
+        tradeBankName: '',
+        tradeBankAccount: '',
+        contact2: '',
+        contactMobile2: '',
+        contactRole2: '',
+        remark: ''
+      },
+      rules: {
+        supplierName: [
+          { required: true, message: '请输入供应商名称', trigger: 'change' }
+        ],
+        contact: [
+          { required: true, message: '请输入联系人1', trigger: 'change' }
+        ],
+        contactMobile: [
+          { required: true, message: '请输入联系手机1', trigger: 'change' },
+          { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
+        ],
+        provinceSn: [
+          { required: true, message: '请选择省', trigger: 'change' }
+        ],
+        citySn: [
+          { required: true, message: '请选择市', trigger: 'change' }
+        ],
+        districtSn: [
+          { required: true, message: '请选择区县', trigger: 'change' }
+        ],
+        address: [
+          { required: true, message: '请输入详细地址', trigger: 'change' }
+        ],
+        supplierTelephone: [
+          { pattern: /^[0-9]{11,13}$/, message: '请输入正确的电话号码!' }
+        ],
+        contactMobile2: [
+          { pattern: /^[1][0-9]{10}$/, message: '请输入正确的手机号码!' }
+        ],
+        cooperateFlag: [
+          { required: true, message: '请选择是否合作', trigger: 'change' }
+        ]
       },
-      rules: {},
-      brandData: [],
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      dateFormat: 'YYYY-MM-DD',
-      productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      dateFormat: 'YYYY-MM-DD'
     }
   },
   methods: {
@@ -277,84 +328,92 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
+    // 详情编辑
+    getDetail () {
+      supplierDetail({ sn: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          this.form = Object.assign(this.form, res.data)
+          this.form.cooperateFlag = Number(this.form.cooperateFlag)
+          this.getArea('city', this.form.provinceSn)
+          this.getArea('district', this.form.citySn)
+        }
+      })
+    },
     // 提交
-    handleSubmit () {},
+    handleSubmit () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          console.log(this.form, 'form data')
+          supplierSave(this.form).then(res => {
+            if (res.status == 200) {
+              this.$message.success(res.message)
+              this.handleBack()
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
     // 返回
     handleBack () {
-      this.$router.push({ path: '/dealerManagement/supplierInfo/list' })
-    },
-    // 产品图片上传
-    changeHomeImage (file) {
-      this.form.homeImage = file
-    },
-    //  文本编辑器
-    editorChange (html, text) {
-      this.form.desc = html
-    },
-    //  产品分类  change
-    changeProductType (val, opt) {
-      this.form.productTypeSn3 = val[2] ? val[2] : ''
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+      this.$router.push({ name: 'supplierInfoList' })
     },
     // 获取城市列表
     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
       }
       this.addrCityList = []
       this.addrDistrictList = []
       this.form.citySn = undefined
-      this.form.countySn = undefined
-      this.form.supplierAddress = ''
+      this.form.districtSn = undefined
+      this.form.address = ''
       this.getArea('city', val)
     },
     // 获取区县列表
     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
       }
       this.addrDistrictList = []
-      this.form.countySn = undefined
-      this.form.supplierAddress = ''
+      this.form.districtSn = undefined
+      this.form.address = ''
       this.getArea('district', val)
     },
     // 区县变更
     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.countyName = this.addrDistrictList[index].name
+        this.form.districtName = this.addrDistrictList[index].name
       }
-      this.form.supplierAddress = ''
+      this.form.address = ''
     },
     //  省/市/区
-    getArea (type, sn) {
+    getArea (leve, sn) {
       let params
-      if (type == 'province') {
-        params = { level: '1' }
+      if (leve == 'province') {
+        params = { type: '2' }
       } else {
-        params = { psn: sn }
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
       }
       getArea(params).then(res => {
         if (res.status == 200) {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = res.data || []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = res.data || []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = res.data || []
           }
         } else {
-          if (type == 'province') {
+          if (leve == 'province') {
             this.addrProvinceList = []
-          } else if (type == 'city') {
+          } else if (leve == 'city') {
             this.addrCityList = []
-          } else if (type == 'district') {
+          } else if (leve == 'district') {
             this.addrDistrictList = []
           }
         }
@@ -366,7 +425,7 @@ export default {
       vm.getArea('province')
       vm.$refs.ruleForm.resetFields()
       if (vm.$route.params.id) { //  编辑页
-        // vm.getGoodsDetail()
+        vm.getDetail()
       }
     })
   }

+ 30 - 56
src/views/supplierManagement/supplierInfo/list.vue

@@ -9,20 +9,6 @@
               <a-input id="supplierInfoList-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="关联品牌">
-              <a-select
-                placeholder="请选择"
-                id="productInfoList-productBrandSn"
-                allowClear
-                v-model="queryParam.productBrandSn"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="supplierInfoList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="supplierInfoList-reset">重置</a-button>
@@ -36,7 +22,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
@@ -49,13 +35,12 @@
       bordered>
       <!-- 状态 -->
       <template slot="enabledFlag" slot-scope="text, record">
-        <a-tag :color="record.enabledFlag==1?'green':'red'" >{{ record.enabledFlagDictValue }}</a-tag>
+        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enableFlag" @change="changeFlagHandle(text, record)"/>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" @click="handleRelated(record)" id="supplierInfoList-related-btn">关联产品</a-button>
-        <a-divider type="vertical" style="margin: 0;" />
-        <a-button size="small" type="link" @click="handleEdit(record)" id="supplierInfoList-edit-btn">编辑</a-button>
+        <a-button size="small" type="link" class="button-warning" @click="handleRelated(record)" id="supplierInfoList-related-btn">关联产品</a-button>
+        <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="supplierInfoList-edit-btn">编辑</a-button>
       </template>
     </s-table>
   </a-card>
@@ -63,66 +48,46 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { supplierList } from '@/api/supplier'
+import { supplierList, updateEnableStatus } from '@/api/supplier'
 export default {
   components: { STable, VSelect },
   data () {
     return {
       queryParam: { //  查询条件
-        supplierName: '', //  供应商名称
-        enabledFlag: undefined //  状态
+        supplierName: '' //  供应商名称
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '供应商名称', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '联系人', dataIndex: 'contactPerson', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '产品款数', dataIndex: 'contactTel', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contact', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品款数', dataIndex: 'totalProductCategory', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 150, align: 'center', fixed: 'right' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
       ],
+      total: 0,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return supplierList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //     const provinceName = data.list[i].provinceName ? data.list[i].provinceName : ''
-        //     const cityName = data.list[i].cityName ? data.list[i].cityName : ''
-        //     const countyName = data.list[i].countyName ? data.list[i].countyName : ''
-        //     const supplierAddress = data.list[i].supplierAddress ? data.list[i].supplierAddress : ''
-        //     data.list[i].address = provinceName + cityName + countyName + supplierAddress
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        return supplierList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
+          this.total = data.count
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].enableFlag = data.list[i].enableFlag + '' === '1'
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
-      },
-      productBrandList: []
+      }
     }
   },
   methods: {
     //  重置
     resetSearchForm () {
       this.queryParam.supplierName = ''
-      this.queryParam.enabledFlag = undefined
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
@@ -135,10 +100,19 @@ export default {
     },
     // 关联产品
     handleRelated (row) {},
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+    // 修改状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        sn: record.supplierSn,
+        flag: record.enableFlag ? '1' : '0'
+      }
+      updateEnableStatus(_data).then(res => {
+        if (res.status + '' === '200') {
+          this.$message.success(res.message)
+        } else {
+          record.enableFlag = !record.enableFlag
+        }
+      })
     }
   }
 }