gjy 3 роки тому
батько
коміт
50b8e296a5

+ 3 - 1
src/api/V2/contract/index.js

@@ -45,4 +45,6 @@ export const API_POST_CONFIRMATIONSHEET_ADD = '/priceConfirmationSheet/api/addPr
 export const API_POST_CONFIRMATIONSHEET_DELETE = '/priceConfirmationSheet/api/deletePriceConfirmationSheet'
 
 //编辑时查看点价确认单
-export const API_GET_GETINFO = '/priceConfirmationSheet/getInfo'
+export const API_GET_GETINFO = '/priceConfirmationSheet/getInfo'
+//客户
+export const API_GET_CUSTOMERINFO = '/customerInfo/customerList'

+ 5 - 2
src/model/contarct/index.js

@@ -23,7 +23,8 @@ import {
     API_GET_GETINFO,
     API_POST_CONFIRMATIONSHEET_DELETE,
     API_GET_STAFF,
-    API_GET_STAFF_FIND
+    API_GET_STAFF_FIND,
+    API_GET_CUSTOMERINFO
 } from '@/api/V2/contract'
 // 列表
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
@@ -70,4 +71,6 @@ export const addPriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_A
 export const deletePriceConfirmationSheet = appRx.post(API_POST_CONFIRMATIONSHEET_DELETE, errorCatcher, errorHandle, filter)
 
 //编辑时查看点价确认单
-export const getInfo = appRx.get(API_GET_GETINFO, errorCatcher, errorHandle, filter)
+export const getInfo = appRx.get(API_GET_GETINFO, errorCatcher, errorHandle, filter)
+// 客户
+export const getcustomerinfo = appRx.get(API_GET_CUSTOMERINFO, errorCatcher, errorHandle, filter)

+ 34 - 3
src/views/contractManagement/purchaseContractAdd.vue

@@ -81,8 +81,14 @@
         </ws-form-item>
         <ws-form-item label="卖方" span="1" prop="seller" class="readonly">
           <!-- <ws-input v-model="deptBudgetList.seller" placeholder="请输入卖方名称" maxlength="100" size="small" /> -->
-          <el-autocomplete class="inline-input" v-model="deptBudgetList.seller" :fetch-suggestions="querySearch2"
-            placeholder="请输入卖方名称" @select="handleSelect"></el-autocomplete>
+          <!-- <el-autocomplete class="inline-input" v-model="deptBudgetList.seller" :fetch-suggestions="querySearch2"
+             @select="handleSelect"></el-autocomplete>
+             -->
+            <ws-select  v-model="deptBudgetList.seller" placeholder="请选择卖方名称" class="typeselect" 
+            @change="sellerSelect">
+            <ws-option v-for="item in customerinfo" :key="item.customerName"  :label="item.customerName"
+              :value="item.customerName" />
+          </ws-select>
         </ws-form-item>
         <!--包装方式-->
         <ws-form-item label="包装方式" span="1" prop="packingMethod">
@@ -364,7 +370,8 @@
     editxiala,
     delxiala,
     getstafffind,
-    getRelationContractNo
+    getRelationContractNo,
+    getcustomerinfo
   } from '@/model/contarct/index'
   import {
     regionData,
@@ -399,6 +406,7 @@
         restaurants2: [],
         restaurants3: [],
         restaurants4: [],
+        customerinfo:[],
         type: '',
         dialogVisible: false,
         //弹出框
@@ -458,6 +466,7 @@
           deliverType: '1',
           agreementType: '采购合同',
           addressUrl: '',
+          sellerPhone:'',
           finalTradingVolume: 0,
           totalContractPrice: 0,
           contractGoodsInfo: {
@@ -559,6 +568,16 @@
       handleSelect(item) {
         console.log(item);
       },
+      sellerSelect(item) {
+        console.log(item)
+        for (let i = 0; i < this.customerinfo.length; i++) {
+          console.log(this.customerinfo[i].customerName,item)
+          if(this.customerinfo[i].customerName==item){
+            this.deptBudgetList.sellerPhone=this.customerinfo[i].customerPhone
+          }
+        }
+        
+      },
       getAddress(data) {
         console.log('getAddress', data)
         if (data[4] == 'source') {
@@ -686,6 +705,18 @@
           .then((response) => {
             this.contractNoList = response
           })
+          getcustomerinfo({compId: sessionStorage.getItem('ws-pf_compId'),}).toPromise()
+          .then((response) => {
+            var arr=[]
+            for (let i = 0; i < response.length; i++) {
+              if(response[i].customerType=='个人客户'){
+                arr.push({customerName:response[i].customerName,customerPhone:response[i].customerPhone})
+              }else{
+                arr.push({customerName:response[i].compName,customerPhone:response[i].customerPhone})
+              }
+            }
+            this.customerinfo = arr
+          })
       },
       selectRelation(e) {
         for (var i = 0; i < this.contractNoList.length; i++) {

+ 31 - 2
src/views/contractManagement/salesContractAdd.vue

@@ -48,8 +48,13 @@
           <!--买方-->
           <ws-form-item label="买方" span="1" prop="buyer" class="readonly">
             <!-- <ws-input v-model="deptBudgetList.buyer" placeholder="请输入买方名称" maxlength="100" size="small" /> -->
-            <el-autocomplete class="inline-input" v-model="deptBudgetList.buyer" :fetch-suggestions="querySearch1"
-              placeholder="请输入买方名称" @select="handleSelect"></el-autocomplete>
+            <!-- <el-autocomplete class="inline-input" v-model="deptBudgetList.buyer" :fetch-suggestions="querySearch1"
+              placeholder="请输入买方名称" @select="handleSelect"></el-autocomplete> -->
+              <ws-select  v-model="deptBudgetList.buyer" placeholder="请选择买方名称" class="typeselect" 
+            @change="buyerSelect">
+            <ws-option v-for="item in customerinfo" :key="item.customerName"  :label="item.customerName"
+              :value="item.customerName" />
+              </ws-select>
           </ws-form-item>
           <!--运输方式-->
           <ws-form-item label="运输方式" span="1" prop="shippingType">
@@ -364,6 +369,7 @@
     editxiala,
     delxiala,
     getRelationContractNo,
+     getcustomerinfo
   } from '@/model/contarct/index'
   import WsUpload from '@/components/WsUpload'
   import {
@@ -393,6 +399,7 @@
         restaurants2: [],
         restaurants3: [],
         restaurants4: [],
+        customerinfo:[],
         //弹出框
         dialogViewSpareMoney: false,
         dialogApproveFormVisible: false,
@@ -436,6 +443,7 @@
           contractGoodsInfo: {
             goodsName: '',
           },
+          buyerPhone:'',
           contractProcessInfo: {},
           addressUrl: '',
           sourceGoods: '',
@@ -495,6 +503,15 @@
       if (!this.restaurants4) this.restaurants4 = [];
     },
     methods: {
+      buyerSelect(item) {
+        console.log(item)
+        for (let i = 0; i < this.customerinfo.length; i++) {
+          console.log(this.customerinfo[i].customerName,item)
+          if(this.customerinfo[i].customerName==item){
+            this.deptBudgetList.buyerPhone=this.customerinfo[i].customerPhone
+          }
+        }
+      },
       querySearch1(queryString, cb) {
         var restaurants1 = this.restaurants1;
         var results = queryString ? restaurants1.filter(this.createFilter(queryString)) : restaurants1;
@@ -616,6 +633,18 @@
           .then((response) => {
             this.contractNoList = response
           })
+          getcustomerinfo({compId: sessionStorage.getItem('ws-pf_compId'),}).toPromise()
+          .then((response) => {
+            var arr=[]
+            for (let i = 0; i < response.length; i++) {
+              if(response[i].customerType=='个人客户'){
+                arr.push({customerName:response[i].customerName,customerPhone:response[i].customerPhone})
+              }else{
+                arr.push({customerName:response[i].compName,customerPhone:response[i].customerPhone})
+              }
+            }
+            this.customerinfo = arr
+          })
       },
       selectRelation(e) {
         for (var i = 0; i < this.contractNoList.length; i++) {