Ver Fonte

2022-8-3 17:00

codeMan há 2 anos atrás
pai
commit
8cf4ce214d

+ 21 - 5
src/SManagement/orderclue/components/edit.vue

@@ -5,7 +5,7 @@
               size="small" 
               type="primary" 
               v-if="position == 'detail'"
-              :disabled="data.data.status == '待跟进' || data.data.status == '跟进中' ? false : true">编辑</el-button>
+              :disabled="!isHandle">编辑</el-button>
     <p  @click="dialogVisible=true" v-else>编辑</p>
     <el-dialog
       title="编辑线索"
@@ -80,7 +80,8 @@ export default {
           { min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
         ],
       },
-      areaSelectResult:[]
+      areaSelectResult:[],
+      isHandle:''
     };
   },
   props:{
@@ -93,7 +94,7 @@ export default {
     position: {
       type:String 
     },
-    data: {
+    detailInfo: {
       type: Object
     },
     arealist: {
@@ -103,8 +104,10 @@ export default {
   computed:{
   },
   watch:{
-    data: {
+    detailInfo: {
       handler(val) {
+        console.log(1111);
+        
         this.param = {
           "classname": "saletool.orderclue.web.orderclue",
           "method": "edit",
@@ -120,8 +123,21 @@ export default {
             "cluesource": val.data.cluesource
           }
         }
-        this.areaSelectResult = val.data.city ? [val.data.province,val.data.city,val.data.county] : [val.data.province]
+        console.log(this.param);
         
+        this.areaSelectResult = val.data.city ? [val.data.province,val.data.city,val.data.county] : [val.data.province]
+        let is 
+        if(JSON.parse(window.sessionStorage.getItem('userInfo')).name == this.detailInfo.data.leadername) {
+          is = true
+          if(this.detailInfo.data.status == '待跟进' || this.detailInfo.data.status == '跟进中') {
+            is = true
+          } else {
+            is = false
+          }
+        } else {
+          is = false
+        }
+        this.isHandle = is
       }
     }
   },

+ 36 - 5
src/SManagement/orderclue/components/follow.vue

@@ -5,7 +5,7 @@
               type="warning" 
               style="margin-left:10px" 
               v-if="position == 'detail'" 
-              :disabled="data.data.status == '待跟进' || data.data.status == '跟进中' ? false : true"
+              :disabled="!isHandle"
               @click="dialogVisible=true">跟进</el-button>
     <p @click="dialogVisible=true" v-else>跟进</p>
     <el-dialog title="线索跟进" :visible.sync="dialogVisible" width="900" :before-close="handleClose">
@@ -34,7 +34,7 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="本次跟进结果" label-width="150px" label-position="left" prop="logtype">
-              <el-radio-group v-model="param.content.logtype">
+              <el-radio-group v-model="param.content.logtype" @change="changeClick">
                 <el-radio label="跟进">跟进</el-radio>
                 <el-radio label="已成交">成交</el-radio>
                 <el-radio label="丢单">丢单</el-radio>
@@ -105,10 +105,11 @@ export default {
       },
       time:'',
       dialogVisible: false,
-    };
+      isHandle:''
+    }
   },
   props: {
-    data: {
+    detailInfo: {
       default() {
         return []
       }
@@ -126,12 +127,42 @@ export default {
   computed: {
   },
   watch: {
+    detailInfo: {
+      handler(val) {
+        // this.isHandle =
+        let is 
+        if(JSON.parse(window.sessionStorage.getItem('userInfo')).name == this.detailInfo.data.leadername) {
+          is = true
+          if(this.detailInfo.data.status == '待跟进' || this.detailInfo.data.status == '跟进中') {
+            is = true
+          } else {
+            is = false
+          }
+        } else {
+          is = false
+        }
+        this.isHandle = is
+      }
+    }
 
   },
   methods: {
     handleClose() {
       this.dialogVisible = false
     },
+    changeClick() {
+      this.param = {
+        "classname": "saletool.orderclue.web.orderclue",
+        "method": "addFollowUpLog",
+        "content": {
+            "sat_orderclueid":0,
+            "content": "",
+            "followupmode": "", //当面拜访、电话沟通
+            "logtype": this.param.content.logtype, //跟进、成交、丢单、无效
+            "competitor": ""
+        }
+      }
+    },
     followAction() {
       this.$refs.ruleForm.validate( async val => {
         if(!val) return this.$notify({
@@ -139,7 +170,7 @@ export default {
           message:'请按照要求填写信息',
           type:'warning'
         })
-        this.param.content.sat_orderclueid = this.data.data.sat_orderclueid
+        this.param.content.sat_orderclueid = this.detailInfo.data.sat_orderclueid
         let res = await this.$api.requested(this.param)
         this.tool.showMessage(res,() => {
           this.dialogVisible = false

+ 2 - 1
src/SManagement/orderclue/components/list.vue

@@ -16,6 +16,7 @@
             <el-option value="丢单">丢单</el-option>
             <el-option value="已成交">成交</el-option>
             <el-option value="无效">无效</el-option>
+            <el-option value="已过期">已过期</el-option>
           </el-select>
         </div>
       </div>
@@ -97,7 +98,7 @@ export default {
         '丢单': '#FF3B30',
         '无效': '#999999',
         '已成交': '#333333',
-        '已过期': '#999999'
+        '已过期': '#999999',
       }
     };
   },

+ 6 - 17
src/SManagement/orderclue/index.vue

@@ -5,21 +5,21 @@
           <p @click="detail(scope.data)" v-if="tool.checkAuth($route.name,'read')">详情</p>
       </template>
       <template v-slot:edit="scope">
-          <edit :data="scope.data" 
+          <edit :detailInfo="scope.data" 
                 @updataList="updataList"
                 :arealist="arealist" 
-                v-if="userInfo.isAuth == 0 || userInfo.name == scope.data.data.leadername && scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中'"></edit>
+                v-if="userInfo.name == scope.data.data.leadername && userInfo.name == scope.data.data.leadername ? scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中' : ''"></edit>
       </template>
       <template v-slot:goUp="scope">
-        <follow :data="scope.data" 
+        <follow :detailInfo="scope.data" 
                 @updataList="updataList" 
-                v-if="userInfo.isAuth == 0 || userInfo.name == scope.data.data.leadername && scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中'"></follow>
+                v-if="userInfo.name == scope.data.data.leadername && userInfo.name == scope.data.data.leadername ? scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中' : ''"></follow>
       </template>
       <template v-slot:move="scope">
         <move :data="[scope.data.data.sat_orderclueid]" 
               @updataList="updataList" 
               :teamList="teamList"  
-              v-if="userInfo.isAuth == 1 && scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中'"></move>
+              v-if="userInfo.isAuth == 1 && userInfo.isAuth == 1 ? scope.data.data.status == '待跟进' || scope.data.data.status == '跟进中' : ''"></move>
       </template>
     </list>
   </div>
@@ -107,18 +107,7 @@ export default {
         isAuth : res.data.agenthr.isleader,
         name: res.data.name
       }
-      console.log(this.userInfo.isAuth);
-      
-    },
-    //操作权限
-    handlePower(role) {
-      if(role == '员工') {
-        console.log(this.userInfo.isAuth == 0);
-        
-        return this.userInfo.isAuth == 0
-      } else {
-        return this.userInfo.isAuth == 1
-      }
+      window.sessionStorage.setItem('userInfo',JSON.stringify(this.userInfo))
     }
   },
 };

+ 6 - 7
src/SManagement/orderclue_detail/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="detail">
     <Header>
-      <edit position="detail" @getDetail="getDetail" :arealist="arealist" :data="{data:detail}"></edit>
-      <follow :data="{data:detail}" @getDetail="getDetail" position="detail"></follow>
+      <edit position="detail" @getDetail="getDetail" :arealist="arealist" :detailInfo="{data:detail}"></edit>
+      <follow :detailInfo="{data:detail}" @getDetail="getDetail" position="detail"></follow>
     </Header>
     <div class="normal-card">
       <el-descriptions :column="5" title="线索信息">
@@ -14,7 +14,7 @@
         <el-descriptions-item label="客户名称">{{detail.name}}</el-descriptions-item>
         <el-descriptions-item label="省市县">{{detail.province}}、{{detail.city}}、{{detail.county}}</el-descriptions-item>
         <el-descriptions-item label="备注">{{detail.notes}}</el-descriptions-item>
-        <el-descriptions-item label="负责人">{{detail.agentname}}</el-descriptions-item>
+        <el-descriptions-item label="负责人">{{detail.leadername}}</el-descriptions-item>
       </el-descriptions>
     </div>
     <div class="normal-card">
@@ -45,10 +45,11 @@ export default {
   data() {
     return {
       param: {
-        "classname": "webmanage.saletool.orderclue.publicclue.PublicClue",
+        "classname": "saletool.orderclue.web.orderclue",
         "method": "selectDetail",
         "content": {
-            "sat_orderclueid": 0
+          "nocache":true,
+          "sat_orderclueid": 0
         }
       },
       statusStyle: {
@@ -80,8 +81,6 @@ export default {
       this.param.content.sat_orderclueid = this.$route.query.id
       let res = await this.$api.requested(this.param)
       this.detail = res.data
-      console.log(this.detail);
-      
     },
     async query_arealist() {
       const res = await this.$api.requested({