Browse Source

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 year ago
parent
commit
61ecaf325b

+ 32 - 4
src/api/business/spd/goal_management/commonWays.js

@@ -29,8 +29,37 @@ function mergeArray() {
 }
 
 // 计算子表小计
+// export function getSummary(param) {
+//   const { columns, data } = param;
+//   const sums = [];
+//   columns.forEach((column, index) => {
+//     if (index === 0) {
+//       sums[index] = '小计';
+//       return;
+//     }
+//     const values = data.map(item => Number(item[column.property]));
+//     if (!values.every(value => isNaN(value))) {
+//       sums[index] = values.reduce((prev, curr) => {
+//         const value = Number(curr);
+//         if (!isNaN(value)) {
+//           return ((prev * 10000000 + curr * 10000000) / 10000000).toFixed(2);
+//         } else {
+//           return prev;
+//         }
+//       }, 0);
+//       sums[index] += '';
+//     } else {
+//       sums[index] = '*';
+//     }
+//   });
+
+//   return sums;
+// }
+
 export function getSummary(param) {
+  console.log(param, 'param')
   const { columns, data } = param;
+  console.log(columns, 'columns')
   const sums = [];
   columns.forEach((column, index) => {
     if (index === 0) {
@@ -42,16 +71,15 @@ export function getSummary(param) {
       sums[index] = values.reduce((prev, curr) => {
         const value = Number(curr);
         if (!isNaN(value)) {
-          return ((prev * 10000000 + curr * 10000000) / 10000000).toFixed(2);
+          return prev + curr;
         } else {
           return prev;
         }
       }, 0);
-      sums[index] += '';
+      sums[index] = sums[index].toFixed(2);
     } else {
-      sums[index] = '*';
+      sums[index] = ' ';
     }
   });
-
   return sums;
 }

+ 74 - 52
src/views/business/spd/target/AnnualSaleGoal.vue

@@ -106,39 +106,42 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
+    <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
       <el-table-column label="编码" align="center" prop="code" width="180" />
-      <el-table-column label="目标名称" align="center" prop="goalName" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" />
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
       <el-table-column label="客户" align="center" prop="custom" width="180" />
       <el-table-column label="销售区域" align="center" prop="saleZone" width="180" />
-      <el-table-column label="制单人" align="center" prop="creator" />
+      <el-table-column label="制单人" align="center" prop="creator" width="180" />
       <el-table-column label="部门" align="center" prop="dept" width="180" />
-      <el-table-column label="目标合计" align="center" prop="goalTotal" />
+      <el-table-column label="目标合计(元)" align="center" prop="goalTotal" width="180" />
       <el-table-column label="备注" align="center" prop="notes" width="180" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding" width="180" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交
+          </el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -204,7 +207,7 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="6">
-            <el-form-item label="目标合计" prop="goalTotal">
+            <el-form-item label="目标合计(元)" prop="goalTotal">
               <el-input v-model="form.goalTotal" placeholder="目标合计自动计算" clearable disabled />
             </el-form-item>
           </el-col>
@@ -222,7 +225,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-      
+
         <div id="addDetails">
           <el-row :gutter="10" class="mb8" style="margin-left: 80%">
             <el-col :span="1.5">
@@ -309,92 +312,108 @@
                     </el-popover-select-v2>
                   </template>
                 </el-table-column>
-                <el-table-column label="合计" align="center" prop="totalGoal" width="180">
+                <el-table-column label="合计(元)" align="center" prop="totalGoal" width="180">
                   <template slot-scope="scope">
                     <el-input v-model="annualSaleGoalDetailsList[scope.$index].totalGoal" disabled></el-input>
                   </template>
                 </el-table-column>
-                <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
+                <el-table-column label="一月(元)" align="center" prop="januaryGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].januaryGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
+                <el-table-column label="二月(元)" align="center" prop="februaryGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1" :min="0">
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                      v-model="annualSaleGoalDetailsList[scope.$index].februaryGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="三月" align="center" prop="marchGoal" width="220">
+                <el-table-column label="三月(元)" align="center" prop="marchGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].marchGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
+                <el-table-column label="四月(元)" align="center" prop="aprilGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].aprilGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="五月" align="center" prop="mayGoal" width="220">
+                <el-table-column label="五月(元)" align="center" prop="mayGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="六月" align="center" prop="juneGoal" width="220">
+                <el-table-column label="六月(元)" align="center" prop="juneGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="七月" align="center" prop="julyGoal" width="220">
+                <el-table-column label="七月(元)" align="center" prop="julyGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="八月" align="center" prop="augustGoal" width="220">
+                <el-table-column label="八月(元)" align="center" prop="augustGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].augustGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
+                <el-table-column label="九月(元)" align="center" prop="septemberGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1" :min="0">
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                      v-model="annualSaleGoalDetailsList[scope.$index].septemberGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
+                <el-table-column label="十月(元)" align="center" prop="octoberGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
                       v-model="annualSaleGoalDetailsList[scope.$index].octoberGoal" :precision="2" :step="0.1" :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
+                <el-table-column label="十一月(元)" align="center" prop="novemberGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1" :min="0">
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                      v-model="annualSaleGoalDetailsList[scope.$index].novemberGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
+                <el-table-column label="十二月(元)" align="center" prop="decemberGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
-                      v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1" :min="0">
+                    <el-input-number
+                      @change="computeTotalDetails(scope.$index, annualSaleGoalDetailsList[scope.$index])"
+                      v-model="annualSaleGoalDetailsList[scope.$index].decemberGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
@@ -484,7 +503,7 @@
 
   export default {
     name: "AnnualSaleGoal",
-    dicts: ["sys_status","oa_templete_id"],
+    dicts: ["sys_status", "oa_templete_id"],
     components: {
       TreeRefers,
       ElPopoverSelectV2
@@ -693,6 +712,9 @@
           this.annualSaleGoalList = response.rows;
           this.total = response.total;
           this.loading = false;
+          this.annualSaleGoalList.forEach(item => {
+            item.goalTotal = item.goalTotal.toFixed(2);
+          })
           console.log(this.annualSaleGoalList);
         });
       },
@@ -1131,7 +1153,7 @@
         importData(formData).then((res) => {
           console.log('res', res);
           if (res.code == '200') {
-            this.annualSaleGoalDetailsList.push.apply(this.annualSaleGoalDetailsList,res.data);
+            this.annualSaleGoalDetailsList.push.apply(this.annualSaleGoalDetailsList, res.data);
             this.$message.success(res.msg);
           } else {
             this.$message.success(res.msg);
@@ -1145,7 +1167,7 @@
         })
       },
       //双击行
-      useDoubleClick(row){
+      useDoubleClick(row) {
         this.openStatus = 'see';
         this.reset();
         const id = row.id || this.ids

+ 85 - 74
src/views/business/spd/target/AnnualSaleGoalMerge.vue

@@ -124,17 +124,17 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
+    <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
       <el-table-column label="编码" align="center" prop="code" width="180" />
-      <el-table-column label="目标名称" align="center" prop="goalName" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" width="180" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
@@ -142,23 +142,25 @@
       <el-table-column label="制单人" align="center" prop="creator" width="180" />
       <el-table-column label="部门" align="center" prop="dept" width="180" />
       <el-table-column label="目标类型" align="center" prop="goalCategory" width="180" />
-      <el-table-column label="目标值汇总" align="center" prop="goalTotal" width="180" />
+      <el-table-column label="目标值汇总(元)" align="center" prop="goalTotal" width="180" />
       <el-table-column label="销售区域" align="center" prop="saleZone" width="220" />
       <el-table-column label="一级分类" align="center" prop="oneLevelClassify" width="180" />
       <el-table-column label="二级分类" align="center" prop="twoLevelClassify" width="180" />
       <el-table-column label="备注" align="center" prop="notes" width="180" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding" width="180" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -218,7 +220,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="目标值汇总" prop="goalTotal">
+            <el-form-item label="目标值汇总(元)" prop="goalTotal">
               <el-input v-model="form.goalTotal" placeholder="目标值汇总自动计算" disabled />
             </el-form-item>
           </el-col>
@@ -260,7 +262,8 @@
         <div>
           <el-row :gutter="10" class="mb8" style="margin-left: 94%">
             <el-col :span="1.5">
-              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并</el-button>
+              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并
+              </el-button>
             </el-col>
           </el-row>
           <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
@@ -320,12 +323,12 @@
                     </el-select>
                   </template>
                 </el-table-column>
-                <el-table-column label="合计" align="center" prop="totalGoal" width="180">
+                <el-table-column label="合计(元)" align="center" prop="totalGoal" width="180">
                   <template slot-scope="scope">
                     <el-input v-model="annualSaleGoalMergeDetailsList[scope.$index].totalGoal" disabled></el-input>
                   </template>
                 </el-table-column>
-                <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
+                <el-table-column label="一月(元)" align="center" prop="januaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -333,7 +336,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
+                <el-table-column label="二月(元)" align="center" prop="februaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -341,7 +344,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="三月" align="center" prop="marchGoal" width="220">
+                <el-table-column label="三月(元)" align="center" prop="marchGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -349,7 +352,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
+                <el-table-column label="四月(元)" align="center" prop="aprilGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -357,31 +360,34 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="五月" align="center" prop="mayGoal" width="220">
+                <el-table-column label="五月(元)" align="center" prop="mayGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
-                      v-model="annualSaleGoalMergeDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1" :min="0">
+                      v-model="annualSaleGoalMergeDetailsList[scope.$index].mayGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="六月" align="center" prop="juneGoal" width="220">
+                <el-table-column label="六月(元)" align="center" prop="juneGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
-                      v-model="annualSaleGoalMergeDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1" :min="0">
+                      v-model="annualSaleGoalMergeDetailsList[scope.$index].juneGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="七月" align="center" prop="julyGoal" width="220">
+                <el-table-column label="七月(元)" align="center" prop="julyGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
-                      v-model="annualSaleGoalMergeDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1" :min="0">
+                      v-model="annualSaleGoalMergeDetailsList[scope.$index].julyGoal" :precision="2" :step="0.1"
+                      :min="0">
                     </el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="八月" align="center" prop="augustGoal" width="220">
+                <el-table-column label="八月(元)" align="center" prop="augustGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -389,7 +395,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
+                <el-table-column label="九月(元)" align="center" prop="septemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -397,7 +403,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
+                <el-table-column label="十月(元)" align="center" prop="octoberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -405,7 +411,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
+                <el-table-column label="十一月(元)" align="center" prop="novemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -413,7 +419,7 @@
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
+                <el-table-column label="十二月(元)" align="center" prop="decemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number
                       @change="computeTotalDetails(scope.$index, annualSaleGoalMergeDetailsList[scope.$index])"
@@ -451,78 +457,78 @@
                     </el-popover-select-v2>
                   </template>
                 </el-table-column>
-                <el-table-column label="合计" align="center" prop="totalGoal" width="180">
+                <el-table-column label="合计(元)" align="center" prop="totalGoal" width="180">
                   <template slot-scope="scope">
                     <el-input v-model="areaDetailList[scope.$index].totalGoal" disabled></el-input>
                   </template>
                 </el-table-column>
-                <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
+                <el-table-column label="一月(元)" align="center" prop="januaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].januaryGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
+                <el-table-column label="二月(元)" align="center" prop="februaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].februaryGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="三月" align="center" prop="marchGoal" width="220">
+                <el-table-column label="三月(元)" align="center" prop="marchGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number disabled v-model="areaDetailList[scope.$index].marchGoal" :precision="2" :step="0.1"
-                      :min="0"></el-input-number>
+                    <el-input-number disabled v-model="areaDetailList[scope.$index].marchGoal" :precision="2"
+                      :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
+                <el-table-column label="四月(元)" align="center" prop="aprilGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number disabled v-model="areaDetailList[scope.$index].aprilGoal" :precision="2" :step="0.1"
-                      :min="0"></el-input-number>
+                    <el-input-number disabled v-model="areaDetailList[scope.$index].aprilGoal" :precision="2"
+                      :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="五月" align="center" prop="mayGoal" width="220">
+                <el-table-column label="五月(元)" align="center" prop="mayGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].mayGoal" :precision="2" :step="0.1"
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="六月" align="center" prop="juneGoal" width="220">
+                <el-table-column label="六月(元)" align="center" prop="juneGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].juneGoal" :precision="2" :step="0.1"
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="七月" align="center" prop="julyGoal" width="220">
+                <el-table-column label="七月(元)" align="center" prop="julyGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].julyGoal" :precision="2" :step="0.1"
                       :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="八月" align="center" prop="augustGoal" width="220">
+                <el-table-column label="八月(元)" align="center" prop="augustGoal" width="220">
                   <template slot-scope="scope">
-                    <el-input-number disabled v-model="areaDetailList[scope.$index].augustGoal" :precision="2" :step="0.1"
-                      :min="0"></el-input-number>
+                    <el-input-number disabled v-model="areaDetailList[scope.$index].augustGoal" :precision="2"
+                      :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
+                <el-table-column label="九月(元)" align="center" prop="septemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].septemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
+                <el-table-column label="十月(元)" align="center" prop="octoberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].octoberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
+                <el-table-column label="十一月(元)" align="center" prop="novemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].novemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
+                <el-table-column label="十二月(元)" align="center" prop="decemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="areaDetailList[scope.$index].decemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
@@ -536,16 +542,16 @@
                 <el-table-column label="序号" type="index" width="70" align="center" fixed />
                 <el-table-column label="销售组织" align="center" width="180">
                   <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleOrg" title="销售组织" valueKey="name"
-                      referName="CUSTOMER_PARAM" disabled :dataMapping="{saleOrg: 'name'}"
+                    <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleOrg" title="销售组织"
+                      valueKey="name" referName="CUSTOMER_PARAM" disabled :dataMapping="{saleOrg: 'name'}"
                       :source.sync="customerDetailList[scope.$index]" placeholder="请输入销售组织">
                     </el-popover-select-v2>
                   </template>
                 </el-table-column>
                 <el-table-column label="销售区域" align="center" width="180">
                   <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleZone" title="销售区域" valueKey="name"
-                      referName="CUSTOMER_PARAM" disabled :dataMapping="{saleZone: 'name'}"
+                    <el-popover-select-v2 v-model="customerDetailList[scope.$index].saleZone" title="销售区域"
+                      valueKey="name" referName="CUSTOMER_PARAM" disabled :dataMapping="{saleZone: 'name'}"
                       :source.sync="customerDetailList[scope.$index]" placeholder="请输入销售区域">
                     </el-popover-select-v2>
                   </template>
@@ -558,78 +564,78 @@
                     </el-popover-select-v2>
                   </template>
                 </el-table-column>
-                <el-table-column label="合计" align="center" prop="totalGoal" width="180">
+                <el-table-column label="合计(元)" align="center" prop="totalGoal" width="180">
                   <template slot-scope="scope">
                     <el-input v-model="customerDetailList[scope.$index].totalGoal" disabled></el-input>
                   </template>
                 </el-table-column>
-                <el-table-column label="一月" align="center" prop="januaryGoal" width="220">
+                <el-table-column label="一月(元)" align="center" prop="januaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].januaryGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="二月" align="center" prop="februaryGoal" width="220">
+                <el-table-column label="二月(元)" align="center" prop="februaryGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].februaryGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="三月" align="center" prop="marchGoal" width="220">
+                <el-table-column label="三月(元)" align="center" prop="marchGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].marchGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="四月" align="center" prop="aprilGoal" width="220">
+                <el-table-column label="四月(元)" align="center" prop="aprilGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].aprilGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="五月" align="center" prop="mayGoal" width="220">
+                <el-table-column label="五月(元)" align="center" prop="mayGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].mayGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="六月" align="center" prop="juneGoal" width="220">
+                <el-table-column label="六月(元)" align="center" prop="juneGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].juneGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="七月" align="center" prop="julyGoal" width="220">
+                <el-table-column label="七月(元)" align="center" prop="julyGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].julyGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="八月" align="center" prop="augustGoal" width="220">
+                <el-table-column label="八月(元)" align="center" prop="augustGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].augustGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="九月" align="center" prop="septemberGoal" width="220">
+                <el-table-column label="九月(元)" align="center" prop="septemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].septemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十月" align="center" prop="octoberGoal" width="220">
+                <el-table-column label="十月(元)" align="center" prop="octoberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].octoberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十一月" align="center" prop="novemberGoal" width="220">
+                <el-table-column label="十一月(元)" align="center" prop="novemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].novemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="十二月" align="center" prop="decemberGoal" width="220">
+                <el-table-column label="十二月(元)" align="center" prop="decemberGoal" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled v-model="customerDetailList[scope.$index].decemberGoal" :precision="2"
                       :step="0.1" :min="0"></el-input-number>
@@ -923,6 +929,9 @@
           this.annualSaleGoalMergeList = response.rows;
           this.total = response.total;
           this.loading = false;
+          this.annualSaleGoalMergeList.forEach(item => {
+            item.goalTotal = item.goalTotal.toFixed(2);
+          })
         });
       },
       getListDetails() {
@@ -1084,7 +1093,7 @@
         });
       },
       //双击行
-      useDoubleClick(row){
+      useDoubleClick(row) {
         this.openStatus = 'see';
         this.reset();
         const id = row.id || this.ids
@@ -1117,7 +1126,7 @@
           this.form.code = null
           this.title = "添加--年度销售目标合并明细";
           this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1)
-          .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
+            .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
           this.form.annual = new Date().getFullYear().toString()
           this.form.goalTotal = 0
           this.form.goalTotal = this.form.goalTotal.toFixed(2)
@@ -1454,7 +1463,9 @@
             console.log(key);
             if (map.has(key)) {
               const existingObj = map.get(key)
-              existingObj.totalGoal += obj.totalGoal
+              existingObj.totalGoal = parseFloat(existingObj.totalGoal)
+              existingObj.totalGoal += parseFloat(obj.totalGoal)
+              existingObj.totalGoal = existingObj.totalGoal.toFixed(2)
               existingObj.januaryGoal += obj.januaryGoal
               existingObj.februaryGoal += obj.februaryGoal
               existingObj.marchGoal += obj.marchGoal

+ 34 - 30
src/views/business/spd/target/MonthGoalMerge.vue

@@ -128,39 +128,41 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
-      <el-table-column label="编码" align="center" prop="code" />
-      <el-table-column label="目标名称" align="center" prop="goalName" />
+    <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
+      <el-table-column label="编码" align="center" prop="code" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" />
-      <el-table-column label="月份" align="center" prop="monthly" />
-      <el-table-column label="客户" align="center" prop="custom" />
-      <el-table-column label="制单人" align="center" prop="creator" />
-      <el-table-column label="部门" align="center" prop="dept" />
-      <el-table-column label="目标类型" align="center" prop="goalCategory" />
-      <el-table-column label="目标值合计" align="center" prop="goalSum" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
+      <el-table-column label="月份" align="center" prop="monthly" width="180" />
+      <el-table-column label="客户" align="center" prop="custom" width="180" />
+      <el-table-column label="制单人" align="center" prop="creator" width="180" />
+      <el-table-column label="部门" align="center" prop="dept" width="180" />
+      <el-table-column label="目标类型" align="center" prop="goalCategory" width="180" />
+      <el-table-column label="目标值合计(元)" align="center" prop="goalSum" width="180" />
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="180" class-name="small-padding" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -230,7 +232,7 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="6">
-            <el-form-item label="目标值合计" prop="goalSum">
+            <el-form-item label="目标值合计(元)" prop="goalSum">
               <el-input v-model="form.goalSum" placeholder="目标值合计自动计算" disabled />
             </el-form-item>
           </el-col>
@@ -270,7 +272,8 @@
         <div>
           <el-row :gutter="10" class="mb8" style="margin-left: 94%">
             <el-col :span="1.5">
-              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并</el-button>
+              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并
+              </el-button>
             </el-col>
           </el-row>
           <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
@@ -362,7 +365,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalValue" width="220">
+                <el-table-column label="目标值(元)" align="center" prop="goalValue" width="220">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="monthGoalMergeDetailsList[scope.$index].goalValue"
                       :precision="2" :step="1" :min="0"></el-input-number>
@@ -396,7 +399,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalValue" width="220">
+                <el-table-column label="目标值(元)" align="center" prop="goalValue" width="220">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="zoneGoalSumList[scope.$index].goalValue"
                       :precision="2" :step="1" :min="0" disabled></el-input-number>
@@ -417,8 +420,9 @@
                 </el-table-column>
                 <el-table-column label="销售区域" align="center" prop="saleZone" width="180">
                   <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="customGoalSumList[scope.$index].saleZone" title="销售区域" valueKey="name"
-                      referName="ORG_PARAM" disabled :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
+                    <el-popover-select-v2 v-model="customGoalSumList[scope.$index].saleZone" title="销售区域"
+                      valueKey="name" referName="ORG_PARAM" disabled
+                      :dataMapping="{ saleZoneCode: 'code', saleZone: 'name'}"
                       :source.sync="customGoalSumList[scope.$index]" placeholder="请输入销售区域">
                     </el-popover-select-v2>
                   </template>
@@ -438,7 +442,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalValue" width="220">
+                <el-table-column label="目标值(元)" align="center" prop="goalValue" width="220">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="customGoalSumList[scope.$index].goalValue"
                       :precision="2" :step="1" :min="0" disabled></el-input-number>

+ 30 - 25
src/views/business/spd/target/MonthReturnGoal.vue

@@ -103,39 +103,41 @@
         </el-dropdown>
       </el-col>
     </el-row>
-    <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
-      <el-table-column label="编码" align="center" prop="code" />
-      <el-table-column label="目标名称" align="center" prop="goalName" />
+    <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
+      <el-table-column label="编码" align="center" prop="code" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" />
-      <el-table-column label="客户" align="center" prop="custom" />
-      <el-table-column label="制单人" align="center" prop="creator" />
-      <el-table-column label="销售区域" align="center" prop="saleZone" />
-      <el-table-column label="部门" align="center" prop="dept" />
-      <el-table-column label="目标合计" align="center" prop="goalSum" />
-      <el-table-column label="备注" align="center" prop="notes" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
+      <el-table-column label="客户" align="center" prop="custom" width="180" />
+      <el-table-column label="制单人" align="center" prop="creator" width="180" />
+      <el-table-column label="销售区域" align="center" prop="saleZone" width="180" />
+      <el-table-column label="部门" align="center" prop="dept" width="180" />
+      <el-table-column label="目标合计(元)" align="center" prop="goalSum" width="180" />
+      <el-table-column label="备注" align="center" prop="notes" width="180" />
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -202,7 +204,7 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="6">
-            <el-form-item label="目标合计" prop="goalSum">
+            <el-form-item label="目标合计(元)" prop="goalSum">
               <el-input v-model="form.goalSum" placeholder="目标合计自动计算" disabled />
             </el-form-item>
           </el-col>
@@ -291,7 +293,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalSum" width="220" :render-header="addRedStar">
+                <el-table-column label="目标值(元)" align="center" prop="goalSum" width="220" :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="monthReturnGoalDetailsList[scope.$index].goalSum"
                       :precision="2" :step="1" :min="0"></el-input-number>
@@ -614,6 +616,9 @@
           this.monthReturnGoalList = response.rows;
           this.total = response.total;
           this.loading = false;
+          this.monthReturnGoalList.forEach(item => {
+            item.goalSum = item.goalSum.toFixed(2);
+          })
         });
       },
       getListDetails() {
@@ -760,7 +765,7 @@
           this.form.code = null
           this.form.goalSum = this.form.goalSum.toFixed(2)
           this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1)
-          .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
+            .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
           this.form.annual = new Date().getFullYear().toString()
           this.monthReturnGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthReturnGoalDetailsList))
           for (const element of this.monthReturnGoalDetailsList) {

+ 27 - 21
src/views/business/spd/target/MonthReturnMerge.vue

@@ -108,40 +108,42 @@
         </el-dropdown>
       </el-col>
     </el-row>
-    <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
+    <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
       <el-table-column label="编码" align="center" prop="code" width="180" />
-      <el-table-column label="目标名称" align="center" prop="goalName" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" width="180" />
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
       <el-table-column label="月份" align="center" prop="monthly" width="180" />
       <el-table-column label="客户" align="center" prop="custom" width="180" />
       <el-table-column label="销售区域" align="center" prop="saleZone" width="180" />
       <el-table-column label="制单人" align="center" prop="creator" width="180" />
       <el-table-column label="部门" align="center" prop="dept" width="180" />
       <el-table-column label="目标类型" align="center" prop="goalCategory" width="180" />
-      <el-table-column label="目标值合计" align="center" prop="goalSum" width="180" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column label="目标值合计(元)" align="center" prop="goalSum" width="180" />
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -221,7 +223,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="目标值合计" prop="goalSum">
+            <el-form-item label="目标值合计(元)" prop="goalSum">
               <el-input v-model="form.goalSum" placeholder="目标值合计自动计算" disabled />
             </el-form-item>
           </el-col>
@@ -239,7 +241,8 @@
         <div>
           <el-row :gutter="10" class="mb8" style="margin-left: 94%">
             <el-col :span="1.5">
-              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并</el-button>
+              <el-button type="primary" plain icon="el-icon-folder-opened" size="mini" @click="clickMerge">合 并
+              </el-button>
             </el-col>
           </el-row>
           <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
@@ -298,7 +301,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalSum" width="220">
+                <el-table-column label="目标值(元)" align="center" prop="goalSum" width="220">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="monthReturnMergeDetailsList[scope.$index].goalSum"
                       :precision="2" :step="1" :min="0"></el-input-number>
@@ -349,7 +352,7 @@
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="目标值" align="center" prop="goalSum" width="220">
+                <el-table-column label="目标值(元)" align="center" prop="goalSum" width="220">
                   <template slot-scope="scope">
                     <el-input-number disabled @change="computeTotal" v-model="zoneGoalSumList[scope.$index].goalSum"
                       :precision="2" :step="1" :min="0"></el-input-number>
@@ -607,6 +610,9 @@
           this.monthReturnMergeList = response.rows;
           this.total = response.total;
           this.loading = false;
+          this.monthReturnMergeList.forEach(item => {
+            item.goalSum = item.goalSum.toFixed(2);
+          })
         });
       },
       getListDetails() {
@@ -763,7 +769,7 @@
           this.form.goalSum = this.form.goalSum.toFixed(2)
           this.title = "添加--月销售目标合并";
           this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1)
-          .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
+            .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
           this.form.annual = new Date().getFullYear().toString()
           this.form.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString()
             .padStart(2, '0')

+ 34 - 28
src/views/business/spd/target/MonthSaleGoal.vue

@@ -105,39 +105,41 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange" @row-dblclick="useDoubleClick"
-      v-horizontal-scroll>
-      <el-table-column label="编码" align="center" prop="code" />
-      <el-table-column label="目标名称" align="center" prop="goalName" />
+    <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange"
+      @row-dblclick="useDoubleClick" v-horizontal-scroll>
+      <el-table-column label="编码" align="center" prop="code" width="180" />
+      <el-table-column label="目标名称" align="center" prop="goalName" width="240" />
       <el-table-column label="单据日期" align="center" prop="documentDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.documentDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="年度" align="center" prop="annual" />
-      <el-table-column label="客户" align="center" prop="custom" />
-      <el-table-column label="销售区域" align="center" prop="saleZone" />
-      <el-table-column label="制单人" align="center" prop="creator" />
-      <el-table-column label="部门" align="center" prop="dept" />
-      <el-table-column label="目标合计" align="center" prop="goalSum" />
-      <el-table-column label="备注" align="center" prop="notes" />
-      <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
+      <el-table-column label="年度" align="center" prop="annual" width="100" />
+      <el-table-column label="客户" align="center" prop="custom" width="180" />
+      <el-table-column label="销售区域" align="center" prop="saleZone" width="180" />
+      <el-table-column label="制单人" align="center" prop="creator" width="180" />
+      <el-table-column label="部门" align="center" prop="dept" width="180" />
+      <el-table-column label="目标合计(元)" align="center" prop="goalSum" width="180" />
+      <el-table-column label="备注" align="center" prop="notes" width="180" />
+      <el-table-column show-overflow-tooltip label="状态" align="center" width="100" prop="status">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding" width="180" fixed="right">
         <template slot-scope="scope">
-          <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-            <el-button size="mini" type="text" @click="handleUpdate(scope.row)">修改
-            </el-button>
-            <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除
-            </el-button>
-            <el-button size="mini" type="text" @click="handleSubmit(scope.row)">提交</el-button>
-          </div>
-          <div v-if="scope.row.status == '1'">
-            <el-button size="mini" type="text" @click="handleReback(scope.row)">收回</el-button>
-          </div>
+          <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+            @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -205,7 +207,7 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="6">
-            <el-form-item label="目标合计" prop="goalSum">
+            <el-form-item label="目标合计(元)" prop="goalSum">
               <el-input v-model="form.goalSum" placeholder="目标合计自动计算" disabled />
             </el-form-item>
           </el-col>
@@ -274,8 +276,8 @@
                 </el-table-column>
                 <el-table-column label="部门" align="center" width="180" :render-header="addRedStar">
                   <template slot-scope="scope">
-                    <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].dept" title="部门" valueKey="name"
-                      referName="DEPT_PARAM" :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                    <el-popover-select-v2 v-model="monthSaleGoalDetailsList[scope.$index].dept" title="部门"
+                      valueKey="name" referName="DEPT_PARAM" :dataMapping="{ deptCode: 'code', dept: 'name'}"
                       :source.sync="monthSaleGoalDetailsList[scope.$index]" placeholder="请输入部门">
                     </el-popover-select-v2>
                   </template>
@@ -312,7 +314,8 @@
                 </el-table-column>
                 <el-table-column label="科室" align="center" width="180">
                   <template slot-scope="scope">
-                    <el-input v-model="monthSaleGoalDetailsList[scope.$index].department" placeholder="请输入科室"></el-input>
+                    <el-input v-model="monthSaleGoalDetailsList[scope.$index].department" placeholder="请输入科室">
+                    </el-input>
                   </template>
                 </el-table-column>
                 <el-table-column label="数量" align="center" prop="num" width="220">
@@ -661,6 +664,9 @@
           this.monthSaleGoalList = response.rows;
           this.total = response.total;
           this.loading = false;
+          this.monthSaleGoalList.forEach(item => {
+            item.goalSum = item.goalSum.toFixed(2);
+          })
         });
       },
       getListDetails() {
@@ -815,7 +821,7 @@
           this.form.code = null
           this.form.goalSum = this.form.goalSum.toFixed(2)
           this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1)
-          .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
+            .toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
           this.form.annual = new Date().getFullYear().toString()
           this.monthSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthDetailsList))
           for (const element of this.monthSaleGoalDetailsList) {

+ 239 - 265
src/views/business/spd/target/targetMk/index.vue

@@ -6,61 +6,35 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="单据状态" prop="status">
-                <el-select
-                  size="mini"
-                  v-model="queryParams.status"
-                  clearable
-                >
-                  <el-option
-                    v-for="dict in dict.type.sys_status"
-                    :key="dict.value"
-                    :label="dict.label"
-                    :value="dict.value"
-                  ></el-option>
+                <el-select size="mini" v-model="queryParams.status" clearable>
+                  <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label"
+                    :value="dict.value"></el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="单据编号">
-                <el-input
-                  v-model="queryParams.code"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
+                <el-input v-model="queryParams.code" size="mini" clearable style="width: 200px" />
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="目标名称">
-                <el-input
-                  v-model="queryParams.name"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
+                <el-input v-model="queryParams.name" size="mini" clearable style="width: 200px" />
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="单据日期">
-                <el-date-picker
-                  size="mini"
-                  v-model="dateRange"
-                  style="width: 240px"
-                  value-format="yyyy-MM-dd"
-                  type="daterange"
-                  range-separator="-"
-                  start-placeholder="开始"
-                  end-placeholder="结束"
-                ></el-date-picker>
+                <el-date-picker size="mini" v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd"
+                  type="daterange" range-separator="-" start-placeholder="开始" end-placeholder="结束"></el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="模板" prop="template">
-                <dr-popover-select size="mini" v-model="queryParams.templateName" title="模板" type="MK_TARGET_TEMPLATE_PARAM" :dataMapping="{
+                <dr-popover-select size="mini" v-model="queryParams.templateName" title="模板"
+                  type="MK_TARGET_TEMPLATE_PARAM" :dataMapping="{
                     template: 'id',
                     templateName: 'name',
-                  }" :source.sync="queryParams"
-                >
+                  }" :source.sync="queryParams">
                 </dr-popover-select>
               </el-form-item>
             </el-col>
@@ -93,59 +67,48 @@
           </el-row>
           <CollapseTransition>
             <div v-show="expanded">
-              
+
             </div>
           </CollapseTransition>
         </el-form>
-        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
-      
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'"
+            @click="drop"></i></el-divider>
+
         <div class="btn_grooup">
           <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
           <!-- <TemplateDownload/>
           <el-button type="primary" size="mini" @click="useUpload">导入</el-button> -->
         </div>
 
-        <el-table 
-          v-loading="loading"
-          :data="tableList"
-          @selection-change="useSelectionRow"
-          @row-dblclick="useDoubleClick"
-          height="600px"
-          v-horizontal-scroll
-        >
-          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
-          <el-table-column show-overflow-tooltip label="单据编号" align="center" width="200" prop="code"/>
-          <el-table-column show-overflow-tooltip label="单据日期" align="center" width="200" prop="date"/>
-          <el-table-column show-overflow-tooltip label="目标名称" align="center" width="200" prop="name"/>
+        <el-table v-loading="loading" :data="tableList" @selection-change="useSelectionRow"
+          @row-dblclick="useDoubleClick" height="600px" v-horizontal-scroll>
+          <el-table-column label="序号" type="index" width="50" align="center" fixed />
+          <el-table-column show-overflow-tooltip label="单据编号" align="center" width="200" prop="code" />
+          <el-table-column show-overflow-tooltip label="单据日期" align="center" width="200" prop="date" />
+          <el-table-column show-overflow-tooltip label="目标名称" align="center" width="200" prop="name" />
           <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
             <template slot-scope="scope">
-              <dict-tag
-                :options="dict.type.sys_status"
-                :value="scope.row.status"
-              />
+              <dict-tag :options="dict.type.sys_status" :value="scope.row.status" />
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="templateData.year"/>
-          <el-table-column show-overflow-tooltip label="模板" align="center" width="200" prop="templateData.name"/>
-          <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="templateData.startTime" />
-          <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200" prop="templateData.deadlineTime" />
+          <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="templateData.year" />
+          <el-table-column show-overflow-tooltip label="模板" align="center" width="200" prop="templateData.name" />
+          <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200"
+            prop="templateData.startTime" />
+          <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200"
+            prop="templateData.deadlineTime" />
           <el-table-column show-overflow-tooltip label="周期" align="center" width="200" prop="templateData.cycle">
             <template slot-scope="scope">
-              <dict-tag
-                :options="dict.type.mk_periodic_unit"
-                :value="scope.row.templateData.cycle"
-              />
+              <dict-tag :options="dict.type.mk_periodic_unit" :value="scope.row.templateData.cycle" />
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="维度" align="center" min-width="200" prop="templateData.dimensionalitys">
+          <el-table-column show-overflow-tooltip label="维度" align="center" min-width="200"
+            prop="templateData.dimensionalitys">
             <template slot-scope="scope">
               <div style="display:flex;">
                 <span v-for="o in scope.row.templateData.dimensionalitys">
-                  <dict-tag
-                    :options="dict.type.mk_dimensionality"
-                    :value="o.dimensionality"
-                    />
-                  </span>
+                  <dict-tag :options="dict.type.mk_dimensionality" :value="o.dimensionality" />
+                </span>
               </div>
             </template>
           </el-table-column>
@@ -153,10 +116,7 @@
             <template slot-scope="scope">
               <div style="display:flex;">
                 <span v-for="o in scope.row.templateData.indexs">
-                  <dict-tag
-                    :options="dict.type.mk_index_type"
-                    :value="o.target"
-                  />
+                  <dict-tag :options="dict.type.mk_index_type" :value="o.target" />
                 </span>
               </div>
             </template>
@@ -167,221 +127,235 @@
           <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
           <el-table-column fixed="right" label="操作" align="center" width="150">
             <template slot-scope="scope">
-              <div v-if="scope.row.status == '0' || scope.row.status == '3'">
-                <el-button type="text" size="mini" @click="useSubmit(scope.row)">提交</el-button>
-                <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
-                <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
-              </div>
-              <div v-if="scope.row.status == '1'">
-                <el-button type="text" size="mini" @click="useRevocation(scope.row)">收回</el-button>
-              </div>
+              <el-button size="mini" type="text" @click="useDoubleClick(scope.row)">查看
+              </el-button>
+              <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+                @click="useSubmit(scope.row)">提交</el-button>
+              <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+                @click="useEdit(scope.row)">编辑</el-button>
+              <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+                @click="useDel(scope.row)">删除</el-button>
+              <el-button v-if="scope.row.status == '1'" type="text" size="mini" @click="useRevocation(scope.row)">收回
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
 
-        <el-pagination
-          background
-          @size-change="useChangePageSize"
-          @current-change="useCurrentChange"
-          :current-page="queryParams.pageNum"
-          :page-sizes="[10, 20, 50, 100]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total=total>
+        <el-pagination background @size-change="useChangePageSize" @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]" :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper" :total=total>
         </el-pagination>
       </el-card>
     </div>
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="useSearch"/>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="useSearch" />
   </div>
 </template>
 
 <script>
-import Add from './add.vue'
-import TemplateDownload from './templateDownload.vue'
-import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import { listTarget,delTarget,submitTarget } from "@/api/business/spd/starget/target";
-import { rebacktWork } from '@/api/purchase/workSpace.js'
-export default {
-  name: 'target',
-  dicts: [
-    "sys_status","mk_periodic_unit","mk_dimensionality","mk_index_type",'oa_templete_id'
-  ],
-  components: { Add,TemplateDownload,CollapseTransition},
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      expanded: false,
-      // 页面配置
-      isList: true,
-      // 页面状态
-      page: '',
-      // 搜索框参数
-      queryParams: {
-        status: '',
-        code: '',
-        name: '',
-        template:'',
-        templateName:'',
-        year:'',
-        pageNum: 1,
-        pageSize: 10
-      },
-      // 查询日期范围
-      dateRange: [],
-      //总条数
-      total: 0,
-      //列表数据
-      tableList:[],
-      disable: false,
-      rowDetail:{},
-      openTemplateDownload:false,
-    }
-  },
-  created() {
-    this.getList(this.queryParams)
-  },
-  methods: {
-    //新增
-    useAdd(){
-      this.isList = false
-      this.page = 'add'
-      this.disable = false
+  import Add from './add.vue'
+  import TemplateDownload from './templateDownload.vue'
+  import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+  import {
+    listTarget,
+    delTarget,
+    submitTarget
+  } from "@/api/business/spd/starget/target";
+  import {
+    rebacktWork
+  } from '@/api/purchase/workSpace.js'
+  export default {
+    name: 'target',
+    dicts: [
+      "sys_status", "mk_periodic_unit", "mk_dimensionality", "mk_index_type", 'oa_templete_id'
+    ],
+    components: {
+      Add,
+      TemplateDownload,
+      CollapseTransition
     },
-    //提交
-    async useSubmit(row){
-      this.$modal.loading("提交中...");
-      try {
-        const {msg, code} = await submitTarget(row.id);
-        if (code === 200) {
-          this.$modal.notifySuccess("提交成功");
-          this.$modal.closeLoading();
-          row.status = '1'
-          // this.getList(this.queryParams)
-        }
-      }catch (err) {
-        console.error(err);
-        this.$modal.closeLoading();
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        expanded: false,
+        // 页面配置
+        isList: true,
+        // 页面状态
+        page: '',
+        // 搜索框参数
+        queryParams: {
+          status: '',
+          code: '',
+          name: '',
+          template: '',
+          templateName: '',
+          year: '',
+          pageNum: 1,
+          pageSize: 10
+        },
+        // 查询日期范围
+        dateRange: [],
+        //总条数
+        total: 0,
+        //列表数据
+        tableList: [],
+        disable: false,
+        rowDetail: {},
+        openTemplateDownload: false,
       }
     },
-    //撤回
-    useRevocation(row){
-      this.$modal.loading("收回中...");
-      let params = {
-        billCode: row.code, 
-        fdId: row.flowId, 
-        fdTemplateId: this.dict.type.oa_templete_id.find(item => {
-          return item.label == "营销目标"
-        }).value,
-        billMaker: row.createBy 
-      }
-      rebacktWork(params).then(res => {
-        if (res.code === 200) {
-          this.$modal.notifySuccess("收回成功");
+    created() {
+      this.getList(this.queryParams)
+    },
+    methods: {
+      //新增
+      useAdd() {
+        this.isList = false
+        this.page = 'add'
+        this.disable = false
+      },
+      //提交
+      async useSubmit(row) {
+        this.$modal.loading("提交中...");
+        try {
+          const {
+            msg,
+            code
+          } = await submitTarget(row.id);
+          if (code === 200) {
+            this.$modal.notifySuccess("提交成功");
+            this.$modal.closeLoading();
+            row.status = '1'
+            // this.getList(this.queryParams)
+          }
+        } catch (err) {
+          console.error(err);
           this.$modal.closeLoading();
-          row.status = '0'
-          // this.getList(this.queryParams)
         }
-      }).catch(err => {
-        this.$modal.closeLoading();
-      })
-    },
-    //修改
-    useEdit(row){
-      this.isList = false
-      this.page = 'edit'
-      this.rowDetail = row
-      this.disable = false
-    },
-    //删除
-    useDel(row){
-      this.$modal.confirm('确认删除选择数据').then(() => {
-        delTarget(row.id).then(res => {
+      },
+      //撤回
+      useRevocation(row) {
+        this.$modal.loading("收回中...");
+        let params = {
+          billCode: row.code,
+          fdId: row.flowId,
+          fdTemplateId: this.dict.type.oa_templete_id.find(item => {
+            return item.label == "营销目标"
+          }).value,
+          billMaker: row.createBy
+        }
+        rebacktWork(params).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
-            this.getList(this.queryParams)
+            this.$modal.notifySuccess("收回成功");
+            this.$modal.closeLoading();
+            row.status = '0'
+            // this.getList(this.queryParams)
           }
+        }).catch(err => {
+          this.$modal.closeLoading();
         })
-      }).catch(() => {})
-    },
-    //查看
-    useSee(){
+      },
+      //修改
+      useEdit(row) {
+        this.isList = false
+        this.page = 'edit'
+        this.rowDetail = row
+        this.disable = false
+      },
+      //删除
+      useDel(row) {
+        this.$modal.confirm('确认删除选择数据').then(() => {
+          delTarget(row.id).then(res => {
+            if (res.code === 200) {
+              this.$modal.msgSuccess("删除成功");
+              this.getList(this.queryParams)
+            }
+          })
+        }).catch(() => {})
+      },
+      //查看
+      useSee() {
 
-    },
-    //选择列
-    useSelectionRow(){
+      },
+      //选择列
+      useSelectionRow() {
 
-    },
-    //双击
-    useDoubleClick(row){
-      this.isList = false
-      this.page = 'see'
-      this.rowDetail = row
-      this.disable = false
-    },
-    //改变一页显示条数
-    useChangePageSize(val){
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
-    },
-    //翻页
-    useCurrentChange(val){
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
-    },
-    //搜索
-    useSearch() {
-      this.getList(this.queryParams)
-    },
-    //重置
-    useReset(){
-      this.dateRange = [];
-      this.queryParams = {
-        code: '',
-        name: '',
-        template:'',
-        templateName:'',
-        year:'',
-        pageNum: 1,
-        pageSize: 10
-      }
-      this.getList(this.queryParams)
-    },
-    //查询列表
-    getList(params){
-      this.loading = true;
-      listTarget(this.addDateRange(params, this.dateRange)).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows;
-          this.total = res.total;
-          this.loading = false;
+      },
+      //双击
+      useDoubleClick(row) {
+        this.isList = false
+        this.page = 'see'
+        this.rowDetail = row
+        this.disable = false
+      },
+      //改变一页显示条数
+      useChangePageSize(val) {
+        this.queryParams.pageSize = val
+        this.getList(this.queryParams)
+      },
+      //翻页
+      useCurrentChange(val) {
+        this.queryParams.pageNum = val
+        this.getList(this.queryParams)
+      },
+      //搜索
+      useSearch() {
+        this.getList(this.queryParams)
+      },
+      //重置
+      useReset() {
+        this.dateRange = [];
+        this.queryParams = {
+          code: '',
+          name: '',
+          template: '',
+          templateName: '',
+          year: '',
+          pageNum: 1,
+          pageSize: 10
         }
-      })
-    },
-    drop() {
-      this.expanded = !this.expanded
-    },
-  }
-};
+        this.getList(this.queryParams)
+      },
+      //查询列表
+      getList(params) {
+        this.loading = true;
+        listTarget(this.addDateRange(params, this.dateRange)).then(res => {
+          if (res.code === 200) {
+            this.tableList = res.rows;
+            this.total = res.total;
+            this.loading = false;
+          }
+        })
+      },
+      drop() {
+        this.expanded = !this.expanded
+      },
+    }
+  };
+
 </script>
 
 <style lang="scss" scoped>
-#deliveryAddressList {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-  overflow-y: scroll;
-}
-.btn_grooup {
-  margin-bottom: 10px;
-  display: flex;
-  justify-content: flex-end;
-}
-.lines {
-  margin-top: 0;
-}
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
+  #deliveryAddressList {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+    overflow-y: scroll;
+  }
+
+  .btn_grooup {
+    margin-bottom: 10px;
+    display: flex;
+    justify-content: flex-end;
+  }
+
+  .lines {
+    margin-top: 0;
+  }
+
+  .el-pagination {
+    margin-top: 10px;
+    text-align: right;
+  }
+
 </style>

+ 1 - 0
src/views/business/spd/target/targetTemplate/index.vue

@@ -88,6 +88,7 @@
           <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
           <el-table-column fixed="right" label="操作" align="center" width="150">
             <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="useDoubleClick(scope.row)">查看</el-button>
               <el-button type="text" size="mini" @click="useEdit(scope.row)">编辑</el-button>
               <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
             </template>