Explorar o código

添加代客录单报价功能

li.pengfei %!s(int64=2) %!d(string=hai) anos
pai
achega
8e60f04f2d

+ 2 - 2
src/http/moudules/letter.js

@@ -429,9 +429,9 @@ export const gainAccidentSchemeList = (data) => {
     })
 }
 //获取允许报价的保险公司列表
-export const gainAllowQuoteList = () => {
+export const gainAllowQuoteList = (deptId) => {
     return axios({
-        url: "/insurance/order/getAgreementInsCompany",
+        url: "/insurance/order/getAgreementInsCompany?deptId="+deptId,
         method: "get",
     })
 }

+ 10 - 1
src/http/moudules/user.js

@@ -265,6 +265,15 @@ export const getLoginUser= () => {
       method: 'get',
   })
 }
+
+// 获取可选业务员列表
+export const getAllUserInfo= (userId) => {
+  return axios({
+    url: '/user/getAllUsers?userId='+userId,
+    method: 'get',
+  })
+}
+
 //用户审核通过接口
 export const getApprovalPass= (id) => {
   return axios({
@@ -295,4 +304,4 @@ export const updateUserInfo = (userId,data) => {
       method: 'post',
       data
   })
-}
+}

+ 1 - 1
src/views/Letter/Letter.vue

@@ -4061,7 +4061,7 @@ export default {
     },
     //获取保险公司列表
     commpanyList() {
-      this.$api.letter.gainAllowQuoteList().then(res => {
+      this.$api.letter.gainAllowQuoteList('').then(res => {
         res.data.map(ele => {
           ele["result"] = {};
           ele["quoteCode"] = 0;

+ 64 - 26
src/views/Task/DaikeLetter.vue

@@ -11,26 +11,33 @@
         style="margin-top:30px;" >
         <el-row>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
-            <el-form-item label="业务员:">
-              <el-input v-model="userform.name"></el-input>
+            <el-form-item label="业务员:"> 
+              <el-select  v-model="userform.name" filterable placeholder="请选择" @change="pickUser">
+                <el-option
+                  v-for="item in userOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value" >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
-            <el-form-item label="工号:">
-              <el-input v-model="userform.id" type="text"></el-input>
+            <el-form-item label="工号:" >
+              <el-input v-model="userform.id" type="text" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
-            <el-form-item label="工号类型:">
-              <el-select v-model="userform.usertype">
+            <el-form-item label="工号类型:" >
+              <el-select v-model="userform.usertype" disabled>
                 <el-option label="业务员" value="A"></el-option>
                 <el-option label="代理人" value="B"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
-            <el-form-item label="归属:">
-              <el-input v-model="deptName"></el-input>
+            <el-form-item label="归属:" >
+              <el-input v-model="deptName" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -2178,6 +2185,7 @@ export default {
       }
     };
     return {
+      userOptions:[],//可选人员列表
       zhongmeiInsurancetype:"",//中煤驾意险产品选中值
       zhongmeiInsuranceData:[],//中煤驾意险产品列表数据
       zhongmeiInsuranceDataDetail:[],//中煤驾意险产品明细方案数据
@@ -3424,25 +3432,16 @@ export default {
     this.$api.letter.queryCompany().then(res => {
       this.continuousCompanyList = res.data;
     });
-    this.commpanyList(); //获取保险公司
     localStorage.setItem('carInfo', JSON.stringify(this.carInfo))
     localStorage.setItem('insureList', JSON.stringify(this.insureList))
-    //--归属信息获取--
-    var userId = Cookies.get("user");
-    if (userId == "admin") {
-      this.userId = "admin";
-    } else {
-      // this.userId = userId;
-      this.$api.user.getLoginUser().then(res => {
-        if (res.code == 200) {
-          this.userform = res.data
-          this.$api.dept.getDeptById(res.data.deptId).then(res => {
-            this.deptName = res.data.name;
-          });
-        }
-      });
-    }
-
+    //代客录单获取可选业务员,原来保险公司获取在选择业务员的时候再获取
+    this.$api.user.getAllUserInfo('').then(res => {
+      if (res.code == 200) {
+        this.userOptions = res.data.map(item => {
+          return { value: `${item.id}`, label: `${item.id} - ${item.name}` };
+        });
+      }
+    });
     //--订单编辑回显--
     this.paramsEdit = this.$route.query.data; //接收参数
     if (this.paramsEdit) {
@@ -3573,6 +3572,19 @@ export default {
     },
   },
   methods: {
+    //代客录单专用
+    pickUser(val){
+        this.userId = val;
+        this.$api.user.getAllUserInfo(val).then(res => {
+          if (res.code == 200) {
+            this.userform=res.data[0];
+            this.$api.dept.getDeptById(res.data[0].deptId).then(res => {
+              this.deptName = res.data.name;
+            });
+            this.commpanyList(); //获取保险公司
+          }
+        });
+    },
     retractFun(){
       this.isRetract=this.isRetract==false?true:false
     },
@@ -3989,7 +4001,12 @@ export default {
     },
     //获取保险公司列表
     commpanyList() {
-      this.$api.letter.gainAllowQuoteList().then(res => {
+      //代客录单时,带出协议需要根据选择的业务员机构进行带出,不使用当前登录人
+      let dept='';
+      if(this.userform&&this.userform.deptId){
+        dept=this.userform.deptId;
+      }
+      this.$api.letter.gainAllowQuoteList(dept).then(res => {
         res.data.map(ele => {
           ele["result"] = {};
           ele["quoteCode"] = 0;
@@ -4380,6 +4397,11 @@ export default {
     },
     //报价
     quote() {
+      console.log(this.userId)
+      if(!(this.userId&&this.userId!='')){
+        this.$message({ message: "先选择归属业务员后再报价", type: "error" });
+        return;
+      }
 
       let starttime = new Date(this.carInfo.registerDate)
       let endtime = new Date(this.carInfo.issueDate)
@@ -4655,6 +4677,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.yonganquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -4770,6 +4794,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.zhongmeiquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -4839,6 +4865,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.dajiaquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -4900,6 +4928,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.huataiquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -4958,6 +4988,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.zijinquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5047,6 +5079,8 @@ export default {
         renewalCodeJq: this.renewalCodeJq,
         renewalCodeSy: this.renewalCodeSy,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter.yongchengquote(params).then(res => {
         this.totalCompanyList[num].msg = res.msg;
@@ -5154,6 +5188,8 @@ export default {
         renewalCodeJq: this.renewalCodeJq,
         renewalCodeSy: this.renewalCodeSy,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId,
         guoRenSpecialAgreementVo
       };
       this.$api.letter.guorenquote(params).then(res => {
@@ -5242,6 +5278,8 @@ export default {
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
+        //代客录单时,需要传递选择业务员的归属机构
+        deptId: this.userform.deptId
       };
       this.$api.letter[api](params).then(res => {
         this.totalCompanyList[num].msg = res.msg;