Преглед изворни кода

lizhuo merges Goal Management into dev at 2023-7-31 9:00

002637 пре 1 година
родитељ
комит
cb05e49d4b

+ 48 - 5
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -102,15 +102,37 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:annualSaleGoal:export']"
-        >导出
+          :disabled="multiple"
+          v-hasPermi="['goal_management:annualSaleGoal:submit']"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -787,6 +809,11 @@ export default {
         ...this.queryParams
       }, `annualSaleGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/annualSaleGoalDetails/export', {
+        ...this.queryParams
+      }, `annualSaleGoalMerge_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -893,6 +920,22 @@ export default {
         }
       }
       return true
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 };

+ 41 - 15
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -98,26 +98,36 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="danger"
+          type="primary"
           plain
-          icon="el-icon-delete"
+          icon="el-icon-grape"
           size="mini"
           :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['goal_management:annualSaleGoalMerge:remove']"
-        >删除
+          v-hasPermi="['goal_management:annualSaleGoal:submit']"
+        >提交
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:annualSaleGoalMerge:export']"
-        >导出
-        </el-button>
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -764,7 +774,7 @@ export default {
         oneLevelClassify: null,
         twoLevelClassifyCode: null,
         twoLevelClassify: null,
-        totalGoal: null,
+        goalSum: null,
         januaryGoal: null,
         februaryGoal: null,
         marchGoal: null,
@@ -1275,6 +1285,22 @@ export default {
         this.queryParams.endTime = null
       }
     },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        // this.handleExportDetails()
+      }
+    }
   }
 };
 </script>

+ 48 - 5
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -126,15 +126,37 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:monthGoalMerge:export']"
-        >导出
+          :disabled="multiple"
+          v-hasPermi="['goal_management:annualSaleGoal:submit']"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -799,6 +821,11 @@ export default {
         ...this.queryParams
       }, `monthGoalMerge${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/monthGoalMergeDetails/export', {
+        ...this.queryParams
+      }, `monthSaleMergeDetails_${new Date().getTime()}.xlsx`)
+    },
     // 树形参照
     chooseTreeReferForQuery(type, isPage, title) {
       this.referCondition.type = type
@@ -1061,6 +1088,22 @@ export default {
         this.queryParams.beginTime = null
         this.queryParams.endTime = null
       }
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 };

+ 50 - 6
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -100,15 +100,37 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['mk:monthReturnGoal:export']"
-        >导出
+          :disabled="multiple"
+          v-hasPermi="['goal_management:annualSaleGoal:submit']"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
@@ -433,6 +455,7 @@ export default {
         saleOrg: null,
         saleZone: null,
         custom: null,
+        dept: null,
         creator: null,
         monthly: null,
         goalSum: null
@@ -640,10 +663,15 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('goal_management/monthReturnGoal/export', {
+      this.download('mk/monthReturnGoal/export', {
         ...this.queryParams
       }, `monthReturnGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('mk/monthReturnGoalDetails/export', {
+        ...this.queryParams
+      }, `monthReturnGoalDetails_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -703,6 +731,22 @@ export default {
         }
       }
       return true
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }

+ 63 - 20
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -1,9 +1,6 @@
 <template>
 <div class="app-container">
   <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-    <el-form-item label="编码" prop="code">
-      <el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"/>
-    </el-form-item>
     <el-form-item label="目标名称" prop="goalName">
       <el-input v-model="queryParams.goalName" placeholder="请输入目标名称" clearable @keyup.enter.native="handleQuery"/>
     </el-form-item>
@@ -22,10 +19,6 @@
         :picker-options="pickerOptions">
       </el-date-picker>
     </el-form-item>
-    <el-form-item>
-      <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-      <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-    </el-form-item>
     <el-form-item label="年度" prop="annual">
       <el-date-picker
         v-model="queryParams.annual"
@@ -36,6 +29,10 @@
         placeholder="请输入年度">
       </el-date-picker>
     </el-form-item>
+    <el-form-item>
+      <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+      <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+    </el-form-item>
     <el-form-item label="月份" prop="monthly">
       <el-date-picker
         v-model="queryParams.monthly"
@@ -101,15 +98,37 @@
     </el-col>
     <el-col :span="1.5">
       <el-button
-        type="warning"
+        type="primary"
         plain
-        icon="el-icon-download"
+        icon="el-icon-grape"
         size="mini"
-        @click="handleExport"
-        v-hasPermi="['mk:monthReturnMerge:export']"
-      >导出
+        :disabled="multiple"
+        v-hasPermi="['goal_management:annualSaleGoal:submit']"
+      >提交
       </el-button>
     </el-col>
+    <el-col :span="1.5">
+      <el-dropdown @command="handleCommand">
+        <el-button type="primary" size="mini" plain icon="el-icon-upload">
+          导入<i class="el-icon-arrow-down el-icon--right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+          <el-dropdown-item command="import">导入</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-col>
+    <el-col :span="1.5">
+      <el-dropdown @command="handleCommand">
+        <el-button type="warning" plain icon="el-icon-download" size="mini">
+          导出<i class="el-icon-arrow-down el-icon--right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="export">导出</el-dropdown-item>
+          <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </el-col>
     <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
   </el-row>
   <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange">
@@ -130,7 +149,7 @@
     <el-table-column label="目标类型" align="center" prop="goalCategory" width="180"/>
     <el-table-column label="目标值合计" align="center" prop="goalSum" width="180"/>
     <el-table-column label="单据状态" align="center" prop="documentStatus" 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 fixed-width" width="120" fixed="right">
       <template slot-scope="scope">
         <el-button
           size="mini"
@@ -359,6 +378,7 @@
           <el-table-column label="序号" type="index" width="55" align="center" fixed />
           <el-table-column label="销售组织" align="center" prop="saleOrg" 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="creator" width="180" />
           <el-table-column label="月份" align="center" prop="monthly" width="180" />
           <el-table-column label="目标值" align="center" prop="goalSum" width="180" />
@@ -386,6 +406,7 @@ import {
 // 参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import ElPopoverSelectV2 from "@/components/popover-select-v2"
+import log from "../../../monitor/job/log";
 
 export default {
   name: "MonthReturnMerge",
@@ -673,7 +694,12 @@ export default {
     handleExport() {
       this.download('mk/monthReturnMerge/export', {
         ...this.queryParams
-      }, `monthReturnMerge${new Date().getTime()}.xlsx`)
+      }, `monthReturnMerge_${new Date().getTime()}.xlsx`)
+    },
+    handleExportDetails() {
+      this.download('mk/monthReturnMergeDetails/export', {
+        ...this.queryParams
+      }, `monthReturnMergeDetails_${new Date().getTime()}.xlsx`)
     },
     // 关闭抽屉
     handleClose(done) {
@@ -697,8 +723,8 @@ export default {
       let query = { classify: classify, classifyValue: classifyValue }
       mergeMonthReturnMergeDetails(query).then(response => {
         console.log(response)
-        /*this.monthReturnMergeDetailsList = response.data
-        this.computeTotal()*/
+        this.monthReturnMergeDetailsList = response.data.monthReturnMergeDetails
+        this.computeTotal()
       })
     },
     // 计算主表合计
@@ -738,14 +764,15 @@ export default {
       }
     },
     getNewTwoArray() {
-      let arr = JSON.parse(JSON.parse(this.monthReturnMergeDetailsList))
+      let arr = JSON.parse(JSON.stringify(this.monthReturnMergeDetailsList))
+      console.log(arr);
       if (this.activeName === 'monthReturnMergeDetails') {
-        this.zoneGoalSumList = null
+        return this.zoneGoalSumList = []
       }
-      // 根据销售组织,销售区域,制单人,月份进行合并,并相加goalSum
+      // 根据**进行合并,并相加goalSum
       const mergeAndSumTotalGoal = (array) => {
         return Array.from(array.reduce((map, obj) => {
-          const key = `${obj.saleOrg}-${obj.saleZone}-${obj.creator}-${obj.monthly}`
+          const key = `${obj.saleOrg}-${obj.saleZone}-${obj.custom}-${obj.dept}-${obj.creator}-${obj.monthly}`
           if (map.has(key)) {
             const existingObj = map.get(key)
             existingObj.goalSum += obj.goalSum
@@ -756,6 +783,22 @@ export default {
         }, new Map()).values())
       }
       this.zoneGoalSumList = mergeAndSumTotalGoal(arr)
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }

+ 48 - 5
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -101,15 +101,37 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
+          icon="el-icon-grape"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['goal_management:monthSaleGoal:export']"
-        >导出
+          :disabled="multiple"
+          v-hasPermi="['goal_management:annualSaleGoal:submit']"
+        >提交
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="primary" size="mini" plain icon="el-icon-upload">
+            导入<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="importModel">导入模板</el-dropdown-item>
+            <el-dropdown-item command="import">导入</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown @command="handleCommand">
+          <el-button type="warning" plain icon="el-icon-download" size="mini">
+            导出<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item command="export">导出</el-dropdown-item>
+            <el-dropdown-item command="exportDetails">导出明细</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -724,6 +746,11 @@ export default {
         ...this.queryParams
       }, `monthSaleGoal_${new Date().getTime()}.xlsx`)
     },
+    handleExportDetails() {
+      this.download('goal_management/monthSaleGoalDetails/export', {
+        ...this.queryParams
+      }, `monthSaleGoalDetails_${new Date().getTime()}.xlsx`)
+    },
     handleClose(done) {
       this.$confirm('确认关闭?')
         .then(_ => {
@@ -820,6 +847,22 @@ export default {
         this.queryParams.beginTime = null
         this.queryParams.endTime = null
       }
+    },
+    handleCommand(command) {
+      // 执行对应的功能
+      if (command === 'importModel') {
+        // 执行选项1的功能
+        console.log('导入模板');
+      } else if (command === 'import') {
+        // 执行选项2的功能
+        console.log('导入');
+      } else if (command === 'export') {
+        console.log('导出主表');
+        this.handleExport()
+      } else if (command === 'exportDetails') {
+        console.log('导出明细');
+        this.handleExportDetails()
+      }
     }
   }
 }