2 Commits b7f1294c8e ... d5253b4c02

Author SHA1 Message Date
  yuanrf d5253b4c02 Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system 3 weeks ago
  yuanrf d9c65d4410 市场客户资料++ 3 weeks ago

+ 32 - 3
src/components/MCR/MarketCustomerResourcesHome.vue

@@ -26,12 +26,12 @@
                         </el-option>
                     </el-select>
                     <el-select v-model="territorySel" clearable placeholder="省域" style="width
-                    :18%" @change="(val) => { this.clientTypeSel = ''; QueryData(); }">
+                    :18%" @change="(val) => { this.clientTypeSel = ''; this.clientLvSel = ''; QueryData(); }">
                         <el-option v-for="item in territoryList" :key="item.id" :label="item.name" :value="item.id">
                         </el-option>
                     </el-select>
                     <el-select v-model="clientLvSel" clearable placeholder="客户级别" style="width
-                    :18%" @change="QueryData">
+                    :18%" @change="(val) => { this.clientTypeSel = ''; QueryData(); }">
                         <el-option v-for="item in clientLvList" :key="item.id" :label="item.name" :value="item.id">
                         </el-option>
                     </el-select>
@@ -288,6 +288,7 @@ export default {
             var that = this;
         },
         QueryData() {
+            this.loading = true;
             this.pageloadData.pageIndex = this.currentPage;
             this.pageloadData.pageSize = this.pageSize;
             this.pageloadData.location = this.inputDQ; //地区
@@ -368,6 +369,34 @@ export default {
                 headers: {
                     'Authorization': this.token,
                 },
+            }).then(resp => {
+                if (resp.data.code == 200) {
+                    this.clientTypeList = resp.data.data.typeArr; //客户类别
+                    this.clientLvList = resp.data.data.lvArr; //客户级别
+                    console.log(this.clientLvSel, "clientLvSel---------------");
+                    if (this.clientLvSel) {
+                        this.territoryChangeSecond();
+                    }
+                } else {
+                    //js抛异常
+                    throw new Error(resp.data.msg);
+                }
+            }).catch(err => {
+                this.$message.error('网络异常!');
+            })
+        },
+
+        territoryChangeSecond() {
+            var sid = this.clientLvSel;
+            if (!sid) {
+                sid = 0;
+            }
+            this.$axios.post('/api/MarketCustomerResources/QueryClientTypeSecond', {
+                SetDataIdArr: [sid]
+            }, {
+                headers: {
+                    'Authorization': this.token,
+                },
             }).then(resp => {
                 if (resp.data.code == 200) {
                     this.clientTypeList = resp.data.data; //客户类别
@@ -378,7 +407,7 @@ export default {
             }).catch(err => {
                 this.$message.error('网络异常!');
             })
-        }
+        },
     },
     mounted() {
         this.token = JSON.parse(localStorage.getItem('userinif')).token;

+ 46 - 16
src/components/MCR/MarketCustomerResourcesOperation.vue

@@ -8,7 +8,8 @@
                         <el-col :span="8">
                             <div class="grid-content bg-purple">
                                 <el-form-item label="客户区域:" prop="lvlid">
-                                    <el-select v-model="requestData.lvlid" placeholder="请选择客户级别">
+                                    <el-select v-model="requestData.lvlid" placeholder="请选择客户级别"
+                                        @change="(val) => { requestData.category = ''; territoryChangeSecond() }">
                                         <el-option v-for="item in level" :key="item.id" :label="item.name"
                                             :value="item.id"></el-option>
                                     </el-select>
@@ -135,7 +136,8 @@
                         </el-col>
                         <el-col :span="8">
                             <div class="grid-content bg-purple"><el-form-item label="护照有效期:">
-                                    <el-date-picker value-format="yyyy-MM-dd" v-model="requestData.passportDate" type="date" placeholder="选择日期">
+                                    <el-date-picker value-format="yyyy-MM-dd" v-model="requestData.passportDate"
+                                        type="date" placeholder="选择日期">
                                     </el-date-picker>
                                 </el-form-item></div>
                         </el-col>
@@ -146,7 +148,8 @@
                         <el-col :span="8">
                             <div class="grid-content bg-purple">
                                 <el-form-item label="生日信息:">
-                                    <el-date-picker value-format="yyyy-MM-dd" v-model="requestData.birthday" type="date" placeholder="选择日期">
+                                    <el-date-picker value-format="yyyy-MM-dd" v-model="requestData.birthday" type="date"
+                                        placeholder="选择日期">
                                     </el-date-picker>
                                 </el-form-item>
                             </div>
@@ -169,9 +172,10 @@
                     <el-row>
                         <el-col :span="8">
                             <div class="grid-content bg-purple">
-                                <el-form-item  prop="ascribedUser" label="负责人:">
+                                <el-form-item prop="ascribedUser" label="负责人:">
                                     <el-select v-model="requestData.ascribedUser" multiple placeholder="请选择">
-                                        <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
+                                        <el-option v-for="item in users" :key="item.id" :label="item.name"
+                                            :value="item.id">
                                         </el-option>
                                     </el-select>
                                 </el-form-item>
@@ -217,9 +221,9 @@
 export default {
     data() {
         const validName = (rule, value, callback) => {
-            if (value.includes('先生')||value.includes('女士')||value.includes('小姐')) {
+            if (value.includes('先生') || value.includes('女士') || value.includes('小姐')) {
                 callback(new Error('请输入真实姓名!'))
-            }else{
+            } else {
                 callback()
             }
             // 如果是编辑需要排除自己
@@ -233,10 +237,10 @@ export default {
 
         }
         return {
-            token :'',
-            userId :'',
+            token: '',
+            userId: '',
             requestData: {
-                "portType":1,
+                "portType": 1,
                 "status": 0,
                 "id": 0,
                 "number": 0,
@@ -324,7 +328,7 @@ export default {
         QueryPageData() {
             var that = this;
             //初始化界面数据
-            this.$axios.post('/api/MarketCustomerResources/QuerySelectAndSingleData', { Id: this.requestData.id,portType:1,userId:this.userId }, {
+            this.$axios.post('/api/MarketCustomerResources/QuerySelectAndSingleData', { Id: this.requestData.id, portType: 1, userId: this.userId }, {
                 headers: {
                     'Authorization': that.token,
                 }
@@ -363,6 +367,8 @@ export default {
                         that.requestData.ascribedDepartment = obj.ascribedDepartment.map(x => x.id);
                         that.requestData.remark = obj.remark;
                     }
+
+                    this.territoryChangeSecond();
                 }
             })
         },
@@ -414,7 +420,29 @@ export default {
             }).catch(reject => {
                 console.log("未通过表单校验");
             })
-        }
+        },
+        territoryChangeSecond() {
+            var sid = this.requestData.lvlid;
+            if (!sid) {
+                sid = 0;
+            }
+            this.$axios.post('/api/MarketCustomerResources/QueryClientTypeSecond', {
+                SetDataIdArr: [sid]
+            }, {
+                headers: {
+                    'Authorization': this.token,
+                },
+            }).then(resp => {
+                if (resp.data.code == 200) {
+                    this.customerClass = resp.data.data; //客户类别
+                } else {
+                    //js抛异常
+                    throw new Error(resp.data.msg);
+                }
+            }).catch(err => {
+                this.$message.error('网络异常!');
+            })
+        },
     },
     mounted() {
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
@@ -456,17 +484,19 @@ body {
 
 }
 
-.operationMCR-Box .el-date-editor.el-input{
+.operationMCR-Box .el-date-editor.el-input {
     width: 100%;
 }
-.operationMCR-Box .el-select{
+
+.operationMCR-Box .el-select {
     width: 100%;
 }
-.operationMCRtitle{
+
+.operationMCRtitle {
     font-size: 17px;
     font-weight: 600;
     color: #555;
-    margin-left:30px ;
+    margin-left: 30px;
     margin-bottom: 25px;
 }
 </style>