Просмотр исходного кода

Merge branch 'dev' into 'purchaseDev'

Dev

See merge request new-business/drp-web!357
黄梓星 1 год назад
Родитель
Сommit
1478cc916c

+ 9 - 0
src/api/business/spd/bo/iuapquery/basic.js

@@ -16,4 +16,13 @@ export function listSaleArea(query) {
     method: 'get',
     params: query
   })
+}
+
+//根据负责人查询客户列表
+export function byPrincipal(query) {
+  return request({
+    url: '/mk/bo/iuapquery/customer/byPrincipal',
+    method: 'get',
+    params: query
+  })
 }

+ 38 - 5
src/views/business/spd/bo/authority/index.vue

@@ -135,12 +135,13 @@
                 size="mini"
                 v-model="form.customerName"
                 title="客户选择"
-                type="CUSTOMER_PARAM_ZT"
+                type="MK_CUSTOMER_BYPRINCIPAL"
                 :dataMapping="{
                   customer: 'id',
                   customerName: 'name',
                 }"
                 :source.sync="form"
+                :queryParams="additionalCondition"
               >
               </dr-popover-select>
             </el-form-item>
@@ -188,6 +189,7 @@
 <script>
 import Detail from './detail.vue'
 import { addAssess,listAssess,delAssess, } from "@/api/business/spd/fillin/dailysale_quantity_assess";
+import { byPrincipal } from "@/api/business/spd/bo/iuapquery/basic";
 
 export default {
   name: "dailysaleQuantityAssess",
@@ -229,10 +231,19 @@ export default {
       openMode:'',
       //行数据
       row:{},
+      //查询员工所负责的客户
+      queryCustomerParams:{
+        staffCode:"",
+        code:"",
+        name:"",
+      },
+      customerList:[],
     };
   },
-  created() {
-    this.getList(this.queryParams);
+  async created() {
+    await this.getList(this.queryParams);
+    this.queryCustomerParams.staffCode = this.$store.state.user.name;
+    await this.getCustomer();
   },
   methods: {
     //是否打开详情页面
@@ -242,6 +253,10 @@ export default {
     //新增
     useAdd(){
       this.reset();
+      if(this.customerList.length){
+        this.form.customer = this.customerList[0].id;
+        this.form.customerName = this.customerList[0].name;
+      }
       this.form.createTime = this.getCurrentTime();
       this.form.month = this.getCurrentMonth();
       this.form.createByName = this.$store.state.user.nickName;
@@ -267,9 +282,9 @@ export default {
       }).catch(() => {})
     },
     //查询列表
-    getList(params){
+    async getList(params){
       this.loading = true;
-      listAssess(params).then(res => {
+      await listAssess(params).then(res => {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
@@ -277,6 +292,24 @@ export default {
         this.loading = false;
       })
     },
+    //查询客户
+    async getCustomer(){
+      console.log('this.queryCustomerParams',this.queryCustomerParams);
+      await byPrincipal(this.queryCustomerParams).then(res => {
+        if (res.code === 200) {
+          this.customerList = res.rows
+          this.queryCustomerParams.total = res.total
+        }
+      })
+    },
+    //客户弹窗附加查询条件
+    additionalCondition(){
+      return {
+        parame:{
+          staffCode: this.$store.state.user.name
+        }
+      }
+    },
     //双击
     useDoubleClick(row){
       this.openMode = 'see';