Explorar o código

Merge remote-tracking branch 'origin/purchaseDev' into purchaseDev

002637 hai 1 ano
pai
achega
032893ac13
Modificáronse 35 ficheiros con 1716 adicións e 392 borrados
  1. 4 1
      package.json
  2. 2 0
      src/api/business/purchase/purchase-order.js
  3. 8 0
      src/api/purchase/purchaseDemand.js
  4. 10 0
      src/components/Retrieve/api/index.js
  5. 93 0
      src/components/Retrieve/index.vue
  6. 9 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  7. 7 0
      src/main.js
  8. 3 0
      src/utils/request.js
  9. 1 0
      src/views/business/spd/bo/plan/add.vue
  10. 2 15
      src/views/business/spd/bo/plan/index.vue
  11. 13 10
      src/views/business/spd/goal_management/AnnualSaleGoal.vue
  12. 12 12
      src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue
  13. 8 8
      src/views/business/spd/goal_management/MonthGoalMerge.vue
  14. 4 4
      src/views/business/spd/goal_management/MonthReturnGoal.vue
  15. 5 5
      src/views/business/spd/goal_management/MonthReturnMerge.vue
  16. 4 4
      src/views/business/spd/goal_management/MonthSaleGoal.vue
  17. 0 1
      src/views/material/basicFile/details.vue
  18. 2 9
      src/views/material/classify/index.vue
  19. 7 6
      src/views/material/requisition/add.vue
  20. 13 0
      src/views/material/requisition/columns.js
  21. 2 2
      src/views/material/requisition/index.vue
  22. 977 0
      src/views/purchase/DemandSummary/index-bak.vue
  23. 44 17
      src/views/purchase/DemandSummary/index.vue
  24. 22 3
      src/views/purchase/PurchaseDemandList/add.vue
  25. 31 5
      src/views/purchase/PurchaseDemandList/index.vue
  26. 26 8
      src/views/purchase/apply/add/index.vue
  27. 2 2
      src/views/purchase/apply/columns.js
  28. 245 230
      src/views/purchase/apply/copy/index.vue
  29. 7 3
      src/views/purchase/apply/edit/index.vue
  30. 14 0
      src/views/purchase/apply/index.vue
  31. 23 0
      src/views/purchase/purchase-order/add/column copy.js
  32. 18 1
      src/views/purchase/purchase-order/add/column.js
  33. 33 31
      src/views/purchase/purchase-order/add/index.vue
  34. 39 3
      src/views/purchase/purchase-order/edit/index.vue
  35. 26 12
      src/views/purchase/purchase-order/index.vue

+ 4 - 1
package.json

@@ -45,6 +45,7 @@
     "clipboard": "2.0.8",
     "core-js": "^3.25.3",
     "echarts": "^5.4.0",
+    "el-table-horizontal-scroll": "^1.2.5",
     "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
@@ -67,7 +68,9 @@
     "vue-print-nb": "^1.7.5",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
-    "vuex": "3.6.0"
+    "vuex": "3.6.0",
+    "vxe-table": "^3.6.13",
+    "xe-utils": "^3.5.12"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",

+ 2 - 0
src/api/business/purchase/purchase-order.js

@@ -180,6 +180,8 @@ const downloadFailData = (data) =>{
   });
 }
 
+
+
 export default {
   list,
   details,

+ 8 - 0
src/api/purchase/purchaseDemand.js

@@ -85,4 +85,12 @@ export function toOA(userName, fdId) {
     url: `/oaflow/redirectToOa/${userName}/${fdId}`,
     method: 'get',
   })
+}
+// 确认提交?
+export function confirmSubmit(data) {
+  return request({
+    url: `/pu/demand/confirm/submit`,
+    method: 'POST',
+    data: data
+  })
 }

+ 10 - 0
src/components/Retrieve/api/index.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+// 模OA流程收回
+export const rollback = (data) =>{
+  return request({
+    url: "/oaflow/rollback",
+    method: "POST",
+    data: data,
+  });
+}

+ 93 - 0
src/components/Retrieve/index.vue

@@ -0,0 +1,93 @@
+<template>
+  <el-button 
+    v-if="isShow"
+    :type="type" 
+    :size="size"
+    @click.native="retrieve"
+  >
+    {{ title }}
+  </el-button>
+</template>
+
+<script>
+// import {rollback} from "@/api/business/purchase/purchase-order.js"
+import {rollback} from "./api/index";
+export default {
+  name:'Retrieve',
+  props:{
+    data:{
+      type:[Object],
+      require:true,
+    },
+    type:{
+      type:String,
+      default:'text',
+    },
+    size:{
+      type:String,
+      default:'mini',
+    },
+
+  },
+  computed:{
+    isShow:{
+      get(){
+        if(this.data.status === '1'){
+
+          return true;
+        }
+        return false;
+      },
+      set(){
+
+      }
+    }
+  },
+  data(){
+    return {
+      title:'收 回',
+    }
+  },
+  methods:{
+    retrieve(){
+
+      // if(this.data.status === '1'){
+
+        this.$confirm('是否继续此操作?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async() => {
+  
+            try {
+              this.$modal.loading("请稍候...");
+              console.log(this.data,'this.data');
+              let {code,msg} = await rollback({...this.data});
+              if(code == 200){
+                this.$emit('success');
+              }
+              
+            } catch (error) {
+              
+            }finally{
+              this.$modal.closeLoading();
+            }
+  
+          }).catch(() => {        
+          });
+      
+      // }else{
+      //   this.$notify.warning({
+      //     title: '警告',
+      //     message: '!',
+      //   });
+      // }
+
+    },
+
+  },
+  created(){},
+  mounted(){},
+
+}
+</script>

+ 9 - 0
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -29,6 +29,15 @@ export default [
     },
   },
   {
+    item: { key: "isMedicineYN", title: "医药物料", width: "auto" },
+    attr: {
+      type:'ComputedInput',
+      formatter: (prop) => {
+        return prop.isMedicine == "0" ? "Y" : "N";
+      },
+    },
+  },
+  {
     item: { key: "isDrug", title: "物料药品属性", width: "auto" },
     attr: {
       type:'ComputedInput',

+ 7 - 0
src/main.js

@@ -62,6 +62,11 @@ import Print from "vue-print-nb";
 // 引入umy-ui
 import UmyUi from 'umy-ui'
 import 'umy-ui/lib/theme-chalk/index.css';// 引入样式
+// 引入vxe-table
+import VXETable from 'vxe-table'
+import 'vxe-table/lib/style.css'
+//底部横拉条
+import horizontalScroll from 'el-table-horizontal-scroll';
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts;
@@ -100,6 +105,8 @@ Vue.use(plugins);
 Vue.use(VueMeta);
 Vue.use(Print); //注册
 Vue.use(UmyUi);
+Vue.use(VXETable)
+Vue.use(horizontalScroll);//底部横拉条
 DictData.install();
 
 // el-table无限滚动解决页面渲染卡死

+ 3 - 0
src/utils/request.js

@@ -168,6 +168,9 @@ service.interceptors.response.use(
     else if (code == 10000) {
       return res.data;
     }
+    else if (code === 233) {
+       return res.data
+    }
     else if (code !== 200) {
       Notification.error({
         title: msg.replaceAll(/(\n|\r|\r\n|↵)/g, "<br/>"),

+ 1 - 0
src/views/business/spd/bo/plan/add.vue

@@ -131,6 +131,7 @@
           fit
           height="460"
           style="font-size: 12px;"
+          v-horizontal-scroll
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" align="center"/>

+ 2 - 15
src/views/business/spd/bo/plan/index.vue

@@ -169,8 +169,9 @@
         <el-table 
         :data="tableList" 
         fit
-        height="560"
+        max-height="560"
         style="font-size: 12px;"
+        v-horizontal-scroll
         @selection-change="handleSelectionChange"
         :row-class-name="tableRowClassName"
         @row-dblclick="getEmpDetail"
@@ -294,7 +295,6 @@ export default {
         isPage: true,
         title: ''
       },
-      customerOptions: [],
       personOptions: [],
       deptOptions: [],
       tableList: [],
@@ -549,12 +549,6 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      // 搜索区选择客户
-      if (this.referCondition.type == 'CUSTOMER_PARAM') {
-        this.customerOptions = selection
-        this.queryParams.customer = selection[0].id
-        this.queryParams.customerName = selection[0].name
-      }
       if (this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
         this.queryParams.charger = selection[0].id
@@ -571,13 +565,6 @@ export default {
         this.queryParams.marketingAreaName = selection[0].name
       }
     },
-    // 搜索区树形选择
-    chooseTreeRefer(type, isPage, title) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.tree.init(this.referCondition)
-    },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
       this.download.category = selection.code

+ 13 - 10
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -96,7 +96,7 @@
           <el-form-item label="部门" prop="dept">
             <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
                                   referName="DEPT_PARAM"
-                                  :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                  :dataMapping="{ deptId: 'id', dept: 'name'}"
                                   :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
             </el-popover-select-v2>
           </el-form-item>
@@ -170,7 +170,7 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="annualSaleGoalList" @selection-change="handleSelectionChange" v-horizontal-scroll>
       <el-table-column type="selection" width="55" align="center" fixed/>
       <el-table-column label="编码" align="center" prop="code" width="180"/>
       <el-table-column label="目标名称" align="center" prop="goalName" width="180"/>
@@ -279,7 +279,7 @@
             <el-form-item label="部门" prop="dept">
               <el-popover-select-v2 v-model="form.dept" title="部门" valueKey="name"
                                     referName="DEPT_PARAM"
-                                    :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                    :dataMapping="{ deptId: 'id', dept: 'name'}"
                                     :source.sync="form" placeholder="请输入部门">
               </el-popover-select-v2>
             </el-form-item>
@@ -317,7 +317,7 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="年销售目标填报明细" name="annualSaleGoalDetails">
-            <el-table max-height="300" show-summary :summary-method="getSummaries" 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" v-horizontal-scroll>
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180" :render-header="(h, obj) => addRedStar(h, obj, '0')">
                 <template slot-scope="scope">
@@ -596,7 +596,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -644,7 +644,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -715,6 +715,7 @@ export default {
     };
   },
   created() {
+    console.log(this.$store.state.user, 'this.$store.state.user')
     this.getList();
   },
   methods: {
@@ -757,7 +758,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -786,7 +787,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -811,7 +812,9 @@ export default {
       this.open = true;
       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.creatorCode = this.$store.state.user.name
       this.form.creator = this.$store.state.user.nickName
+      this.form.deptId = this.$store.state.user.deptId
       this.form.dept = this.$store.state.user.deptName
     },
     handleAddDetails() {
@@ -915,7 +918,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除年度销售目标编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除年销售目标填报单据编号为"' + row.code + '"的数据项?').then(function () {
         return delAnnualSaleGoal(ids);
       }).then(() => {
         this.getList();
@@ -929,7 +932,7 @@ export default {
         this.computeTotal()
       } else {
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除年度销售目标明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除年度销售目标明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delAnnualSaleGoalDetails(row.id)
           }).then(() => {
             this.getListDetails()

+ 12 - 12
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -57,7 +57,7 @@
           <el-form-item label="部门" prop="dept">
             <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
                                   referName="DEPT_PARAM"
-                                  :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                  :dataMapping="{ deptId: 'id', dept: 'name'}"
                                   :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
             </el-popover-select-v2>
           </el-form-item>
@@ -183,7 +183,7 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="annualSaleGoalMergeList" @selection-change="handleSelectionChange" v-horizontal-scroll>
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编码" align="center" prop="code" width="180"/>
       <el-table-column label="目标名称" align="center" prop="goalName" width="180"/>
@@ -277,7 +277,7 @@
             <el-form-item label="部门" prop="dept">
               <el-popover-select-v2 v-model="form.dept" title="部门" valueKey="name"
                                     referName="DEPT_PARAM"
-                                    :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                    :dataMapping="{ deptId: 'id', dept: 'name'}"
                                     :source.sync="form" placeholder="请输入部门">
               </el-popover-select-v2>
             </el-form-item>
@@ -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 :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalMergeDetailsList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="annualSaleGoalMergeDetailsList" v-horizontal-scroll>
               <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 :summary-method="getSummaries" v-loading="loading" :data="areaDetailList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="areaDetailList" v-horizontal-scroll>
               <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 :summary-method="getSummaries" v-loading="loading" :data="customerDetailList">
+            <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="customerDetailList" v-horizontal-scroll>
               <el-table-column label="序号" type="index" width="70" align="center" fixed />
               <el-table-column label="销售组织" align="center" width="180">
                 <template slot-scope="scope">
@@ -764,7 +764,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -816,7 +816,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -940,7 +940,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -974,7 +974,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -1111,7 +1111,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除年度销售目标明细编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除年度销售目标单据编号为"' + row.code + '"的数据项?').then(function () {
         return delAnnualSaleGoalMerge(ids);
       }).then(() => {
         this.getList();
@@ -1125,7 +1125,7 @@ export default {
         this.computeTotal()
       } else { // 修改
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除年度销售目标明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除年度销售目标明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delAnnualSaleMergeDetails(row.id);
           }).then(() => {
             this.getListDetails();

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

@@ -196,7 +196,7 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="monthGoalMergeList" @selection-change="handleSelectionChange" v-horizontal-scroll>
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编码" align="center" prop="code"/>
       <el-table-column label="目标名称" align="center" prop="goalName"/>
@@ -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 :summary-method="getSummaries" 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" v-horizontal-scroll>
               <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">
@@ -469,8 +469,8 @@
               </el-table-column>
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum">
-            <el-table max-height="300" :data="zoneGoalSumList">
+          <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum" v-if="this.form.goalCategory == '销售区域'">
+            <el-table max-height="300" :data="zoneGoalSumList" v-horizontal-scroll>
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -503,8 +503,8 @@
               </el-table-column>
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="客户目标汇总(月)" name="customGoalSum">
-            <el-table max-height="300" :data="customGoalSumList">
+          <el-tab-pane label="客户目标汇总(月)" name="customGoalSum" v-if="this.form.goalCategory == '销售区域'">
+            <el-table max-height="300" :data="customGoalSumList" v-horizontal-scroll>
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
                 <template slot-scope="scope">
@@ -977,7 +977,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除月销售目标合并编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除月销售目标合并单据编号为"' + row.code + '"的数据项?').then(function () {
         return delMonthGoalMerge(ids);
       }).then(() => {
         this.getList();
@@ -991,7 +991,7 @@ export default {
         this.computeTotal()
       } else {
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除月销售目标合并明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除月销售目标合并明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delMonthGoalMergeDetails(row.id);
           }).then(() => {
             this.getListDetails();

+ 4 - 4
src/views/business/spd/goal_management/MonthReturnGoal.vue

@@ -167,7 +167,7 @@
         </el-dropdown>
       </el-col>
     </el-row>
-    <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="monthReturnGoalList" @selection-change="handleSelectionChange" v-horizontal-scroll>
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编码" align="center" prop="code"/>
       <el-table-column label="目标名称" align="center" prop="goalName"/>
@@ -322,7 +322,7 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月回款目标明细" name="monthReturnGoalDetails">
-            <el-table max-height="300" show-summary :summary-method="getSummaries" 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" v-horizontal-scroll>
               <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">
@@ -827,7 +827,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除月销售目标填报编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除月销售目标填报单据编号为"' + row.code + '"的数据项?').then(function () {
         return delMonthReturnGoal(ids);
       }).then(() => {
         this.getList();
@@ -841,7 +841,7 @@ export default {
         this.computeTotal()
       } else {
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除月销售目标填报明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除月销售目标填报明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delMonthReturnGoalDetails(row.id);
           }).then(() => {
             this.getListDetails();

+ 5 - 5
src/views/business/spd/goal_management/MonthReturnMerge.vue

@@ -171,7 +171,7 @@
       </el-dropdown>
     </el-col>
   </el-row>
-  <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange">
+  <el-table v-loading="loading" :data="monthReturnMergeList" @selection-change="handleSelectionChange" v-horizontal-scroll>
     <el-table-column type="selection" width="55" align="center"/>
     <el-table-column label="编码" align="center" prop="code" width="180"/>
     <el-table-column label="目标名称" align="center" prop="goalName" width="180"/>
@@ -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 :summary-method="getSummaries" v-loading="loading" :data="monthReturnMergeDetailsList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" v-loading="loading" :data="monthReturnMergeDetailsList" v-horizontal-scroll>
             <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 :summary-method="getSummaries" :data="zoneGoalSumList">
+          <el-table max-height="300" show-summary :summary-method="getSummaries" :data="zoneGoalSumList" v-horizontal-scroll>
             <el-table-column label="序号" type="index" width="55" align="center" fixed />
             <el-table-column label="销售组织" align="center" width="180">
               <template slot-scope="scope">
@@ -826,7 +826,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除月销售目标合并编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除月销售目标合并单据编号为"' + row.code + '"的数据项?').then(function () {
         return delMonthReturnMerge(ids);
       }).then(() => {
         this.getList();
@@ -840,7 +840,7 @@ export default {
         this.computeTotal()
       } else {
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除月销售目标合并明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除月销售目标合并明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delMonthReturnMergeDetails(row.id);
           }).then(() => {
             this.getListDetails();

+ 4 - 4
src/views/business/spd/goal_management/MonthSaleGoal.vue

@@ -169,7 +169,7 @@
       </el-col>
     </el-row>
 
-    <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="monthSaleGoalList" @selection-change="handleSelectionChange" v-horizontal-scroll>
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编码" align="center" prop="code"/>
       <el-table-column label="目标名称" align="center" prop="goalName"/>
@@ -324,7 +324,7 @@
         </el-row>
         <el-tabs v-model="activeName">
           <el-tab-pane label="月销售目标明细" name="monthSaleGoalDetails">
-            <el-table max-height="300" show-summary :summary-method="getSummaries" 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" v-horizontal-scroll>
               <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">
@@ -875,7 +875,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除月销售目标填报编号为"' + ids + '"的数据项?').then(function () {
+      this.$modal.confirm('是否确认删除月销售目标填报单据编号为"' + row.code + '"的数据项?').then(function () {
         return delMonthSaleGoal(ids);
       }).then(() => {
         this.getList();
@@ -889,7 +889,7 @@ export default {
         this.computeTotal()
       } else {
         if (row.id !== null) {
-          this.$modal.confirm('是否确认删除月销售目标填报明细编号为"' + row.id + '"的数据项?').then(function () {
+          this.$modal.confirm('是否确认删除月销售目标填报明细序号为"' + (index + 1) + '"的数据项?').then(function () {
             return delMonthSaleGoalDetails(row.id);
           }).then(() => {
             this.getListDetails();

+ 0 - 1
src/views/material/basicFile/details.vue

@@ -2103,7 +2103,6 @@
             this.basicData.value['rateCode'] = this.MoreDataDialog.value.code
           }
 
-
         } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
           //  医药信息

+ 2 - 9
src/views/material/classify/index.vue

@@ -112,31 +112,24 @@
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-row :gutter="20">
+            <!-- <el-row :gutter="20">
               <el-col :span="24">
                 <el-form-item label="" prop="name">
-                  <!-- <el-checkbox-group :disabled="disable" v-model="checkList"> -->
                   <el-checkbox
                     :disabled="disable"
                     v-model="ruleForm.isInventory"
                     label="isInventory"
                     >库存状态</el-checkbox
                   >
-                  <!-- <el-checkbox label="项目"></el-checkbox>
-                  <el-checkbox label="供应商"></el-checkbox>
-                  <el-checkbox label="生产厂商"></el-checkbox>
-                  <el-checkbox label="客户"></el-checkbox>
-                  <el-checkbox label="特征码"></el-checkbox> -->
                   <el-checkbox
                     :disabled="disable"
                     v-model="ruleForm.isProductBatch"
                     label="isProductBatch"
                     >产品批号</el-checkbox
                   >
-                  <!-- </el-checkbox-group> -->
                 </el-form-item>
               </el-col>
-            </el-row>
+            </el-row> -->
 
             <el-row :gutter="20">
               <el-col :span="24">

+ 7 - 6
src/views/material/requisition/add.vue

@@ -258,7 +258,7 @@
               </el-col>
               <el-col :span="6">
                 <el-form-item label="近效期预警天数" prop="recentWarningPeriod"
-                              :rules="{ required: !isExp, message: '请填写近效期预警天数', trigger: 'blur' }">
+                              :rules="{ required: (basicForm.expiryDateManagerment === '0' && basicForm.nearOnsetManagerment ==='0'), message: '请填写近效期预警天数', trigger: 'blur' }">
                   <el-input type="number" min="0" :disabled="disable || isExp"
                             v-model="basicForm.recentWarningPeriod"></el-input>
                 </el-form-item>
@@ -1127,11 +1127,12 @@
         if (val == 0) {
           this.isExp = false
         } else {
-          this.basicForm.usefulLife = ''
-          this.basicForm.expiryUnitId = ''
-          this.basicForm.usefulLifeUnitId = ''
-          this.basicForm.recentWarningPeriod = ''
-          this.isExp = true
+          this.basicForm.usefulLife = '';
+          this.basicForm.expiryUnitId = '';
+          this.basicForm.usefulLifeUnitId = '';
+          this.basicForm.recentWarningPeriod = '';
+          this.basicForm.nearOnsetManagerment = '2'
+          this.isExp = true;
         }
       },
       // 选择采购组织时控制业务部门

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

@@ -116,6 +116,19 @@
         clearable: true,
       },
     },
+    // { 
+    //   item: { key: "createName", title: "创建人" ,width:150, }, 
+    //   attr: {
+    //     is: "el-popover-select-v2",
+    //     referName: "CONTACTS_PARAM",
+    //     valueKey: "name",
+    //     dataMapping: {
+    //       create: "code",
+    //     },
+    //     clearable: true,
+    //   } 
+    // },
+    
     // {
     //   item: { key: "createTimeString", title: "申请时间" },
     //   attr: {

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

@@ -29,11 +29,11 @@
           
           <el-button-group >
             <el-button :size="size" @click="handleImport">批量导入</el-button>
-            <el-button  
+            <!-- <el-button  
             :size="size"
               @click="handleDownload" 
               v-hasPermi="['system:apply:export']"
-            >批量导出</el-button>
+            >批量导出</el-button> -->
             <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
           </el-button-group>
         </el-col>

+ 977 - 0
src/views/purchase/DemandSummary/index-bak.vue

@@ -0,0 +1,977 @@
+<template>
+  <div id="demandSummary">
+    <div v-if="isList">
+      <el-card style="position: relative;">
+        <el-form class="search_area" label-width="100px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="行状态">
+                <el-select multiple v-model="queryParams.rowStatus" size="mini" style="width: 200px" clearable>
+                  <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="采购员">
+                <el-select clearable size="mini" v-model="queryParams.buyer" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="品类">
+                <el-select
+                v-model="queryParams.materialClassifyFour"
+                size="mini"
+                clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
+                style="width: 200px"
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="生产厂家">
+                <el-input
+                v-model.trim="queryParams.manufacturer"
+                size="mini"
+                clearable
+                style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <!-- <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" @click="search">搜索</el-button>
+                  <el-button size="mini" plain @click="reset">重置</el-button>
+                </div>
+              <!-- </el-form-item> -->
+            <!-- </el-col> -->
+          </el-row>
+
+          <CollapseTransition>
+          <div v-show="expanded">
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="预测分类">
+                  <el-select v-model="queryParams.forecastClassification" size="mini" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.label">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="审核人">
+                  <el-select clearable size="mini" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+                    <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.code" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="注册人">
+                  <el-input
+                  v-model.trim="queryParams.registrant"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="业务类型">
+                  <el-select v-model="queryParams.businessType" size="mini" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="单据来源">
+                  <el-select v-model="queryParams.billSource" size="mini" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="需求客户">
+                  <el-select clearable size="mini" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                    <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="供应仓库">
+                  <el-select clearable size="mini" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
+                    <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="供应库位">
+                  <el-select clearable size="mini" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '供应库位', queryParams.lastWarehouse)" style="width: 200px">
+                    <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="物料编码">
+                  <el-popover
+                    placement="top-start"
+                    width="200"
+                    trigger="hover"
+                    :content="queryParams.names">
+                  <el-input slot="reference" clearable size="mini" v-model="queryParams.names" @clear="clearMaterial" style="width: 200px" @paste.native="pasteMe($event)">
+                    <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+                  </el-input>
+                  </el-popover>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="默认采购组织">
+                  <el-select clearable size="mini" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+                    <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="需求日期">
+                  <el-date-picker
+                    v-model="queryParams.demandDate"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    size="mini"
+                    style="width: 200px"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="采购需求单号">
+                  <el-input
+                  v-model.trim="queryParams.code"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="审批结束日期">
+                  <el-date-picker
+                    v-model="queryParams.approverFinishTime"
+                    type="date"
+                    clearable
+                    value-format="yyyy-MM-dd"
+                    size="mini"
+                    style="width: 200px"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="是否客户指定">
+                  <el-select clearable v-model="queryParams.isCustomerSpecified" size="mini" style="width: 200px">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="1.5">
+                <el-form-item label="是否紧急需求">
+                  <el-select clearable v-model="queryParams.isUrgency" size="mini" style="width: 200px">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+          </CollapseTransition>
+        </el-form>
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+    
+      
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="editList">编辑</el-button>
+          <el-button type="danger" size="mini" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
+          <el-button type="success" size="mini" v-if="!lineDisable" @click="saveList">保存</el-button>
+          <el-button type="primary" size="mini" v-if="lineDisable" @click="confirms">确认</el-button>
+          <el-button type="primary" size="mini" v-if="lineDisable" @click="cancels">取消</el-button>
+          <!-- <el-button type="primary" size="mini" v-if="lineDisable" @click="cancelAudit">取消审批</el-button> -->
+          <el-button type="primary" size="mini" v-if="lineDisable" @click="audits">审核</el-button>
+          <el-button type="primary" size="mini" v-if="lineDisable" @click="closeLine">行关闭</el-button>
+
+          <el-button size="mini" type="primary" style="margin: 0 10px;" v-if="lineDisable" @click="handleCommand">
+            导出
+          </el-button>
+
+          <!-- <el-button type="primary" size="mini">转请购</el-button> -->
+        </div>
+        <vxe-table
+          v-loading="loading"
+          :data="tableList" 
+          :cell-style="{ borderColor: '#c0c0c0' }"
+          :header-cell-style="{ borderColor: '#c0c0c0' }"
+          class="exporttable"
+          border
+          resizable
+          show-overflow
+          show-summary
+          :summary-method="getSummaries"
+          highlight-current-row
+          height="355"
+          max-height="355"
+          style="font-size: 12px;"
+          :cell-class-name="cellClassName"
+          @checkbox-change="handleSelectionChange"
+          @row-click="rowSelect"
+          @row-dblclick="doubleClick"
+          ref="table"
+        >
+          <vxe-column type="checkbox" width="60" fixed="left"/>
+          <vxe-column  title="序号" type="seq" align="center" width="50px" fixed="left"/>
+          <!-- <vxe-column show-header-overflow v-if="showColumn.status" title="行号" align="center" field="rowNo"/> -->
+          <vxe-column show-header-overflow v-if="showColumn.status" title="行状态" align="center" field="status" width="100px" :formatter="hangStatus"/>
+          <vxe-column show-header-overflow v-if="showColumn.materialClassifyOneName" title="一级品类" align="center" field="materialClassifyOneName" width="80"/>
+          <vxe-column show-header-overflow v-if="showColumn.materialCode" title="物料编码" align="center" field="materialCode" width="150px"/>
+          <vxe-column show-header-overflow v-if="showColumn.materialName" title="品名" align="center" field="materialName" width="150px"/>
+          <vxe-column show-header-overflow v-if="showColumn.specification" title="规格" align="center" field="specification" width="100px"/>
+          <vxe-column show-header-overflow v-if="showColumn.unit" title="单位" align="center" field="unit"/>
+          <vxe-column show-header-overflow v-if="showColumn.manufacturer" title="生产厂家/代理人" align="center" field="manufacturer" width="150px"/>
+          <vxe-column show-header-overflow v-if="showColumn.demandNum" title="需求单位数" align="center" field="demandNum" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.evensalesforyear" title="近1月月均需求" align="center" field="evensalesforyear" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.evensalesforthrmonth" title="近3月月均需求" align="center" field="evensalesforthrmonth" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.netDemandNum" title="总最终净需求量" align="center" field="netDemandNum" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.totalMonthlySales" title="总月销量" align="center" field="totalMonthlySales" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.demandCycle" title="需求可用周期" align="center" field="demandCycle" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '0.0'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.dullQut" title="呆滞量" align="center" field="dullQut" width="80px">
+            <template slot-scope="scope">
+              {{parseFloat(scope.row.dullQut).toFixed(2)}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.buyPeriod" title="采购周期" align="center" field="buyPeriod" width="80px" />
+          <vxe-column show-header-overflow v-if="showColumn.centralPublicStock" title="中心公共库存" align="center" field="centralPublicStock" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.centralWarehouse" title="中心仓专属货位" align="center" field="centralWarehouse" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.regionPublicStock" title="区域分仓公共库存" align="center" field="regionPublicStock" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.eachWarehouseStock" title="各项目仓库存" align="center" field="eachWarehouseStock" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.commerceWarehouse" title="电商仓库" align="center" field="commerceWarehouse"  width="80px" />
+          <vxe-column show-header-overflow v-if="showColumn.buyTransit" title="采购在途" align="center" field="buyTransit"  width="80px" />
+          <vxe-column show-header-overflow v-if="showColumn.lendTransit" title="借出在途" align="center" field="lendTransit"  width="80px" />
+          <vxe-column show-header-overflow v-if="showColumn.transferTransit" title="调拨在途" align="center" field="transferTransit"  width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.stockTotal" title="库存总计" align="center" field="stockTotal" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.minPackage" title="最小包装量" align="center" field="minPackage"  width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.minOrder" title="最小订货量" align="center" field="minOrder"  width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.minBatch" title="最小批量" align="center" field="minBatch"  width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.artificialAdjust" title="人工调整数" align="center" field="artificialAdjust" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.modifyReason" title="修改原因" align="center" field="modifyReason" width="150px">
+            <template slot-scope="scope">
+                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$rowIndex)"/>
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.suggestionPurchase" title="建议采购量" align="center" field="suggestionPurchase"  width="80px"/>
+          <!-- <vxe-column show-header-overflow v-if="showColumn.status" title="建议净采购量" align="center" field="suggestBuyQty" width="100px"/> -->
+          <vxe-column show-header-overflow v-if="showColumn.finalBuyQty" title="最终采购量" align="center" field="finalBuyQty" width="80px">
+            <template slot-scope="scope">
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$rowIndex)"/>
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.materialClassifyTwoName" title="二级品类" align="center" field="materialClassifyTwoName" width="120px"/>
+          <vxe-column show-header-overflow v-if="showColumn.materialClassifyThreeName" title="三级品类" align="center" field="materialClassifyThreeName" width="120px"/>
+          <vxe-column show-header-overflow v-if="showColumn.materialClassifyFourName" title="四级品类" align="center" field="materialClassifyFourName" width="120px"/>
+          <vxe-column show-header-overflow v-if="showColumn.buyerName" title="采购员" align="center" field="buyerName" width="150px">
+            <template slot-scope="scope">
+                <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
+                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$rowIndex, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
+                </el-input>
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.purchaseOrgName" title="默认采购组织" align="center" field="purchaseOrgName" width="150px">
+            <!-- <template slot-scope="scope">
+                <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
+                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
+                </el-input>
+            </template> -->
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.validityPeriod" title="有效期" align="center" field="validityPeriod"/>
+          <vxe-column show-header-overflow v-if="showColumn.validityPeriodUnit" title="有效期单位" align="center" field="validityPeriodUnit" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.businessType" title="业务类型" align="center" field="businessType" :formatter="formatterBusinessType"/>
+          <vxe-column show-header-overflow v-if="showColumn.safetyStock" title="安全库存量" align="center" field="safetyStock" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.safetyStock ? parseFloat(scope.row.safetyStock).toFixed(2) : '0.00'}}
+            </template>
+          </vxe-column>
+          <vxe-column show-header-overflow v-if="showColumn.billSource" title="单据来源" align="center" field="billSource" :formatter="formatterSource"/>
+          <vxe-column show-header-overflow v-if="showColumn.registrant" title="注册人" align="center" field="registrant" width="120px"/>
+          <!-- <vxe-column title="可用量" align="center" field="qty"/> -->
+          <vxe-column show-header-overflow v-if="showColumn.buyDiscrepancy" title="总需与终采差异" align="center" field="buyDiscrepancy" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.forecastClassification" title="集团预测分类" align="center" field="forecastClassification" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.centerBinPossession" title="中心仓占有量" align="center" field="centerBinPossession" width="80px"/>
+          <vxe-column show-header-overflow v-if="showColumn.centralWarehouseAvailable" title="中心仓可用量" align="center" field="centralWarehouseAvailable" width="80px"/>
+          <!-- <vxe-column title="物料类别" align="center" field="materialCategory" width="150px"/> -->
+          <!-- <vxe-column title="业务部门" align="center" field="departmentName" width="150px"/> -->
+          <!-- <vxe-column show-header-overflow v-if="showColumn.status" title="需求单位" align="center" field="demandUnit"/> -->
+          <vxe-column show-header-overflow v-if="showColumn.puManagerAuditor" title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
+          <vxe-column
+          fixed="right"
+          title="操作"
+          align="center"
+          width="100"
+          >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
+          </template>
+        </vxe-column>
+        </vxe-table>
+
+        <el-button size="mini" style="position: absolute;left: 20px;bottom: 20px;" @click="tols.open = true">隐藏列</el-button>
+
+        <colTol :isVisible.sync="tols.open" @reDraw="reDraw" :showColumn.sync="showColumn" :arrs.sync="arrs"/>
+
+        <el-pagination
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 20, 50, 100, 200, 500]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" :query="queryParams" @refresh="search"/>
+  
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="false" />
+  </div>
+</template>
+
+<script>
+import Add from './add'
+import colTol from './colTol.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
+import popDialog from '@/components/PopDialog/index.vue'
+import CollapseTransition from '@/components/MyCollapse/collapse.vue'
+// 用于物料参照框数据
+import {getRefer} from '@/api/purchase/basic.js'
+import {getSummaryList, auditSummary, cancelAudits, confirmSummary , cancelSummary , shutDownSummary, editSummaryList, exportList, exportItems } from '@/api/purchase/DemandSummary.js'
+export default {
+  name: 'demandSummary',
+  dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
+  components: {
+    Add,
+    colTol,
+    CollapseTransition,
+    Refers,
+    TreeRefers,
+    popDialog
+  },
+  data() {
+    return {
+      loading: true,
+      showColumn: {},
+      arrs:[],
+      tols: {
+        open: false
+      },
+      hangStatus(row) {
+        console.log('行状态', row)
+        switch (row.row.status) {
+          case '0':
+            return '需补货'
+          case '1':
+            return '待计划确认'
+          case '2':
+            return '计划已确认'
+          case '3':
+            return '计划已审核'
+          case '4':
+            return '行关闭'
+          case '5':
+            return '总供应可满足'
+        }
+      },
+      formatterBusinessType(row) {
+        switch (row.row.businessType) {
+          case 'ZQBH':
+            return '周期备货'
+          case 'FXXQ':
+            return '分销需求'
+          case 'TSXQ':
+            return '特殊采购需求'
+          case 'BDXQ':
+            return '补单需求'
+          case 'JJXQ':
+            return '紧急需求单'
+          case 'XPXQ':
+            return '新品需求'
+          case 'HZBM':
+            return '合作部门需求'
+        }
+      },
+      formatterSource(row) {
+        switch (row.row.billSource) {
+          case '1':
+            return '手工导入'
+          case '2':
+            return '按客户计算'
+          case '3':
+            return '按仓库计算'
+          case '4':
+            return '手工新增'
+        }
+      },
+      expanded: false,
+      // 页面配置
+      isList: true,
+      // 页面状态
+      page: '',
+      queryParams: {
+        rowStatus: ['1'],
+        buyer: '',
+        buyerName: '',
+        materialClassifyFour: '',
+        manufacturer: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
+        code: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCodeList: [],
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
+        pageNum: 1,
+        pageSize: 10
+      },
+      personOptions: [],
+      classOptions: [],
+      deptOptions: [],
+      auditOptions: [],
+      customerOptions: [],
+      lastWarehouseOptions: [],
+      lastAllocationOptions: [],
+      orgOptions: [],
+      options: [{
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
+      }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      tableList: [],
+      total: 0,
+      rowDetail: {},
+      disable: false,
+      lineDisable: true,
+      ids: [],
+      allSelection: [],
+      // 子表index
+      tableIndex: null,
+      // referConditionMx: {
+      //   type: '',
+      //   isPage: true,
+      //   title: ''
+      // }
+      // 用于保存临时记录修改行的数组
+      record:[]
+    }
+  },
+  created() {
+    this.getList(this.queryParams)
+  },
+  methods: {
+    reDraw() {
+      // this.$refs.table.doLayout();
+    },
+    // 单元格标红
+    cellClassName({row, column, rowIndex, columnIndex}) {
+      if(column.label == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
+        return 'success-row';
+      }
+    },
+    // 指定列合计
+    getSummaries(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 (column.property === 'demandNum' || column.property === 'netDemandNum' || column.property === 'artificialAdjust' || column.property === 'suggestBuyQty' || column.property === 'finalBuyQty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index];
+
+        }
+      });
+      return sums
+    },
+    // 搜索
+    search() {
+      this.getList(this.queryParams)
+    },
+    reset() {
+      this.queryParams = {
+        rowStatus: ['1'],
+        buyer: '',
+        buyerName: '',
+        materialClassifyFour: '',
+        manufacturer: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
+        code: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCodeList: [],
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        approverFinishTime: '',
+        isCustomerSpecified: '',
+        isUrgency: '',
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams)
+    },
+    getList(params){
+      getSummaryList(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+          let arrs = []
+          this.$refs.table.$children.forEach(item => {
+            if (item.label != undefined && item.prop != undefined) {
+              arrs.push({
+                label: item.label,
+                prop: item.prop
+              })
+            }
+          })
+          this.arrs = arrs
+          console.log('获取表头数据', arrs)
+        }
+      }).then(() => {
+        // 合计不显示重绘
+        // this.$refs.table.doLayout()
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
+      })
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.allSelection = selection
+      this.ids = selection.map(item => item.demandItemId)
+      console.log('选中数组', this.ids.join())
+    },
+    handleCommand() {
+      this.$modal.loading("正在导出数据,请稍后...");
+      let param = this.queryParams
+      param.pageSize = this.total
+      exportItems(param).then(res => {
+        this.$modal.closeLoading();
+        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 = '采购需求处理导出'+ this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
+      })
+    },
+    check(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    doubleClick(row) {
+      this.isList = false
+      this.page = 'check'
+      this.rowDetail = row
+      this.disable = true
+    },
+    // 表格选中数据
+    rowSelect(row) {
+      this.$refs.table.toggleRowSelection(row);
+    },
+    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)
+    },
+    drop() {
+      this.expanded = !this.expanded
+    },
+    editList() {
+      console.log('Lists`````',this.tableList)
+      this.lineDisable = false
+    },
+    cancelEdit() {
+      this.lineDisable = true
+      this.getList(this.queryParams)
+    },
+    saveList() {
+      // console.log('记录',this.record)
+      // 对记录的数据进行去重
+      let newRecord = Array.from(new Set(this.record))
+      // console.log('去重后的', newRecord)
+      let changeList = newRecord.map(i => {
+        return this.tableList[i]
+      })
+      // console.log('shuzu', changeList)
+      editSummaryList(changeList).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("保存成功");
+          this.lineDisable = true
+          this.getList(this.queryParams)
+        }
+      })
+    },
+    confirms() {
+      if (this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        confirmSummary(this.allSelection).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("确认成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    cancels() {
+      if (this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        let param = this.ids.join()
+        cancelSummary(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("取消成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    cancelAudit() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        let param = this.ids.join()
+        cancelAudits(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("审核成功");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    audits() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        let param = this.ids.join()
+        auditSummary(param).then(res => {
+          if (res.code === 200) {
+            this.$modal.notifySuccess("审核成功");
+            this.getList(this.queryParams)
+          }
+        }).catch(err => {
+          this.getList(this.queryParams)
+        })
+      }
+    },
+    // 行关闭
+    closeitem() {
+      let param = this.ids.join()
+      shutDownSummary(param).then(res => {
+        if (res.code === 200) {
+          this.$modal.notifySuccess("操作成功");
+          this.getList(this.queryParams)
+        }
+      })
+    },
+    closeLine() {
+      if (this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        console.log('选中数组', this.allSelection)
+        let item = this.allSelection.some(item => {
+          return item.demandNum >= 2
+        })
+        if (item) {
+          this.$modal.confirm('选中项有多个需求单位,是否确定关闭?').then(function () {
+          }).then(() => {
+            this.closeitem()
+          }).catch(() => {})
+        } else {
+          this.closeitem()
+        }
+      }
+    },
+    // 搜索区参照选择
+    chooseRefer(type, isPage, title, stordocId) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.title == '采购员') {
+        this.personOptions = selection
+        this.queryParams.buyer = selection[0].code
+        this.queryParams.buyerName = selection[0].name
+      }
+      if (this.referCondition.title == '业务部门') {
+        this.deptOptions = selection
+        this.queryParams.departmentName = selection[0].id
+      }
+      if (this.referCondition.title == '审核人') {
+        this.auditOptions = selection
+        this.queryParams.puManagerAuditor = selection[0].code
+      }
+      if (this.referCondition.title == '需求客户') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      if (this.referCondition.title == '供应仓库') {
+        this.lastWarehouseOptions = selection
+        this.queryParams.lastWarehouse = selection[0].id
+      }
+      if (this.referCondition.title == '供应库位') {
+        this.lastAllocationOptions = selection
+        this.queryParams.lastAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '默认采购组织') {
+        this.orgOptions = selection
+        this.queryParams.purchaseOrg = selection[0].id
+      }
+      if (this.referCondition.title == '明细采购员') {
+        console.log('选择进了吗',this.tableList)
+        this.record.push(this.tableIndex)
+        this.tableList[this.tableIndex].buyer = selection[0].code
+        this.tableList[this.tableIndex].buyerName = selection[0].name
+      }
+      // if (this.referCondition.title == '明细默认采购组织') {
+      //   console.log('选择进了吗',this.tableList)
+      //   this.tableList[this.tableIndex].purchaseOrg = selection[0].id
+      //   this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
+      // }
+    },
+    // 搜索区树形选择
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.queryParams.materialClassifyFour = selection.id
+    },
+    // 搜索区物料编码
+    chooseMaterial() {
+      this.$refs.materialRefer.init()
+    },
+    selectMaterial(selection) {
+      console.log('选择的物料', selection)
+      this.queryParams.materialCodeList = selection.map(item => {return item.code})
+      console.log(this.queryParams.materialCodeList)
+      this.queryParams.names = (selection.map(item => {return item.name})).join(',')
+    },
+    // 清空物料搜索框
+    clearMaterial() {
+      this.queryParams.names = ''
+      this.queryParams.materialCodeList = []
+    },
+    // 粘贴来的数据
+    async pasteMe(e) {
+      this.$modal.loading("正在粘贴数据...");
+      e.preventDefault() //阻止默认粘贴事件
+      let source = e.clipboardData.getData("Text");
+      console.log('source', source)
+      // 这里区分普通复制和在表格内复制,判断是否包含','
+      // 没找到,就通过表格复制
+      if (source.indexOf(",") === -1) {
+        // 首先对源头进行解析
+        let rows = source.split("\r\n"); // 拆成一个数组
+        // 数组去除空字符串
+        rows = rows.filter(item => {
+          return item && item.trim()
+        })
+        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+          this.$modal.closeLoading();
+          if (res.code === 200) {
+            let rowList = res.rows
+            console.log('粘贴的', rowList)
+            this.queryParams.materialCodeList = rowList.map(item => {return item.code})
+            this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
+          }
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      } else {
+        // 找到了,按,分割
+        let codelist = source.split(',')
+        console.log('按照逗号分隔', codelist)
+        // 数组去除空字符串
+        codelist = codelist.filter(item => {
+          return item && item.trim()
+        })
+        this.queryParams.materialCodeList = codelist
+        this.queryParams.names = codelist.join(',')
+        this.$modal.closeLoading();
+      }
+    },
+        // 明细行选择业务部门参照带出业务部门数据
+    chooseSon(index, type, isPage, title) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    jilu(index) {
+      console.log('记录index', index)
+      this.record.push(index)
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#demandSummary {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.lines {
+  margin-top: 0;
+}
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+::v-deep .el-table__row > td {
+  border-right: none;
+}
+ ::v-deep .el-card .el-form-item {
+  margin-bottom: 3px;
+}
+::v-deep .el-table__row .success-row {
+  background-color: #ff8a8a!important;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+ }
+</style>

+ 44 - 17
src/views/purchase/DemandSummary/index.vue

@@ -245,6 +245,7 @@
           height="355"
           max-height="355"
           style="font-size: 12px;"
+          :cell-class-name="cellClassName"
           @selection-change="handleSelectionChange"
           @row-click="rowSelect"
           @row-dblclick="doubleClick"
@@ -546,7 +547,12 @@ export default {
   methods: {
     reDraw() {
       this.$refs.table.doLayout();
-      console.log(111)
+    },
+    // 单元格标红
+    cellClassName({row, column, rowIndex, columnIndex}) {
+      if(column.label == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
+        return 'success-row';
+      }
     },
     // 指定列合计
     getSummaries(param) {
@@ -763,6 +769,8 @@ export default {
             this.$modal.notifySuccess("审核成功");
             this.getList(this.queryParams)
           }
+        }).catch(err => {
+          this.getList(this.queryParams)
         })
       }
     },
@@ -875,23 +883,39 @@ export default {
       this.$modal.loading("正在粘贴数据...");
       e.preventDefault() //阻止默认粘贴事件
       let source = e.clipboardData.getData("Text");
-      // 首先对源头进行解析
-      let rows = source.split("\r\n"); // 拆成一个数组
-      // 数组去除空字符串
-      rows = rows.filter(item => {
-        return item && item.trim()
-      })
-      await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-        this.$modal.closeLoading();
-        if (res.code === 200) {
-          let rowList = res.rows
-          console.log('粘贴的', rowList)
-          this.queryParams.materialCodeList = rowList.map(item => {return item.code})
-          this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
-        }
-      }).catch(err => {
+      console.log('source', source)
+      // 这里区分普通复制和在表格内复制,判断是否包含','
+      // 没找到,就通过表格复制
+      if (source.indexOf(",") === -1) {
+        // 首先对源头进行解析
+        let rows = source.split("\r\n"); // 拆成一个数组
+        // 数组去除空字符串
+        rows = rows.filter(item => {
+          return item && item.trim()
+        })
+        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+          this.$modal.closeLoading();
+          if (res.code === 200) {
+            let rowList = res.rows
+            console.log('粘贴的', rowList)
+            this.queryParams.materialCodeList = rowList.map(item => {return item.code})
+            this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
+          }
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      } else {
+        // 找到了,按,分割
+        let codelist = source.split(',')
+        console.log('按照逗号分隔', codelist)
+        // 数组去除空字符串
+        codelist = codelist.filter(item => {
+          return item && item.trim()
+        })
+        this.queryParams.materialCodeList = codelist
+        this.queryParams.names = codelist.join(',')
         this.$modal.closeLoading();
-      })
+      }
     },
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {
@@ -938,6 +962,9 @@ export default {
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;
 }
+::v-deep .el-table__row .success-row {
+  background-color: #ff8a8a!important;
+}
 </style>
 <style>
 .exporttable {

+ 22 - 3
src/views/purchase/PurchaseDemandList/add.vue

@@ -292,7 +292,7 @@
           </ux-table-column>
           <ux-table-column resizable title="预留数量" align="center"  field="reservedQty" width="120px" edit-render>
             <template v-slot:edit="scope">
-                <el-input type="number" min="0" oninput="value=value.replace(/^(0+)|[^\d]+/g, '')" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedQty"></el-input>
+                <el-input type="number" min="0" @input="scope.row.reservedQty=Math.ceil(scope.row.reservedQty)" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedQty"></el-input>
             </template>
           </ux-table-column>
           <ux-table-column resizable title="集团预测分类" align="center"  field="forecastClassify" width="120px"/>
@@ -506,7 +506,7 @@
 <script>
 import Reserved from './reserved.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA } from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan, toOA, confirmSubmit } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
 // 明细行选择物料参照
@@ -1082,6 +1082,25 @@ export default {
           this.$modal.closeLoading();
           this.back()
         }
+        if (res.code === 233) {
+          this.$modal.confirm(res.msg).then(function() {
+            // 确认
+          }).then(() => {
+            confirmSubmit(this.basicForm).then(res => {
+              if (res.code === 200) {
+                this.$modal.notifySuccess("提交成功");
+                this.$modal.closeLoading();
+                this.back()
+              }
+            }).catch(err => {
+              this.$modal.closeLoading();
+            })
+            // 取消
+          }).catch(() => {
+            this.$modal.closeLoading();
+          })
+          this.$modal.closeLoading();
+        }
       }).catch(err => {
         // 加入定时器防止报错关不掉遮罩
         setTimeout(() => {
@@ -1854,7 +1873,7 @@ export default {
 //   top: 70%
 // }
 ::v-deep .elx-body--row .success-row {
-  background-color: #f11616!important;
+  background-color: #ff8a8a!important;
 }
 ::v-deep .uxbeautifyTableClass .elx-table--header-wrapper {
   color: #606266;

+ 31 - 5
src/views/purchase/PurchaseDemandList/index.vue

@@ -207,10 +207,10 @@
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="commit(scope.row)">提交</el-button>
             <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
-            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '9'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
         </el-table>
@@ -320,7 +320,7 @@ import TreeRefers from '@/components/Refers/treeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 // 流程收回
 import { rebacktWork } from '@/api/purchase/workSpace.js'
-import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand } from '@/api/purchase/purchaseDemand.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand, confirmSubmit } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
@@ -661,15 +661,41 @@ export default {
           this.$modal.closeLoading();
           this.getList(this.queryParams)
         }
+        if (res.code === 233) {
+          this.$modal.confirm(res.msg).then(function() {
+            // 确认
+          }).then(() => {
+            confirmSubmit(row).then(res => {
+              if (res.code === 200) {
+                this.$modal.notifySuccess("提交成功");
+                this.$modal.closeLoading();
+                this.getList(this.queryParams)
+              }
+            }).catch(err => {
+              this.$modal.closeLoading();
+            })
+            // 取消
+          }).catch(() => {
+            this.$modal.closeLoading();
+          })
+          this.$modal.closeLoading();
+        }
       }).catch(err => {
         this.$modal.closeLoading();
       })
     },
     // 流程收回
     reback(row) {
+      this.$modal.loading("收回中...");
       let params = {billCode: row.code, fdId: row.flowId, fdTemplateId: '18804432233a7813df7921d436ab69b7' }
       rebacktWork(params).then(res => {
-        
+        if (res.code === 200) {
+          this.$modal.notifySuccess("收回成功");
+          this.$modal.closeLoading();
+          this.getList(this.queryParams)
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
       })
     },
     // 行内删除

+ 26 - 8
src/views/purchase/apply/add/index.vue

@@ -86,8 +86,16 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-            purchasequantity
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "", priceType: prop.row.priceType});
+            purchasequantity,
+            recentlyPriceDate
+          } = await fetchExist({
+            puOrg,
+            customer,
+            supplier,
+            materialCode,
+            customerName: "",
+            priceType: prop.row.priceType
+          });
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -102,6 +110,7 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            recentlyPriceDate: recentlyPriceDate,
             yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
@@ -110,7 +119,7 @@
           });
         }
       },
-      // 
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -123,11 +132,20 @@
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
-          prop.row.yPurchaseQuantity = purchasequantity
-          prop.row.recentlyPrice = recentlyPrice
-          prop.row.isApprovalFirst = isApprovalFirst
+          purchasequantity,
+          recentlyPriceDate
+        } = await fetchExist({
+          puOrg,
+          supplier,
+          materialCode: prop.row.materialCode,
+          customer: prop.row.customer,
+          customerName: prop.row.customerName,
+          priceType: prop.row.priceType
+        });
+        prop.row.yPurchaseQuantity = purchasequantity
+        prop.row.recentlyPrice = recentlyPrice
+        prop.row.isApprovalFirst = isApprovalFirst
+        prop.row.recentlyPriceDate = recentlyPriceDate
       },
       //
       async onOpen() {

+ 2 - 2
src/views/purchase/apply/columns.js

@@ -22,7 +22,7 @@ export default function useColumns() {
     { item: { key: "createByName", title: "创建人", width: 100 }, attr: {} },
     {
       item: { key: "isEffective", title: "是否已推价格", width: 100 },
-      attr: { is: "el-dict-tag", dictName: "is_effective", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "is_effective"},
     },
     {
       item: { key: "approveTime", title: "单据申请日期", width: 100 },
@@ -30,7 +30,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型", width: 100 },
-      attr: { is: "el-dict-tag", dictName: "price_source", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "price_source" },
     },
   ].map(({ item, attr }) => ({
     attr,

+ 245 - 230
src/views/purchase/apply/copy/index.vue

@@ -1,132 +1,135 @@
 <script>
-import useColumns from "./columns";
-import { EXIST } from "@/api/business/purchase/catalogue";
-import { ITEM, SAVE } from "@/api/business/purchase/apply";
-import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
+  import useColumns from "./columns";
+  import {EXIST} from "@/api/business/purchase/catalogue";
+  import {ITEM, SAVE} from "@/api/business/purchase/apply";
+  import {tax, unit, currency} from "@/components/popover-select-v2/fetch";
 
-const fetchExist = async (prop) => {
-  try {
-    // try
-    const { code, data } = await EXIST(prop);
-    if (code === 200) return data;
-  } catch (err) {
-    // catch
-    console.error(err);
-  } finally {
-    // finally
-  }
-};
+  const fetchExist = async (prop) => {
+    try {
+      // try
+      const {code, data} = await EXIST(prop);
+      if (code === 200) return data;
+    } catch (err) {
+      // catch
+      console.error(err);
+    } finally {
+      // finally
+    }
+  };
 
-export default {
-  name: "CopyDrawer",
-  props: {
-    dict: {
-      type: Object,
+  export default {
+    name: "CopyDrawer",
+    props: {
+      dict: {
+        type: Object,
+      },
+      selectData: {
+        type: [Array],
+        require: true,
+      },
     },
-    selectData: {
-      type: [Array],
-      require: true,
+    components: {
+      ElSuperForm: () => import("@/components/super-form/index.vue"),
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
+    },
+    data() {
+      const {
+        TabColumns,
+        TableColumns,
+        TabColumns: [
+          {
+            item: {key: tabName},
+          },
+        ],
+      } = useColumns();
+      const rules = this.$init.rules([...TabColumns, ...TableColumns]);
+      const params = this.$init.params([...TabColumns, ...TableColumns]);
+      return {
+        title: "复 制",
+        width: "100%",
+        visible: false,
+        loading: false,
+        rules: rules,
+        params: params,
+        tabName: tabName,
+        TabColumns: TabColumns,
+        TableColumns: TableColumns,
+      };
     },
-  },
-  components: {
-    ElSuperForm: () => import("@/components/super-form/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
-  },
-  data() {
-    const {
-      TabColumns,
-      TableColumns,
-      TabColumns: [
-        {
-          item: { key: tabName },
+    computed: {
+      disabled: {
+        get() {
+          const {
+            selectData: {length},
+          } = this.$props;
+          if (length !== 1) {
+            return true;
+          }
+        },
+        set() {
         },
-      ],
-    } = useColumns();
-    const rules = this.$init.rules([...TabColumns, ...TableColumns]);
-    const params = this.$init.params([...TabColumns, ...TableColumns]);
-    return {
-      title: "复 制",
-      width: "100%",
-      visible: false,
-      loading: false,
-      rules: rules,
-      params: params,
-      tabName: tabName,
-      TabColumns: TabColumns,
-      TableColumns: TableColumns,
-    };
-  },
-  computed: {
-    disabled: {
-      get() {
-        const {
-          selectData: { length },
-        } = this.$props;
-        if (length !== 1) {
-          return true;
-        }
       },
-      set() {},
     },
-  },
-  watch: {},
-  methods: {
-    //
-    async changeMaterialName(prop) {
-      const { selectData } = prop;
-      const {
-        puOrg,
-        customer,
-        supplier,
-        currency,
-        currencyCode,
-        currencyName,
-      } = this.params;
-      const { nickName: createByName } = this.$store.state.user;
-      if (selectData.length) {
-        this.params[this.tabName].splice(-1);
-      }
-      for (const item of selectData) {
-        this.loading = true;
-        const { tax: taxName, unitName, code: materialCode } = item;
-        // task 1
-        const { ntaxrate } = await tax(taxName);
-        // task 2
+    watch: {},
+    methods: {
+      //
+      async changeMaterialName(prop) {
+        const {selectData} = prop;
         const {
-          id: puUnit,
-          code: puUnitCode,
-          name: puUnitName,
-        } = await unit(unitName);
-        // task 3
-        const {
-          recentlyPrice = "0",
-          isApprovalFirst = "N",
-          purchasequantity
-        } = await fetchExist({ puOrg, customer, supplier, materialCode, priceType: prop.row.priceType });
-        this.loading = false;
-        await this.onRowAdd(this.tabName, {
-          ...item,
-          currency: currency,
-          currencyCode: currencyCode,
-          currencyName: currencyName,
-          unit: puUnit,
-          unitCode: puUnitCode,
-          unitName: puUnitName,
-          puUnit: puUnit,
-          puUnitCode: puUnitCode,
-          puUnitName: puUnitName,
-          recentlyPrice,
-          isApprovalFirst,
-          yPurchaseQuantity: purchasequantity,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
-          createByName: createByName,
-          updateByName: createByName,
-          id: null,
-        });
-      }
-    },
-      // 
+          puOrg,
+          customer,
+          supplier,
+          currency,
+          currencyCode,
+          currencyName,
+        } = this.params;
+        const {nickName: createByName} = this.$store.state.user;
+        if (selectData.length) {
+          this.params[this.tabName].splice(-1);
+        }
+        for (const item of selectData) {
+          this.loading = true;
+          const {tax: taxName, unitName, code: materialCode} = item;
+          // task 1
+          const {ntaxrate} = await tax(taxName);
+          // task 2
+          const {
+            id: puUnit,
+            code: puUnitCode,
+            name: puUnitName,
+          } = await unit(unitName);
+          // task 3
+          const {
+            recentlyPrice = "0",
+            isApprovalFirst = "N",
+            purchasequantity,
+            recentlyPriceDate
+          } = await fetchExist({puOrg, customer, supplier, materialCode, priceType: prop.row.priceType});
+          this.loading = false;
+          await this.onRowAdd(this.tabName, {
+            ...item,
+            currency: currency,
+            currencyCode: currencyCode,
+            currencyName: currencyName,
+            unit: puUnit,
+            unitCode: puUnitCode,
+            unitName: puUnitName,
+            puUnit: puUnit,
+            puUnitCode: puUnitCode,
+            puUnitName: puUnitName,
+            recentlyPrice,
+            recentlyPriceDate: recentlyPriceDate,
+            isApprovalFirst,
+            yPurchaseQuantity: purchasequantity,
+            tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
+            createByName: createByName,
+            updateByName: createByName,
+            id: null,
+          });
+        }
+      },
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -139,124 +142,136 @@ export default {
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
-          prop.row.yPurchaseQuantity = purchasequantity
-          prop.row.recentlyPrice = recentlyPrice
-          prop.row.isApprovalFirst = isApprovalFirst
+          purchasequantity,
+          recentlyPriceDate
+        } = await fetchExist({
+          puOrg,
+          supplier,
+          materialCode: prop.row.materialCode,
+          customer: prop.row.customer,
+          customerName: prop.row.customerName,
+          priceType: prop.row.priceType
+        });
+        prop.row.yPurchaseQuantity = purchasequantity
+        prop.row.recentlyPrice = recentlyPrice
+        prop.row.isApprovalFirst = isApprovalFirst
+        prop.row.recentlyPriceDate = recentlyPriceDate
       },
-    //
-    async fetchItem(prop) {
-      try {
-        // try
-        this.loading = true;
-        const { tabName, TabColumns } = this;
-        const { TableColumns } = TabColumns.find(
-          ({ item: { key } }) => key === tabName
-        );
-        console.log('看看prop', prop)
-        const { code, data } = await ITEM(prop, true);
-        if (code === 200) {
-          this.params = data;
-          this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
-            ...this.$init.params(TableColumns),
-            ...item,
-            id: null,
-          }));
-          this.params.id = null;
-        } else {
+      //
+      async fetchItem(prop) {
+        try {
+          // try
+          this.loading = true;
+          const {tabName, TabColumns} = this;
+          const {TableColumns} = TabColumns.find(
+            ({item: {key}}) => key === tabName
+          );
+          console.log('看看prop', prop)
+          const {code, data} = await ITEM(prop, true);
+          if (code === 200) {
+            this.params = data;
+            this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
+              ...this.$init.params(TableColumns),
+              ...item,
+              id: null,
+            }));
+            this.params.id = null;
+          } else {
+            this.visible = false;
+          }
+        } catch (err) {
+          // catch
+          console.error(err);
           this.visible = false;
+        } finally {
+          // finally
+          this.loading = false;
         }
-      } catch (err) {
-        // catch
-        console.error(err);
+      },
+      //
+      async onOpen() {
+        this.visible = true;
+        const {
+          selectData: [{id}],
+        } = this.$props;
+        this.params.id = null;
+        this.params.createBy = null;
+        this.params.priceCode = null;
+        this.params.createByName = null;
+        this.params.effectiveDate = null;
+        this.params.priceApplyOrgs = [];
+        this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
+          ...item,
+          id: null,
+          applyId: null,
+          createByName: null,
+          updateByName: null,
+          delFlag: 0,
+        }));
+        await this.fetchItem(id);
+      },
+      //
+      async onHide() {
+        const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
-      } finally {
-        // finally
-        this.loading = false;
-      }
-    },
-    //
-    async onOpen() {
-      this.visible = true;
-      const {
-        selectData: [{ id }],
-      } = this.$props;
-      this.params.id = null;
-      this.params.createBy = null;
-      this.params.priceCode = null;
-      this.params.createByName = null;
-      this.params.effectiveDate = null;
-      this.params.priceApplyOrgs = [];
-      this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
-        ...item,
-        id: null,
-        applyId: null,
-        createByName: null,
-        updateByName: null,
-        delFlag: 0,
-      }));
-      await this.fetchItem(id);
-    },
-    //
-    async onHide() {
-      const { TabColumns, TableColumns } = useColumns();
-      this.visible = false;
-      this.params = this.$init.params([...TabColumns, ...TableColumns]);
-      this.$emit("success");
+        this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
+      },
+      //
+      async onRowAdd(prop, pushParams = {}) {
+        this.$refs.superForm.validate(async (valid) => {
+          if (valid) {
+            const {TabColumns} = this;
+            const {TableColumns} = TabColumns.find(
+              ({item: {key}}) => key === prop
+            );
+            this.params[prop].push({
+              delFlag: "0",
+              ...this.$init.params(TableColumns),
+              ...pushParams,
+            });
+          }
+        });
+      },
+      //
+      async onRowRemove(prop, scope) {
+        const {$index} = scope;
+        this.params[prop].splice($index, 1);
+      },
+      //
+      async useSubmit(prop) {
+        this.$refs[prop].validate(async (valid) => {
+          console.log(this.params);
+          if (valid) {
+            try {
+              this.loading = true;
+              this.params.priceApplyOrgs = [];
+              const {msg, code} = await SAVE(this.params);
+              if (code === 200) {
+                this.onHide();
+                this.$emit("success");
+                this.$notify.success(msg);
+              }
+            } catch (err) {
+              // catch
+              console.error(err);
+            } finally {
+              // finally
+              this.loading = false;
+            }
+          } else {
+            return false;
+          }
+        });
+      },
     },
-    //
-    async onRowAdd(prop, pushParams = {}) {
-      this.$refs.superForm.validate(async (valid) => {
-        if (valid) {
-          const { TabColumns } = this;
-          const { TableColumns } = TabColumns.find(
-            ({ item: { key } }) => key === prop
-          );
-          this.params[prop].push({
-            delFlag: "0",
-            ...this.$init.params(TableColumns),
-            ...pushParams,
-          });
-        }
-      });
+    created() {
     },
-    //
-    async onRowRemove(prop, scope) {
-      const { $index } = scope;
-      this.params[prop].splice($index, 1);
+    mounted() {
     },
-    //
-    async useSubmit(prop) {
-      this.$refs[prop].validate(async (valid) => {
-        console.log(this.params);
-        if (valid) {
-          try {
-            this.loading = true;
-            this.params.priceApplyOrgs = [];
-            const { msg, code } = await SAVE(this.params);
-            if (code === 200) {
-              this.onHide();
-              this.$emit("success");
-              this.$notify.success(msg);
-            }
-          } catch (err) {
-            // catch
-            console.error(err);
-          } finally {
-            // finally
-            this.loading = false;
-          }
-        } else {
-          return false;
-        }
-      });
+    destroyed() {
     },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
+  };
 </script>
 <template>
   <el-button

+ 7 - 3
src/views/purchase/apply/edit/index.vue

@@ -131,7 +131,8 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-            purchasequantity
+            purchasequantity,
+            recentlyPriceDate
           } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "",priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
@@ -147,6 +148,7 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            recentlyPriceDate: recentlyPriceDate,
             yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
@@ -155,7 +157,7 @@
           });
         }
       },
-      // 
+      //
       async changeCustomerName(prop) {
         console.log("prop", prop)
         const {
@@ -168,11 +170,13 @@
         const {
           recentlyPrice,
           isApprovalFirst,
-          purchasequantity
+          purchasequantity,
+          recentlyPriceDate
           } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
           prop.row.yPurchaseQuantity = purchasequantity
           prop.row.recentlyPrice = recentlyPrice
           prop.row.isApprovalFirst = isApprovalFirst
+          prop.row.recentlyPriceDate = recentlyPriceDate
       },
       //
       async fetchItem(prop) {

+ 14 - 0
src/views/purchase/apply/index.vue

@@ -171,6 +171,10 @@
         this.upload.title = "文件导入"
         this.upload.open = true
       },
+      // 收回
+      reback(row) {
+        console.log(row)
+      },
     },
   };
 </script>
@@ -257,6 +261,16 @@
       @row-select="useSelect"
       @pagination="useQuery(params, page)"
     >
+      <el-table-column
+        fixed="right"
+        label="操作"
+        align="center"
+        width="100"
+        >
+        <template slot-scope="scope">
+          <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
+        </template>
+      </el-table-column>
     </el-super-table>
     <!-- 文件导入对话框 -->
     <el-dialog title="文件导入" :visible.sync="upload.open" width="400px">

+ 23 - 0
src/views/purchase/purchase-order/add/column copy.js

@@ -0,0 +1,23 @@
+
+// 集采中心
+const PurColumns =[];
+const PurchaseTabColumns =[];
+
+// 事业发展部
+const CauseColumns =[];
+const CauseTabColumns =[];
+// export const initTabColumns = () => tabColumns;
+
+export const Columns = [];
+export const TabColumns = [];
+
+const judgeColumns = () =>{
+
+  const { deptName, deptId, name, nickName, roles } = this.$store.state.user;
+
+  if(roles.length && roles.find(role => role === '')){
+
+  }
+
+
+}

+ 18 - 1
src/views/purchase/purchase-order/add/column.js

@@ -557,7 +557,7 @@ export const TabColumns = [
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',
-          isMedcine:'isMedicine',
+          isMedcine:'isMedicineYN',
           manufacturer:'manufacturerId',
           manufacturerName:'manufacturerIdName',
           unit:'unitId',
@@ -709,6 +709,23 @@ export const TabColumns = [
         width: 180,
        },
       { 
+        key: "nitemdiscountrate", 
+        title: "折扣(%)", 
+        inputType: "Input",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { 
+        key: "ntaxnetprice", 
+        title: "含税净价", 
+        inputType: "Input",
+        controlsPosition: "right",
+        // precision:2,
+        disabled:true,
+        width: 180,
+       },
+      { 
         key: "arrivalQty",
         title: "已到货数量",
         inputType: "InputNumber",

+ 33 - 31
src/views/purchase/purchase-order/add/index.vue

@@ -70,8 +70,9 @@ export default {
     "params.billType":{
       handler(nVal, oVal){
 
-        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10')){
-
+        let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
+        
+        if(billList.find(item => item === nVal)){
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
@@ -83,6 +84,7 @@ export default {
           this.rules.warehouseName = null;
           this.rules.goodsAllocationName = null;
         }
+
         this.count++;
       }
     }
@@ -388,37 +390,37 @@ export default {
         
       }
 
-      // // 组织
-      // if(type === 'ORG_PARAM'){
-
-      //     for (const key in this.params) {
-
-      //       // if (Array.isArray(this.params[key])) {
-      //       if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
-
-      //         this.params[key] = [];
-
-      //       }
-      //       else if(key === 'sysFileRecordList'){
-      //         this.params[key] = [];
-      //       }
-      //        else if (
-      //         key != "puOrg" &&
-      //         key != "puOrgName" &&
-      //         key != "buyer" &&
-      //         key != "buyerName" &&
-      //         key != "puDept" &&
-      //         key != "puDeptName" &&
-      //         key != "status" &&
-      //         key != "billDate" 
-      //       ) {
-      //         this.params[key] = "";
-      //       } else {
-      //       }
-      //     }
+      // 组织
+      if(type === 'ORG_PARAM'){
+
+          for (const key in this.params) {
+
+            // if (Array.isArray(this.params[key])) {
+            if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+              this.params[key] = [];
+
+            }
+            else if(key === 'sysFileRecordList'){
+              this.params[key] = [];
+            }
+             else if (
+              key != "puOrg" &&
+              key != "puOrgName" &&
+              key != "buyer" &&
+              key != "buyerName" &&
+              key != "puDept" &&
+              key != "puDeptName" &&
+              key != "status" &&
+              key != "billDate" 
+            ) {
+              this.params[key] = "";
+            } else {
+            }
+          }
         
 
-      // }
+      }
     },
 
     // 下拉框选择改变

+ 39 - 3
src/views/purchase/purchase-order/edit/index.vue

@@ -60,8 +60,9 @@ export default {
     "params.billType":{
       handler(nVal, oVal){
 
-        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10')){
-
+        let billList = ['21-Cxx-02','21-Cxx-04','21-Cxx-10','21-Cxx-14','21-Cxx-09','21-Cxx-17','21-Cxx-18'];
+        
+        if(billList.find(item => item === nVal)){
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
           ];
@@ -73,9 +74,10 @@ export default {
           this.rules.warehouseName = null;
           this.rules.goodsAllocationName = null;
         }
+
         this.count++;
       }
-    },
+    }
   },
   methods: {
     setVisible(prop) {
@@ -343,6 +345,40 @@ export default {
 
           await this.handleGetPrice();
         }
+
+      
+      }
+
+      // 组织
+      if(type === 'ORG_PARAM'){
+
+        for (const key in this.params) {
+
+          // if (Array.isArray(this.params[key])) {
+          if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+            this.params[key] = [];
+
+          }
+          else if(key === 'sysFileRecordList'){
+            this.params[key] = [];
+          }
+          else if (
+            key != "puOrg" &&
+            key != "puOrgName" &&
+            key != "buyer" &&
+            key != "buyerName" &&
+            key != "puDept" &&
+            key != "puDeptName" &&
+            key != "status" &&
+            key != "billDate" 
+          ) {
+            this.params[key] = "";
+          } else {
+          }
+        }
+
+
       }
     },
     // 子表参照改变之后

+ 26 - 12
src/views/purchase/purchase-order/index.vue

@@ -29,6 +29,7 @@ export default {
     PurchaseReturnDrawer: () => import('./purchaseReturn/index.vue'),
     ElSuperTable: () => import("@/components/super-table/index.vue"),
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    Retrieve: () => import("@/components/Retrieve/index.vue"),
     },
   data() {
     const initTabColumns = () => TabColumns;
@@ -318,7 +319,7 @@ export default {
     // 批量提交
     handleBatchSubmit(){
 
-      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3') && row.isEnd === 'N'));
+      let inconformity = this.checkedList.filter(row => !((row.status == '0' || row.status == '3' || row.status == '9') && row.isEnd === 'N'));
 
       if(!inconformity.length && this.checkedList.length){
 
@@ -368,9 +369,9 @@ export default {
               cancelButtonText: '取消',
               beforeClose: async(action, instance, done) => {
                 if (action === 'confirm') {
+                  instance.confirmButtonLoading = true;
+                  instance.confirmButtonText = '执行中...';
                   try {
-                    instance.confirmButtonLoading = true;
-                    instance.confirmButtonText = '执行中...';
                     let { code,msg } = await orderApi.submit({ puOrderIds,checkAmount:false});
                     if(code == 200){
                       done();
@@ -378,7 +379,7 @@ export default {
                     }
                     
                   } catch (error) {
-                    
+                    instance.confirmButtonText = "确认";
                   }finally{
                     instance.confirmButtonLoading = false;
                   }
@@ -395,7 +396,7 @@ export default {
         finally{
           this.loading = false;
         }
-        })
+      })
      
     },
 
@@ -601,27 +602,38 @@ export default {
       }
     },
     judgeIsOption(type,source){
-      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中
+      // status: 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中 9=已回退
       // source: 1=自动协议直采,2=协议直采,3=手工
       // isEnd:整单关闭标识
       switch(type){
         case 'edit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'revise':
             return source.status == '2' && source.isEnd === 'N';
         case 'del':
-          return (source.status == '0' || source.status == '3') && source.source == '3' && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.source == '3' && source.isEnd === 'N';
         case 'submit':
-          return (source.status == '0' || source.status == '3') && source.isEnd === 'N';
+          return (source.status == '0' || source.status == '3' || source.status == '9') && source.isEnd === 'N';
         case 'allClose':
           return source.status == 0 && source.isEnd === 'N';
         case 'return':
           return source.source != 3 && source.isEnd === 'N' &&
-                (source.status == 0 || source.status == 3);
+                (source.status == 0 || source.status == 3 || source.status == '9');
         default:
          return false;
       }
-    }
+    },
+    handelRetrieve(row){
+
+      let { status, flowId, code,createBy } = row;
+      return {
+        status,
+        fdId:flowId,
+        fdTemplateId:'1880447a834addc648b3763477a9b09f',
+        billCode:code,
+        billMaker:createBy,
+      }
+    },
   }
 };
 </script>
@@ -674,6 +686,7 @@ export default {
             size="mini" 
             @click="handleDownload" 
           >批量导出</el-button>
+          
         </el-button-group>
         
 
@@ -735,11 +748,12 @@ export default {
                 @click.stop="handleSubmit(scope.row)"
               >提交</el-button>
               <el-button 
-                v-if="scope.row.flowId && scope.row.flowId !== ''" 
+                v-if="scope.row.flowId && scope.row.flowId !== '' && scope.row.status !== '9'" 
                 type="text" 
                 size="mini"
                 @click.stop="jumpFlow(scope.row)"
               >流程跳转</el-button>
+              <!-- <Retrieve :data="handelRetrieve(scope.row)" @success="handleQueryList"></Retrieve> -->
             </template>
         </el-table-column>