瀏覽代碼

项目商机的跟进动态新增变更项目阶段的功能

qymljy 3 周之前
父節點
當前提交
e80d482545

+ 5 - 0
src/HDrpManagement/projectChange/modules/detail.vue

@@ -16,6 +16,7 @@
     @pageChange="pageChange"
     @onEditSuccess="queryMainData($route.query.id)"
     @logSuccess="queryMainData"
+    @followAdd="followAdd"
     @sysTag="sysTag">
     <!-- 使用此插槽可不传[tags] -->
 <!--    <tagPanl slot="tags" :data="tagObj" ownertable="sa_project" :id="mainData.sa_projectid" @onSuccess="queryMainData"/>-->
@@ -734,6 +735,10 @@ export default {
     },
     dialogClose(){
       this.$refs.details.$refs.tag.queryTag()
+    },
+    followAdd(){
+      this.queryMainData()
+      this.projectStage()
     }
   },
   mounted () {

+ 5 - 1
src/components/normal-basic-layout/details/index.vue

@@ -102,7 +102,8 @@
           <group v-if="activeApp.isdatateam" :isGroup="isGroup" :status="status" :disabled="disabled" ref="group" style="margin-bottom:10px"  :justsaler="justsaler" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" @onSuccess="onSuccess" @teamList="teamList">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </group>
-          <follow-up v-if="activeApp.isdatafollowup" :status="status" ref="follow" :disabled="disabled" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" :editData="editData" :idname="idname" @logSuccess="logSuccess" @onMore="onMore" :bindData="{ ownertable: ownertable, ownerid: editData[idname], usetype: 'default' }">
+          <follow-up v-if="activeApp.isdatafollowup" :status="status" ref="follow" :disabled="disabled" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" :editData="editData" :idname="idname" @logSuccess="logSuccess" @onMore="onMore"
+                     @followAdd="followAdd" :bindData="{ ownertable: ownertable, ownerid: editData[idname], usetype: 'default' }">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </follow-up>
         </el-col>
@@ -544,6 +545,9 @@ export default {
       if (val == '查看更多'){
         this.$refs.tabRef.activeName = 'follow'
       }
+    },
+    followAdd(){
+      this.$emit('followAdd')
     }
   },
   mounted () {

+ 11 - 1
src/components/normal-basic-layout/details/modules/followTable/index.vue

@@ -15,7 +15,7 @@
       <el-table-column
           prop="createby"
           :label="$t('跟进人')"
-          min-width="60">
+          min-width="90">
         <template slot-scope="scope">
           <div>
             {{scope.row.createby}}
@@ -65,6 +65,16 @@
           <div v-else>{{scope.row.content}}</div>
         </template>
       </el-table-column>
+      <el-table-column
+          v-if="$route.path === '/projectChangeDetail'"
+          prop="squarestage"
+          :label="$t(`项目阶段`)"
+          min-width="500"
+      >
+        <template slot-scope="scope">
+          <div>{{scope.row.squarestage?scope.row.squarestage:''}}</div>
+        </template>
+      </el-table-column>
       <el-table-column
           prop="attcount"
           :label="$t(`附件数`)"

+ 74 - 7
src/components/normal-basic-layout/details/modules/followUp/addLog.vue

@@ -41,6 +41,16 @@
           <el-form-item :label="$t(`下次跟进计划`)" prop="nextplan" :rules="{ required: false, message: $t('请填写下次跟进计划'), trigger: 'blur'}" v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
             <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 18 }" v-model="form.nextplan" :placeholder="$t(`请输入下次跟进计划`)" autocomplete="off"></el-input>
           </el-form-item>
+          <el-form-item :label="$t(`变更项目阶段`)" prop="squarestage" :rules="{ required: true, message: $t('请选择项目阶段'), trigger: 'change'}" v-if="$route.path === '/projectChangeDetail'">
+            <el-select v-model="form.squarestage" :placeholder="$t(`请选择项目阶段`)" @focus="squarestageFocus" style="width: 100%">
+              <el-option
+                  v-for="item in squarestageList"
+                  :key="item.stagename"
+                  :label="$t(item.stagename)"
+                  :value="item.stagename">
+              </el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item>
             <upload
               ref="upload"
@@ -71,7 +81,7 @@ import upload from '@/components/upload/preview_upload.vue'
 import previewImage from '@/components/previewImage/index.vue'
 import contactsList from '@/template/projectChange/contactsList.vue'
 export default {
-  props:['ownertable','status','disabled','bindDataFile'],
+  props:['ownertable','status','disabled','bindDataFile','editData'],
   components:{
     upload,
     previewImage,
@@ -90,6 +100,8 @@ export default {
         target:'',//目的
         results:'',//结果
         nextplan:'',//下次跟进计划
+        squarestage:'',
+        sa_project_stageid:''
       },
       selectTag:[],
       bindData:{},
@@ -108,7 +120,8 @@ export default {
             condition:''
           }
         }
-      }
+      },
+      squarestageList:[]
     }
   },
 
@@ -121,6 +134,7 @@ export default {
       console.log(this.$route,'route')
       this.path = this.$route.path
       console.log(this.path)
+      this.form.squarestage = this.editData.stagename
       this.queryFollowUpType()
     },
     /*获取跟进类型*/
@@ -129,12 +143,22 @@ export default {
       this.followUpType = res.data
     },
     submitLog () {
+      console.log(this.form.squarestage,'阶段')
+      if (this.squarestageList.length == 0){
+        this.stageData()
+      }else {
+        this.squarestageList.forEach(item=>{
+          if (item.stagename === this.form.squarestage){
+            this.form.sa_project_stageid = item.sa_project_stageid
+          }
+        })
+      }
       this.$refs.form.validate(async (valid)=>{
         if (!valid) return false
         let resource = this.$route.matched[1].meta.title
-        const res = await this.$api.requested({
-          "id": 20220930121601,
-          "content": {
+        let content = {}
+        if (this.$route.path === '/projectChangeDetail'){
+          content = {
             "sys_datafollowupid":0,
             "ownertable":this.ownertable,
             "ownerid":this.$route.query.id,
@@ -146,8 +170,29 @@ export default {
             "dataextend": {
               "contactsid": this.form.dataextend.contactsid // 跟进对象
             },
-            "resource":resource
+            "resource":resource,
+            "squarestage":this.form.squarestage,
+            "sa_project_stageid":this.form.sa_project_stageid
           }
+        }else {
+          content = {
+            "sys_datafollowupid":0,
+            "ownertable":this.ownertable,
+            "ownerid":this.$route.query.id,
+            "type":this.form.type,
+            "content":this.form.content,
+            "target":this.form.target,//目的
+            "results":this.form.results,//结果
+            "nextplan":this.form.nextplan,//下次跟进计划
+            "dataextend": {
+              "contactsid": this.form.dataextend.contactsid // 跟进对象
+            },
+            "resource":resource,
+          }
+        }
+        const res = await this.$api.requested({
+          "id": 20220930121601,
+          "content": content
         })
         this.tool.showMessage(res,()=>{
           this.bindData = {
@@ -160,6 +205,7 @@ export default {
 
           this.$refs['upload'].toUpload()
           this.$emit('onSuccess')
+          this.squarestageList = []
           this.selectTag = []
           this.form.dataextend.contactsid = []
         })
@@ -188,8 +234,29 @@ export default {
       this.dialogFormVisible = false
       this.selectTag = []
       this.form.dataextend.contactsid = []
+      this.squarestageList = []
       this.$refs.form.resetFields()
-    }
+    },
+    async squarestageFocus(){
+      if (this.squarestageList.length == 0){
+        this.stageData()
+      }
+    },
+    /*获取阶段*/
+    async stageData(){
+      const res = await this.$api.requested({
+        "id": 20221024102402,
+        "content": {
+          "sa_projectid":this.$route.query.id
+        }
+      })
+      this.squarestageList = res.data
+      this.squarestageList.forEach(item=>{
+        if (item.stagename === this.form.squarestage){
+          this.form.sa_project_stageid = item.sa_project_stageid
+        }
+      })
+    },
   }
 }
 

+ 72 - 8
src/components/normal-basic-layout/details/modules/followUp/editLog.vue

@@ -44,6 +44,16 @@
           <el-form-item :label="$t(`下次跟进计划`)" prop="nextplan" :rules="{ required: false, message: $t('请填写下次跟进计划'), trigger: 'blur'}" v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
             <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 18 }" v-model="form.nextplan" :placeholder="$t(`请输入下次跟进计划`)" autocomplete="off"></el-input>
           </el-form-item>
+          <el-form-item :label="$t(`变更项目阶段`)" prop="squarestage" :rules="{ required: true, message: $t('请选择项目阶段'), trigger: 'change'}" v-if="$route.path === '/projectChangeDetail'">
+            <el-select v-model="form.squarestage" :placeholder="$t(`请选择项目阶段`)" @focus="squarestageFocus" style="width: 100%" disabled>
+              <el-option
+                  v-for="item in squarestageList"
+                  :key="item.stagename"
+                  :label="$t(item.stagename)"
+                  :value="item.stagename">
+              </el-option>
+            </el-select>
+          </el-form-item>
           <div class="flex-align-center flex-between pionter" v-for="file in data.attinfos" :key="file.index">
             <div class="flex-align-center">
               <img width="30" :src="checkFileType(file.postfix) === 'file'?require('@/assets/file_icons/file.svg'):file.url" class="inline-16" alt="">
@@ -79,7 +89,7 @@ import upload from '@/components/upload/hw_obs_upload.vue'
 import previewImage from '@/components/previewImage/index.vue'
 import contactsList from '@/template/projectChange/contactsList.vue'
 export default {
-  props:['data','ownertable','status','disabled','isOperation','bindDataFile'],
+  props:['data','ownertable','status','disabled','isOperation','bindDataFile','editData'],
   components:{
     upload,
     previewImage,
@@ -96,12 +106,14 @@ export default {
         dataextendContactsid:[],
         dataextend: {
           contactsid: [] // 跟进对象
-        }//扩展参数
+        },//扩展参数
+        squarestage:''
       },
       followUpType:[],
       selectTag:[],
       folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
-      attachmentids:[]
+      attachmentids:[],
+      squarestageList:[]
     }
   },
 
@@ -127,12 +139,38 @@ export default {
 
     // 更新接口
      submitLog () {
+       if (this.squarestageList.length == 0){
+         this.stageData()
+       }else {
+         this.squarestageList.forEach(item=>{
+           if (item.stagename === this.form.squarestage){
+             this.form.sa_project_stageid = item.sa_project_stageid
+           }
+         })
+       }
       this.$refs.form.validate(async(valid)=>{
         if (!valid) return false
         let resource = this.$route.matched[1].meta.title
-        const res = await this.$api.requested({
-          "id": 20220930121601,
-          "content": {
+        let content = {}
+        if (this.$route.path === '/projectChangeDetail'){
+          content = {
+            "sys_datafollowupid":this.data.sys_datafollowupid,
+            "ownertable":this.ownertable,
+            "ownerid":this.$route.query.id,
+            "type":this.form.type,
+            "content":this.form.content,
+            "target":this.form.target,//目的
+            "results":this.form.results,//结果
+            "nextplan":this.form.nextplan,//下次跟进计划
+            "dataextend": {
+              "contactsid": this.form.dataextend.contactsid // 跟进对象
+            },
+            "resource":resource,
+            "squarestage":this.form.squarestage,
+            "sa_project_stageid":this.form.sa_project_stageid
+          }
+        }else {
+          content = {
             "sys_datafollowupid":this.data.sys_datafollowupid,
             "ownertable":this.ownertable,
             "ownerid":this.$route.query.id,
@@ -144,8 +182,12 @@ export default {
             "dataextend": {
               "contactsid": this.form.dataextend.contactsid // 跟进对象
             },
-            "resource":resource
+            "resource":resource,
           }
+        }
+        const res = await this.$api.requested({
+          "id": 20220930121601,
+          "content": content
         })
         this.tool.showMessage(res,()=>{
           this.form.content = ''
@@ -158,6 +200,7 @@ export default {
 
           }).then(rs=>{
             this.attachmentids = []
+            this.squarestageList = []
             this.dialogFormVisible = false
             this.$emit('onSuccess')
           })
@@ -212,8 +255,29 @@ export default {
       this.selectTag = []
       this.form.dataextend.contactsid = []
       this.form.dataextendContactsid = []
+      this.squarestageList = []
       this.$refs.form.resetFields()
-    }
+    },
+    async squarestageFocus(){
+      if (this.squarestageList.length == 0){
+        this.stageData()
+      }
+    },
+    /*获取阶段*/
+    async stageData(){
+      const res = await this.$api.requested({
+        "id": 20221024102402,
+        "content": {
+          "sa_projectid":this.$route.query.id
+        }
+      })
+      this.squarestageList = res.data
+      this.squarestageList.forEach(item=>{
+        if (item.stagename === this.form.squarestage){
+          this.form.sa_project_stageid = item.sa_project_stageid
+        }
+      })
+    },
   }
 }
 

+ 7 - 3
src/components/normal-basic-layout/details/modules/followUp/followUp.vue

@@ -8,7 +8,7 @@
       <div style="display: flex;justify-content: space-between">
 <!--        <fullScreen class="inline-16" domId="containerFull" @onFull="onFull" @backFull="backFull"></fullScreen>-->
         <el-button type="default" size="mini" @click="onMore('查看更多')" class="inline-16">{{$t(`查看更多`)}}</el-button>
-        <addLog :ownertable="ownertable" @onSuccess="queryLogs" :status="status" :disabled="disabled" :bindDataFile="bindData" ></addLog>
+        <addLog :ownertable="ownertable" @onSuccess="queryLogs" :status="status" :disabled="disabled" :bindDataFile="bindData" :editData="editData"></addLog>
       </div>
     </div>
     <div style="padding: 0 10px 0 10px">
@@ -78,6 +78,9 @@
           <div class="padding-style" v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail' || $route.path === '/projectProjectDetail' || $route.path === '/customerCustomerDetail'">
             <span class="span-style">{{$t(`下次跟进计划`)}}:{{i.nextplan}}</span>
           </div>
+          <div class="padding-style" v-if="$route.path === '/projectChangeDetail'">
+            <span class="span-style">{{$t(`项目阶段`)}}:{{i.squarestage}}</span>
+          </div>
           <div class="padding-style" v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail' || $route.path === '/projectProjectDetail' || $route.path === '/customerCustomerDetail'">
             <span class="span-style">{{$t(`营销费用`)}}:</span>
             <span v-if="i.salesfeesamount || i.salesfeesamount == 0">
@@ -186,7 +189,7 @@
             </div>
             <div>
               <marketingExpenses  v-if="($route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail') && !disabled"  class="inline-16" ownertable="sa_customers" :ownerid="i.sys_datafollowupid" :dataTime="i.createdate" :userid="i.createuserid" @onSuccess="onSuccess" :ownertable="ownertable"></marketingExpenses>
-              <editLog v-if="nowUserid === i.createuserid && !disabled" :status="status" ref="edits" :data="i" :ownertable="ownertable" @onSuccess="queryLogs" :bindDataFile="bindData"></editLog>
+              <editLog v-if="nowUserid === i.createuserid && !disabled" :status="status" ref="edits" :data="i" :ownertable="ownertable" @onSuccess="queryLogs" :bindDataFile="bindData" :editData="editData"></editLog>
               <el-popconfirm
                   :confirm-button-text="$t('确定')" :cancel-button-text="$t('取消')"
                   :title="$t(`确定删除该跟进动态吗?`)"
@@ -212,7 +215,7 @@ import addLog from './addLog.vue'
 import editLog from './editLog.vue'
 import marketingExpenses from '@/components/marketingExpenses/index'
 export default {
-  props:['ownertable','status','disabled','bindData'],
+  props:['ownertable','status','disabled','bindData','editData'],
   components:{
     addLog,
     editLog,
@@ -258,6 +261,7 @@ export default {
       })
       this.logList = res.data
       this.total = res.total
+      this.$emit('followAdd')
       setTimeout(()=>{
         this.onMore()
       },1000)