2213980799@qq.com 1 年間 前
コミット
e859157d09

+ 86 - 33
src/views/marketManagem/components/addOrEditDialog.vue

@@ -19,10 +19,10 @@
     <el-form
       ref="form"
       :rules="rules"
-      class="el-form-box"
+      class="el-form-box borNone"
       :model="form"
       label-width="0"
-      style="padding:0 15px "
+      style="padding: 0 15px"
     >
       <el-row :gutter="15">
         <el-descriptions title="基本信息" :column="4" border>
@@ -51,7 +51,7 @@
           ></el-descriptions-item>
 
           <el-descriptions-item label="发起人">
-            <el-form-item prop="type">
+            <el-form-item prop="promoterName">
               <el-input
                 v-model="form.promoterName"
                 @click.native="userListOpen('promoterName')"
@@ -137,12 +137,10 @@
                 :default-time="['9:00:00', '12:00:00']"
                 value-format="yyyy-MM-dd HH:mm:ss"
               >
-              </el-date-picker> 
-              <span v-if="TimeArr.length>1">
-                 {{ getTimeArr }}  天
-              </span>
-              </el-form-item
-          ></el-descriptions-item>
+              </el-date-picker>
+              <span v-if="TimeArr.length > 1"> {{ getTimeArr }} 天 </span>
+            </el-form-item></el-descriptions-item
+          >
         </el-descriptions>
         <el-descriptions title="接待项目" :column="4" border>
           <el-descriptions-item label="项目类别">
@@ -248,13 +246,11 @@
                 ref="conferenceListRef"
                 v-if="item.name == '会议'"
                 :organizationList="organizationList"
-
               ></conferenceList>
               <companyList
                 ref="companyListRef"
                 v-if="item.name == '公司参观'"
                 :organizationList="organizationList"
-
               ></companyList>
               <visitList
                 ref="visitListRef"
@@ -268,6 +264,8 @@
     </el-form>
     <div slot="footer">
       <el-button type="primary" @click="save()">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
+
       <el-button @click="cancel">返回</el-button>
     </div>
     <UserList ref="userListRef" @success="userListSuccess"></UserList>
@@ -276,6 +274,13 @@
       ref="staffSelectionRef"
       @confirm="staffSelectionbk"
     ></staffSelection>
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="done"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
   </ele-modal>
 </template>
 <script>
@@ -332,6 +337,8 @@ import companyList from './companyList.vue';
 import visitList from './visitList.vue';
 //住宿
 import putUpList from './putUpList.vue';
+import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+
 export default {
   components: {
     deptSelect,
@@ -345,14 +352,23 @@ export default {
     modalTitle,
     putUpList,
     visitList,
-    staffSelection
+    staffSelection,
+    processSubmitDialog
   },
   mixins: [dictMixins],
   computed: {
     ...mapGetters(['user']),
-    getTimeArr(){
-      let [start,end]=this.TimeArr
-      return Math.ceil((new Date(end).getTime()-new Date(start).getTime())/1000/60/60/24)||''
+    getTimeArr() {
+      let [start, end] = this.TimeArr;
+      return (
+        Math.ceil(
+          (new Date(end).getTime() - new Date(start).getTime()) /
+            1000 /
+            60 /
+            60 /
+            24
+        ) || ''
+      );
     }
   },
   data() {
@@ -367,6 +383,7 @@ export default {
       organizationList: [],
       form: { ...defForm },
       linkList: [],
+      processSubmitDialogFlag: false,
       checkboxGroup: [
         {
           refKey: 'taskInfoTableRef',
@@ -405,7 +422,12 @@ export default {
         value: 'id',
         label: 'name'
       },
-      rules: {}
+      rules: {
+    
+        name: { required: true, message: '请输入', trigger: 'change' },
+        type: { required: true, message: '请选择', trigger: 'change' },
+        
+      }
     };
   },
   mounted() {},
@@ -431,17 +453,36 @@ export default {
             this.checkList.push(item.refKey);
           });
           this.activeName = this.checkList[0];
-          if(this.form.start&&this.form.end){
+          if (this.form.start && this.form.end) {
             this.TimeArr = [this.form.start, this.form.end];
           }
-          
         });
       } else {
         this.form.promoterName = this.user.info.name;
         this.form.promoterId = this.user.info.id;
       }
     },
-    async save() {
+    submit(data) {
+      
+      this.processSubmitDialogFlag = true;
+      this.$nextTick(() => {
+        let params = {
+          businessId: data.id,
+          businessKey: 'market_management_approve',
+          formCreateUserId: data.createUserId,
+          pcHandle: '/bpm/handleTask/components/marketManagem/submit.vue',
+          pcView: '/bpm/handleTask/components/marketManagem/view.vue',
+          variables: {
+            businessCode: data.code
+          }
+        };
+        this.$refs.processSubmitDialogRef.init(params);
+      });
+    },
+    done() {
+      this.$emit('done');
+    },
+    async save(type) {
       try {
         await this.getValidate();
         // 表单验证通过,执行保存操作
@@ -464,14 +505,22 @@ export default {
 
         // return;
         save(this.form)
-          .then((res) => {
+          .then(async (res) => {
             this.loading = false;
             this.$message.success('操作成功');
+            if (type == 'sub') {
+              if(this.form.id){
+                this.submit(this.form);
+              }else{
+                this.submit( await getById(res));
+              }
+            
+            }
             this.cancel();
             this.$emit('done');
           })
           .catch((e) => {
-            //this.loading = false;
+            this.loading = false;
           });
       } catch (error) {
         console.log(error);
@@ -561,20 +610,21 @@ export default {
       this.form.phone = phone;
       this.form.positionName = positionName;
     },
-    receptionDepartmentIdChange(){
-      this.$nextTick(()=>{
-        const data =this.$refs.deptRef.getCheckedNodes()
-        console.log(data,'data')
-        this.form.receptionDepartmentName=data.map(item=>item.label).toString()
-
-      })
+    receptionDepartmentIdChange() {
+      this.$nextTick(() => {
+        const data = this.$refs.deptRef.getCheckedNodes();
+        console.log(data, 'data');
+        this.form.receptionDepartmentName = data
+          .map((item) => item.label)
+          .toString();
+      });
     },
-   
+
     //关闭弹窗
     cancel() {
       this.addOrEditDialogFlag = false;
       this.checkList = [];
-      this.TimeArr=[]
+      this.TimeArr = [];
       this.form = {
         ...defForm
       };
@@ -583,9 +633,12 @@ export default {
 };
 </script>
 <style scoped lang="scss">
-:deep(.el-input__inner) {
-  border: none;
+.borNone{
+  :deep(.el-input__inner) {
+  border-color: #fff;
 }
+}
+
 :deep(.el-input-group__append) {
   border-left: 1px solid var(--border-color-base);
 }
@@ -618,7 +671,7 @@ export default {
     width: 400px;
   }
 }
-:deep(.el-tabs__item){
+:deep(.el-tabs__item) {
   font-size: 16px;
   font-weight: 800;
 }

+ 11 - 28
src/views/marketManagem/components/searchTable.vue

@@ -7,43 +7,26 @@
     @submit.native.prevent
   >
     <el-row :gutter="15">
-      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="编码:" prop="code">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="关键字:" prop="searchName">
           <el-input
             clearable
-            placeholder="请输入"
-            v-model.trim="params.code"
+            placeholder="编码/主题/来访单位/发起人"
+            v-model="params.searchName"
           ></el-input>
         </el-form-item>
-      </el-col> -->
+      </el-col>
       <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
         <el-form-item label="类型" prop="type">
           <DictSelection
             dictName="市场活动类型"
             clearable
-            v-model="params.type"
+            v-model="params.key"
           >
           </DictSelection>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="主题" prop="name">
-          <el-input
-            clearable
-            placeholder="请输入"
-            v-model.trim="params.name"
-          ></el-input>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
-        <el-form-item label="来访单位" prop="visitingUnitsName">
-          <el-input
-            clearable
-            placeholder="请输入"
-            v-model.trim="params.visitingUnitsName"
-          ></el-input>
-        </el-form-item>
-      </el-col>
+
       <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
         <el-form-item label="来访时间" prop="targetTime">
           <el-date-picker
@@ -82,11 +65,11 @@ export default {
   data() {
     // 默认表单数据
     const defaultParams = {
-      code: '',
-      name: '',
+      // code: '',
+      // name: '',
       targetTime:'',
-      visitingUnitsName:'',
-      type:''
+      type:'',
+      searchName:""
     };
     return {
       defaultParams,

+ 1 - 1
src/views/marketManagem/components/viewDialog.vue

@@ -33,7 +33,7 @@
       class="el-form-box"
       :model="form"
       label-width="0"
-      v-if="activeComp=='main'"
+      v-show="activeComp=='main'"
       style="padding:0px 15px"
     >
       <el-row :gutter="15">

+ 1 - 0
src/views/marketManagem/index.vue

@@ -91,6 +91,7 @@
       v-if="processSubmitDialogFlag"
       ref="processSubmitDialogRef"
       @reload="reload"
+      :isNotNeedProcess="false"
     ></process-submit-dialog>
   </div>
 </template>

+ 4 - 4
src/views/purchasingManage/producerManage/components/addContactDialog.vue

@@ -311,7 +311,7 @@
           </template>
         </ele-pro-table>
       </el-tab-pane>
-      <el-tab-pane label="联系人信息" name="3">
+      <el-tab-pane label="联系人信息" :name="3">
         <headerTitle title="联系人信息" style="margin-top: 30px"></headerTitle>
         <ele-pro-table
           ref="linkTable"
@@ -421,7 +421,7 @@
           </template>
         </ele-pro-table>
       </el-tab-pane>
-      <el-tab-pane label="其他信息" name="4">
+      <el-tab-pane label="其他信息" :name="4">
         <headerTitle title="其他信息" style="margin-top: 30px"></headerTitle>
         <el-form
           label-width="100px"
@@ -518,7 +518,7 @@
           </el-row>
         </el-form>
       </el-tab-pane>
-      <el-tab-pane label="供货列表" name="5">
+      <el-tab-pane label="供货列表" :name="5">
         <headerTitle title="供货列表" style="margin-top: 30px"></headerTitle>
         <ele-pro-table
           ref="supplyRef"
@@ -548,7 +548,7 @@
           </template>
         </ele-pro-table>
       </el-tab-pane>
-      <el-tab-pane label="证书资质" name="6">
+      <el-tab-pane label="证书资质" :name="6">
         <headerTitle title="证书资质" style="margin-top: 30px"></headerTitle>
         <ele-pro-table
           ref="certificateTable"

+ 2 - 0
src/views/saleManage/businessOpportunity/components/addOpportunityDialog.vue

@@ -393,6 +393,8 @@ export default {
       if (type == 'add') {
         if (row.id) {
           this.changeParent(row);
+          console.log(this.form.contactId,'this.form.contactId')
+          
         }
         this.isUpdate = false;
         if (this.contactId) { //客户管理详情进入

+ 48 - 12
src/views/targetManage/salesTarget/components/addOrEditDialog.vue

@@ -9,10 +9,12 @@
     width="100%"
     :before-close="cancel"
     :fullscreen="fullscreen"
-
   >
-  <template slot="title">
-     <modalTitle :title="title" @setFullscreen="fullscreen=!fullscreen"></modalTitle>
+    <template slot="title">
+      <modalTitle
+        :title="title"
+        @setFullscreen="fullscreen = !fullscreen"
+      ></modalTitle>
     </template>
     <el-form
       ref="form"
@@ -22,7 +24,7 @@
       label-width="120px"
     >
       <el-row :gutter="15">
-        <el-col :span="6">
+        <el-col :span="4">
           <headerTitle title="基本信息"></headerTitle>
           <el-row>
             <el-col :span="24">
@@ -131,13 +133,19 @@
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item label="负责人" prop="branchName">
-                <el-input v-model="form.branchName"></el-input>
+              <el-form-item label="负责人" prop="superintendentName">
+                <el-input
+                  v-model="form.superintendentName"
+                  @click.native="userListOpen"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item label="可见人" prop="branchName">
-                <el-input v-model="form.branchName"></el-input>
+              <el-form-item label="可见人" prop="participantsName">
+                <el-input
+                  v-model="participantsName"
+                  @click.native="receptionUserOpen"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -147,7 +155,7 @@
             </el-col>
           </el-row>
         </el-col>
-        <el-col :span="18">
+        <el-col :span="20">
           <headerTitle title="目标"></headerTitle>
           <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane
@@ -175,6 +183,11 @@
       <el-button type="primary" @click="handleSave(0)">保存</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
+    <staffSelection
+      ref="staffSelectionRef"
+      @confirm="staffSelectionbk"
+    ></staffSelection>
+    <UserList ref="userListRef" @success="userListSuccess"></UserList>
   </ele-modal>
 </template>
 <script>
@@ -192,6 +205,7 @@ const defForm = {
   superintendentName: '', //负责人名称
   participantsId: '',
   participantsName: '',
+  discernibleUserList: [],
   status: '',
   type: 1,
   describes: ''
@@ -209,16 +223,19 @@ import deptSelect from '@/components/CommomSelect/dept-select.vue';
 import { getUserPage } from '@/api/system/organization';
 import dictMixins from '@/mixins/dictMixins';
 import modalTitle from '@/BIZComponents/modalTitle.vue';
+import staffSelection from '@/views/marketManagem/components/staffSelection.vue';
+import UserList from '@/views/marketManagem/components/userList.vue';
 
 export default {
-  components: { deptSelect,modalTitle },
+  components: { deptSelect, modalTitle, staffSelection, UserList },
   mixins: [dictMixins],
   computed: {},
   data() {
     return {
       dialogType: '',
-      fullscreen:false,
+      fullscreen: false,
       title: '',
+      participantsName: '',
       unitOption: [],
       addOrEditDialogFlag: false,
       activeName: '',
@@ -305,6 +322,11 @@ export default {
         if (this.form.departmentId) {
           this.getUserList({ groupId: this.form.departmentId });
         }
+        if (this.form.discernibleUserList) {
+          this.participantsName = this.form.discernibleUserList
+            .map((item) => item.name)
+            .toString();
+        }
 
         this.form.assessmentDimensions =
           this.form.assessmentDimensions.split(',');
@@ -313,7 +335,21 @@ export default {
         this.initTree();
       }
     },
-
+    receptionUserOpen() {
+      this.$refs.staffSelectionRef.open(this.form.participantsId || []);
+    },
+    staffSelectionbk(data) {
+      this.form.discernibleUserList = data;
+      this.participantsName = data.map((item) => item.name).toString();
+      // console.log(data,'data')
+    },
+    userListOpen(key) {
+      this.$refs.userListRef.open(key);
+    },
+    userListSuccess({ data }) {
+      this.form.superintendentName = data?.name;
+      this.form.superintendentId = data?.id;
+    },
     //tree更新
     initTree() {
       this.treeData.children = [];

+ 9 - 1
src/views/targetManage/salesTarget/components/searchTable.vue

@@ -7,7 +7,15 @@
     @submit.native.prevent
   >
     <el-row :gutter="15">
- 
+      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="编码:" prop="code">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.code"
+          ></el-input>
+        </el-form-item>
+      </el-col> -->
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="编码:" prop="code">
           <el-input

+ 2 - 2
src/views/targetManage/salesTarget/index.vue

@@ -24,7 +24,7 @@
           >
             新建
           </el-button>
-          <el-button
+          <!-- <el-button
             size="small"
             type="danger"
             el-icon-delete
@@ -33,7 +33,7 @@
             :disabled="selection?.length === 0"
           >
             批量删除
-          </el-button>
+          </el-button> -->
         </template>
         <!-- 操作 -->
         <template v-slot:action="{ row }">

+ 89 - 46
src/views/targetManage/util.js

@@ -200,7 +200,7 @@ export function getTargetManageTree(data, type) {
                 ratio: '',
                 value: '',
                 type: '3',
-                
+
               },
               {
                 id: data.id + '-' + '7',
@@ -434,67 +434,110 @@ export function renderInput(h, data, className, placeholder, form, children) {
       on: {
         input: (value) => {
           data[className == 'ratioInput' ? 'ratio' : 'value'] = value; // 监听输入事件,更新数据
-          flattenTree(data, className, children);
+          flattenTree(data, className, children, 'input');
+        },
+        focus: () => {
+          flattenTree(data, className, children, 'focus');
         }
       }
     },
     [className == 'ratioInput' ? h('slot', { slot: 'suffix' }, ['%']) : '']
   );
 }
-// 目标值改变递归更新数据
-function flattenTree(data, className, tree) {
+//占比改变
+function setRatio(data, tree, eventFn) {
   let ratio = 0
   tree.forEach((node) => {
-    if (className == 'select') {
-      if (data.id == node.pid) {
-        node.unit = data.unit
-        node.children.forEach((val) => {
-          val.unit = data.unit
-        });
+    if (data.pid == node.pid && data.id !== node.id) {
+      ratio += (+node.ratio)
+      if (eventFn == 'focus' && ratio) {
+        data.ratio = 100 - ratio >= 0 ? 100 - ratio : 0
+      }
+      if (eventFn == 'input') {
+        if (ratio + (+data.ratio) > 100) {
+          data.ratio = 100 - ratio
+        }
       }
+
+    }
+    if (node.children && node.children.length > 0) {
+      setRatio(data, node.children, eventFn);
+    }
+  })
+
+}
+//占比改变值改变
+function setValue(data, tree) {
+  tree.forEach((node) => {
+
+    if (node.id == data.pid) {
+      data.value = +(node.value * (data.ratio / 100)).toFixed(2)
+      //季度占比改变计算月度目标值
+    }
+    if (data.type == '2') {
+      data.children.forEach((val) => {
+        val.value = +(data.value * (val.ratio / 100)).toFixed(2)
+      });
+    }
+    if (node.children && node.children.length > 0) {
+      setValue(data, node.children);
     }
-    //占比改变根据父级目标值计算
-    if (className == 'ratioInput') {
+  })
 
-      if (data.pid == node.pid) {
-        ratio += (+node.ratio)
+}
 
-        if (ratio > 100) {
 
-          data.ratio = 100 - (ratio - data.ratio)
-          ratio = 100
-        }
-      }
-      // if (data.ratio < 0) {
-      //   data.ratio = 0
-      // }
-      // if (data.ratio > 100) {
-      //   data.ratio = 100
-      // }
-      if (node.id == data.pid) {
-        data.value = +(node.value * (data.ratio / 100)).toFixed(2)
-        //季度占比改变计算月度目标值
-      }
-      if (data.type == '2') {
-        data.children.forEach((val) => {
-          val.value = +(data.value * (val.ratio / 100)).toFixed(2)
-        });
-      }
+//设置单位
+function setSelect(data, tree) {
+  tree.forEach((node) => {
+
+    if (data.id == node.pid) {
+      node.unit = data.unit
+      node.children.forEach((val) => {
+        val.unit = data.unit
+      });
     }
-    //目标值改变根据子级占比计算
-    if (className == 'valueInput') {
-      if (node.pid == data.id) {
-        node.value = +(data.value * (node.ratio / 100)).toFixed(2)
-        //年度目标值改变月度目标
-        if (data.type == '1') {
-          node.children.forEach((val) => {
-            val.value = +(node.value * (val.ratio / 100)).toFixed(2)
-          });
-        }
+    if (node.children && node.children.length > 0) {
+      setSelect(data, node.children);
+    }
+  })
+
+}
+//改变值
+function setValueInput(data, tree) {
+  tree.forEach((node) => {
+
+    if (node.pid == data.id) {
+      node.value = +(data.value * (node.ratio / 100)).toFixed(2)
+      //年度目标值改变月度目标
+      if (data.type == '1') {
+        node.children.forEach((val) => {
+          val.value = +(node.value * (val.ratio / 100)).toFixed(2)
+        });
       }
     }
     if (node.children && node.children.length > 0) {
-      flattenTree(data, className, node.children);
+      setValueInput(data, node.children);
     }
-  });
+  })
+
+}
+
+
+// 目标值改变递归更新数据
+function flattenTree(data, className, tree, eventFn) {
+
+  if (className == 'ratioInput') {
+    setRatio(data, tree, eventFn) //设置占比
+    setValue(data, tree) //占比改变值更新
+
+  }
+  if (className == 'select') {
+    setSelect(data, tree,) //设置单位
+
+  }
+  //目标值改变根据子级占比计算
+  if (className == 'valueInput') {
+    setValueInput(data, tree) //改变值
+  }
 }