Quellcode durchsuchen

更正复制时带出的执行人和部门数据错误,复制时去掉明细行单据号,明细行中必填项加了红*

DongZ vor 1 Jahr
Ursprung
Commit
e575d49414

+ 41 - 39
src/views/business/spd/task_management/visitingPlan/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="addPlanList">
-    <el-card>
+    <el-card style="position: relative;">
       <span>基本信息</span>
       <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
         <el-row :gutter="10">
@@ -115,15 +115,17 @@
 
         </el-row>
 
-        <span>明细信息</span>
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
-          <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
-          <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
-          <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
+          <span>明细信息</span>
+          <div>
+            <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
+            <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+            <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
+            <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
+          </div>
         </div>
 
-        <el-table 
+        <el-table
           :data="basicForm.mkBoPlanItemList" 
           fit
           max-height="600"
@@ -134,12 +136,12 @@
           <el-table-column type="selection" align="center"/>
           <el-table-column label="序号" type="index" align="center"/>
           <el-table-column show-overflow-tooltip label="计划编号" prop="planCode" width="150"/>
-          <el-table-column show-overflow-tooltip label="日期"  prop="date" width="230px">
+          <el-table-column show-overflow-tooltip label="日期"  prop="date" width="230px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'date'" :rules="{ required: true, message: '请填写日期', trigger: 'blur' }">
                 <el-date-picker
                   v-model="scope.row.date"
-                  readonly
+                  :readonly="sonDisable"
                   clearable
                   type="date"
                   size="mini"
@@ -150,7 +152,7 @@
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="客户名称" prop="customerName" min-width="230">
+          <el-table-column show-overflow-tooltip label="客户名称" prop="customerName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'customerName'" :rules="{ required: true, message: '请选择客户', trigger: 'blur' }">
                 <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
@@ -160,10 +162,10 @@
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230">
+          <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
-                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {})" style="width: 200px">
+                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {id: customer})" style="width: 200px">
                   <el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
@@ -178,7 +180,7 @@
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200">
+          <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'purpose'" :rules="{ required: true, message: '请选择拜访目的', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" v-model="scope.row.purpose" size="mini">
@@ -304,7 +306,7 @@ export default {
   mounted() {},
   created() {
     //查看系统数据
-    // console.log(this.$store.state.user, 'this.$store.state.user')
+    console.log(this.$store.state.user, 'this.$store.state.user')
     if(this.pageStu == 'check') {
       console.log('数据', this.row)
       this.getDetails(this.row)
@@ -323,25 +325,17 @@ export default {
       this.sonDisable = false
       // this.getDetails(this.row)
       this.basicForm.id = ''
-      this.basicForm.code = ''
+      this.basicForm.planCode = ''
       this.basicForm.createBy = ''
-      this.basicForm.chargerName = this.$store.state.user.name
-      this.basicForm.deptName = this.$store.state.user.deptId
+      this.basicForm.createTime = ''
+      this.basicForm.chargerName = this.$store.state.user.nickName
+      this.basicForm.dept = this.$store.state.user.deptId
       if (this.basicForm.chargerName) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.chargerName) }
       if (this.basicForm.marketingAreaName) { this.reBackRefer('MK_SALESAREA_PARAM', this.basicForm.marketingAreaName) }
       if (this.basicForm.deptName) { this.reBackRefer('DEPT_PARAM', this.basicForm.deptName) }
-      // this.basicForm.mkBoPlanItemList.forEach(item => {
-        // item.date = ''
-        // item.customer = ''
-        // item.customerName = ''
-        // item.contact = ''
-        // item.contactName = ''
-        // item.address = ''
-        // item.purpose = ''
-        // item.bo = ''
-        // item.boName = ''
-        // item.marketingCampaign = ''
-      // })
+      this.basicForm.mkBoPlanItemList.forEach(item => {
+        item.planCode = ''
+      })
     },
     handleData() {
       console.log('222')
@@ -371,7 +365,7 @@ export default {
     },
     async save() {
       if(this.basicForm.mkBoPlanItemList.length !== 0) {
-        this.$refs['basic'].validate((valid) => {
+        this.$refs['basic'].validate((valid, obj) => {
           if(valid) {
             this.$modal.loading("保存中...");
             if(this.sonPageStu == 'add') {
@@ -404,6 +398,14 @@ export default {
                 this.$modal.closeLoading();
               })
             }
+          } else {
+            // 校验加弹窗
+            const jiaoyan = []
+            for(let key in obj) {
+              jiaoyan.push(obj[key][0].message);
+            }
+            this.$modal.notifyWarning(jiaoyan[0]);
+            return false
           }
         })
       } else {
@@ -428,7 +430,6 @@ export default {
         date = this.getCurrentTime();
       }
       const newLine = {
-        contacts: null,
         id: null,
         planId: null,
         planCode: null,
@@ -445,8 +446,6 @@ export default {
         delFlag: 0,
         // 新增字段
         model: null,
-        storageCondition: null,
-        transportationCondition: null,
       }
       this.basicForm.mkBoPlanItemList.push(newLine)
     },
@@ -469,11 +468,7 @@ export default {
     delLine(index, row) {
       console.log('删除行:', index)
       console.log('改变行:', row)
-      // this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
-      //   return item.id !== row.id
-      // })
       row.delFlag = '2'
-      // this.basicForm.mkBoPlanItemList.splice(index,1)
       let delList = []
       delList = this.basicForm.mkBoPlanItemList.filter(item => {
         return item.delFlag == '2'
@@ -613,7 +608,14 @@ export default {
         this.addLine(this.getNextWeek(i + 1));
       }
       this.isFlag = true;
-    }
+    },
+    // 必选标识
+    addRedStar(h, { column }) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+    },
   }
 }
 
@@ -629,7 +631,7 @@ export default {
 .btn_grooup {
   margin-bottom: 10px;
   display: flex;
-  justify-content: flex-end;
+  justify-content: space-between;
 }
 .hang {
   margin: auto;

+ 1 - 1
src/views/business/spd/task_management/visitingPlan/index.vue

@@ -204,7 +204,7 @@
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="queryParams.pageNum"
-        :page-sizes="[10, 15, 20]"
+        :page-sizes="[100, 150, 200]"
         :page-size="100"
         layout="total, sizes, prev, pager, next, jumper"
         :total=total>