Browse Source

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

002201 1 year ago
parent
commit
2a585e4f0e
35 changed files with 1193 additions and 439 deletions
  1. 28 0
      src/api/business/spd/goal_management/commonWays.js
  2. 3 3
      src/api/business/spd/task_management/visitingPlan/visitingPlan.js
  3. 33 5
      src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue
  4. 1 1
      src/views/business/spd/fillin/dailysale_quantity_assess/index.vue
  5. 38 17
      src/views/business/spd/goal_management/AnnualSaleGoal.vue
  6. 17 6
      src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue
  7. 8 2
      src/views/business/spd/goal_management/MonthGoalMerge.vue
  8. 8 3
      src/views/business/spd/goal_management/MonthReturnGoal.vue
  9. 7 3
      src/views/business/spd/goal_management/MonthReturnMerge.vue
  10. 9 5
      src/views/business/spd/goal_management/MonthSaleGoal.vue
  11. 30 1
      src/views/business/spd/target/targetMk/index.vue
  12. 2 2
      src/views/business/spd/target/targetMk/item.vue
  13. 34 40
      src/views/business/spd/target/targetTemplate/detail.vue
  14. 1 1
      src/views/business/spd/target/targetTemplate/index.vue
  15. 152 119
      src/views/business/spd/task_management/visitingPlan/add.vue
  16. 45 34
      src/views/business/spd/task_management/visitingPlan/index.vue
  17. 36 0
      src/views/material/basicFile/columns.js
  18. 7 2
      src/views/material/basicFile/details.vue
  19. 2 2
      src/views/material/basicFile/index.vue
  20. 1 1
      src/views/material/basicFile/style/index.scss
  21. 22 17
      src/views/material/requisition/add.vue
  22. 72 0
      src/views/material/requisition/columns.js
  23. 411 0
      src/views/material/requisition/index copy.vue
  24. 113 121
      src/views/material/requisition/index.vue
  25. 4 3
      src/views/purchase/DemandSummary/index.vue
  26. 2 2
      src/views/purchase/MaterialClassDivision/index.vue
  27. 66 15
      src/views/purchase/PurchaseDemandList/add.vue
  28. 4 4
      src/views/purchase/PurchaseDemandList/index.vue
  29. 1 2
      src/views/purchase/apply/index.vue
  30. 2 2
      src/views/purchase/deliveryAddress/index.vue
  31. 15 15
      src/views/purchase/purchase-order/add/column.js
  32. 10 3
      src/views/purchase/purchase-order/index.vue
  33. 5 5
      src/views/purchase/transferOrder/add.vue
  34. 2 2
      src/views/purchase/transferOrder/index.vue
  35. 2 1
      vue.config.js

+ 28 - 0
src/api/business/spd/goal_management/aDemo.js → src/api/business/spd/goal_management/commonWays.js

@@ -27,3 +27,31 @@ function mergeArray() {
   const mergedArray = mergeAndSumTotalGoal(arr);
   console.log(mergedArray);
 }
+
+// 计算子表小计
+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;
+}

+ 3 - 3
src/api/business/spd/task_management/visitingPlan/visitingPlan.js

@@ -19,7 +19,7 @@ export function addPlan(data) {
 //拜访计划编辑
 export function editPlan(data) {
     return request({
-        url: '/mk/bo/plan/',
+        url: '/mk/bo/plan/edit',
         method: 'put',
         data: data
     })
@@ -60,7 +60,7 @@ export function delPlanItem(id) {
         method: 'delete'
     })
 }
-// 采购需求单导出
+//拜访计划导出
 export function exportPlan(data) {
     return request({
       url: `/mk/bo/plan/export`,
@@ -68,4 +68,4 @@ export function exportPlan(data) {
       data: data,
       responseType: 'blob'
     })
-}
+}

+ 33 - 5
src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue

@@ -26,6 +26,7 @@
           <el-col :span="1.5">
             <el-form-item label="月份" prop="month">
               <el-date-picker
+                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
                 v-model="form.month"
                 value-format="yyyy-MM"
                 type="month"
@@ -37,6 +38,7 @@
           <el-col :span="1.5">
             <el-form-item label="客户" prop="customer">
               <dr-popover-select
+                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
                 size="mini"
                 v-model="form.customerName"
                 title="客户选择"
@@ -652,6 +654,20 @@
                     />
                   </template>
                 </el-table-column>
+                <el-table-column
+                  show-overflow-tooltip
+                  label="合计数量"
+                  align="center"
+                  width="100"
+                  prop="amount"
+                />
+                <el-table-column
+                  show-overflow-tooltip
+                  label="合计金额"
+                  align="center"
+                  width="100"
+                  prop="money"
+                />
               </el-table-column>
               <el-table-column
                 fixed="right"
@@ -727,11 +743,8 @@ export default {
   watch: {
     'form.month': {
       handler(newVal) {
-          console.log('newVal',newVal);
           let arr = newVal.split('-');
-          console.log('arr.[1]',arr[1]);
           this.numDay = this.getDays(arr[0],arr[1]);
-          console.log('this.numDay',this.numDay);
       },
       immediate:true,
     }
@@ -752,9 +765,12 @@ export default {
         break;
       case "edit":
         await this.fetchAssess(this.row.id);
+        this.total();
+        console.log('this.form.items',this.form.items);
         break;
       case "see":
         await this.fetchAssess(this.row.id);
+        this.total();
         break;
     }
   },
@@ -827,8 +843,6 @@ export default {
     },
     //删行
     async useRowRemove(index, row) {
-      console.log("index", index);
-      console.log("row", row);
       if (row.id) {
         this.form.items.forEach((e) => {
           if (e.id == row.id) {
@@ -876,6 +890,20 @@ export default {
       } else {
           return i;
       }
+    },
+    //计算合计
+    total(){
+      let num = ["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth","thirteenth","fourteenth","fifteenth"
+				,"twentyFirst","seventeenth","eighteenth","nineteenth","twentieth","twentyFirst","twentySecond","twentyThird","twentyFourth","twentyFifth","twentySixth","twentySeventh","twentyEighth","twentyNinth","thirtieth","thirtyFirst"];
+      for(let i in this.form.items){
+        let c = 0;
+        for(let j in num){
+          c = (this.form.items[i][num[j]] || 0) - 0 + c;
+        }
+        console.log('c',c);
+        this.form.items[i].amount = c;
+        this.form.items[i].money = c * (this.form.items[i].price || 0);
+      }
     }
   },
 };

+ 1 - 1
src/views/business/spd/fillin/dailysale_quantity_assess/index.vue

@@ -18,7 +18,7 @@
                 <el-date-picker
                   v-model="queryParams.month"
                   type="month"
-                  format="yyyy-MM-dd"
+                  value-format="yyyy-MM"
                   clearable
                   >
                 </el-date-picker>

+ 38 - 17
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -317,9 +317,9 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="年销售目标填报明细" name="annualSaleGoalDetails">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
-              <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="销售组织" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleOrg" title="销售组织" valueKey="name"
                                         referName="ORG_PARAM"
@@ -328,7 +328,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="销售区域" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="销售区域" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].saleZone" title="销售区域" valueKey="name"
                                         referName="MK_SALESAREA_PARAM"
@@ -337,7 +337,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="客户" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="客户" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].custom" title="客户" valueKey="name"
                                         referName="CUSTOMER_PARAM"
@@ -346,7 +346,7 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="负责人" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="负责人" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].creator" title="负责人" valueKey="name"
                                         referName="CONTACTS_PARAM"
@@ -355,17 +355,17 @@
                   </el-popover-select-v2>
                 </template>
               </el-table-column>
-              <el-table-column label="一级分类" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="一级分类" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-input v-model="annualSaleGoalDetailsList[scope.$index].oneLevelClassify" placeholder="请输入一级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="二级分类" align="center" width="180" :render-header="addRedStar">
+              <el-table-column label="二级分类" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-input v-model="annualSaleGoalDetailsList[scope.$index].twoLevelClassify" placeholder="请输入二级分类" disabled></el-input>
                 </template>
               </el-table-column>
-              <el-table-column label="物料" align="center" width="220" :render-header="addRedStar">
+              <el-table-column label="物料" align="center" width="220" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
                   <el-popover-select-v2 v-model="annualSaleGoalDetailsList[scope.$index].material" title="物料" valueKey="name"
                                         referName="MATERIAL_PARAM"
@@ -546,12 +546,12 @@ import {
   addAnnualSaleGoal,
   updateAnnualSaleGoal
 } from "@/api/business/spd/goal_management/annualSaleGoal";
-
 import {
   delAnnualSaleGoalDetails,
   getAnnualSaleGoalDetails
 } from "@/api/business/spd/goal_management/annualSaleGoalDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "@/api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -828,7 +828,7 @@ export default {
         twoLevelClassify: null,
         materialCode: null,
         material: null,
-        totalGoal: 0,
+        totalGoal: '0.00',
         januaryGoal: null,
         februaryGoal: null,
         marchGoal: null,
@@ -851,6 +851,7 @@ export default {
       const id = row.id || this.ids
       getAnnualSaleGoal(id).then(response => {
         this.form = response.data;
+        this.saveFormTwoPoint(this.form)
         this.annualSaleGoalDetailsList = this.form.annualGoalMergeDetails
         this.open = true;
         this.title = "修改--年度销售目标";
@@ -860,11 +861,13 @@ export default {
     handleCopy(id) {
       this.reset();
       getAnnualSaleGoal(id).then(response => {
+        console.log(response);
         this.form = response.data;
         this.form.id = null
         this.form.code = null
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
         this.form.annual = new Date().getFullYear().toString()
+        this.saveFormTwoPoint(this.form)
         this.annualSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.annualGoalMergeDetails))
         for (const element of this.annualSaleGoalDetailsList) {
           element.id = null
@@ -875,6 +878,13 @@ export default {
         console.log(this.form);
       })
     },
+    // 进入修改复制界面保留两位小数
+    saveFormTwoPoint(form) {
+      form.goalTotal = form.goalTotal.toFixed(2)
+      for (const element of form.annualGoalMergeDetails) {
+        element.totalGoal = element.totalGoal.toFixed(2)
+      }
+    },
     /** 提交按钮 */
     submitForm() {
       if (!this.justiceDetailsList()) {
@@ -892,6 +902,7 @@ export default {
           } else {
             this.form.documentStatus = '未提交'
             this.form.annualGoalMergeDetails = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
+            console.log(this.form);
             addAnnualSaleGoal(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
@@ -990,7 +1001,7 @@ export default {
       for (const element of array) {
         sum = (sum * 1000000 + element * 1000000) / 1000000
       }
-      this.annualSaleGoalDetailsList[index].totalGoal = sum
+      this.annualSaleGoalDetailsList[index].totalGoal = sum.toFixed(2)
       this.computeTotal()
     },
     // 计算主表合计
@@ -1000,14 +1011,24 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.totalGoal * 1000000) / 1000000
       }
-      this.form.goalTotal = sum
+      this.form.goalTotal = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 给table添加必填项
-    addRedStar(h, { column }) {
-      return [
-        h('span', { style: 'color: #F56C6C' }, '*'),
-        h('span', '' + column.label)
-      ]
+    addRedStar(h, { column }, required) {
+      if (required === '0') {
+        return [
+          h('span', { style: 'color: #F56C6C' }, '*'),
+          h('span', '' + column.label)
+        ]
+      } else {
+        return [
+          // h('span', { style: 'color: #F56C6C' }, '*'),
+          h('span', '' + column.label)
+        ]
+      }
     },
     // 判断子表的字段是否都填了
     justiceDetailsList() {

+ 17 - 6
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -344,7 +344,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="年销售目标合并明细" name="annualSaleGoalMergeDetails">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -468,7 +468,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="区域目标汇总(年)" name="zoneGoalSum(year)">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="areaDetailList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="areaDetailList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -565,7 +565,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="客户目标汇总(年)" name="customerGoalSum(year)">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="customerDetailList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="customerDetailList">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -719,6 +719,7 @@ import {
   getAnnualSaleMergeDetails
 } from "@/api/business/spd/goal_management/annualSaleMergeDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "@/api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -1054,7 +1055,11 @@ export default {
       getAnnualSaleGoalMerge(id).then(response => {
         console.log(response);
         this.form = response.data;
-        this.annualSaleGoalMergeDetailsList = response.data.annualGoalMergeDetailsList
+        this.form.goalTotal = this.form.goalTotal.toFixed(2)
+        for (const element of this.form.annualGoalMergeDetailsList) {
+          element.totalGoal = element.totalGoal.toFixed(2)
+        }
+        this.annualSaleGoalMergeDetailsList = JSON.parse(JSON.stringify(this.form.annualGoalMergeDetailsList))
         this.open = true;
         this.title = "修改--年度销售目标合并明细";
       });
@@ -1074,6 +1079,7 @@ export default {
         this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).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)
         this.open = true
       })
     },
@@ -1327,7 +1333,10 @@ export default {
         }
         sum = (sum * 1000000 + listElement.totalGoal * 1000000) / 1000000
       }
-      this.form.goalTotal = sum
+      this.form.goalTotal = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 合并数据
     clickMerge() {
@@ -1358,12 +1367,14 @@ export default {
       mergeAnnualSaleMergeDetails(query).then(response => {
         console.log(response);
         if (response.data.consolidatedDetail.length > 0) {
+          for (const consolidatedDetail of response.data.consolidatedDetail) {
+            consolidatedDetail.totalGoal = consolidatedDetail.totalGoal.toFixed(2)
+          }
           this.annualSaleGoalMergeDetailsList = response.data.consolidatedDetail
           this.computeTotal()
         } else {
           return this.$message.warning('未查到相关数据')
         }
-
       })
     },
     // 获得区域目标汇总or客户目标汇总

+ 8 - 2
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -377,7 +377,7 @@
         </el-row>
         <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
           <el-tab-pane label="月销售目标合并明细" name="monthGoalMergeDetails">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthGoalMergeDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -604,6 +604,7 @@ import {
   mergeMonthSaleMergeDetails
 } from "@/api/business/spd/goal_management/monthGoalMergeDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -921,6 +922,7 @@ export default {
       const id = row.id || this.ids
       getMonthGoalMerge(id).then(response => {
         this.form = response.data;
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthGoalMergeDetailsList = this.form.monthMergeDetailsList
         this.open = true;
         this.title = "修改--月销售目标合并";
@@ -942,6 +944,7 @@ export default {
         this.form.annual = new Date().getFullYear().toString()
         this.form.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0')
         this.form.goalSum = 0
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.open = true
         this.changeGoalCategoryForm()
       })
@@ -1229,7 +1232,10 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 合并数据
     clickMerge() {

+ 8 - 3
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -322,7 +322,7 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月回款目标明细" name="monthReturnGoalDetails">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthReturnGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
@@ -505,6 +505,7 @@ import {
   delMonthReturnGoalDetails
 } from "@/api/business/spd/goal_management/monthReturnGoalDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -771,7 +772,7 @@ export default {
       const id = row.id || this.ids
       getMonthReturnGoal(id).then(response => {
         this.form = response.data;
-        console.log(this.form);
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthReturnGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthReturnGoalDetailsList))
         this.open = true;
         this.title = "修改--月回款目标填报";
@@ -784,6 +785,7 @@ export default {
         this.form = response.data;
         this.form.id = null
         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')
         this.form.annual = new Date().getFullYear().toString()
         this.monthReturnGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthReturnGoalDetailsList))
@@ -879,7 +881,10 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalSum * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
+    },
+    getSummaries(param) {
+      return getSummary(param)
     },
     // 复制明细
     handleCopyDetails(row) {

+ 7 - 3
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -334,7 +334,7 @@
       </el-row>
       <el-tabs v-model="activeName" @tab-click="getNewTwoArray">
         <el-tab-pane label="月回款目标合并明细" name="monthReturnMergeDetails">
-          <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthReturnMergeDetailsList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthReturnMergeDetailsList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -395,7 +395,7 @@
           </el-table>
         </el-tab-pane>
         <el-tab-pane label="区域目标汇总(月回款)" name="zoneGoalSum(monthReturn)">
-          <el-table max-height="300" show-summary sum-text="小计" :data="zoneGoalSumList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" :data="zoneGoalSumList">
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -500,6 +500,7 @@ import {
   mergeMonthReturnMergeDetails
 } from "@/api/business/spd/goal_management/monthReturnMergeDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -771,6 +772,7 @@ export default {
       const id = row.id || this.ids
       getMonthReturnMerge(id).then(response => {
         this.form = response.data;
+        this.form.goalSum = this.form.goalSum.toFixed(2)
         this.monthReturnMergeDetailsList = this.form.monthReturnMergeDetailsList
         this.open = true;
         this.title = "修改--月回款目标合并";
@@ -788,6 +790,7 @@ export default {
         this.form.id = null
         this.form.code = null
         this.form.goalSum = 0
+        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')
         this.form.annual = new Date().getFullYear().toString()
@@ -903,8 +906,9 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalSum * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
     },
+    getSummaries(param) { return getSummary(param) },
     // 复制明细
     handleCopyDetails(row) {
       let list = {

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

@@ -324,7 +324,7 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
-            <el-table max-height="300" show-summary sum-text="小计" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthSaleGoalDetailsList" @selection-change="handleSelectionChange">
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="addRedStar">
                 <template slot-scope="scope">
@@ -537,6 +537,7 @@ import {
   delMonthSaleGoalDetails
 } from "@/api/business/spd/goal_management/monthSaleGoalDetails"
 import { getToken } from "@/utils/auth";
+import { getSummary } from "../../../../api/business/spd/goal_management/commonWays";
 
 // 树形参照
 import TreeRefers from '@/components/Refers/treeRefer.vue'
@@ -784,7 +785,7 @@ export default {
       this.reset();
       this.monthSaleGoalDetailsList = []
       this.open = true;
-      this.title = "添加月销售目标填报";
+      this.title = "添加--月销售目标填报";
       this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
       this.form.annual = new Date().getFullYear().toString()
       this.form.creator = this.$store.state.user.nickName
@@ -819,9 +820,10 @@ export default {
       const id = row.id || this.ids
       getMonthSaleGoal(id).then(response => {
         this.form = response.data;
-        this.monthSaleGoalDetailsList = this.form.monthDetailsList
+        this.form.goalSum = this.form.goalSum.toFixed(2)
+        this.monthSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthDetailsList))
         this.open = true;
-        this.title = "修改月销售目标填报";
+        this.title = "修改--月销售目标填报";
       });
     },
     // 复制按钮
@@ -831,6 +833,7 @@ export default {
         this.form = response.data;
         this.form.id = null
         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')
         this.form.annual = new Date().getFullYear().toString()
         this.monthSaleGoalDetailsList = JSON.parse(JSON.stringify(this.form.monthDetailsList))
@@ -950,8 +953,9 @@ export default {
       for (const listElement of list) {
         sum = (sum * 1000000 + listElement.goalValue * 1000000) / 1000000
       }
-      this.form.goalSum = sum
+      this.form.goalSum = sum.toFixed(2)
     },
+    getSummaries(param) { return getSummary(param) },
     // 子表table加必填标志
     addRedStar(h, { column }) {
       return [

+ 30 - 1
src/views/business/spd/target/targetMk/index.vue

@@ -40,6 +40,30 @@
                 />
               </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-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="{
+                    template: 'id',
+                    templateName: 'name',
+                  }" :source.sync="queryParams"
+                >
+                </dr-popover-select>
+              </el-form-item>
+            </el-col>
             <!-- <el-col :span="1.5">
               <el-form-item label="模板">
                 <el-input
@@ -194,10 +218,13 @@ export default {
         code: '',
         name: '',
         template:'',
+        templateName:'',
         year:'',
         pageNum: 1,
         pageSize: 10
       },
+      // 查询日期范围
+      dateRange: [],
       //总条数
       total: 0,
       //列表数据
@@ -278,10 +305,12 @@ export default {
     },
     //重置
     useReset(){
+      this.dateRange = [];
       this.queryParams = {
         code: '',
         name: '',
         template:'',
+        templateName:'',
         year:'',
         pageNum: 1,
         pageSize: 10
@@ -290,7 +319,7 @@ export default {
     },
     //查询列表
     getList(params){
-      listTarget(params).then(res => {
+      listTarget(this.addDateRange(params, this.dateRange)).then(res => {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total

+ 2 - 2
src/views/business/spd/target/targetMk/item.vue

@@ -91,8 +91,8 @@ export default {
   methods: {
     //增行
     useAdd(){
-      this.items.push(this.itemTemplate);
-      console.log('this.itemTemplate',this.itemTemplate);
+      let obj = JSON.parse(JSON.stringify(this.itemTemplate))
+      this.items.push(obj);
       console.log('this.items',this.items);
     },
     //删行

+ 34 - 40
src/views/business/spd/target/targetTemplate/detail.vue

@@ -96,7 +96,7 @@
                             </el-table-column>
                             <el-table-column fixed="right" label="操作" align="center" width="150">
                                 <template slot-scope="scope">
-                                    <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                    <el-button type="text" size="mini" @click="useRowRemove(scope.$index,scope.row)">删行</el-button>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -118,7 +118,7 @@
                             </el-table-column>
                             <el-table-column fixed="right" label="操作" align="center" width="150">
                                 <template slot-scope="scope">
-                                <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                <el-button type="text" size="mini" @click="useRowRemove(scope.$index,scope.row)">删行</el-button>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -264,6 +264,7 @@ export default {
                     }
                     this.loading = true;
                     let res = null;
+                    console.log("1111",1111);
                     if (this.openMode === "add") {
                         res = await addTargetTemplate(this.form);
                     }
@@ -293,7 +294,6 @@ export default {
                 return false;
             }
             arr = arr.filter(item => !item.target);
-            console.log("arr",arr);
             if(arr.length > 0){
                 this.$modal.msgError("指标页签不能存在空数据!");
                 return false;
@@ -327,6 +327,7 @@ export default {
             this.$modal.msgError("周期页签不能为空!");
             return false;
         }
+        return true;
     },
     //查询详情
     async fetchTemplate(id) {
@@ -369,7 +370,7 @@ export default {
         console.log("this.form[this.activeName]",this.form[this.activeName]);
     },
     //删行
-    async useRowRemove(row) {
+    async useRowRemove(index,row) {
       if (row.id) {
         this.form[this.activeName].forEach(e => {
           if(e.id == row.id){
@@ -377,7 +378,7 @@ export default {
           }
         });
       }else{
-        this.form[this.activeName] = form[this.activeName].filter(item => item.$index != row.$index);
+        this.form[this.activeName].splice(index, 1);
       }
       console.log("this.form[this.activeName]",this.form[this.activeName]);
     },
@@ -409,58 +410,48 @@ export default {
       if(this.form.cycle == 'period'){
         cycles.push({
           name:'目标期间',
-          startTime:start,
-          deadlineTime:deadline,
+          startTime:this.formatDateTime(start, 'yyyy-MM-dd'),
+          deadlineTime:this.formatDateTime(deadline, 'yyyy-MM-dd'),
         });
       }else{
         while(deadline >= start){
-          console.log(start);
           if(this.form.cycle == 'day'){
             var cy = {
               name:this.formatDateTime(start, 'yyyy-MM-dd'),
-              startTime:start,
-              deadlineTime:start,
+              startTime:this.formatDateTime(start, 'yyyy-MM-dd'),
+              deadlineTime:this.formatDateTime(start, 'yyyy-MM-dd'),
             }
-            console.log(cy);
             cycles.push(cy);
-            start = start.setDate(start.getDate()+1);
-            start = new Date(start);
+            start.setDate(start.getDate()+1);
           }
           if(this.form.cycle == 'week'){
-            var de = start;
-            var cy = {
-              name:this.formatDateTime(start, 'yyyy-MM-dd'),
-              startTime:start,
-              deadlineTime:de.setDate(de.getDate()+7),
-            }
-            console.log(cy);
+            var cy = {};
+            cy.name = this.formatDateTime(start, 'yyyy-MM-dd');
+            cy.startTime = this.formatDateTime(start, 'yyyy-MM-dd');
+            start.setDate(start.getDate()+6);
+            cy.deadlineTime = this.formatDateTime(start, 'yyyy-MM-dd');
             cycles.push(cy);
-            start = start.setDate(start.getDate()+7);
-            start = new Date(start);
+            start.setDate(start.getDate()+1);
           }
           if(this.form.cycle == 'month'){
-            var de = start;
-            var cy = {
-              name:this.formatDateTime(start, 'yyyy-MM-dd'),
-              startTime:start,
-              deadlineTime:de.setDate(de.getDate()+30),
-            }
-            console.log(cy);
+            var cy = {};
+            cy.name = this.formatDateTime(start, 'yyyy-MM');
+            cy.startTime = this.formatDateTime(start, 'yyyy-MM-dd');
+            let arr = cy.startTime.split('-');
+            start = this.getLastDay(arr[0],arr[1]);
+            console.log('start',start);
+            cy.deadlineTime = this.formatDateTime(start, 'yyyy-MM-dd');
             cycles.push(cy);
-            start = start.setDate(start.getDate()+30);
-            start = new Date(start);
+            start.setDate(start.getDate()+1);
           }
           if(this.form.cycle == 'season'){
-            var de = start;
-            var cy = {
-              name:this.formatDateTime(start, 'yyyy-MM-dd'),
-              startTime:start,
-              deadlineTime:de.setDate(de.getDate()+90),
-            }
-            console.log(cy);
+            var cy = {};
+            cy.name = this.formatDateTime(start, 'yyyy-MM');
+            cy.startTime = this.formatDateTime(start, 'yyyy-MM-dd');
+            start.setDate(start.getDate()+90);
+            cy.deadlineTime = this.formatDateTime(start, 'yyyy-MM-dd');
             cycles.push(cy);
-            start = start.setDate(start.getDate()+90);
-            start = new Date(start);
+            start.setDate(start.getDate()+1);
           }
         }
       }
@@ -493,6 +484,9 @@ export default {
         }
       }
       return format;
+    },
+    getLastDay(year, month) {
+      return new Date(new Date(`${month<12?year:++year}-${month==12?1:++month} 00:00`).getTime() - 1);
     }
   },
 };

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

@@ -187,7 +187,7 @@ export default {
         return;
       }
       this.$modal.confirm('确认删除选择数据').then(() => {
-        delTarget(row.id).then(res => {
+        delTargetTemplate(row.id).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("删除成功");
             this.getList(this.queryParams)

+ 152 - 119
src/views/business/spd/task_management/visitingPlan/add.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="addPlanList">
-    <el-card>
+    <el-card style="position: relative;">
       <span>基本信息</span>
       <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
         <el-row :gutter="10">
@@ -16,7 +16,7 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="计划名称" prop="planName" :rules="{ required: true, message: '请填写名称', trigger: 'blur' }">
+            <el-form-item label="计划名称" prop="planName" :rules="{ required: true, message: '请填写计划名称', trigger: 'blur' }">
               <el-input
                 v-model.trim="basicForm.planName"
                 size="mini"
@@ -28,7 +28,7 @@
          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="线路类型" prop="type">
+            <el-form-item label="线路类型" prop="type" :rules="{ required: true, message: '请选择线路类型', trigger: 'blur' }">
               <el-select :disabled="sonDisable" v-model="basicForm.type" size="mini" style="width: 200px">
                 <el-option v-for="dict in dict.type.mk_plan_route_type" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
@@ -37,7 +37,7 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="执行人" prop="chargerName">
+            <el-form-item label="执行人" prop="chargerName" :rules="{ required: true, message: '请选择执行人', trigger: 'blur' }">
                 <el-select clearable size="mini" v-model="basicForm.chargerName" :disabled="sonDisable" @focus="choose('CONTACTS_PARAM', true, '执行人')" style="width: 200px">
                   <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
@@ -70,9 +70,9 @@
               >
               </el-date-picker>
             </el-form-item>
-         </el-col>
+          </el-col>
 
-         <el-col :span="1.5">
+          <el-col :span="1.5">
             <el-form-item label="截止时间" prop="deadlineTime" :rules="{ required: true, message: '请选择截止时间', trigger: 'blur' }">
               <el-date-picker
                 v-model="basicForm.deadlineTime"
@@ -85,10 +85,10 @@
               >
               </el-date-picker>
             </el-form-item>
-         </el-col>
+          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="销售区域" prop="marketingAreaName">
+            <el-form-item label="销售区域" prop="marketingAreaName" :rules="{ required: true, message: '请选择销售区域', trigger: 'blur' }">
               <el-select clearable v-model="basicForm.marketingAreaName" size="mini" :disabled="sonDisable" @focus="choose('MK_SALESAREA_PARAM', true, '销售区域')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
@@ -115,30 +115,32 @@
 
         </el-row>
 
-        <span>明细信息</span>
         <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
-          <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
-          <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
+          <span>明细信息</span>
+          <div>
+            <el-button type="primary" size="mini" @click="addLine" v-if="!sonDisable">增行</el-button>
+            <el-button type="primary" size="mini"  @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+            <el-button type="primary" size="mini" @click="delItems" v-if="sonPageStu == 'edit'">批量删除</el-button>
+            <el-button type="primary" size="mini" @click="edit" v-if="sonPageStu == 'check'">编辑</el-button>
+          </div>
         </div>
 
-        <el-table 
+        <el-table
           :data="basicForm.mkBoPlanItemList" 
           fit
-          max-height="300"
+          max-height="600"
           style="font-size: 12px;"
           @selection-change="handleSelectionChange"
-          :cell-class-name="cellClassName"
         >
           <el-table-column type="selection" align="center"/>
           <el-table-column label="序号" type="index" align="center"/>
           <el-table-column show-overflow-tooltip label="计划编号" prop="planCode" width="150"/>
-          <el-table-column show-overflow-tooltip label="日期"  prop="date" width="230px">
+          <el-table-column show-overflow-tooltip label="日期"  prop="date" width="230px" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'date'" :rules="{ required: true, message: '请填写日期', trigger: 'blur' }">
                 <el-date-picker
                   v-model="scope.row.date"
-                  readonly
+                  :readonly="sonDisable"
                   clearable
                   type="date"
                   size="mini"
@@ -149,9 +151,9 @@
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="客户名称" prop="customerName" min-width="230">
+          <el-table-column show-overflow-tooltip label="客户" prop="customerName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'customerName'" :rules="{ required: true, message: '请选择客户', trigger: 'blur' }">
                 <el-select clearable size="mini" v-model="scope.row.customerName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'CUSTOMER_PARAM_ZT', true, '客户')" style="width: 200px">
                   <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
@@ -159,10 +161,10 @@
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230">
+          <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {})" style="width: 200px">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
+                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '联系人', {customer:scope.row.customer})" style="width: 200px">
                   <el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
@@ -171,15 +173,15 @@
 
           <el-table-column show-overflow-tooltip label="详细地址" prop="address" min-width="200">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'address'">
                 <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.address"/>
               </el-form-item>
             </template>
           </el-table-column>
 
-          <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200">
+          <el-table-column show-overflow-tooltip label="拜访目的" prop="purpose" min-width="200" :render-header="addRedStar">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'purpose'" :rules="{ required: true, message: '请选择拜访目的', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" v-model="scope.row.purpose" size="mini">
                   <el-option v-for=" dict in dict.type.mk_bo_behavior_goal" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
@@ -188,10 +190,17 @@
             </template>
           </el-table-column>
 
-          <el-table-column :readonly="sonDisable" show-overflow-tooltip label="商机" prop="boName" min-width="200"/>
+          <el-table-column :readonly="sonDisable" show-overflow-tooltip label="商机" prop="boName" min-width="200">
+            <template slot-scope="scope">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'boName'">
+                <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.boName"/>
+              </el-form-item>
+            </template>
+          </el-table-column>
+
           <el-table-column :readonly="sonDisable" show-overflow-tooltip label="营销活动" prop="marketingCampaign" min-width="200">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'marketingCampaign'">
                 <el-input clearable :readonly="sonDisable" size="mini" v-model="scope.row.marketingCampaign"/>
               </el-form-item>
             </template>
@@ -214,10 +223,10 @@
       <el-col :span="1.5">
         <el-button type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       </el-col>
-      <el-col :span="1.5" style="margin: 0 10px;">
+      <!-- <el-col :span="1.5" style="margin: 0 10px;">
         <el-button type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
-      </el-col>
-      <el-col :span="1.5">
+      </el-col> -->
+      <el-col :span="1.5" style="margin: 0 10px;">
         <el-button size="mini" plain @click="back">返回</el-button>
       </el-col>
 
@@ -253,32 +262,21 @@ export default {
       // },
       basicForm: {
         id: '',
-        planId: '',
         planCode: '',
-        planName :'',
-        charger: '',
-        chargerName: '',
+        planName : '',
+        charger: this.$store.state.user.id,
+        chargerName: this.$store.state.user.nickName,
+        dept: this.$store.state.user.deptId,
+        deptName: this.$store.state.user.deptName,
+        startDate: this.getNextWeek(1),
+        deadlineTime: this.getNextWeek(7),
         type: '0',
-        dept: '',
-        deptName: '',
-        startDate: this.getWeek(1),
-        deadlineTime: this.getWeek(7),
-        date: '',
+        state: '0',
         marketingArea: '',
         marketingAreaName: '',
-        state: '0',
-        customer: '',
-        customerName: '',
-        contact: '',
-        contactName: '',
-        address: '',
-        purpose: '',
-        bo: '',
-        boName: '',
-        marketingCampaign: '',
         mkBoPlanItemList: []
       },
-      delDemandItemList: [],
+      delPlanItemList: [],
       basicRules: {},
       tableList: [],
       referCondition: {
@@ -298,43 +296,59 @@ export default {
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
-      pickerOptionsEnd: {
-        disabledDate: (time) => {
-          return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000
-        }
-      },
-      isBDXQ: false,
-      isYl: false,
+      salesAreaOptions: [],
+      //判断默认明细行带出完毕后日期等于当前日期的标识
+      isFlag: false
     }
   },
   updated() {},
   mounted() {},
   created() {
+    //查看系统数据
+    console.log(this.$store.state.user, 'this.$store.state.user')
     if(this.pageStu == 'check') {
       console.log('数据', this.row)
       this.getDetails(this.row)
-    } else if(this.pageStu == 'edit') {
+    } else if (this.pageStu == 'edit') {
       this.getDetails(this.row)
+    } else if (this.pageStu == 'add') {
+    //新增时默认带出7条明细行
+    this.defaultDetailLine(7)
     }
   },
   methods:{
+    copy() {
+      this.isFlag = true;
+      this.$modal.notifySuccess("复制成功");
+      this.sonPageStu = 'add'
+      this.sonDisable = false
+      // this.getDetails(this.row)
+      this.basicForm.id = ''
+      this.basicForm.planCode = ''
+      this.basicForm.createBy = ''
+      this.basicForm.createTime = ''
+      this.basicForm.chargerName = this.$store.state.user.nickName
+      this.basicForm.dept = this.$store.state.user.deptId
+      if (this.basicForm.chargerName) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.chargerName) }
+      if (this.basicForm.marketingAreaName) { this.reBackRefer('MK_SALESAREA_PARAM', this.basicForm.marketingAreaName) }
+      if (this.basicForm.deptName) { this.reBackRefer('DEPT_PARAM', this.basicForm.deptName) }
+      this.basicForm.mkBoPlanItemList.forEach(item => {
+        item.planCode = ''
+      })
+    },
     handleData() {
       console.log('222')
       // 复制新增把id,编码,创建人置为空,子表去掉id
       this.basicForm.id = ''
-      this.basicForm.code = ''
+      this.basicForm.planCode = ''
       this.basicForm.createBy = ''
-      this.basicForm.source = '4'
       if (this.basicForm.mkBoPlanItemList.length !== 0) {
         this.basicForm.mkBoPlanItemList.forEach(item => {
           if (item.id) {
             delete item.id
           }
-          if (item.demandId) {
-            delete item.demandId
-          }
-          if (item.allotCode) {
-            delete item.allotCode
+          if (item.planId) {
+            delete item.planId
           }
         })
       }
@@ -350,7 +364,7 @@ export default {
     },
     async save() {
       if(this.basicForm.mkBoPlanItemList.length !== 0) {
-        this.$refs['basic'].validate((valid) => {
+        this.$refs['basic'].validate((valid, obj) => {
           if(valid) {
             this.$modal.loading("保存中...");
             if(this.sonPageStu == 'add') {
@@ -358,7 +372,7 @@ export default {
               addPlan(this.basicForm).then(res => {
                 console.log(333)
                 if (res.code === 200) {
-                  this.$modal.msgSuccess("保存成功");
+                  this.$modal.notifySuccess("保存成功");
                   this.$modal.closeLoading();
                   this.back()
                 }
@@ -367,15 +381,15 @@ export default {
               })
             } else if (this.sonPageStu == 'edit') {
               let list = []
-              list.push(...this.basicForm.mkBoPlanItemList, ...this.delDemandItemList)
+              list.push(...this.basicForm.mkBoPlanItemList, ...this.delPlanItemList)
               // 深拷贝一下参数对象
               let param = JSON.parse(JSON.stringify(this.basicForm))
               console.log('深拷贝对象',param);
               param.mkBoPlanItemList = list
-              // this.basicForm.mkBoPlanItemList.push(...this.delDemandItemList)
+              // this.basicForm.mkBoPlanItemList.push(...this.delPlanItemList)
               editPlan(param).then(res => {
                 if (res.code === 200) {
-                  this.$modal.msgSuccess("编辑成功");
+                  this.$modal.notifySuccess("编辑成功");
                   this.$modal.closeLoading();
                   this.back()
                 }
@@ -383,32 +397,42 @@ export default {
                 this.$modal.closeLoading();
               })
             }
+          } else {
+            // 校验加弹窗
+            const jiaoyan = []
+            for(let key in obj) {
+              jiaoyan.push(obj[key][0].message);
+            }
+            this.$modal.notifyWarning(jiaoyan[0]);
+            return false
           }
         })
       } else {
         this.$modal.msgWarning("明细信息不能为空!");
       }
     },
-    submit() {
-      this.$modal.loading("提交中...");
-      submitDemand(this.basicForm).then(res => {
-        if (res.code === 200) {
-          this.$modal.msgSuccess("提交成功");
-          this.$modal.closeLoading();
-          this.back()
-        }
-      }).catch(err => {
-        this.$modal.closeLoading();
-      })
-    },
+    // submit() {
+    //   this.$modal.loading("提交中...");
+    //   submitDemand(this.basicForm).then(res => {
+    //     if (res.code === 200) {
+    //       this.$modal.notifySuccess("提交成功");
+    //       this.$modal.closeLoading();
+    //       this.back()
+    //     }
+    //   }).catch(err => {
+    //     this.$modal.closeLoading();
+    //   })
+    // },
     // 增行
-    addLine() {
+    addLine(date) {
+      if (this.isFlag) {
+        date = this.getCurrentTime();
+      }
       const newLine = {
-        contacts: null,
         id: null,
         planId: null,
         planCode: null,
-        date: this.getCurrentTime(),
+        date: date,
         customer: null,
         customerName: null,
         contact: null,
@@ -421,8 +445,6 @@ export default {
         delFlag: 0,
         // 新增字段
         model: null,
-        storageCondition: null,
-        transportationCondition: null,
       }
       this.basicForm.mkBoPlanItemList.push(newLine)
     },
@@ -435,7 +457,7 @@ export default {
         this.$modal.confirm('确认信息').then(() => {
         delPlanItem(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
+            this.$modal.notifySuccess("删除成功");
             this.getDetails(this.row)
           }
         })
@@ -445,11 +467,7 @@ export default {
     delLine(index, row) {
       console.log('删除行:', index)
       console.log('改变行:', row)
-      // this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
-      //   return item.id !== row.id
-      // })
       row.delFlag = '2'
-      // this.basicForm.mkBoPlanItemList.splice(index,1)
       let delList = []
       delList = this.basicForm.mkBoPlanItemList.filter(item => {
         return item.delFlag == '2'
@@ -457,14 +475,16 @@ export default {
       this.basicForm.mkBoPlanItemList = this.basicForm.mkBoPlanItemList.filter(item => {
         return item.delFlag == '0'
       })
-      this.delDemandItemList.push(...delList)
-      console.log('删除的数组',this.delDemandItemList)
+      this.delPlanItemList.push(...delList)
+      console.log('删除的数组',this.delPlanItemList)
     },
     edit() {
-      // this.isList = false
-      // this.page = 'edit'
-      // this.rowDetail = row
-      // this.disable = false
+      this.isFlag = true;
+      this.sonPageStu = 'edit'
+      this.sonDisable = false
+      this.basicForm.mkBoPlanItemList.forEach(item => {
+        item.planCode = this.basicForm.planCode
+      })
     },
     back() {
       this.$emit('jugislist', true)
@@ -474,18 +494,17 @@ export default {
       // }
       this.$emit('refresh')
     },
-    // 单元格标红
-    cellClassName({row, column, rowIndex, columnIndex}) {
-      if(this.basicForm.isSpeical == 'N' && column.label == '需求可用周期' && Number(row.demandPeriod) > 1.5 && Number(row.demandPeriod) > Number(row.minOrderQty)) {
-        return 'success-row';
-      }
+    // 如果需要回显则调用详情接口
+    getDetails(row) {
+      getPlanDetail(row.id).then(res => {
+        if (res.code === 200) {
+          this.basicForm = res.data
+          for (let i = 0; i < this.basicForm.mkBoPlanItemList.length; i++) {
+            this.basicForm.mkBoPlanItemList[i].planCode = res.data.planCode
+          }
+        }
+      })
     },
-    // handleSelectionChange(selection) {
-    //   this.ids = selection.map(item =>{
-    //     return item.id
-    //   })
-    //   console.log('选中数组', this.ids)
-    // },
     handleSelectionChange(selection) {
       console.log('选中', selection)
       this.ids = selection.map(item => item.id)
@@ -494,8 +513,8 @@ export default {
     // 回显参照框
     reBackRefer(type, id, title) {
       getRefer({type: type, id: id}).then(res => {
-        if(type == 'LINKMAN_PARAM') {
-          this.linkOptions = res.rows
+        if(type == 'MK_SALESAREA_PARAM') {
+          this.salesAreaOptions = res.rows
         }
         if (type == 'CUSTOMER_PARAM_ZT') {
           this.customerOptions = res.rows
@@ -503,10 +522,10 @@ export default {
         if (type == 'CONTACTS_PARAM') {
           this.personOptions = res.rows
         }
-        if (type == 'DEPT_PARAM') {
-          this.deptOptions = res.rows
+        if (type == 'LINKMAN_PARAM') {
+          this.linkOptions = res.rows
         }
-        if (type == 'MK_SALESAREA_PARAM') {
+        if (type == 'DEPT_PARAM') {
           this.deptOptions = res.rows
         }
       })
@@ -539,7 +558,7 @@ export default {
         this.basicForm.chargerName = selection[0].name
       }
       if(this.referCondition.type == 'MK_SALESAREA_PARAM') {
-        this.personOptions = selection
+        this.salesAreaOptions = selection
         this.basicForm.marketingArea = selection[0].id
         this.basicForm.marketingAreaName = selection[0].name
       }
@@ -560,16 +579,30 @@ export default {
       return date;
     },
     //获取下周七天日期,day表示想要星期几
-    getWeek(day) {
+    getNextWeek(day) {
       const week = [];
       for (let i = 0; i < 7; i++) {
         let Stamp = new Date();
-        let num = 7-Stamp.getDay() + 1 + i;
+        let num = 7 - Stamp.getDay() + 1 + i;
         Stamp.setDate(Stamp.getDate() + num);
         week[i] = Stamp.getFullYear() + '-' + (Stamp.getMonth() + 1) + '-' + Stamp.getDate();
       }
       return week[day - 1];
-    }
+    },
+    //新增时默认带出num条明细行
+    defaultDetailLine(num) {
+      for (let i = 0; i < num; i++) {
+        this.addLine(this.getNextWeek(i + 1));
+      }
+      this.isFlag = true;
+    },
+    //必选标识
+    addRedStar(h, { column }) {
+      return [
+        h('span', { style: 'color: #F56C6C' }, '*'),
+        h('span', ' ' + column.label)
+      ];
+    },
   }
 }
 
@@ -585,7 +618,7 @@ export default {
 .btn_grooup {
   margin-bottom: 10px;
   display: flex;
-  justify-content: flex-end;
+  justify-content: space-between;
 }
 .hang {
   margin: auto;

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

@@ -172,6 +172,8 @@
         max-height="550"
         style="font-size: 12px;"
         @selection-change="handleSelectionChange"
+        :row-class-name="tableRowClassName"
+        @row-dblclick="getEmpDetail"
         >
           <el-table-column type="selection" align="center" min-width="55" />
           <el-table-column type="index" label="序号" min-width="50" align="center"/>
@@ -192,7 +194,7 @@
               <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
               <el-button type="text" size="mini" v-if="scope.row.state == '0'" @click="edit(scope.row)">编辑</el-button>
               <el-button type="text" size="mini" v-if="scope.row.state == '0'" @click="commit(scope.row)">提交</el-button>
-              <el-button type="text" size="mini" @click="deleteids(scope.row)">删除</el-button>
+              <el-button type="text" size="mini" v-if="scope.row.state == '0'" @click="deleteids(scope.row)">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -202,7 +204,7 @@
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="queryParams.pageNum"
-        :page-sizes="[10, 15, 20]"
+        :page-sizes="[100, 150, 200]"
         :page-size="100"
         layout="total, sizes, prev, pager, next, jumper"
         :total=total>
@@ -356,38 +358,38 @@ export default {
       this.ids = selection.map(item => item.id)
       console.log('选中数组', this.ids.join())
     },
-    mbDownload() {
-      downLoadDemand(this.download).then(res => {
-        console.log('下载的文件流', res)
-        const blob = new Blob([res], {
-          type: "application/vnd.ms-excel;charset=UTF-8",
-        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
-        const downloadElement = document.createElement("a"); //创建a标签
-        const href = window.URL.createObjectURL(blob); // 创建下载的链接
-        // var temp = res.headers["content-disposition"]; 
-        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
-        // var name = fileName.split(";")[0]; //切割成文件名
-        downloadElement.href = href;  //下载地址
-        downloadElement.download = '模板'; // 下载后文件名
-        document.body.appendChild(downloadElement);
-        downloadElement.click(); // 点击下载
-        document.body.removeChild(downloadElement); // 下载完成移除元素
-        window.URL.revokeObjectURL(href); // 释放blob对象
-        this.download.open = false
-      })
-    },
-    // 关闭模板下载弹窗清空参数
-    clearDownload() {
-      // 模板下载参数
-      this.download =  {
-        open: false,
-        customer: '',
-        warehouse: '',
-        warehouseId: '',
-        cargoSpace: '',
-        category: ''
-      }
-    },
+    // mbDownload() {
+    //   downLoadDemand(this.download).then(res => {
+    //     console.log('下载的文件流', res)
+    //     const blob = new Blob([res], {
+    //       type: "application/vnd.ms-excel;charset=UTF-8",
+    //     });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+    //     const downloadElement = document.createElement("a"); //创建a标签
+    //     const href = window.URL.createObjectURL(blob); // 创建下载的链接
+    //     // var temp = res.headers["content-disposition"]; 
+    //     // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+    //     // var name = fileName.split(";")[0]; //切割成文件名
+    //     downloadElement.href = href;  //下载地址
+    //     downloadElement.download = '模板'; // 下载后文件名
+    //     document.body.appendChild(downloadElement);
+    //     downloadElement.click(); // 点击下载
+    //     document.body.removeChild(downloadElement); // 下载完成移除元素
+    //     window.URL.revokeObjectURL(href); // 释放blob对象
+    //     this.download.open = false
+    //   })
+    // },
+    // // 关闭模板下载弹窗清空参数
+    // clearDownload() {
+    //   // 模板下载参数
+    //   this.download =  {
+    //     open: false,
+    //     customer: '',
+    //     warehouse: '',
+    //     warehouseId: '',
+    //     cargoSpace: '',
+    //     category: ''
+    //   }
+    // },
     handleCommand(command) {
       // alert(command)
       if(command == '模板下载') {
@@ -580,6 +582,15 @@ export default {
       this.classOptions.push(selection)
       this.download.category = selection.code
     },
+    tableRowClassName({ row, rowIndex }) {
+      row.index = rowIndex;
+    },
+    getEmpDetail(row, event, column) {
+      let index = row.index;
+      console.log(index) //此时的index就是单选行的下标
+      this.check(row)
+      //this.index = row.index;  也可以直接在data()定义一个值来存放下标
+    },
   }
 }
 </script>

+ 36 - 0
src/views/material/basicFile/columns.js

@@ -24,6 +24,17 @@ export const SearchColumns = [
       referName: "MATERIAL_PARAM",
     },
   },
+  // {
+  //   item: {
+  //     key: "classIds",
+  //     title: "物料分类",
+  //   },
+  //   attr: {
+  //     is: "el-popover-tree-select",
+  //     referName: "MATERIALCLASSIFY_PARAM",
+  //     valueKey: "id",
+  //   },
+  // },
   {
     item:{
       key: "isEnable",
@@ -37,6 +48,31 @@ export const SearchColumns = [
   },
   {
     item:{
+      key: "puPersonnelIdName",
+      title: "采购员",
+    },
+    attr: {
+      clearable:true,
+      is: "el-popover-select-v2",
+      referName: "CONTACTS_PARAM",
+      valueKey: "name",
+      dataMapping: {
+        puPersonnelId: "code",
+      },
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "注册人/上市许可持有人",
+    },
+    attr: {
+      clearable:true,
+      is: "el-input",
+    },
+  },
+  {
+    item:{
       key: "isSync",
       title: "是否同步NC",  
     },

+ 7 - 2
src/views/material/basicFile/details.vue

@@ -517,8 +517,8 @@
     <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
       <span>是否确认{{ optionDialog.op }}?</span>
       <span slot="footer">
-        <el-button @click="handleOptionCancal">取 消</el-button>
         <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
+        <el-button @click="handleOptionCancal">取 消</el-button>
       </span>
     </el-dialog>
 
@@ -696,6 +696,7 @@
             v-loading="MoreDataDialog.loading" 
             style="width: 100%"
             @row-click="handleCurentRow" 
+            @row-dblclick="handleDbClick"
             highlight-current-row
           >
             <el-table-column type="index" label="序号" width="55" align="center"/>
@@ -715,8 +716,8 @@
 
         <!-- 按钮 -->
         <el-row class="more-button">
-          <el-button round size="small" @click="handleConcalRefer">取消</el-button>
           <el-button round size="small" type="primary" @click="handleConfirmRefer">确认</el-button>
+          <el-button round size="small" @click="handleConcalRefer">取消</el-button>
         </el-row>
       </div>
     </el-dialog>
@@ -2064,6 +2065,10 @@
         console.log(row, '修改-更多数据表格——选择行');
         this.MoreDataDialog.value = row;
       },
+      handleDbClick(row){
+        this.MoreDataDialog.value = row;
+        this.handleConfirmRefer();
+      },
       // 参照弹窗确认
       handleConfirmRefer() {
 

+ 2 - 2
src/views/material/basicFile/index.vue

@@ -6,7 +6,6 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
       <el-super-search
@@ -606,7 +605,7 @@
           vm.queryForm = vm.$store.state.query.queryVlue;
           // 清空选中数据
           vm.checkedList = [];
-          vm.$refs.materialTable.clearSelection();
+          vm.$refs.materialTable &&vm.$refs.materialTable.clearSelection();
         }
         vm.getTagList('material');
         vm.getMaterialList('material');
@@ -634,6 +633,7 @@
     .el-card__body {
       height: 100%;
       box-sizing: border-box;
+      padding: 10px;
 
       .el-table {
         overflow: auto;

+ 1 - 1
src/views/material/basicFile/style/index.scss

@@ -9,7 +9,7 @@
   }
 
   .el-card{
-    overflow: auto;
+    // overflow: auto;
     box-sizing: border-box;
   }
 

+ 22 - 17
src/views/material/requisition/add.vue

@@ -1,5 +1,21 @@
 <template>
   <div class="requisition_add">
+
+    <el-row type="flex" justify="end" style="margin-bottom: 16px;">
+      <el-col :span="1.5">
+        <el-button type="primary" :size="size" plain @click="save"
+                   v-if="pageStu == 'add' || pageStu == 'edit' || pageStu ==='copy' ">保存
+        </el-button>
+      </el-col>
+      <el-col :span="1.5" style="margin: 0 10px;">
+        <el-button type="primary" :size="size" plain @click="submit"
+                   v-if="pageStu == 'check' && (row.status == '0' || row.status == '3')">提交
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" :size="size" plain @click="back">返回</el-button>
+      </el-col>
+    </el-row>
     <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
       <el-tab-pane label="基本信息" name="first">
         <div style="width: 100%;height: 680px;overflow-y: auto; overflow-x: hidden;">
@@ -519,8 +535,8 @@
         <span>物料类别</span>
         </el-row> -->
         <el-row style="margin-bottom: 12px;">
-          <el-button :disabled="disable" type="primary" size="small" plain @click="addLine">新增</el-button>
-          <el-button :disabled="disable" type="primary" size="small" plain @click="handleDelete">删除</el-button>
+          <el-button :disabled="disable" type="primary" :size="size" plain @click="addLine">新增</el-button>
+          <el-button :disabled="disable" type="primary" :size="size" plain @click="handleDelete">删除</el-button>
           <!-- <el-button :disabled="disable || isControl" type="primary" size="small" plain @click="testsave">暂存</el-button> -->
         </el-row>
         <el-row>
@@ -611,21 +627,7 @@
       </el-tab-pane>
     </el-tabs>
 
-    <div class="btn_group">
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="save"
-                   v-if="pageStu == 'add' || pageStu == 'edit' || pageStu ==='copy' ">保存
-        </el-button>
-      </el-col>
-      <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit"
-                   v-if="pageStu == 'check' && (row.status == '0' || row.status == '3')">提交
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="back">返回</el-button>
-      </el-col>
-    </div>
+    
 
     <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
 
@@ -708,6 +710,7 @@
     },
     data() {
       return {
+        size:'mini',
         testOptions: [],
         factoryOptions: [],
         unitOptions: [],
@@ -1241,6 +1244,8 @@
 
               this.basicForm.diCode = '';
 
+              this.basicForm.healthCode = '';
+
               this.basicForm.status = '0';
 
               this.basicForm.sysMaterialMedcineApply.id = '';

+ 72 - 0
src/views/material/requisition/columns.js

@@ -0,0 +1,72 @@
+
+
+ export const TableColumns = [
+    { item: { key: "orgName", title: "所属组织" ,width:150,}, attr: {} },
+    { item: { key: "billCode", title: "单据编码" }, attr: {} },
+   
+    { item: { key: "status", title: "单据状态",width:120, }, 
+      attr: {
+        
+        is: "el-dict-tag",
+        dictName: "documents_status", // 字典名
+      } 
+    },
+    {
+      item: { key: "createName", title: "申请人",width:150, },
+      attr: { },
+    },
+    { item: { key: "createTime", title: "申请时间",width:150, }, attr: {} },
+    { 
+      item: { key: "name", title: "物料名称" }, 
+      attr: {} 
+    },
+    // { 
+    //   item: { key: "materialCode", title: "物料编码" }, 
+    //   attr: {
+   
+    //   } 
+    // },
+    { item: { key: "createName", title: "创建人" ,width:150, }, attr: {} },
+    { item: { key: "createTime", title: "创建时间" ,width:150,}, attr: {} },
+    {
+      item: { key: "updateName", title: "最后修改人" ,width:150, },
+      attr: {  },
+    },
+    { item: { key: "updateTime", title: "最后修改时间" ,width:150,}, attr: {} },
+   
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, fixed: false },
+  }));
+
+ export const SearchColumns = [
+    {
+      item: { key: "billCode", title: "单据编码" },
+      attr: {
+        is: "el-input",
+        clearable:true,
+      },
+    },
+    {
+      item: { key: "name", title: "物料名称" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MATERIAL_PARAM",
+        valueKey: "name",
+        clearable:true,
+      },
+    },
+    {
+      item: { key: "status", title: "单据状态" },
+      attr: {
+        is: "el-select",
+        dictName: "documents_status",
+        clearable: true,
+      },
+    },
+  
+  ].map(({ item, attr }) => ({
+    attr,
+    item: { ...item, hidden: true, span: item.span || 6 },
+  }));
+

+ 411 - 0
src/views/material/requisition/index copy.vue

@@ -0,0 +1,411 @@
+<template>
+  <div class="requisition" v-loading="failLoad">
+    <div class="applyList" v-if="isList">
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
+          <el-input
+            v-model="queryParams.billCode"
+            size="small"
+            placeholder="请输入单据编码查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
+
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
+          <el-input
+            v-model="queryParams.name"
+            size="small"
+            placeholder="请输入物料名称查询"
+            clearable
+            style="width: 240px"
+          />
+        </el-col>
+
+        <el-col :span="1.5">
+          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
+          <el-select
+            v-model="queryParams.status"
+            size="small"
+            placeholder="请选择单据状态"
+            clearable
+            style="width: 240px">
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+        </el-col>
+
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
+        </el-col>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>高级查询</el-button>
+        </el-col> -->
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
+        </el-col>
+
+      </el-row>
+
+      <el-row :gutter="10" class="mb10">
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain
+                     @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
+          </el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="small" @click="handleImport">批量导入</el-button>
+        </el-col>
+        <!-- 导入弹窗 -->
+        <el-dialog 
+          title="批量导入" 
+          :visible.sync="importData.show" 
+          width="35%" 
+          center
+          :before-close="handlefileDialogColse"
+        >
+          <div class="mb-import">
+            <el-upload 
+              accept=".xls, .xlsx" 
+              ref="upload" 
+              action="#" 
+              :on-remove="handleFileRemove"
+              :file-list="importData.list" 
+              :auto-upload="false" 
+              :on-change="handleChangeFile" 
+              :limit="1"
+              style="text-align: center;"
+            >
+              <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+              <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
+            </el-upload>
+
+          </div>
+          <span slot="footer">
+        <el-button @click="handleImportData('cancal')">取 消</el-button>
+        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
+      </span>
+        </el-dialog>
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导入</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>导出</el-button>
+        </el-col> -->
+        <!-- <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量提交</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button type="primary" size="small" plain>批量删除</el-button>
+        </el-col> -->
+      </el-row>
+
+      <el-card>
+        <el-table
+          :data="tableList"
+          class="request-table"
+          fit
+          max-height="680"
+          @selection-change="handleSelectionChange"
+          @select="handleSelect"
+        >
+          <el-table-column type="selection" width="45"></el-table-column>
+          <el-table-column label="序号" align="center" type="index" width="50"/>
+          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
+          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
+          <el-table-column label="申请人" align="center" prop="createName"/>
+          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
+          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
+          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
+          <el-table-column label="创建人" align="center" prop="createName"/>
+          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
+          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
+          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            align="center"
+            width="180"
+          >
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
+              <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
+                         size="small">编辑
+              </el-button>
+              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
+              <el-button type="text" size="small" @click="deleteRow(scope.row)"
+                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :page-sizes="[5, 10, 15, 20]"
+          :page-size=queryParams.pageSize
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          style="text-align: center;">
+        </el-pagination>
+      </el-card>
+    </div>
+
+    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
+               v-if="!isList"/>
+  </div>
+</template>
+
+<script>
+  import addReq from './add.vue';
+  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {saveAs} from "file-saver";
+  import { blobValidate } from "@/utils/ruoyi";
+
+  export default {
+    name: 'requisition',
+    components: {
+      addReq
+    },
+    data() {
+      return {
+        failLoad: false,
+        tableList: [],
+        queryParams: {
+          billCode: '',
+          name: '',
+          status: '',
+          pageNum: 1,
+          pageSize: 10
+        },
+        options: [{
+          value: 0, label: '未提交'
+        }, {
+          value: 1, label: '审批中'
+        }, {
+          value: 2, label: '已完成'
+        }, {
+          value: 3, label: '已驳回'
+        },],
+        total: 0,
+        // isComponent
+        isComponent: 'addReq',
+        isList: true,
+        // 页面状态
+        page: '',
+        rowDetail: {},
+        disable: false,
+        checkedList: [],
+        importData: {
+          show: false,
+          list: []
+        },
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      this.getList(this.queryParams)
+    },
+    methods: {
+      reset() {
+        this.queryParams.billCode = ''
+        this.queryParams.name = ''
+        this.queryParams.status = ''
+        this.queryParams.pageNum = 1
+        this.getList(this.queryParams)
+      },
+      newAdd() {
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'add'
+        this.disable = false
+      },
+      // 复制
+      handleCopy() {
+        this.isList = false;
+        this.isComponent = 'addReq';
+        this.page = 'copy';
+        this.rowDetail = this.checkedList[0];
+        this.disable = false;
+      },
+      // 导入
+      handleImport() {
+        this.importData.show = true
+      },
+      // 删除文件
+      handleFileRemove(file, fileList) {
+        console.log('删除文件', file, 'file', fileList, 'fileList');
+        this.importData.list = fileList;
+      },
+      // 文件发生改变
+      handleChangeFile(file, fileList) {
+        this.importData.list = fileList;
+      },
+      // 导入弹窗操作
+      handleImportData(type) {
+        switch (type) {
+          // 取消
+          case 'cancal':
+            this.importData.list = [];
+            this.importData.show = false;
+            break;
+          // 确认
+          case 'confirm':
+            if (this.importData.list.length) {
+
+              let formData = new FormData();
+
+              formData.append('file', this.importData.list[0].raw);
+              importData(formData).then(res => {
+                if (res.code == 200) {
+                  this.importData.show = false;
+                  this.importData.list = [];
+                  if (res.data.flag) {
+                    this.failLoad = true;
+                    console.log(res.data.datas)
+                    let param = {failDatas: res.data.datas}
+                    if (null != param) {
+
+                      fileImport(param).then(res => {
+                        console.log('res',res)
+                        const isBlob = blobValidate(res);
+                        if (isBlob) {
+                          const blob = new Blob([res]);
+                          saveAs(blob, '导入失败的物料申请单数据.xlsx');
+                        }
+                        this.failLoad = false;
+                      })
+                    }
+                  }
+                  this.$message({
+                    message: res.data.msg,
+                    type: res.data.flag ? 'warning' : 'success'
+                  });
+                } else {
+                  this.$message({
+                    message: res.msg,
+                    type: res.code == 200 ? 'success' : 'warning'
+                  });
+                }
+              })
+            } else {
+              this.$message({
+                message: '请上传文件之后在确认!',
+                type: 'warning'
+              });
+            }
+            break;
+        }
+      },
+      handlefileDialogColse(done){
+        this.importData.list = [];
+        done();
+      },
+      // Select框
+      handleSelect(selection, row) {
+
+        this.checkedList = selection;
+
+        console.log(this.checkedList, 'this.checkedList');
+
+      },
+      getList(val) {
+        console.log('val', val)
+        getReqList(val).then(res => {
+          if (res.code === 200) {
+            this.tableList = res.rows
+            this.total = res.total
+          }
+        })
+        this.checkedList = [];
+      },
+      // 表格内状态栏判断值
+      statusJug(row) {
+        if (row.status == 0) {
+          return '未提交'
+        } else if (row.status == 1) {
+          return '审批中'
+        } else if (row.status == 2) {
+          return '已完成'
+        } else if (row.status == 3) {
+          return '已驳回'
+        }
+      },
+      //
+      handleSelectionChange() {
+
+      },
+      check(row) {
+        console.log('查看详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'check'
+        this.rowDetail = row
+        this.disable = true
+      },
+      edit(row) {
+        console.log('修改先加载详情', row)
+        this.isList = false
+        this.isComponent = 'addReq'
+        this.page = 'edit'
+        this.rowDetail = row
+        this.disable = false
+      },
+      commit(row) {
+        console.log('row', row)
+      },
+      deleteRow(row) {
+        this.$confirm('是否删除此条数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delReq(row.id).then(res => {
+            if (res.code === 200) {
+              this.$message({
+                message: res.msg,
+                type: 'success'
+              });
+              this.getList(this.queryParams)
+            }
+          })
+        }).catch(() => {
+        })
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+        this.queryParams.pageSize = val
+        this.getList(this.queryParams)
+      },
+      handleCurrentChange(val) {
+        console.log(`当前页: ${val}`);
+        this.queryParams.pageNum = val
+        this.getList(this.queryParams)
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .requisition {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+  }
+</style>

+ 113 - 121
src/views/material/requisition/index.vue

@@ -1,82 +1,57 @@
 <template>
   <div class="requisition" v-loading="failLoad">
     <div class="applyList" v-if="isList">
-      <el-row :gutter="10" class="mb10">
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据编码</span>
-          <el-input
-            v-model="queryParams.billCode"
-            size="small"
-            placeholder="请输入单据编码查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
-
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
-          <el-input
-            v-model="queryParams.name"
-            size="small"
-            placeholder="请输入物料名称查询"
-            clearable
-            style="width: 240px"
-          />
-        </el-col>
-
-        <el-col :span="1.5">
-          <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
-          <el-select
-            v-model="queryParams.status"
-            size="small"
-            placeholder="请选择单据状态"
-            clearable
-            style="width: 240px">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value">
-            </el-option>
-          </el-select>
-        </el-col>
-
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
-        </el-col>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>高级查询</el-button>
-        </el-col> -->
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="reset">重置</el-button>
-        </el-col>
+     
+      <el-card>
 
-      </el-row>
+        <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="reset"
+        @submit="getList"
+      ></el-super-search>
 
-      <el-row :gutter="10" class="mb10">
+      <el-row :gutter="10" class="mb10" type="flex" justify="end" style="margin-top: 15px;">
         <el-col :span="1.5">
-          <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
+          <el-button type="primary" :size="size" plain @click="newAdd">新增</el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+          <el-button :size="size" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button type="primary" size="small" plain
+          <el-button type="primary" :size="size" plain
                      @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载
           </el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button size="small" @click="handleImport">批量导入</el-button>
+          <el-button :size="size" @click="handleImport">批量导入</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <!-- <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button> -->
         </el-col>
         <!-- 导入弹窗 -->
-        <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center
-                   :before-close="handlefileDialogColse">
+        <el-dialog 
+          title="批量导入" 
+          :visible.sync="importData.show" 
+          width="35%" 
+          center
+          :before-close="handlefileDialogColse"
+        >
           <div class="mb-import">
-            <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
-                       :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
+            <el-upload 
+              accept=".xls, .xlsx" 
+              ref="upload" 
+              action="#" 
+              :on-remove="handleFileRemove"
+              :file-list="importData.list" 
+              :auto-upload="false" 
+              :on-change="handleChangeFile" 
+              :limit="1"
+              style="text-align: center;"
+            >
               <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-              <el-button style="margin-left: 10px;" size="small" type="success" @click="handleDownTemplate">下载模板
-              </el-button>
               <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
             </el-upload>
 
@@ -86,75 +61,56 @@
         <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
       </span>
         </el-dialog>
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导入</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>导出</el-button>
-        </el-col> -->
-        <!-- <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量提交</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button type="primary" size="small" plain>批量删除</el-button>
-        </el-col> -->
       </el-row>
 
-      <el-card>
-        <el-table
-          :data="tableList"
-          class="request-table"
-          fit
-          max-height="680"
+      <div style="height: 600px;display: flex;">
+        <el-super-table
+          v-model="tableList"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          pagination
+          index
+          checkbox
+          convenitentOperation
+          :page="pageStatus"
+          @pagination="getList"
+          @row-dblclick="check"
           @selection-change="handleSelectionChange"
           @select="handleSelect"
         >
-          <el-table-column type="selection" width="45"></el-table-column>
-          <el-table-column label="序号" align="center" type="index" width="50"/>
-          <el-table-column label="所属组织" align="center" width="200" prop="orgName"/>
-          <el-table-column label="单据编码" align="center" width="200" prop="billCode"/>
-          <el-table-column label="申请人" align="center" prop="createName"/>
-          <el-table-column label="申请时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug"/>
-          <!-- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" /> -->
-          <el-table-column label="物料名称" align="center" width="150" prop="name"/>
-          <el-table-column label="创建人" align="center" prop="createName"/>
-          <el-table-column label="创建时间" align="center" width="150" prop="createTime"/>
-          <el-table-column label="最后修改人" align="center" width="120" prop="updateName"/>
-          <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime"/>
           <el-table-column
             fixed="right"
             label="操作"
             align="center"
-            width="180"
+            width="120"
           >
             <template slot-scope="scope">
-              <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
+              <el-button type="text" :size="size" @click="check(scope.row)">查看</el-button>
               <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text"
-                         size="small">编辑
+                        :size="size">编辑
               </el-button>
-              <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
-              <el-button type="text" size="small" @click="deleteRow(scope.row)"
-                         v-if="scope.row.status == 0 || scope.row.status == 3">删除
+              <el-button type="text" :size="size" @click="deleteRow(scope.row)"
+                        v-if="scope.row.status == 0 || scope.row.status == 3">删除
               </el-button>
             </template>
           </el-table-column>
-        </el-table>
+        </el-super-table>
+      </div>
+       
 
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :page-sizes="[5, 10, 15, 20]"
-          :page-size=queryParams.pageSize
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          style="text-align: center;">
-        </el-pagination>
       </el-card>
     </div>
 
-    <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"
-               v-if="!isList"/>
+    <component 
+      :is="isComponent" 
+      v-model="isList" 
+      :pageStu="page" 
+      :disable="disable" 
+      :row="rowDetail" 
+      @refresh="getList"
+      v-if="!isList
+    "/>
   </div>
 </template>
 
@@ -163,16 +119,28 @@
   import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
+  import { SearchColumns, TableColumns } from './columns';
+  import { initDicts } from "@/utils/init.js";
+
 
   export default {
     name: 'requisition',
+    dicts:[...initDicts([...SearchColumns,...TableColumns])],
     components: {
-      addReq
+      addReq,
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
     },
     data() {
+      const params = this.$init.params(SearchColumns);
       return {
         failLoad: false,
         tableList: [],
+        size:'mini',
+        params:params,
+        SearchColumns:SearchColumns,
+        TableColumns:TableColumns,
+        pageStatus: { pageNum: 1, pageSize: 10, total: 0 },
         queryParams: {
           billCode: '',
           name: '',
@@ -211,11 +179,29 @@
       this.getList(this.queryParams)
     },
     methods: {
+      // 批量提交
+      handleBatchSubmit(){
+        let filterList = this.checkedList.filter(item => (item.status ==='0' ||item.status ==='3') )
+        
+        console.log(filterList,'filterList');
+        if(filterList.length){  
+
+
+        }else{
+          this.$notify.warning({
+            title: '警告',
+            message: '存在不符合提交条件数据或未选择数据!',
+          });
+        }
+      },
       reset() {
-        this.queryParams.billCode = ''
-        this.queryParams.name = ''
-        this.queryParams.status = ''
-        this.queryParams.pageNum = 1
+        // this.queryParams.billCode = ''
+        // this.queryParams.name = ''
+        // this.queryParams.status = ''
+        // this.queryParams.pageNum = 1
+        this.pageStatus.pageNum = 1;
+        this.pageStatus.pageSize = 10;
+        this.params = this.$init.params(SearchColumns);
         this.getList(this.queryParams)
       },
       newAdd() {
@@ -301,6 +287,10 @@
             break;
         }
       },
+      handlefileDialogColse(done){
+        this.importData.list = [];
+        done();
+      },
       // Select框
       handleSelect(selection, row) {
 
@@ -311,10 +301,12 @@
       },
       getList(val) {
         console.log('val', val)
-        getReqList(val).then(res => {
+        
+        getReqList({...this.params,...this.pageStatus}).then(res => {
           if (res.code === 200) {
-            this.tableList = res.rows
-            this.total = res.total
+            this.tableList = res.rows;
+            // this.total = res.total;
+            this.pageStatus.total = res.total;
           }
         })
         this.checkedList = [];
@@ -332,8 +324,8 @@
         }
       },
       //
-      handleSelectionChange() {
-
+      handleSelectionChange(selection) {
+        this.checkedList = selection;
       },
       check(row) {
         console.log('查看详情', row)
@@ -388,7 +380,7 @@
 
 <style scoped lang="scss">
   .requisition {
-    height: calc(100vh - 84px);
+    // height: calc(100vh - 84px);
     padding: 12px;
     box-sizing: border-box;
   }

+ 4 - 3
src/views/purchase/DemandSummary/index.vue

@@ -45,8 +45,8 @@
             <!-- <el-col :span="1.5"> -->
               <!-- <el-form-item label="" label-width="20px"> -->
                 <div style="position: absolute;top: 3px;right: 10px;">
-                  <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
-                  <el-button size="mini" icon="el-icon-refresh" plain @click="reset">重置</el-button>
+                  <el-button type="primary" size="mini" @click="search">搜索</el-button>
+                  <el-button size="mini" plain @click="reset">重置</el-button>
                 </div>
               <!-- </el-form-item> -->
             <!-- </el-col> -->
@@ -343,7 +343,7 @@
 
     <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
 
-    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
   </div>
 </template>
 
@@ -781,6 +781,7 @@ export default {
       this.$refs.materialRefer.init()
     },
     selectMaterial(selection) {
+      console.log('选择的物料', selection)
       this.queryParams.materialCode = selection[0].code
       this.queryParams.names = selection[0].name
     },

+ 2 - 2
src/views/purchase/MaterialClassDivision/index.vue

@@ -47,8 +47,8 @@
           <!-- <el-col :span="1.5"> -->
             <!-- <el-form-item label="" label-width="20px"> -->
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
             <!-- </el-form-item> -->
           <!-- </el-col> -->

+ 66 - 15
src/views/purchase/PurchaseDemandList/add.vue

@@ -110,7 +110,7 @@
         </el-col> -->
 
         <el-col :span="1.5">
-          <el-form-item label="编码">
+          <el-form-item label="需求单号">
             <el-input
               v-model="basicForm.code"
               size="mini"
@@ -235,8 +235,8 @@
           <el-table-column show-overflow-tooltip label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
-                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')">
+                  <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseCangKu(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库', scope.row.puOrg)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -244,7 +244,7 @@
           <el-table-column show-overflow-tooltip label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')">
                   <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
@@ -362,7 +362,7 @@
           <el-table-column show-overflow-tooltip label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
+                <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @paste.native="pasteMe($event, scope, scope.$index)">
                   <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
@@ -484,7 +484,7 @@
       <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">收货地址</el-col>
         <el-col :span="14">
-          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.deliveryAddressName" @focus="chooseOrg('ADDRESS_PARAM', true, '收货地址')">
+          <el-input class="pltzIpt" clearable size="mini" v-model="adjust.deliveryAddressName">
             <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ADDRESS_PARAM', true, '收货地址')"></el-button>
           </el-input>
         </el-col>
@@ -899,7 +899,7 @@ export default {
     },
     handleData() {
       console.log('222')
-      // 复制新增把id,编码,创建人置为空,子表去掉id
+      // 复制新增把id,需求单号,创建人置为空,子表去掉id
       this.basicForm.id = ''
       this.basicForm.code = ''
       this.basicForm.createBy = ''
@@ -1213,7 +1213,7 @@ export default {
       })
 
       if (rows.length < 100) {
-
+        // 粘贴物料编码
         if(scope.column.property == 'materialCode') {
           await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
             this.$modal.closeLoading();
@@ -1265,7 +1265,7 @@ export default {
           }).catch(err => {
             this.$modal.closeLoading();
           })
-
+        // 粘贴实际业务需求量
         }else if(scope.column.property == 'qty') {
           console.log('复制内容:', rows)
           let newLine = []
@@ -1291,7 +1291,7 @@ export default {
             this.$refs.table.doLayout()
             this.$modal.closeLoading();
           }
-
+        // 粘贴补单供应商
         }else if(scope.column.property == 'additionalSupplierName') {
           await getRefer({ type: 'SUPPLIER_PARAM', searchList: rows }).then(res => {
             this.$modal.closeLoading();
@@ -1309,7 +1309,6 @@ export default {
                 newLine.push(line)
                 console.log('临时数组', newLine)
               }
-
               if(this.basicForm.puDemandItemList.length <= 1) {
                 // 删除指定下标
                 this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
@@ -1322,7 +1321,47 @@ export default {
                 this.$refs.table.doLayout()
                 this.$modal.closeLoading();
               }
-
+            }
+          }).then(() => {
+            this.$refs.table.doLayout()
+          }).catch(err => {
+            this.$modal.closeLoading();
+          })
+        }else if(scope.column.property == 'deliveryAddressName') {
+          await getRefer({ type: 'ADDRESS_PARAM', searchList: rows }).then(res => {
+           this.$modal.closeLoading();
+            if (res.code === 200) {
+              let rowList = res.rows
+              let newLine = []
+              for (let i = 0; i<rowList.length; i++) {
+                let line = {...this.sonModel}
+                line.isUrgency = (this.basicForm.billType == 'JJXQ' ? 'Y' : 'N')
+                line.isReplenishment = (this.basicForm.billType == 'BDXQ' ? 'Y' : 'N')
+                line.demandCustomer = this.basicForm.customer
+                line.demandCustomerName = this.basicForm.customerName
+                line.deliveryAddressName = rowList[i].name
+                line.deliveryAddress = rowList[i].code
+                line.contacts = rowList[i].contactsName
+                line.contactsPhone = rowList[i].contactsPhone
+                line.address = rowList[i].address
+                newLine.push(line)
+                console.log('临时数组', newLine)
+              }
+              if(this.basicForm.puDemandItemList.length <= 1) {
+                // 删除指定下标
+                this.basicForm.puDemandItemList.splice(index,this.basicForm.puDemandItemList.length - index,...newLine)
+                this.$modal.notifySuccess("共粘贴" + rowList.length + '条数据');
+              } else {
+                for(let i = index , j = 0; i < this.basicForm.puDemandItemList.length; i++, j++) {
+                  this.basicForm.puDemandItemList[i].deliveryAddressName = newLine[j].deliveryAddressName
+                  this.basicForm.puDemandItemList[i].deliveryAddress = newLine[j].deliveryAddress
+                  this.basicForm.puDemandItemList[i].contacts = newLine[j].contacts
+                  this.basicForm.puDemandItemList[i].contactsPhone = newLine[j].contactsPhone
+                  this.basicForm.puDemandItemList[i].address = newLine[j].address
+                }
+                this.$refs.table.doLayout()
+                this.$modal.closeLoading();
+              }
             }
           }).then(() => {
             this.$refs.table.doLayout()
@@ -1331,7 +1370,6 @@ export default {
           })
         }
 
-
       } else {
         this.$modal.notifyWarning("复制长度不能超过100!");
         this.$modal.closeLoading();
@@ -1466,7 +1504,7 @@ export default {
         // this.basicForm.puDemandItemList.splice(this.tableIndex,1)
       }
     },
-    // 明细行选择业务部门参照带出业务部门数据
+    // 明细行选择参照
     chooseDept(index, type, isPage, title) {
       this.tableIndex = index
       this.referCondition.type = type
@@ -1474,7 +1512,20 @@ export default {
       this.referCondition.title = title
       this.$refs.refer.init(this.referCondition)
     },
-    // 明细行选择业务部门参照带出业务部门数据
+    // 明细行选择仓库需要先确认采购组织
+    chooseCangKu(index, type, isPage, title, pkOrg) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      if(pkOrg) {
+        this.referCondition.pkOrg = pkOrg
+        this.$refs.refer.init(this.referCondition)
+      } else {
+        this.$modal.notifyWarning("请先确认默认采购组织");
+      }
+    },
+    // 明细行选择货位先确认仓库
     choosehuoWei(index, type, isPage, title, stordocId) {
       this.tableIndex = index
       this.referCondition.type = type

+ 4 - 4
src/views/purchase/PurchaseDemandList/index.vue

@@ -5,7 +5,7 @@
         <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="单据编码">
+              <el-form-item label="需求单号">
                 <el-input
                   v-model.trim="queryParams.code"
                   size="mini"
@@ -43,8 +43,8 @@
             <!-- <el-col :span="1.5"> -->
               <!-- <el-form-item label="" label-width="20px"> -->
                 <div style="position: absolute;top: 3px;right: 10px;">
-                  <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-                  <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+                  <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+                  <el-button size="mini" plain @click="resetList">重置</el-button>
                 </div>
               <!-- </el-form-item> -->
             <!-- </el-col> -->
@@ -177,7 +177,7 @@
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" fixed="left"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center" width="50px" fixed="left"/>
-          <el-table-column show-overflow-tooltip label="编码" align="center" width="170" prop="code"/>
+          <el-table-column show-overflow-tooltip label="需求单号" align="center" width="170" prop="code"/>
           <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
           <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="120" prop="approverFinishTime"/>
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>

+ 1 - 2
src/views/purchase/apply/index.vue

@@ -103,8 +103,7 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button :size="size" :dict="dict" @success="useQuery(params, page)">
-        </add-button>
+        <add-button :size="size" :dict="dict" @success="useQuery(params, page)"></add-button>
         <copy-button
           :size="size"
           :dict="dict"

+ 2 - 2
src/views/purchase/deliveryAddress/index.vue

@@ -42,8 +42,8 @@
           <!-- <el-col :span="1.5"> -->
             <!-- <el-form-item label="" label-width="20px"> -->
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
             <!-- </el-form-item> -->
           <!-- </el-col> -->

+ 15 - 15
src/views/purchase/purchase-order/add/column.js

@@ -156,7 +156,7 @@ export const Columns = [
     title: "价税合计", 
     inputType: "InputNumber",
     controlsPosition: "right", 
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -165,7 +165,7 @@ export const Columns = [
     title: "原始总金额", 
     inputType: "InputNumber",
     controlsPosition: "right", 
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -174,7 +174,7 @@ export const Columns = [
     title: "无税金额", 
     inputType: "InputNumber",  
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     disabled:true,
   },
@@ -236,7 +236,7 @@ export const Columns = [
     title: "订单使用返利金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     require: true,
   },
@@ -245,7 +245,7 @@ export const Columns = [
     title: "订单抵扣余款金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true, 
     require: true,
   },
@@ -371,7 +371,7 @@ export const Columns = [
     title: "累计付款申请金额", 
     inputType: "InputNumber", 
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
     disabled:true,
   },
@@ -380,7 +380,7 @@ export const Columns = [
     title: "累计付款金额", 
     inputType: "InputNumber", 
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
   },
   { 
@@ -388,7 +388,7 @@ export const Columns = [
     title: "发票金额", 
     inputType: "InputNumber",
     controlsPosition: "right",
-    precision:2,
+    // precision:2,
     isShow:true,
    },
   {
@@ -669,7 +669,7 @@ export const TabColumns = [
         title: "含税单价", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         require: true,
         disabled:true,
         width: 180,
@@ -679,7 +679,7 @@ export const TabColumns = [
         title: "价税合计", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
        },
@@ -689,7 +689,7 @@ export const TabColumns = [
         // inputType: "Input",
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -698,7 +698,7 @@ export const TabColumns = [
         title: "折扣金额", 
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
        },
@@ -723,7 +723,7 @@ export const TabColumns = [
         title: "无税单价",
         inputType: "InputNumber",
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -732,7 +732,7 @@ export const TabColumns = [
         title: "无税金额", 
         inputType: "InputNumber", 
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },
@@ -835,7 +835,7 @@ export const TabColumns = [
         title: "原始金额", 
         inputType: "InputNumber", 
         controlsPosition: "right",
-        precision:2,
+        // precision:2,
         disabled:true,
         width: 180,
       },

+ 10 - 3
src/views/purchase/purchase-order/index.vue

@@ -308,6 +308,8 @@ export default {
 
         this.handleConfirmTips(async()=>{
 
+          this.loading = true;
+
           let { code } = await orderApi.submit({ puOrderIds});
 
           if (code == 200) {
@@ -318,6 +320,9 @@ export default {
 
         })
       } catch (error) {} 
+      finally{
+        this.loading = false;
+      }
     },
 
     // 判断“整单退回”按钮
@@ -662,7 +667,10 @@ export default {
           :disabled="judgeIsLineReturn()"
         >行退回</el-button>
       </el-row>
-      <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px;height: 1000px;">
+      <el-tabs 
+        v-model="tabName" 
+        @tab-click="handleTabClick" 
+        style="width: 100%;padding: 20px 10px;">
         <el-tab-pane 
           v-for="(column, index) in tabColumns" 
           :key="index" 
@@ -670,10 +678,9 @@ export default {
           :name="column.key"
         >
           <el-super-table
-            style="padding: 20px 10px;height: 800px;"
+            style="height: 300px;"
             v-model="tabTableDatas[column.key]"
             :ref="column.key"
-            max-height="500"
             :dict="dict"
             :columns="column.tableColumns"
             :selectable="setTabSelectable"

+ 5 - 5
src/views/purchase/transferOrder/add.vue

@@ -1902,11 +1902,11 @@ export default {
       }
     },
 
-    chooseRefer(type, isPage, title, drpOrg, isDirectStore, gubFlag) {
+    chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.drpOrg = drpOrg;
+      this.referCondition.pkOrg = pkOrg;
       this.referCondition.isDirectStore = isDirectStore;
       this.referCondition.gubFlag = gubFlag;
       this.$refs.refer.init(this.referCondition);
@@ -2105,17 +2105,17 @@ export default {
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.drpOrg = "";
+      this.referCondition.pkOrg = "";
       this.referCondition.stordocId = stordocId;
       this.$refs.refer.init(this.referCondition);
     },
     // 明细行选择调入部门
-    chooseMxBM(index, type, isPage, title, drpOrg) {
+    chooseMxBM(index, type, isPage, title, pkOrg) {
       this.tableIndex = index;
       this.referCondition.type = type;
       this.referCondition.isPage = isPage;
       this.referCondition.title = title;
-      this.referCondition.drpOrg = drpOrg;
+      this.referCondition.pkOrg = pkOrg;
       this.$refs.refer.init(this.referCondition);
     },
     // 选择框彻底清空

+ 2 - 2
src/views/purchase/transferOrder/index.vue

@@ -39,8 +39,8 @@
               </el-form-item>
             </el-col>
             <div style="position: absolute;top: 3px;right: 10px;">
-              <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
-              <el-button size="mini" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+              <el-button size="mini" plain @click="resetList">重置</el-button>
             </div>
           </el-row>
 

+ 2 - 1
vue.config.js

@@ -47,7 +47,8 @@ module.exports = {
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
         // target: `http://172.16.13.43:8000/drp-admin`, //lz's localhost
-        //  target: `http://127.0.0.1:8000/drp-admin`,
+        // target: `http://172.16.63.52:8000/drp-admin`, //董卓
+         // target: `http://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",