chenrui 4 سال پیش
والد
کامیت
cb86cfd132

+ 2 - 2
src/api/custType.js

@@ -13,9 +13,9 @@ export const custTypeList = (params) => {
 }
 
 //  客户类型列表  不分页
-export const custTypeFindAll = (params) => {
+export const custTypeAllList = (params) => {
   return axios({
-    url: `/custType/findAll`,
+    url: `/custType/queryList`,
     data: {},
     method: 'post'
   })

+ 4 - 3
src/api/customer.js

@@ -12,9 +12,9 @@ export const custList = (params) => {
   })
 }
 //  客户列表  不分页
-export const custFindAll = (params) => {
+export const custAllList = (params) => {
   return axios({
-    url: `/cust/findAll`,
+    url: `/cust/queryList`,
     data: {},
     method: 'post'
   })
@@ -32,7 +32,8 @@ export const custSave = params => {
 export const custFindById = params => {
   return axios({
     url: `/cust/findById/${params.id}`,
-    method: 'post'
+    data: {},
+    method: 'get'
   })
 }
 

+ 45 - 0
src/api/supplier.js

@@ -0,0 +1,45 @@
+import { axios } from '@/utils/request'
+
+//  供应商 列表  有分页
+export const supplierList = (params) => {
+  const url = `/supplier/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  供应商 列表  无分页
+export const supplierAllList = (params) => {
+  return axios({
+    url: '/supplier/queryList',
+    data: params,
+    method: 'post'
+  })
+}
+//  供应商 详情
+export const supplierDetail = (params) => {
+  return axios({
+    url: `/supplier/findById/${params.id}`,
+    data: params,
+    method: 'get'
+  })
+}
+//  供应商 保存
+export const supplierSave = (params) => {
+  return axios({
+    url: '/supplier/save',
+    data: params,
+    method: 'post'
+  })
+}
+//  供应商 删除
+export const supplierDel = (params) => {
+  return axios({
+    url: `/supplier/delete/${params.id}`,
+    data: params,
+    method: 'post'
+  })
+}

+ 4 - 4
src/api/warehouse.js

@@ -12,8 +12,8 @@ export const warehouseList = (params) => {
   })
 }
 //  仓库列表  无分页
-export const warehouseFindAll = (params) => {
-  const url = '/warehouse/findAll'
+export const warehouseAllList = (params) => {
+  const url = '/warehouse/queryList'
   return axios({
     url: url,
     data: params,
@@ -48,8 +48,8 @@ export const warehouseLocList = (params) => {
   })
 }
 //  仓位列表  无分页
-export const warehouseLocFindAll = (params) => {
-  const url = '/warehouseLoc/findAll'
+export const warehouseLocAllList = (params) => {
+  const url = '/warehouseLoc/queryList'
   return axios({
     url: url,
     data: params,

+ 2 - 2
src/views/basicData/bulkPartsTypeManagement/list.vue

@@ -26,7 +26,7 @@
 </template>
 
 <script>
-import { custTypeFindAll } from '@/api/custType'
+import { custTypeAllList } from '@/api/custType'
 import { STable, VSelect } from '@/components'
 import bulkPartsTypeEditModal from './editModal.vue'
 export default {
@@ -46,7 +46,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return custTypeFindAll( this.queryParam ).then(res => {
+        // return custTypeAllList( this.queryParam ).then(res => {
         //   const data = res.data
         //   for (var i = 0; i < data.length; i++) {
         //     data[i].no = i + 1

+ 2 - 2
src/views/basicData/storeTransferOutTypeManagement/list.vue

@@ -26,7 +26,7 @@
 </template>
 
 <script>
-import { custTypeFindAll } from '@/api/custType'
+import { custTypeAllList } from '@/api/custType'
 import { STable, VSelect } from '@/components'
 import storeTransferOutTypeEditModal from './editModal.vue'
 export default {
@@ -46,7 +46,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return custTypeFindAll( this.queryParam ).then(res => {
+        // return custTypeAllList( this.queryParam ).then(res => {
         //   const data = res.data
         //   for (var i = 0; i < data.length; i++) {
         //     data[i].no = i + 1

+ 2 - 3
src/views/customerManagement/customerInfo/edit.vue

@@ -128,7 +128,7 @@
 import { STable, VSelect } from '@/components'
 import { getArea } from '@/api/data'
 import { custSave, custFindById } from '@/api/customer'
-import { custTypeFindAll } from '@/api/custType'
+import { custTypeAllList } from '@/api/custType'
 export default {
   name: 'CustomerManagementEdit',
   components: { STable, VSelect },
@@ -189,7 +189,7 @@ export default {
     },
     //  客户类型
     getCustTypeList () {
-      custTypeFindAll({}).then(res => {
+      custTypeAllList({}).then(res => {
         if (res.status == 200) {
           this.custTypeList = res.data
         }
@@ -203,7 +203,6 @@ export default {
         if (valid) {
           const form = _this.form
           form.id = this.$route.params.id ? this.$route.params.id : null
-          console.log(form, '-----提交信息')
           custSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)

+ 4 - 4
src/views/customerManagement/customerInfo/list.vue

@@ -132,8 +132,8 @@
 <script>
 import moment from 'moment'
 import { getArea } from '@/api/data'
-import { custList, custDel, custFindAll } from '@/api/customer'
-import { custTypeFindAll } from '@/api/custType'
+import { custList, custDel, custAllList } from '@/api/customer'
+import { custTypeAllList } from '@/api/custType'
 import { STable, VSelect } from '@/components'
 import customerManagementDetailModal from './detailModal.vue'
 export default {
@@ -265,7 +265,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {
@@ -276,7 +276,7 @@ export default {
     //  获取客户类型列表
     getCustTypeList () {
       const _this = this
-      custTypeFindAll().then(res => {
+      custTypeAllList().then(res => {
         if (res.status == 200) {
           _this.custTypeList = res.data || []
         } else {

+ 1 - 1
src/views/inventoryManagement/inventoryChecking/checkingTipsModal.vue

@@ -73,7 +73,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return warehouseFindAll( this.queryParam ).then(res => {
+        // return warehouseAllList( this.queryParam ).then(res => {
         //   const data = res.data
         //   this.disabled = false
         //   return data

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/list.vue

@@ -65,7 +65,7 @@
 </template>
 
 <script>
-import { warehouseFindAll, warehouseDel } from '@/api/warehouse'
+import { warehouseAllList, warehouseDel } from '@/api/warehouse'
 import { STable, VSelect } from '@/components'
 import inventoryCheckingTipsModal from './checkingTipsModal.vue'
 export default {
@@ -94,7 +94,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return warehouseFindAll( this.queryParam ).then(res => {
+        // return warehouseAllList( this.queryParam ).then(res => {
         //   const data = res.data
         //   this.disabled = false
         //   return data

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/overall.vue

@@ -35,7 +35,7 @@
 </template>
 
 <script>
-import { warehouseFindAll, warehouseDel } from '@/api/warehouse'
+import { warehouseAllList, warehouseDel } from '@/api/warehouse'
 import { STable, VSelect } from '@/components'
 export default {
   components: { STable, VSelect },
@@ -55,7 +55,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return warehouseFindAll( this.queryParam ).then(res => {
+        // return warehouseAllList( this.queryParam ).then(res => {
         //   const data = res.data
         //   this.disabled = false
         //   return data

+ 2 - 2
src/views/inventoryManagement/satelliteWarehouseInventory/list.vue

@@ -75,7 +75,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import satelliteWarehouseInventoryAddModal from './addModal.vue'
-import { custFindAll } from '@/api/customer'
+import { custAllList } from '@/api/customer'
 export default {
   components: { STable, VSelect, satelliteWarehouseInventoryAddModal },
   data () {
@@ -183,7 +183,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {

+ 2 - 2
src/views/inventoryManagement/warehouse/storingLocation/editModal.vue

@@ -52,7 +52,7 @@
 
 <script>
 import { STable } from '@/components'
-import { warehouseLocSave, warehouseFindAll } from '@/api/warehouse'
+import { warehouseLocSave, warehouseAllList } from '@/api/warehouse'
 export default {
   name: 'StoringLocationEditModal',
   components: { STable },
@@ -101,7 +101,7 @@ export default {
   methods: {
     //  获取仓库列表数据
     getWarehouseList () {
-      warehouseFindAll({}).then(res => {
+      warehouseAllList({}).then(res => {
         if (res.status == 200) {
           this.warehouseList = res.data
         } else {

+ 2 - 2
src/views/salesManagement/giftRecord/list.vue

@@ -75,7 +75,7 @@
 <script>
 import moment from 'moment'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { custFindAll } from '@/api/customer'
+import { custAllList } from '@/api/customer'
 import { giftsDetailList } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
 export default {
@@ -140,7 +140,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {

+ 5 - 5
src/views/salesManagement/salesQuery/list.vue

@@ -114,7 +114,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1960 }"
+      :scroll="{ x: 2040 }"
       bordered>
       <!-- 业务/审核状态 -->
       <template slot="auditStatus" slot-scope="text, record">
@@ -145,7 +145,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
-import { custFindAll } from '@/api/customer'
+import { custAllList } from '@/api/customer'
 import { salesList, salesDel } from '@/api/sales'
 export default {
   name: 'TableList',
@@ -172,8 +172,8 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 140, align: 'center' },
-        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 180, align: 'center' },
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -282,7 +282,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {

+ 14 - 3
src/views/salesManagement/salesQuery/queryPart.vue

@@ -79,6 +79,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
+      :customRow="handleClickRow"
       :scroll="{ x: 1530 }"
       bordered>
       <!-- 售价 -->
@@ -190,6 +191,16 @@ export default {
     }
   },
   methods: {
+    // 双击列表
+    handleClickRow (record) {
+      return {
+        on: {
+          dblclick: (event) => {
+            console.log(record)
+          }
+        }
+      }
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.orderBundleNo = ''
@@ -201,9 +212,9 @@ export default {
       this.$refs.table.refresh(true)
     },
     filterOption (input, option) {
-    	return (
-    		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-    	)
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     },
     // 选择配件
     handleAdd (row) {

+ 2 - 2
src/views/salesManagement/salesReturn/list.vue

@@ -126,7 +126,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import chooseCustom from './chooseCustom.vue'
-import { custFindAll } from '@/api/customer'
+import { custAllList } from '@/api/customer'
 import { salesReturnList } from '@/api/salesReturn'
 export default {
   name: 'TableList',
@@ -249,7 +249,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {

+ 2 - 2
src/views/salesManagement/urgentItemsOffset/list.vue

@@ -88,7 +88,7 @@
 
 <script>
 import moment from 'moment'
-import { custFindAll } from '@/api/customer'
+import { custAllList } from '@/api/customer'
 import { urgentList } from '@/api/urgent'
 import { STable, VSelect } from '@/components'
 export default {
@@ -167,7 +167,7 @@ export default {
     // 客户无分页列表数据
     getCustAllList () {
       const _this = this
-      custFindAll().then(res => {
+      custAllList().then(res => {
         if (res.status == 200) {
           _this.custAllList = res.data || []
         } else {

+ 80 - 66
src/views/supplierManagement/supplierInfo/edit.vue

@@ -14,11 +14,11 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="供应商名称" prop="name">
+        <a-form-model-item label="供应商名称" prop="supplierName">
           <a-input
-            id="supplierInfoEdit-name"
+            id="supplierInfoEdit-supplierName"
             :maxLength="30"
-            v-model="form.name"
+            v-model="form.supplierName"
             placeholder="请输入供应商名称(最多30个字符)"
             allowClear />
         </a-form-model-item>
@@ -26,65 +26,65 @@
           <a-row :gutter="20">
             <!-- 所在地区 -->
             <a-col span="8">
-              <a-form-model-item prop="provinceCode">
-                <a-select id="supplierInfoEdit-provinceCode" @change="getCityList" v-model="form.provinceCode" placeholder="请选择省">
-                  <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+              <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>
               </a-form-model-item>
             </a-col>
             <a-col span="8">
-              <a-form-model-item prop="cityCode">
-                <a-select id="supplierInfoEdit-cityCode" @change="getAreaList" v-model="form.cityCode" placeholder="请选择市">
-                  <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+              <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>
               </a-form-model-item>
             </a-col>
             <a-col span="8">
-              <a-form-model-item prop="districtCode">
-                <a-select id="supplierInfoEdit-districtCode" @change="areaCharged" v-model="form.districtCode" placeholder="请选择区/县">
-                  <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+              <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-select>
               </a-form-model-item>
             </a-col>
           </a-row>
         </a-form-model-item>
-        <a-form-model-item label="详细地址" prop="address">
+        <a-form-model-item label="详细地址" prop="supplierAddress">
           <a-input
-            id="supplierInfoEdit-address"
+            id="supplierInfoEdit-supplierAddress"
             :maxLength="60"
-            v-model="form.address"
+            v-model="form.supplierAddress"
             placeholder="请输入详细地址(最多60个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="联系人" prop="contactName">
+        <a-form-model-item label="联系人" prop="contactPerson">
           <a-input
-            id="supplierInfoEdit-contactName"
+            id="supplierInfoEdit-contactPerson"
             :maxLength="30"
-            v-model="form.contactName"
+            v-model="form.contactPerson"
             placeholder="请输入联系人(最多30个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="联系电话" prop="contactPhone">
+        <a-form-model-item label="联系电话" prop="contactTel">
           <a-input
-            id="supplierInfoEdit-contactPhone"
+            id="supplierInfoEdit-contactTel"
             :maxLength="20"
-            v-model="form.contactPhone"
+            v-model="form.contactTel"
             placeholder="请输入联系电话(最多20个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="主营内容" prop="remarks">
+        <a-form-model-item label="主营内容" prop="businessScope">
           <a-textarea
-            id="supplierInfoEdit-remarks"
+            id="supplierInfoEdit-businessScope"
             :maxLength="500"
-            v-model="form.remarks"
+            v-model="form.businessScope"
             placeholder="请输入主营内容(最多500个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="状态" prop="state">
+        <a-form-model-item label="状态" prop="enabledFlag">
           <a-radio-group
             name="radioGroup"
-            v-model="form.state"
-            id="supplierInfoEdit-state" >
+            v-model="form.enabledFlag"
+            id="supplierInfoEdit-enabledFlag" >
             <a-radio :value="1">启用</a-radio>
             <a-radio :value="0">禁用</a-radio>
           </a-radio-group>
@@ -100,6 +100,7 @@
 <script>
 import { STable, VSelect } from '@/components'
 import { getArea } from '@/api/data'
+import { supplierDetail, supplierSave } from '@/api/supplier'
 export default {
   name: 'SupplierInfoEdit',
   components: { STable, VSelect },
@@ -110,42 +111,42 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        name: '', // 供应商名称
-        provinceCode: undefined, //  省
+        supplierName: '', // 供应商名称
+        provinceSn: undefined, //  省
         provinceName: '',
-        cityCode: undefined, // 市
+        citySn: undefined, // 市
         cityName: '',
-        districtCode: undefined, // 区
+        countySn: undefined, // 区
         districtName: '',
-        address: '', //  详细地址
-        contactName: '', //  联系人
-        contactPhone: '', //  联系电话
-        remarks: '', //  主营内容
-        state: 0 //  启禁用
+        supplierAddress: '', //  详细地址
+        contactPerson: '', //  联系人
+        contactTel: '', //  联系电话
+        businessScope: '', //  主营内容
+        enabledFlag: 1 //  启禁用
       },
       rules: {
-        name: [
+        supplierName: [
           { required: true, message: '请输入供应商名称', trigger: 'blur' }
         ],
-        provinceCode: [
+        provinceSn: [
           { required: true, message: '请选择省', trigger: 'change' }
         ],
-        cityCode: [
+        citySn: [
           { required: true, message: '请选择市', trigger: 'change' }
         ],
-        districtCode: [
+        countySn: [
           { required: true, message: '请选择区/县', trigger: 'change' }
         ],
-        address: [
+        supplierAddress: [
           { required: true, message: '请输入详细地址', trigger: 'blur' }
         ],
-        contactName: [
+        contactPerson: [
           { required: true, message: '请输入联系人', trigger: 'blur' }
         ],
-        contactPhone: [
+        contactTel: [
           { required: true, message: '请输入联系人电话', trigger: 'blur' }
         ],
-        state: [
+        enabledFlag: [
           { required: true, message: '请选择状态', trigger: 'change' }
         ]
       },
@@ -157,11 +158,14 @@ export default {
   methods: {
     //  获取供应商信息
     getGoodsDetail () {
-      // goodsFind({ id: this.$route.params.id }).then(res => {
-      //   if (res.status == 200) {
-      //     this.form = Object.assign(this.form, res.data)
-      //   }
-      // })
+      supplierDetail({ id: this.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          if (res.data.provinceSn) { this.getArea('city', res.data.provinceSn) }
+          if (res.data.citySn) { this.getArea('district', res.data.citySn) }
+          this.form = Object.assign(this.form, res.data)
+          this.form.enabledFlag = Number(this.form.enabledFlag)
+        }
+      })
     },
     //  保存
     handleSubmit (e) {
@@ -169,18 +173,16 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          const form = values.form
-          form.desc = _this.form.desc
+          const form = _this.form
           form.id = this.$route.params.id ? this.$route.params.id : null
-          console.log(form, '-----提交信息')
-          // goodsSave(form).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     setTimeout(() => {
-          //       _this.$router.push({ path: '/shop/goods/list' })
-          //     }, 1000)
-          //   }
-          // })
+          supplierSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.handleBack()
+              }, 1000)
+            }
+          })
         } else {
           console.log('error submit!!')
           return false
@@ -193,23 +195,35 @@ export default {
     },
     // 获取城市列表
     getCityList (val) {
+      const index = this.addrProvinceList.findIndex(item => item.sn == val)
+      if (index >= 0) {
+        this.form.provinceName = this.addrProvinceList[index].name
+      }
       this.addrCityList = []
       this.addrDistrictList = []
-      this.form.cityCode = undefined
-      this.form.districtCode = undefined
-      this.form.address = ''
+      this.form.citySn = undefined
+      this.form.countySn = undefined
+      this.form.supplierAddress = ''
       this.getArea('city', val)
     },
     // 获取区县列表
     getAreaList (val) {
+      const index = this.addrCityList.findIndex(item => item.sn == val)
+      if (index >= 0) {
+        this.form.cityName = this.addrCityList[index].name
+      }
       this.addrDistrictList = []
-      this.form.districtCode = undefined
-      this.form.address = ''
+      this.form.countySn = undefined
+      this.form.supplierAddress = ''
       this.getArea('district', val)
     },
     // 区县变更
     areaCharged (val) {
-      this.form.address = ''
+      const index = this.addrDistrictList.findIndex(item => item.sn == val)
+      if (index >= 0) {
+        this.form.countyName = this.addrDistrictList[index].name
+      }
+      this.form.supplierAddress = ''
     },
     //  省/市/区
     getArea (type, sn) {

+ 26 - 40
src/views/supplierManagement/supplierInfo/list.vue

@@ -6,12 +6,12 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="供应商名称">
-              <a-input id="supplierInfoList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入供应商名称"/>
+              <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="状态">
-              <v-select code="CHECK_ENABLE_STATE" id="supplierInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="ENABLE_FLAG" id="supplierInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -34,11 +34,11 @@
       :columns="columns"
       :data="loadData"
       :customRow="handleClickRow"
-      :scroll="{ x: 1260 }"
+      :scroll="{ x: 1310 }"
       bordered>
       <!-- 状态 -->
-      <template slot="state" slot-scope="text, record">
-        <a-tag :color="record.state==1?'green':'red'" >{{ record.state==1? '已启用': '已禁用' }}</a-tag>
+      <template slot="enabledFlag" slot-scope="text, record">
+        <a-tag :color="record.enabledFlag==1?'green':'red'" >{{ record.enabledFlagDictValue }}</a-tag>
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
@@ -50,53 +50,43 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import { supplierList } from '@/api/supplier'
 export default {
   components: { STable, VSelect },
   data () {
     return {
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
-        state: undefined //  状态
+        supplierName: '', //  供应商名称
+        enabledFlag: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '供应商名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '地址', dataIndex: 'productOldNum', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '联系人', dataIndex: 'productBrand', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '联系电话', dataIndex: 'productType', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '主营内容', dataIndex: 'inventoryNum', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'inventoryMoney', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', scopedSlots: { customRender: 'state' }, width: 100, align: 'center' },
+        { title: '供应商名称', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '地址', dataIndex: 'address', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '联系人', dataIndex: 'contactPerson', width: 150, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '联系电话', dataIndex: 'contactTel', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '主营内容', dataIndex: 'businessScope', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 100, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( 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
-        //   }
-        //   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', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        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
-          resolve(data)
+          this.disabled = false
+          return data
         })
       }
     }
@@ -113,12 +103,8 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.supplierName = ''
+      this.queryParam.enabledFlag = undefined
       this.$refs.table.refresh(true)
     },
     //  新增/编辑