Browse Source

Merge branch 'dev' into 'historical_route'

Dev

See merge request new-business/drp-web!446
黄梓星 1 year ago
parent
commit
238c6bfbf4
81 changed files with 4563 additions and 1543 deletions
  1. 3 1
      package.json
  2. 12 3
      src/api/business/purchase/apply.js
  3. 9 0
      src/api/business/purchase/catalogue.js
  4. 21 1
      src/api/business/purchase/purchase-order.js
  5. 19 1
      src/api/changeApply/basic.js
  6. 9 0
      src/api/classify/basic.js
  7. 1 1
      src/api/purchase/DemandSummary.js
  8. 27 0
      src/api/purchase/ownership.js
  9. 8 0
      src/api/purchase/purchaseDemand.js
  10. 8 1
      src/api/purchase/transferOrder.js
  11. 26 0
      src/api/purchase/workSpace.js
  12. 9 0
      src/api/system/role.js
  13. 196 0
      src/components/BatchImport/index.vue
  14. 1 1
      src/components/Pagination/index.vue
  15. 11 2
      src/components/popover-select-v2/index.vue
  16. 26 10
      src/components/popover-select/components/MATERIAL_PARAM.js
  17. 1 0
      src/components/popover-select/components/TAX_RATE_PARAM.js
  18. 1 1
      src/components/popover-select/index.vue
  19. 2 0
      src/components/super-form/index.vue
  20. 2 0
      src/components/super-search/index.vue
  21. 13 2
      src/components/super-table/index.vue
  22. 7 0
      src/main.js
  23. 1 1
      src/utils/init.js
  24. 3 0
      src/utils/request.js
  25. 0 476
      src/views/business/spd/bo/authority/authority-index.vue
  26. 418 373
      src/views/business/spd/bo/authority/index.vue
  27. 1 0
      src/views/business/spd/bo/task/taskList.vue
  28. 0 0
      src/views/business/spd/fillin/dailysale_quantity_assess/addmaterial.vue
  29. 0 0
      src/views/business/spd/fillin/dailysale_quantity_assess/choosematerial.vue
  30. 0 0
      src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue
  31. 431 0
      src/views/business/spd/fillin/dailysale_quantity_assess/index.vue
  32. 0 12
      src/views/business/spd/fillin/test/index.vue
  33. 27 0
      src/views/business/spd/goal_management/experiment/DemoChildren.vue
  34. 48 0
      src/views/business/spd/goal_management/experiment/DemoFather.vue
  35. 8 0
      src/views/material/basicFile/columns.js
  36. 13 5
      src/views/material/basicFile/details.vue
  37. 16 8
      src/views/material/basicFile/index.vue
  38. 37 36
      src/views/material/changeApply/add/column.js
  39. 202 137
      src/views/material/changeApply/add/index.vue
  40. 11 1
      src/views/material/changeApply/columns.js
  41. 6 5
      src/views/material/changeApply/index.vue
  42. 106 13
      src/views/material/classify/index.vue
  43. 36 17
      src/views/material/requisition/add.vue
  44. 71 16
      src/views/material/requisition/columns.js
  45. 44 30
      src/views/material/requisition/index.vue
  46. 31 6
      src/views/purchase/DemandSummary/add.vue
  47. 977 0
      src/views/purchase/DemandSummary/index-bak.vue
  48. 106 35
      src/views/purchase/DemandSummary/index.vue
  49. 48 28
      src/views/purchase/PurchaseDemandList/add.vue
  50. 48 6
      src/views/purchase/PurchaseDemandList/index.vue
  51. 17 9
      src/views/purchase/apply/add/columns.js
  52. 10 7
      src/views/purchase/apply/add/index.vue
  53. 2 2
      src/views/purchase/apply/columns.js
  54. 17 6
      src/views/purchase/apply/copy/columns.js
  55. 8 4
      src/views/purchase/apply/copy/index.vue
  56. 18 11
      src/views/purchase/apply/edit/columns.js
  57. 7 5
      src/views/purchase/apply/edit/index.vue
  58. 208 98
      src/views/purchase/apply/index.vue
  59. 9 7
      src/views/purchase/apply/see/columns.js
  60. 3 1
      src/views/purchase/apply/see/index.vue
  61. 21 7
      src/views/purchase/catalogue/columns.js
  62. 28 2
      src/views/purchase/catalogue/index.vue
  63. 7 4
      src/views/purchase/catalogue/see/columns.js
  64. 5 1
      src/views/purchase/contract/columns.js
  65. 309 0
      src/views/purchase/ownership/index.vue
  66. 23 0
      src/views/purchase/purchase-order/add/column copy.js
  67. 33 3
      src/views/purchase/purchase-order/add/column.js
  68. 116 6
      src/views/purchase/purchase-order/add/index.vue
  69. 141 86
      src/views/purchase/purchase-order/column.js
  70. 151 4
      src/views/purchase/purchase-order/edit/index.vue
  71. 4 3
      src/views/purchase/purchase-order/edit/initColumn.js
  72. 5 5
      src/views/purchase/purchase-order/index.vue
  73. 35 5
      src/views/purchase/task/columns.js
  74. 13 14
      src/views/purchase/task/xie-yi-zhi-cai/column.js
  75. 4 0
      src/views/purchase/task/xie-yi-zhi-cai/index.vue
  76. 2 2
      src/views/purchase/task/zhuan-pai/index.vue
  77. 22 5
      src/views/purchase/transferOrder/add.vue
  78. 18 11
      src/views/purchase/transferOrder/index.vue
  79. 214 0
      src/views/purchase/workSpace/index.vue
  80. 11 5
      src/views/system/table-template/auth-dialog.vue
  81. 1 1
      vue.config.js

+ 3 - 1
package.json

@@ -68,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",

+ 12 - 3
src/api/business/purchase/apply.js

@@ -9,9 +9,9 @@ export function LIST(data, params) {
   });
 }
 
-export function ITEM(data) {
+export function ITEM(data, isCopy) {
   return request({
-    url: `/pu/priceApply/${data}`,
+    url: `/pu/priceApply/${data}/${isCopy}`,
     method: "GET",
   });
 }
@@ -42,7 +42,16 @@ export function REMOVE(data) {
 // 模板下载
 export function mbDownload(data) {
   return request({
-    url: `/pu/demand/download`,
+    url: `/pu/priceApply/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}
+// 导入失败文件下载
+export function failDownload(data) {
+  return request({
+    url: `/pu/priceApply/downloadFailData`,
     method: 'post',
     data: data,
     responseType: 'blob'

+ 9 - 0
src/api/business/purchase/catalogue.js

@@ -55,3 +55,12 @@ export function EXPORT(data) {
     data: data,
   });
 }
+// 采购需求单导出
+export function exportAll(data) {
+  return request({
+    url: `/pu/price/catalogue/export`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 21 - 1
src/api/business/purchase/purchase-order.js

@@ -152,6 +152,8 @@ const toOA =(userName, fdId) => {
   })
 }
 
+
+
 // 采购订单修订导出
 const orderExport =(data) => {
   return request({
@@ -161,6 +163,23 @@ const orderExport =(data) => {
   })
 }
 
+// 行导入
+const orderImport = (data) =>{
+  return request({
+    url: "/pu/order/import",
+    method: "POST",
+    data: data,
+  });
+}
+// 模板下载
+const downloadFailData = (data) =>{
+  return request({
+    url: "/pu/order/downloadFailData",
+    method: "POST",
+    data: data,
+  });
+}
+
 export default {
   list,
   details,
@@ -180,5 +199,6 @@ export default {
   returnedGoods,
   toOA,
   orderExport,
-
+  orderImport,
+  downloadFailData,
 }

+ 19 - 1
src/api/changeApply/basic.js

@@ -104,4 +104,22 @@ export function toOA(userName, fdId) {
     url: `/oaflow/redirectToOa/${userName}/${fdId}`,
     method: 'get',
   })
-}
+}
+
+
+// 行模板下载
+export function downloadInner(data) {
+  return request({
+    url: `/material/change/downloadInner`,
+    method: 'post',
+    data: data
+  })
+}
+// 行模板下载
+export function importInner(data) {
+  return request({
+    url: `/material/change/importInner`,
+    method: 'post',
+    data: data
+  })
+}

+ 9 - 0
src/api/classify/basic.js

@@ -40,3 +40,12 @@ export function edit(data) {
     data: data
   })
 }
+// 物料基本分类模板下载
+export function downLoadClassify(data) {
+  return request({
+    url: `/system/classify/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}

+ 1 - 1
src/api/purchase/DemandSummary.js

@@ -95,7 +95,7 @@ export function exportList(data) {
 // 采购需求汇总明细导出
 export function exportItems(data) {
   return request({
-    url: `/pu/demand/item/exports`,
+    url: `/pu/demand/item/exports?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
     method: 'post',
     data: data,
     responseType: 'blob'

+ 27 - 0
src/api/purchase/ownership.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+// 列表
+export function materialList(query) {
+  return request({
+    url: '/pu/ownership/item/materialList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 详细
+export function getDetail(id) {
+  return request({
+    url: '/pu/ownership/item/' + id,
+    method: 'get'
+  })
+}
+
+// 修改
+export function update(data) {
+  return request({
+    url: '/pu/ownership/item/',
+    method: 'put',
+    data: data
+  })
+}

+ 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
+  })
 }

+ 8 - 1
src/api/purchase/transferOrder.js

@@ -33,7 +33,6 @@ export function submitOrder(data) {
   })
 }
 // 调拨订单详情
-// 调拨订单详情
 export function getOrderDetail(id) {
   return request({
     url: `/pu/allot/detail/${id}`,
@@ -61,4 +60,12 @@ export function getResevedDetail(id) {
     url: `/pu/ownership/detail/${id}`,
     method: 'get',
   })
+}
+
+// 查询调拨物料明细列表
+export function listStAllotItem(pid) {
+  return request({
+    url: `/pu/allot/material/byPid/${pid}`,
+    method: 'get',
+  })
 }

+ 26 - 0
src/api/purchase/workSpace.js

@@ -0,0 +1,26 @@
+import request from '@/utils/request'
+
+// 工作台列表
+export function getWorkSpaceList(data) {
+  return request({
+    url: `oaflow/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    method: 'post',
+    data: data
+  })
+}
+// 工作台审批
+export function auditWork(data) {
+  return request({
+    url: `oaflow/approve`,
+    method: 'post',
+    data: data
+  })
+}
+// 统一所有页面的收回流程接口
+export function rebacktWork(data) {
+  return request({
+    url: `oaflow/rollback`,
+    method: 'post',
+    data: data
+  })
+}

+ 9 - 0
src/api/system/role.js

@@ -117,3 +117,12 @@ export function deptTreeSelect(roleId) {
     method: 'get'
   })
 }
+
+// 角色列表
+export function listOptionselect(query) {
+  return request({
+    url: '/system/role/optionselect',
+    method: 'get',
+    params: query
+  })
+}

+ 196 - 0
src/components/BatchImport/index.vue

@@ -0,0 +1,196 @@
+
+
+<script>
+export default {
+  name:'BatchImport',
+  props:{
+    disabled:{
+      type:Boolean,
+      default:false,
+    },
+    limit:{
+      type:Number,
+      default:1,
+    },
+    fileType:{
+      type:Array,
+      default:()=>['xls', 'xlsx'],
+    },
+    size:{
+      type:String,
+      default:'mini',
+    },
+    isShowTip:{
+      type:Boolean,
+      default:true,
+    },
+    isTemplate:{
+      type:Boolean,
+      default:true,
+    },
+    fileSize: {
+      type: Number,
+      default: 100,
+    },
+  },
+  computed:{
+     // 是否显示提示
+     showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize);
+    },
+    accept(){
+      return this.fileType.map(item =>(`.${item}`)).join(',');
+    }
+  },
+  data(){
+    return {
+      title:'批量导入',
+      visible:false,
+      loading:false,
+      fileList:[],
+      number: 0,
+
+    }
+  },
+  methods:{
+    // 确认上传
+    async submitUpload(){
+      if(this.fileList.length){
+        this.$emit('import',this.fileList);
+      }else{
+      this.$notify.warning({
+        title:'警告',
+        message: '请上传文件之后在确认!',
+      });
+
+      }
+      
+    },
+    // 模板下载
+    async templateDownload(){
+      this.$emit('temDownload')
+      // 放父组件
+      // this.download('/system/material/download', {}, `物料基本信息模板.xlsx`);
+    },
+    // 
+    beforeClose(done){
+      this.fileList = [];
+      // 关闭前清空
+      done();
+    },
+    // 预览
+    handlePreview(){},
+    // 移除
+    handleRemove(file, fileList){
+      this.fileList = fileList;
+    },
+    // 文件改变
+    onChange(file, fileList){
+      this.fileList = fileList;
+    },
+    setVisible(prop){
+      this.visible = prop;
+      if(!prop){
+        this.fileList = [];
+      }
+    },
+    open(){
+      this.setVisible(true);
+    },
+    // 取消
+    cancal(){
+      this.setVisible(false);
+    },
+     // 上传前校检格式和大小
+     handleBeforeUpload(file) {
+      // 校检文件类型
+      if (this.fileType) {
+        const fileName = file.name.split(".");
+        const fileExt = fileName[fileName.length - 1];
+        const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
+        if (!isTypeOk) {
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
+          return false;
+        }
+      }
+      // 校检文件大小
+      if (this.fileSize) {
+        const isLt = file.size / 1024 / 1024 < this.fileSize;
+        if (!isLt) {
+          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
+          return false;
+        }
+      }
+      this.$modal.loading("正在上传文件,请稍候...");
+      this.number++;
+      return true;
+    },
+    
+  },
+  created(){},
+}
+</script>
+
+<template>
+  <el-button 
+    :disabled="disabled"
+    :size="size"
+    @click="open"
+    type="primary"
+  >
+    {{ title }}
+    <el-dialog 
+      :title="title" 
+      :visible.sync="visible"
+      v-loading="loading"
+      width="35%" 
+      center
+      :before-close="beforeClose"
+      append-to-body
+    >
+      <el-upload
+        ref="upload"
+        action="#"
+        :on-preview="handlePreview"
+        :accept="accept"
+        :before-upload="handleBeforeUpload"
+        :on-remove="handleRemove"
+        :file-list="fileList"
+        :auto-upload="false"
+        :on-change="onChange" 
+        :limit="limit"
+        :disabled="disabled"
+        style="text-align: center;"
+      >
+        <el-button 
+          slot="trigger" 
+          :size="size" 
+          type="primary"
+        >选取文件</el-button>
+        <el-button
+          v-if="isTemplate"
+          style="margin-left: 10px;" 
+          :size="size" 
+          type="success" 
+          @click="templateDownload"
+        >下载模板</el-button>
+        <div slot="tip" class="el-upload__tip" v-if="isShowTip">
+          请上传
+          <template v-if="fileSize">
+            大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+          </template>
+          <template v-if="fileType">
+            格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
+          </template>
+        </div>
+      </el-upload>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitUpload" :size="size">确 定</el-button>
+        <el-button @click="cancal" :size="size">取 消</el-button>
+      </div>
+    </el-dialog>
+  </el-button>
+</template>

+ 1 - 1
src/components/Pagination/index.vue

@@ -36,7 +36,7 @@ export default {
     pageSizes: {
       type: Array,
       default() {
-        return [1, 10, 20, 50, 100];
+        return [10, 20, 50, 100, 200, 500];
       },
     },
     // 移动端页码按钮的数量端默认值5

+ 11 - 2
src/components/popover-select-v2/index.vue

@@ -41,6 +41,13 @@ export default {
       type: Boolean,
       default: false,
     },
+    // 参照弹窗标题
+    title: {
+      type: String,
+      dafault: () => {
+        return "TITEL";
+      },
+    },
   },
   components: {
     ElSuperTable: () => import("@/components/super-table/index.vue"),
@@ -163,7 +170,7 @@ export default {
     // auto
     async useAutocomplete(prop, cb) {
       if (prop) {
-        this.page.pageSize = 25;
+        this.page.pageSize = 1000000;
         this.model.search = prop;
         await this.fetchList(this.model, this.page);
         await cb(this.data);
@@ -215,6 +222,7 @@ export default {
 <template>
   <div class="popover-select-v2">
     <el-autocomplete
+      clearable
       v-bind="$attrs"
       v-model="innerValue"
       :value-key="valueKey"
@@ -272,7 +280,8 @@ export default {
               </el-input>
             </el-form-item>
             <el-form-item>
-              <el-button icon="el-icon-refresh" @click="useReset"></el-button>
+              <el-button icon="el-icon-search" @click="useQuery">搜索</el-button>
+              <el-button icon="el-icon-refresh" @click="useReset">重置</el-button>
             </el-form-item>
           </div>
         </el-form>

+ 26 - 10
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -22,42 +22,55 @@ export default [
   {
     item: { key: "registrationNo", title: "注册证号", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine.registrationNo;
       },
     },
   },
   {
-    item: { key: "isDrug", title: "物料药品属性", width: "auto" },
+    item: { key: "isMedicineYN", title: "医药物料", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
+        return prop.isMedicine == "0" ? "Y" : "N";
       },
     },
   },
   {
-    item: { key: "isDrugNumber", title: "药品", width: "auto" },
+    item: { key: "isDrug", title: "物料药品属性", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.isDrug;
+        return prop.materialMedcine.isDrug == "0" ? "Y" : "N";
       },
     },
   },
   {
-    item: {
-      key: "oriRegistrationNo",
-      title: "注册证号/备案凭证编号",
-      width: "auto",
-    },
+    item: { key: "isDrugNumber", title: "药品", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
-        return prop.materialMedcine.oriRegistrationNo;
+        return prop.materialMedcine.isDrug;
       },
     },
   },
+  // {
+  //   item: {
+  //     key: "oriRegistrationNo",
+  //     title: "注册证号/备案凭证编号",
+  //     width: "auto",
+  //   },
+  //   attr: {
+  //     formatter: (prop) => {
+  //       return prop.materialMedcine.oriRegistrationNo;
+  //     },
+  //   },
+  // },
   {
     item: { key: "dosageFrom", title: "剂型", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine.dosageFrom;
       },
@@ -66,6 +79,7 @@ export default [
   {
     item: { key: "dosageFromName", title: "剂型名称", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine.dosageFromName;
       },
@@ -74,6 +88,7 @@ export default [
   {
     item: { key: "curingType", title: "养护类型", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine.curingType;
       },
@@ -82,6 +97,7 @@ export default [
   {
     item: { key: "medicalInstruments", title: "医疗器械", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return prop.materialMedcine.medicalInstruments;
       },

+ 1 - 0
src/components/popover-select/components/TAX_RATE_PARAM.js

@@ -11,6 +11,7 @@ export default [
   {
     item: { key: "ntaxrate", title: "税率%", width: "auto" },
     attr: {
+      type:'ComputedInput',
       formatter: (prop) => {
         return Number(prop.ntaxrate === "0E-8" ? 0 : prop.ntaxrate).toFixed(6);
       },

+ 1 - 1
src/components/popover-select/index.vue

@@ -315,7 +315,7 @@ export default {
                 v-if="attr.type === 'ComputedInput'"
                 v-model="scope.row[item.key]"
                 :source="scope.row"
-                :computed="attr.computed"
+                :formatter="attr.formatter"
                 :placeholder="attr.placeholder"
                 style="width: 100%"
               ></dr-computed-input>

+ 2 - 0
src/components/super-form/index.vue

@@ -121,6 +121,7 @@ export default {
             <component
               v-else-if="attr.is === 'el-popover-select-v2'"
               v-bind="attr"
+              :title="item.title"
               v-model="innerValue[item.key]"
               :source.sync="innerValue"
               style="width: 100%"
@@ -129,6 +130,7 @@ export default {
             <component
               v-else-if="attr.is === 'el-popover-multiple-select-v2'"
               v-bind="attr"
+              :title="item.title"
               v-model="innerValue[item.key]"
               :source.sync="innerValue"
               style="width: 100%"

+ 2 - 0
src/components/super-search/index.vue

@@ -141,6 +141,7 @@ export default {
               v-if="attr.is === 'el-popover-select-v2'"
               v-bind="attr"
               v-model="innerValue[item.key]"
+              :title="item.title"
               :source.sync="innerValue"
               @change="$emit('submit')"
               style="width: 100%"
@@ -149,6 +150,7 @@ export default {
             <component
               v-if="attr.is === 'el-popover-multiple-select-v2'"
               v-bind="attr"
+              :title="item.title"
               v-model="innerValue[item.key]"
               :source.sync="innerValue"
               @change="$emit('submit')"

+ 13 - 2
src/components/super-table/index.vue

@@ -147,6 +147,15 @@ export default {
         this.filterData = multiFilter(this.$props.value, newValue);
       },
     },
+    value:{
+      handler: function (newValue) {
+        if(this.value.length > 0){
+          this.$refs.superTable.clearSelection();
+        }
+      },
+      immediate: true,
+      deep:true
+    }
   },
   methods: {
     //
@@ -373,6 +382,7 @@ export default {
                 v-else-if="attr.is === 'el-popover-select-v2'"
                 v-bind="attr"
                 v-model="scope.row[item.key]"
+                :title="item.title"
                 :size="$attrs.size"
                 :source.sync="scope.row"
               >
@@ -381,6 +391,7 @@ export default {
                 v-else-if="attr.is === 'el-popover-multiple-select-v2'"
                 v-bind="attr"
                 v-model="scope.row[item.key]"
+                :title="item.title"
                 :size="$attrs.size"
                 :source.sync="scope.row"
               >
@@ -435,7 +446,7 @@ export default {
       }"
     >
       <div class="mr-4">
-        <template v-if="checkbox">
+        <!-- <template v-if="checkbox">
           <el-button
             v-if="selectState"
             size="mini"
@@ -452,7 +463,7 @@ export default {
             选择列
             {{ selectData.length ? ` :${selectData.length}` : "" }}
           </el-button>
-        </template>
+        </template> -->
         <template v-if="convenitentOperation">
           <button-hide v-model="innerColumns" @change="onHide"></button-hide>
         </template>

+ 7 - 0
src/main.js

@@ -50,6 +50,7 @@ import VueMeta from "vue-meta";
 import DictData from "@/components/DictData";
 //
 import PopoverSelect from "@/components/popover-select";
+import PopoverSelectV2 from "@/components/popover-select-v2";
 //
 import PopoverTreeSelect from "@/components/popover-tree-select";
 //
@@ -61,6 +62,9 @@ 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';
 
@@ -82,6 +86,7 @@ Vue.prototype.$init = {
 };
 
 // 全局组件挂载
+
 Vue.component("DictTag", DictTag);
 Vue.component("Pagination", Pagination);
 Vue.component("RightToolbar", RightToolbar);
@@ -90,6 +95,7 @@ Vue.component("FileUpload", FileUpload);
 Vue.component("ImageUpload", ImageUpload);
 Vue.component("ImagePreview", ImagePreview);
 Vue.component("DrPopoverSelect", PopoverSelect);
+Vue.component("DrPopoverSelectV2", PopoverSelectV2);
 Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
 Vue.component("DrComputedInput", ComputedInput);
 Vue.component("DrFilePreview", FilePreview);
@@ -99,6 +105,7 @@ Vue.use(plugins);
 Vue.use(VueMeta);
 Vue.use(Print); //注册
 Vue.use(UmyUi);
+Vue.use(VXETable)
 Vue.use(horizontalScroll);//底部横拉条
 DictData.install();
 

+ 1 - 1
src/utils/init.js

@@ -50,5 +50,5 @@ export const initDicts = (prop) => {
 };
 
 export const initPage = () => {
-  return { pageNum: 1, pageSize: 20, total: 0 };
+  return { pageNum: 1, pageSize: 50, total: 0 };
 };

+ 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/>"),

+ 0 - 476
src/views/business/spd/bo/authority/authority-index.vue

@@ -1,476 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-table v-loading="loading" :data="authorityList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="项目岗位" align="center" prop="postName" />
-      <el-table-column label="商机-下一步" align="center" prop="boNext">
-        <template slot-scope="scope">
-          {{scope.row.boNext ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="商机-修改" align="center" prop="boEdit">
-        <template slot-scope="scope">
-          {{scope.row.boEdit ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="商机-关闭" align="center" prop="boClose">
-        <template slot-scope="scope">
-          {{scope.row.boClose ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="商机-赢单" align="center" prop="boWin">
-        <template slot-scope="scope">
-          {{scope.row.boWin ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="商机-丢单" align="center" prop="boLose">
-        <template slot-scope="scope">
-          {{scope.row.boLose ? '√' : '×'}}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="项目成员-新增" align="center" prop="pojpsnAdd" >
-        <template slot-scope="scope">
-          {{scope.row.pojpsnAdd ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="项目成员-删除" align="center" prop="pojpsnDel">
-        <template slot-scope="scope">
-          {{scope.row.pojpsnDel ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="项目成员-编辑" align="center" prop="pojpsnEdit">
-        <template slot-scope="scope">
-          {{scope.row.pojpsnEdit ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="项目成员-查看" align="center" prop="pojpsnView">
-        <template slot-scope="scope">
-          {{scope.row.pojpsnView ? '√' : '×'}}
-        </template>
-      </el-table-column>
-
-      <el-table-column label="任务-新增" align="center" prop="taskAdd" >
-        <template slot-scope="scope">
-          {{scope.row.taskAdd ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="任务-删除" align="center" prop="taskDel">
-        <template slot-scope="scope">
-          {{scope.row.taskDel ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="任务-编辑" align="center" prop="taskEdit">
-        <template slot-scope="scope">
-          {{scope.row.taskEdit ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="任务-查看" align="center" prop="taskView">
-        <template slot-scope="scope">
-          {{scope.row.taskView ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="行动-新增" align="center" prop="behaviorAdd">
-        <template slot-scope="scope">
-          {{scope.row.behaviorAdd ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="行动-删除" align="center" prop="behaviorDel">
-        <template slot-scope="scope">
-          {{scope.row.behaviorDel ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="行动-编辑" align="center" prop="behaviorEdit">
-        <template slot-scope="scope">
-          {{scope.row.behaviorEdit ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="行动-查看" align="center" prop="behaviorView">
-        <template slot-scope="scope">
-          {{scope.row.behaviorView ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="联系人-新增" align="center" prop="contactAdd">
-        <template slot-scope="scope">
-          {{scope.row.contactAdd ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="联系人-删除" align="center" prop="contactDel">
-        <template slot-scope="scope">
-          {{scope.row.contactDel ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="联系人-编辑" align="center" prop="contactEdit">
-        <template slot-scope="scope">
-          {{scope.row.contactEdit ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="联系人-查看" align="center" prop="contactView">
-        <template slot-scope="scope">
-          {{scope.row.contactView ? '√' : '×'}}
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['material:authority:edit']"
-          >修改</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改商机角色权限对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="项目岗位" prop="postName">
-          {{form.postName}}
-          <!-- <el-input v-model="form.postName"/> -->
-        </el-form-item>
-        <el-divider content-position="left">
-          <dev style="width: 50px; height: 40px; font-size: 18px">商机</dev>
-        </el-divider>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="boNext">
-              <el-checkbox v-model="form.boNext">下一步</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="boEdit">
-              <el-checkbox v-model="form.boEdit">修改</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="boClose">
-              <el-checkbox v-model="form.boClose">关闭</el-checkbox>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="boWin">
-              <el-checkbox v-model="form.boWin">赢单</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="boLose">
-              <el-checkbox v-model="form.boLose">丢单</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-        </el-row>
-        <el-divider content-position="left">
-          <dev style="width: 50px; height: 40px; font-size: 18px">项目成员</dev>
-        </el-divider>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="taskAdd">
-              <el-checkbox v-model="form.pojpsnAdd">新增</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="pojpsnDel">
-              <el-checkbox v-model="form.pojpsnDel">删除</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="pojpsnEdit">
-              <el-checkbox v-model="form.pojpsnEdit">编辑</el-checkbox>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="pojpsnView">
-              <el-checkbox v-model="form.pojpsnView">查看</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-        </el-row>
-        <el-divider content-position="left">
-          <dev style="width: 50px; height: 40px; font-size: 18px">任务</dev>
-        </el-divider>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="taskAdd">
-              <el-checkbox v-model="form.taskAdd">新增</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="taskDel">
-              <el-checkbox v-model="form.taskDel">删除</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="taskEdit">
-              <el-checkbox v-model="form.taskEdit">编辑</el-checkbox>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="taskView">
-              <el-checkbox v-model="form.taskView">查看</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-        </el-row>
-        <el-divider content-position="left">
-          <dev style="width: 50px; height: 40px; font-size: 18px">行动</dev>
-        </el-divider>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="behaviorAdd">
-              <el-checkbox v-model="form.behaviorAdd">新增</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="behaviorDel">
-              <el-checkbox v-model="form.behaviorDel">删除</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="behaviorEdit">
-              <el-checkbox v-model="form.behaviorEdit">编辑</el-checkbox>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="behaviorView">
-              <el-checkbox v-model="form.behaviorView">查看</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-        </el-row>
-        <el-divider content-position="left">
-          <dev style="width: 50px; height: 40px; font-size: 18px">联系人</dev>
-        </el-divider>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="contactAdd">
-              <el-checkbox v-model="form.contactAdd">新增</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="contactDel">
-              <el-checkbox v-model="form.contactDel">删除</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item prop="contactEdit">
-              <el-checkbox v-model="form.contactEdit">编辑</el-checkbox>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item prop="contactView">
-              <el-checkbox v-model="form.contactView">查看</el-checkbox>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-          <el-col :span="8">
-          </el-col>
-        </el-row>
-      </el-form>
-      <div slot="footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listAuthority, getAuthority, delAuthority, addAuthority, updateAuthority } from "@/api/business/spd/bo/authority";
-export default {
-  name: "Authority",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 商机角色权限表格数据
-      authorityList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        post: null,
-        boNext: null,
-        boEdit: null,
-        boClose: null,
-        boWin: null,
-        boLose: null,
-        taskAdd: null,
-        taskDel: null,
-        taskEdit: null,
-        taskView: null,
-        behaviorAdd: null,
-        behaviorDel: null,
-        behaviorEdit: null,
-        behaviorView: null,
-        contactAdd: null,
-        contactDel: null,
-        contactEdit: null,
-        contactView: null
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询商机角色权限列表 */
-    getList() {
-      this.loading = true;
-      listAuthority(this.queryParams).then(response => {
-        this.authorityList = response.rows;
-        console.log('this.authorityList',this.authorityList);
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        post: null,
-        boNext: null,
-        boEdit: null,
-        boClose: null,
-        boWin: null,
-        boLose: null,
-        taskAdd: null,
-        taskDel: null,
-        taskEdit: null,
-        taskView: null,
-        behaviorAdd: null,
-        behaviorDel: null,
-        behaviorEdit: null,
-        behaviorView: null,
-        contactAdd: null,
-        contactDel: null,
-        contactEdit: null,
-        contactView: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加商机角色权限";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getAuthority(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改商机角色权限";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateAuthority(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addAuthority(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除商机角色权限编号为"' + ids + '"的数据项?').then(function() {
-        return delAuthority(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('material/authority/export', {
-        ...this.queryParams
-      }, `authority_${new Date().getTime()}.xlsx`)
-    }
-  }
-};
-</script>

+ 418 - 373
src/views/business/spd/bo/authority/index.vue

@@ -1,182 +1,301 @@
-
 <template>
-  <div>
-    <div v-if="!openDetail">
-      <el-card>
-        <el-form size="mini" class="search_area" label-width="120px">
-          <el-row :gutter="10">
-            <el-col :span="1.5">
-              <el-form-item label="客户名称">
-                <el-input
-                  v-model="queryParams.customerName"
-                  clearable
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="年度">
-                <el-date-picker
-                  v-model="queryParams.month"
-                  type="month"
-                  value-format="yyyy-MM"
-                  clearable
-                  >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="创建人">
-                <el-input
-                  v-model="queryParams.createByName"
-                  clearable
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="部门">
-                <el-input
-                  v-model="queryParams.deptName"
-                  clearable
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="" label-width="20px">
-                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
-                <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-form>
-        <el-divider></el-divider>
-        <div class="btn_grooup">
-          <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
-        </div>
+  <div class="app-container">
+    <el-table v-loading="loading" :data="authorityList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="项目岗位" align="center" prop="postName" />
+      <el-table-column label="商机-下一步" align="center" prop="boNext">
+        <template slot-scope="scope">
+          {{scope.row.boNext ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="商机-修改" align="center" prop="boEdit">
+        <template slot-scope="scope">
+          {{scope.row.boEdit ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="商机-关闭" align="center" prop="boClose">
+        <template slot-scope="scope">
+          {{scope.row.boClose ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="商机-赢单" align="center" prop="boWin">
+        <template slot-scope="scope">
+          {{scope.row.boWin ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="商机-丢单" align="center" prop="boLose">
+        <template slot-scope="scope">
+          {{scope.row.boLose ? '√' : '×'}}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="项目成员-新增" align="center" prop="pojpsnAdd" >
+        <template slot-scope="scope">
+          {{scope.row.pojpsnAdd ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="项目成员-删除" align="center" prop="pojpsnDel">
+        <template slot-scope="scope">
+          {{scope.row.pojpsnDel ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="项目成员-编辑" align="center" prop="pojpsnEdit">
+        <template slot-scope="scope">
+          {{scope.row.pojpsnEdit ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="项目成员-查看" align="center" prop="pojpsnView">
+        <template slot-scope="scope">
+          {{scope.row.pojpsnView ? '√' : '×'}}
+        </template>
+      </el-table-column>
 
-        <el-table
-          :data="tableList"
-          @row-dblclick="useDoubleClick"
-          v-loading="loading"
-          height="600px"
-        >
-          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
-          <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
-          <el-table-column show-overflow-tooltip label="客户名称" align="center" width="200" prop="customerName"/>
-          <el-table-column show-overflow-tooltip label="月度" align="center" width="200" prop="month"/>
-          <el-table-column show-overflow-tooltip label="部门" align="center" width="200" prop="deptName"/>
-          <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
-          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
-          <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
-          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
-          <el-table-column fixed="right" label="操作" align="center" width="150">
-            <template slot-scope="scope">
-              <el-button type="text" size="mini" @click="useEdit(scope.row)">填报</el-button>
-              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
+      <el-table-column label="任务-新增" align="center" prop="taskAdd" >
+        <template slot-scope="scope">
+          {{scope.row.taskAdd ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="任务-删除" align="center" prop="taskDel">
+        <template slot-scope="scope">
+          {{scope.row.taskDel ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="任务-编辑" align="center" prop="taskEdit">
+        <template slot-scope="scope">
+          {{scope.row.taskEdit ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="任务-查看" align="center" prop="taskView">
+        <template slot-scope="scope">
+          {{scope.row.taskView ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="行动-新增" align="center" prop="behaviorAdd">
+        <template slot-scope="scope">
+          {{scope.row.behaviorAdd ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="行动-删除" align="center" prop="behaviorDel">
+        <template slot-scope="scope">
+          {{scope.row.behaviorDel ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="行动-编辑" align="center" prop="behaviorEdit">
+        <template slot-scope="scope">
+          {{scope.row.behaviorEdit ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="行动-查看" align="center" prop="behaviorView">
+        <template slot-scope="scope">
+          {{scope.row.behaviorView ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人-新增" align="center" prop="contactAdd">
+        <template slot-scope="scope">
+          {{scope.row.contactAdd ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人-删除" align="center" prop="contactDel">
+        <template slot-scope="scope">
+          {{scope.row.contactDel ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人-编辑" align="center" prop="contactEdit">
+        <template slot-scope="scope">
+          {{scope.row.contactEdit ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="联系人-查看" align="center" prop="contactView">
+        <template slot-scope="scope">
+          {{scope.row.contactView ? '√' : '×'}}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['material:authority:edit']"
+          >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
 
-        <el-pagination
-          background
-          @size-change="useChangePageSize"
-          @current-change="useCurrentChange"
-          :current-page="queryParams.pageNum"
-          :page-sizes="[10, 15, 20]"
-          :page-size="100"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total=total>
-        </el-pagination>
-      </el-card>
-    </div>
-    <Detail v-if="openDetail" :openMode="openMode" :row="row"/>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
 
-    <!-- 新增填报对话框 -->
-    <el-dialog
-      title="新增"
-      :visible.sync="open"
-      width="1000px"
-      append-to-body
-    >
-      <el-form
-        size="mini"
-        :model="form"
-        :rules="rules"
-        ref="form"
-        label-width="auto"
-      >
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="编码" prop="code">
-              <el-input
-                placeholder="自动生成"
-                readonly
-                v-model="form.code"
-                style="width: 200px"
-                clearable
-              />
+    <!-- 添加或修改商机角色权限对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="项目岗位" prop="postName">
+          {{form.postName}}
+          <!-- <el-input v-model="form.postName"/> -->
+        </el-form-item>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">商机</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="boNext">
+              <el-checkbox v-model="form.boNext">下一步</el-checkbox>
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="月份" prop="month">
-              <el-date-picker
-                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
-                v-model="form.month"
-                value-format="yyyy-MM"
-                type="month"
-                clearable
-              >
-              </el-date-picker>
+          <el-col :span="8">
+            <el-form-item prop="boEdit">
+              <el-checkbox v-model="form.boEdit">修改</el-checkbox>
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="客户" prop="customer">
-              <dr-popover-select
-                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
-                size="mini"
-                v-model="form.customerName"
-                title="客户选择"
-                type="MK_CUSTOMER_BYPRINCIPAL"
-                :dataMapping="{
-                  customer: 'id',
-                  customerName: 'name',
-                }"
-                :source.sync="form"
-                :queryParams="additionalCondition"
-              >
-              </dr-popover-select>
+          <el-col :span="8">
+            <el-form-item prop="boClose">
+              <el-checkbox v-model="form.boClose">关闭</el-checkbox>
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="创建日期" prop="createTime">
-              <el-input
-                v-model="form.createTime"
-                style="width: 200px"
-                clearable
-                readonly
-              />
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="boWin">
+              <el-checkbox v-model="form.boWin">赢单</el-checkbox>
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="创建人" prop="createByName">
-              <el-input
-                v-model="form.createByName"
-                style="width: 200px"
-                clearable
-                readonly
-              />
+          <el-col :span="8">
+            <el-form-item prop="boLose">
+              <el-checkbox v-model="form.boLose">丢单</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">项目成员</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="taskAdd">
+              <el-checkbox v-model="form.pojpsnAdd">新增</el-checkbox>
             </el-form-item>
           </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="部门" prop="deptName">
-              <el-input
-                v-model="form.deptName"
-                style="width: 200px"
-                clearable
-                readonly
-              />
+          <el-col :span="8">
+            <el-form-item prop="pojpsnDel">
+              <el-checkbox v-model="form.pojpsnDel">删除</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="pojpsnEdit">
+              <el-checkbox v-model="form.pojpsnEdit">编辑</el-checkbox>
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="pojpsnView">
+              <el-checkbox v-model="form.pojpsnView">查看</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">任务</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="taskAdd">
+              <el-checkbox v-model="form.taskAdd">新增</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="taskDel">
+              <el-checkbox v-model="form.taskDel">删除</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="taskEdit">
+              <el-checkbox v-model="form.taskEdit">编辑</el-checkbox>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="taskView">
+              <el-checkbox v-model="form.taskView">查看</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">行动</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="behaviorAdd">
+              <el-checkbox v-model="form.behaviorAdd">新增</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="behaviorDel">
+              <el-checkbox v-model="form.behaviorDel">删除</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="behaviorEdit">
+              <el-checkbox v-model="form.behaviorEdit">编辑</el-checkbox>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="behaviorView">
+              <el-checkbox v-model="form.behaviorView">查看</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
+        <el-divider content-position="left">
+          <dev style="width: 50px; height: 40px; font-size: 18px">联系人</dev>
+        </el-divider>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="contactAdd">
+              <el-checkbox v-model="form.contactAdd">新增</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="contactDel">
+              <el-checkbox v-model="form.contactDel">删除</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="contactEdit">
+              <el-checkbox v-model="form.contactEdit">编辑</el-checkbox>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="contactView">
+              <el-checkbox v-model="form.contactView">查看</el-checkbox>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+          <el-col :span="8">
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -187,245 +306,171 @@
 </template>
 
 <script>
-import Detail from './detail.vue'
-import { addAssess,listAssess,delAssess, } from "@/api/business/spd/fillin/dailysale_quantity_assess";
-import { byPrincipal } from "@/api/business/spd/bo/iuapquery/basic";
-
+import { listAuthority, getAuthority, delAuthority, addAuthority, updateAuthority } from "@/api/business/spd/bo/authority";
 export default {
-  name: "dailysaleQuantityAssess",
-  components: {Detail},
+  name: "Authority",
   data() {
     return {
-      loading: false,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 商机角色权限表格数据
+      authorityList: [],
+      // 弹出层标题
+      title: "",
       // 是否显示弹出层
       open: false,
-      //新增表单
-      form: {
-        month: "",
-        customer: "",
-        customerName: "",
-      },
-      //表单校验
-      rules: {
-        month: [{ required: true, message: "月份不能为空", trigger: "blur" }],
-        customer: [
-          { required: true, message: "客户不能为空", trigger: "blur" },
-        ],
-      },
-      // 搜索框参数
+      // 查询参数
       queryParams: {
-        customerName:null,
-        month:null,
-        deptName:null,
-        deptName:null,
         pageNum: 1,
         pageSize: 10,
+        post: null,
+        boNext: null,
+        boEdit: null,
+        boClose: null,
+        boWin: null,
+        boLose: null,
+        taskAdd: null,
+        taskDel: null,
+        taskEdit: null,
+        taskView: null,
+        behaviorAdd: null,
+        behaviorDel: null,
+        behaviorEdit: null,
+        behaviorView: null,
+        contactAdd: null,
+        contactDel: null,
+        contactEdit: null,
+        contactView: null
       },
-      //总条数
-      total: 0,
-      //列表数据
-      tableList:[],
-      //是否打开详情页面
-      openDetail:false,
-      //编辑页面打开方式,add或edit或see
-      openMode:'',
-      //行数据
-      row:{},
-      //查询员工所负责的客户
-      queryCustomerParams:{
-        staffCode:"",
-        code:"",
-        name:"",
-      },
-      customerList:[],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
     };
   },
-  async created() {
-    await this.getList(this.queryParams);
-    this.queryCustomerParams.staffCode = this.$store.state.user.name;
-    await this.getCustomer();
+  created() {
+    this.getList();
   },
   methods: {
-    //是否打开详情页面
-    useOpenDetail(){
-      this.openDetail = !this.openDetail;
-    },
-    //新增
-    useAdd(){
-      this.reset();
-      if(this.customerList.length){
-        this.form.customer = this.customerList[0].id;
-        this.form.customerName = this.customerList[0].name;
-      }
-      this.form.createTime = this.getCurrentTime();
-      this.form.month = this.getCurrentMonth();
-      this.form.createByName = this.$store.state.user.nickName;
-      this.form.dept = this.$store.state.user.deptId;
-      this.form.deptName = this.$store.state.user.deptName;
-      this.open = true;
-    },
-    //编辑
-    async useEdit(row){
-      this.openMode = 'edit';
-      this.row = row;
-      this.openDetail = true;
-    },
-    //删除
-    async useDel(row){
-      this.$modal.confirm('确认删除选择数据').then(() => {
-        delAssess(row.id).then(res => {
-          if (res.code === 200) {
-            this.$modal.msgSuccess("删除成功");
-            this.getList(this.queryParams);
-          }
-        })
-      }).catch(() => {})
-    },
-    //查询列表
-    async getList(params){
+    /** 查询商机角色权限列表 */
+    getList() {
       this.loading = true;
-      await listAssess(params).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
-        }
+      listAuthority(this.queryParams).then(response => {
+        this.authorityList = response.rows;
+        console.log('this.authorityList',this.authorityList);
+        this.total = response.total;
         this.loading = false;
-      })
-    },
-    //查询客户
-    async getCustomer(){
-      await byPrincipal(this.queryCustomerParams).then(res => {
-        if (res.code === 200) {
-          this.customerList = res.rows
-          this.queryCustomerParams.total = res.total
-        }
-      })
+      });
     },
-    //客户弹窗附加查询条件
-    additionalCondition(){
-      return {
-        parame:{
-          staffCode: this.$store.state.user.name
-        }
-      }
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
     },
-    //双击
-    useDoubleClick(row){
-      this.openMode = 'see';
-      this.row = row;
-      this.openDetail = true;
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        post: null,
+        boNext: null,
+        boEdit: null,
+        boClose: null,
+        boWin: null,
+        boLose: null,
+        taskAdd: null,
+        taskDel: null,
+        taskEdit: null,
+        taskView: null,
+        behaviorAdd: null,
+        behaviorDel: null,
+        behaviorEdit: null,
+        behaviorView: null,
+        contactAdd: null,
+        contactDel: null,
+        contactEdit: null,
+        contactView: null
+      };
+      this.resetForm("form");
     },
-    //改变一页显示条数
-    useChangePageSize(val){
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
     },
-    //翻页
-    useCurrentChange(val){
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
     },
-    //搜索
-    useSearch() {
-      console.log(this.queryParams);
-      this.getList(this.queryParams);
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
     },
-    //重置
-    useReset(){
-      this.queryParams = {
-        customerName:null,
-        month:null,
-        deptName:null,
-        deptName:null,
-        pageNum: 1,
-        pageSize: 10,
-      }
-      this.getList(this.queryParams);
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加商机角色权限";
     },
-    //重置表单
-    reset(){
-      this.form = {
-        month: "",
-        customer: "",
-        customerName: "",
-      }
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getAuthority(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改商机角色权限";
+      });
     },
-    // 确认
-    async submitForm() {
-      this.$refs["form"].validate(async (valid) => {
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
         if (valid) {
-          this.loading = true;
-          try {
-            let res = await addAssess(this.form);
-            if (res.code === 200) {
-              this.$modal.msgSuccess("保存成功");
-              this.cancel();
-              this.getList(this.queryParams);
-            }
-          } catch (err) {
-            console.error(err);
-          } finally {
-            this.loading = false;
+          if (this.form.id != null) {
+            updateAuthority(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addAuthority(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
-        } else {
-          return false;
         }
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    getCurrentTime() {
-      var date = new Date();//当前时间
-      var year = date.getFullYear() //年
-      var month = this.repair(date.getMonth() + 1);//月
-      var day = this.repair(date.getDate());//日
-      var hour = this.repair(date.getHours());//时
-      var minute = this.repair(date.getMinutes());//分
-      var second = this.repair(date.getSeconds());//秒
-      //当前时间 
-      var curTime = year + "-" + month + "-" + day
-              + " " + hour + ":" + minute + ":" + second;
-      return curTime;
-    },
-    repair(i){
-      if (i >= 0 && i <= 9) {
-          return "0" + i;
-      } else {
-          return i;
-      }
-    },
-     //获取当月
-    getCurrentMonth(){
-      const date = new Date()
-      let year = date.getFullYear()
-      let month = date.getMonth() + 1
-      month = month > 9 ? month : '0' + month
-      return `${year}-${month}`
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除商机角色权限编号为"' + ids + '"的数据项?').then(function() {
+        return delAuthority(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
     },
-  },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('material/authority/export', {
+        ...this.queryParams
+      }, `authority_${new Date().getTime()}.xlsx`)
+    }
+  }
 };
 </script>
-
-<style scoped lang="scss">
-.el-card {
-  width: calc(100% - 20px);
-  height: 100%;
-  margin: 10px;
-  padding: 20px;
-}
-.el-button-group + .el-button-group {
-  margin: 0 0 0 10px;
-}
-.btn_grooup {
-  margin-bottom: 10px;
-  display: flex;
-  justify-content: flex-end;
-}
-.el-pagination {
-  margin-top: 10px;
-  text-align: right;
-}
-</style>

+ 1 - 0
src/views/business/spd/bo/task/taskList.vue

@@ -338,6 +338,7 @@ import {
   delTask,
   addTask,
   updateTask,
+  submit
 } from "@/api/business/spd/bo/task";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";

+ 0 - 0
src/views/business/spd/bo/authority/addmaterial.vue → src/views/business/spd/fillin/dailysale_quantity_assess/addmaterial.vue


+ 0 - 0
src/views/business/spd/bo/authority/choosematerial.vue → src/views/business/spd/fillin/dailysale_quantity_assess/choosematerial.vue


+ 0 - 0
src/views/business/spd/bo/authority/detail.vue → src/views/business/spd/fillin/dailysale_quantity_assess/detail.vue


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

@@ -0,0 +1,431 @@
+
+<template>
+  <div>
+    <div v-if="!openDetail">
+      <el-card>
+        <el-form size="mini" class="search_area" label-width="120px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="客户名称">
+                <el-input
+                  v-model="queryParams.customerName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="年度">
+                <el-date-picker
+                  v-model="queryParams.month"
+                  type="month"
+                  value-format="yyyy-MM"
+                  clearable
+                  >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="创建人">
+                <el-input
+                  v-model="queryParams.createByName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="部门">
+                <el-input
+                  v-model="queryParams.deptName"
+                  clearable
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+                <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-divider></el-divider>
+        <div class="btn_grooup">
+          <el-button type="primary" size="mini" @click="useAdd">新增</el-button>
+        </div>
+
+        <el-table
+          :data="tableList"
+          @row-dblclick="useDoubleClick"
+          v-loading="loading"
+          height="600px"
+        >
+          <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+          <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
+          <el-table-column show-overflow-tooltip label="客户名称" align="center" width="200" prop="customerName"/>
+          <el-table-column show-overflow-tooltip label="月度" align="center" width="200" prop="month"/>
+          <el-table-column show-overflow-tooltip label="部门" align="center" width="200" prop="deptName"/>
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="200" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="200" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="200" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="200" prop="updateTime" />
+          <el-table-column fixed="right" label="操作" align="center" width="150">
+            <template slot-scope="scope">
+              <el-button type="text" size="mini" @click="useEdit(scope.row)">填报</el-button>
+              <el-button type="text" size="mini" @click="useDel(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+      </el-card>
+    </div>
+    <Detail v-if="openDetail" :openMode="openMode" :row="row"/>
+
+    <!-- 新增填报对话框 -->
+    <el-dialog
+      title="新增"
+      :visible.sync="open"
+      width="1000px"
+      append-to-body
+    >
+      <el-form
+        size="mini"
+        :model="form"
+        :rules="rules"
+        ref="form"
+        label-width="auto"
+      >
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="编码" prop="code">
+              <el-input
+                placeholder="自动生成"
+                readonly
+                v-model="form.code"
+                style="width: 200px"
+                clearable
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="月份" prop="month">
+              <el-date-picker
+                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
+                v-model="form.month"
+                value-format="yyyy-MM"
+                type="month"
+                clearable
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="客户" prop="customer">
+              <dr-popover-select
+                :readonly="this.openMode == 'edit' || this.openMode == 'see'"
+                size="mini"
+                v-model="form.customerName"
+                title="客户选择"
+                type="MK_CUSTOMER_BYPRINCIPAL"
+                :dataMapping="{
+                  customer: 'id',
+                  customerName: 'name',
+                }"
+                :source.sync="form"
+                :queryParams="additionalCondition"
+              >
+              </dr-popover-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="创建日期" prop="createTime">
+              <el-input
+                v-model="form.createTime"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="创建人" prop="createByName">
+              <el-input
+                v-model="form.createByName"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="部门" prop="deptName">
+              <el-input
+                v-model="form.deptName"
+                style="width: 200px"
+                clearable
+                readonly
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer">
+        <el-button size="mini" type="primary" @click="submitForm">确 定</el-button>
+        <el-button size="mini" @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Detail from './detail.vue'
+import { addAssess,listAssess,delAssess, } from "@/api/business/spd/fillin/dailysale_quantity_assess";
+import { byPrincipal } from "@/api/business/spd/bo/iuapquery/basic";
+
+export default {
+  name: "dailysaleQuantityAssess",
+  components: {Detail},
+  data() {
+    return {
+      loading: false,
+      // 是否显示弹出层
+      open: false,
+      //新增表单
+      form: {
+        month: "",
+        customer: "",
+        customerName: "",
+      },
+      //表单校验
+      rules: {
+        month: [{ required: true, message: "月份不能为空", trigger: "blur" }],
+        customer: [
+          { required: true, message: "客户不能为空", trigger: "blur" },
+        ],
+      },
+      // 搜索框参数
+      queryParams: {
+        customerName:null,
+        month:null,
+        deptName:null,
+        deptName:null,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableList:[],
+      //是否打开详情页面
+      openDetail:false,
+      //编辑页面打开方式,add或edit或see
+      openMode:'',
+      //行数据
+      row:{},
+      //查询员工所负责的客户
+      queryCustomerParams:{
+        staffCode:"",
+        code:"",
+        name:"",
+      },
+      customerList:[],
+    };
+  },
+  async created() {
+    await this.getList(this.queryParams);
+    this.queryCustomerParams.staffCode = this.$store.state.user.name;
+    await this.getCustomer();
+  },
+  methods: {
+    //是否打开详情页面
+    useOpenDetail(){
+      this.openDetail = !this.openDetail;
+    },
+    //新增
+    useAdd(){
+      this.reset();
+      if(this.customerList.length){
+        this.form.customer = this.customerList[0].id;
+        this.form.customerName = this.customerList[0].name;
+      }
+      this.form.createTime = this.getCurrentTime();
+      this.form.month = this.getCurrentMonth();
+      this.form.createByName = this.$store.state.user.nickName;
+      this.form.dept = this.$store.state.user.deptId;
+      this.form.deptName = this.$store.state.user.deptName;
+      this.open = true;
+    },
+    //编辑
+    async useEdit(row){
+      this.openMode = 'edit';
+      this.row = row;
+      this.openDetail = true;
+    },
+    //删除
+    async useDel(row){
+      this.$modal.confirm('确认删除选择数据').then(() => {
+        delAssess(row.id).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("删除成功");
+            this.getList(this.queryParams);
+          }
+        })
+      }).catch(() => {})
+    },
+    //查询列表
+    async getList(params){
+      this.loading = true;
+      await listAssess(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+        this.loading = false;
+      })
+    },
+    //查询客户
+    async getCustomer(){
+      await byPrincipal(this.queryCustomerParams).then(res => {
+        if (res.code === 200) {
+          this.customerList = res.rows
+          this.queryCustomerParams.total = res.total
+        }
+      })
+    },
+    //客户弹窗附加查询条件
+    additionalCondition(){
+      return {
+        parame:{
+          staffCode: this.$store.state.user.name
+        }
+      }
+    },
+    //双击
+    useDoubleClick(row){
+      this.openMode = 'see';
+      this.row = row;
+      this.openDetail = true;
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+    //搜索
+    useSearch() {
+      console.log(this.queryParams);
+      this.getList(this.queryParams);
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        customerName:null,
+        month:null,
+        deptName:null,
+        deptName:null,
+        pageNum: 1,
+        pageSize: 10,
+      }
+      this.getList(this.queryParams);
+    },
+    //重置表单
+    reset(){
+      this.form = {
+        month: "",
+        customer: "",
+        customerName: "",
+      }
+    },
+    // 确认
+    async submitForm() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          try {
+            let res = await addAssess(this.form);
+            if (res.code === 200) {
+              this.$modal.msgSuccess("保存成功");
+              this.cancel();
+              this.getList(this.queryParams);
+            }
+          } catch (err) {
+            console.error(err);
+          } finally {
+            this.loading = false;
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    getCurrentTime() {
+      var date = new Date();//当前时间
+      var year = date.getFullYear() //年
+      var month = this.repair(date.getMonth() + 1);//月
+      var day = this.repair(date.getDate());//日
+      var hour = this.repair(date.getHours());//时
+      var minute = this.repair(date.getMinutes());//分
+      var second = this.repair(date.getSeconds());//秒
+      //当前时间 
+      var curTime = year + "-" + month + "-" + day
+              + " " + hour + ":" + minute + ":" + second;
+      return curTime;
+    },
+    repair(i){
+      if (i >= 0 && i <= 9) {
+          return "0" + i;
+      } else {
+          return i;
+      }
+    },
+     //获取当月
+    getCurrentMonth(){
+      const date = new Date()
+      let year = date.getFullYear()
+      let month = date.getMonth() + 1
+      month = month > 9 ? month : '0' + month
+      return `${year}-${month}`
+    },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 20px);
+  height: 100%;
+  margin: 10px;
+  padding: 20px;
+}
+.el-button-group + .el-button-group {
+  margin: 0 0 0 10px;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 0 - 12
src/views/business/spd/fillin/test/index.vue

@@ -1,12 +0,0 @@
-
-<template>
-  <div>
-    测试
-  </div>
-</template>
-
-<script>
-export default {
-  
-};
-</script>

+ 27 - 0
src/views/business/spd/goal_management/experiment/DemoChildren.vue

@@ -0,0 +1,27 @@
+<template>
+<div>
+  <span>{{user}}</span>
+  <span><el-button type="info" @change="sendMessageToFather">change</el-button></span>
+</div>
+</template>
+
+<script>
+export default {
+  name: "DemoChildren",
+  props: ['user'],
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+    sendMessageToFather() {
+      this.$emit('sendMessageToFather', 'uyasjhfasb')
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 48 - 0
src/views/business/spd/goal_management/experiment/DemoFather.vue

@@ -0,0 +1,48 @@
+<template>
+  <div>
+    <div>
+      <el-table :data="myUser">
+        <el-table-column label="name" prop="name"></el-table-column>
+        <el-table-column label="age" prop="age"></el-table-column>
+        <el-table-column>
+          <template scope="scope">
+            <el-button type="primary">主要按钮</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <DemoChildren :user="myUser" @sendMessageToFather="handlerTitle"></DemoChildren>
+  </div>
+</template>
+
+<script>
+import DemoChildren from "./DemoChildren"
+export default {
+  name: "DemoFather",
+  components: {
+    DemoChildren
+  },
+  data () {
+    return {
+      myUser: [
+        {id: null, name: 'lz', age: 12},
+        {id: 1, name: 'lz', age: 12},
+        {id: 2, name: 'lz', age: 12},
+        {id: 3, name: 'lz', age: 12},
+        {id: null, name: 'lz', age: 12}
+      ]
+    }
+  },
+  methods: {
+    handlerTitle(title) {
+      for (const element of this.myUser) {
+        element.name = title
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -12,6 +12,14 @@ export const SearchColumns = [
     },
   },
   {
+    item: { key: "materialCodes", title: "物料编码" },
+    attr: {
+      clearable: true,
+      is: "el-input",
+      placeholder: '多物料编码使用 , 隔开',
+    },
+  },
+  {
     item:{
       key: "name",
       title: "物料名称",  

+ 13 - 5
src/views/material/basicFile/details.vue

@@ -143,6 +143,7 @@
                   :inline="true"
                   label-position="right"
                   :model="basicData.value"
+                  :key="basicData.value.id"
                   ref="basicMessageRef"
                   :rules="rules"
                 >
@@ -281,8 +282,11 @@
               <!-- 副信息 -->
               <div class="md-vice">
 
-                <dr-tabs v-if="activeMainTab == 'material'" :tabList="basicMessage"
-                         :handleTabClick="handleViceTabClick">
+                <dr-tabs 
+                  v-if="activeMainTab == 'material'" 
+                  :tabList="basicMessage"
+                  :handleTabClick="handleViceTabClick"
+                >
 
                   <template #tabContent>
 
@@ -293,6 +297,7 @@
                       :model="medcineData.value" 
                       class="md-vice-content"
                       :rules="medcineRules"
+                      :key="medcineData.value.id"
                     >
 
                       <el-row :gutter="10">
@@ -969,7 +974,7 @@
       },
       // 切换副表信息
       handleViceTabClick(e) {
-        console.log(this.basicMessage[e.index], '切换标签');
+        // console.log(this.basicMessage[e.index], '切换标签');
         this.activeViceTab = this.basicMessage[e.index].code;
 
         switch (this.activeViceTab) {
@@ -2093,7 +2098,10 @@
             this.basicData.value['businessDepartmentName'] = '';
 
           }
-
+          // 物料税类materialRate
+          if (this.MoreDataDialog.target.prop == 'materialRate') {
+            this.basicData.value['rateCode'] = this.MoreDataDialog.value.code
+          }
 
         } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
@@ -2466,7 +2474,7 @@
             this.medcineData.value[item.prop] = ''
           })
           this.medcineData.form = form;
-          this.medcineData.value = initParams(this.medcineData.form,'prop')
+          this.medcineData.value = initParams(this.medcineData.form,'prop');
           this.medcineRules = initRules(form);
           this.getMedcineDetails(this.materialId, 'material_medcine');
         })

+ 16 - 8
src/views/material/basicFile/index.vue

@@ -111,7 +111,7 @@
         border 
         :data="taskList" 
         ref="materialTable" 
-        max-height="550"
+        max-height="525"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -153,15 +153,23 @@
         </el-table-column>
       </el-table>
 
-      <el-pagination 
+      <pagination
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="handleQuery"
+        style="height: 32px; padding: 0 !important; "
+      />
+
+      <!-- <el-pagination 
         @size-change="handleSizeChange" 
         @current-change="handleCurrentChange"
         :current-page="queryParams.pageNum" 
-        :page-sizes="[10, 20, 50, 100]"
+        :page-sizes="[10, 20, 50, 100,200,500]"
         layout="total, sizes, prev, pager, next, jumper" 
         :total="total"
       >
-      </el-pagination>
+      </el-pagination> -->
     </el-card>
 
     <!-- 操作提示 -->
@@ -234,7 +242,7 @@
         // 查询参数
         queryParams: {
           pageNum: 1,
-          pageSize: 10,
+          pageSize: 50,
           code: null,
           name: null
         },
@@ -335,7 +343,7 @@
 
         this.queryParams.pageNum = 1;
       
-        this.queryParams.pageSize = 10;
+        this.queryParams.pageSize = 100;
 
         this.params = this.$init.params(SearchColumns);
 
@@ -456,7 +464,7 @@
 
       // 删除文件
       handleFileRemove(file, fileList) {
-        console.log('删除文件', file, 'file', fileList, 'fileList');
+        // console.log('删除文件', file, 'file', fileList, 'fileList');
         this.importData.list = fileList;
       },
       // 文件发生改变
@@ -664,7 +672,7 @@
       padding: 10px;
 
       .el-table {
-        overflow: auto;
+        // overflow: auto;
 
         .el-table__body-wrapper {
           overflow-y: auto !important;

+ 37 - 36
src/views/material/changeApply/add/column.js

@@ -46,7 +46,7 @@ export default function useColumns(){
     //     is: "el-input",
     //     disabled:true,
     //   },
-      
+
     // },
     {
       item:{
@@ -58,7 +58,7 @@ export default function useColumns(){
         valueFormat: "yyyy-MM-dd HH:mm:ss",
         disabled:true,
       },
-  
+
     },
     {
       item:{
@@ -69,7 +69,7 @@ export default function useColumns(){
         is: "el-input",
         disabled:true,
       },
-  
+
     },
     {
       item:{
@@ -81,7 +81,7 @@ export default function useColumns(){
         valueFormat: "yyyy-MM-dd HH:mm:ss",
         disabled:true,
       },
-  
+
     },
     {
       item:{
@@ -92,7 +92,7 @@ export default function useColumns(){
         is: "el-input",
         disabled:true,
       },
-  
+
     },
     {
       item:{
@@ -104,14 +104,14 @@ export default function useColumns(){
         valueFormat: "yyyy-MM-dd HH:mm:ss",
         disabled:true,
       },
-  
+
     },
-    
+
   ].map(({ item, attr }) => ({
     attr,
     item: { ...item, hidden: true, span: item.span || 6 },
   }));
-  
+
   const TabColumns = [
     {
       item:{
@@ -129,7 +129,7 @@ export default function useColumns(){
             require: true,
           },
           attr:{
-            readonly:true,
+            // readonly:true,
             is: "el-popover-select-v2",
             valueKey: "code",
             referName: "MATERIAL_PARAM",
@@ -154,7 +154,7 @@ export default function useColumns(){
               threeClass:'threeClass',
               fourClass:'fourClass',
               drug:'isDrugNumber',
-              registrationNo:'oriRegistrationNo',
+              registrationNo:'registrationNo',
               dosageFrom:'dosageFrom',
               dosageFromName:'dosageFromName',
               maintenanceType:'curingType',
@@ -162,9 +162,9 @@ export default function useColumns(){
               leadTime:'deliveryPeriod',
             },
 
-            
+
           },
-         
+
         },
         {
           item:{
@@ -176,7 +176,7 @@ export default function useColumns(){
             is: "el-input",
             // disabled:true,
           },
-         
+
         },
         {
           item:{
@@ -187,7 +187,7 @@ export default function useColumns(){
             is: "el-select",
             dictName: "sys_number_yes_no", // 字典名
           },
-         
+
         },
         {
           item:{
@@ -197,7 +197,7 @@ export default function useColumns(){
           attr:{
             is: "el-input",
           },
-          
+
         },
         {
           item:{
@@ -208,7 +208,7 @@ export default function useColumns(){
           attr:{
             is: "el-input",
           },
-         
+
         },
         {
           item:{
@@ -218,7 +218,7 @@ export default function useColumns(){
           attr:{
             is: "el-input",
           },
-         
+
         },
         {
           item:{
@@ -234,7 +234,7 @@ export default function useColumns(){
               factory:'id'
             }
           },
-          
+
         },
         {
           item:{
@@ -245,7 +245,7 @@ export default function useColumns(){
           attr:{
             is: "el-input",
           },
-         
+
         },
         {
           item:{
@@ -257,7 +257,7 @@ export default function useColumns(){
             is: "el-select",
             dictName: "sys_storage_condition", // 字典名
           },
-          
+
         },
         {
           item:{
@@ -268,7 +268,7 @@ export default function useColumns(){
             is: "el-select",
             dictName: "sys_conditions_carriage", // 字典名
           },
-         
+
         },
         {
           item:{
@@ -280,7 +280,7 @@ export default function useColumns(){
             controlsPosition:"right",
             min:0
           },
-         
+
         },
         // {
         //   item:{
@@ -290,7 +290,7 @@ export default function useColumns(){
         //   attr:{
         //     is: "el-input",
         //   },
-         
+
         // },
         // {
         //   item:{
@@ -300,7 +300,7 @@ export default function useColumns(){
         //   attr:{
         //     is: "el-input",
         //   },
-         
+
         // },
         {
           item:{
@@ -311,7 +311,7 @@ export default function useColumns(){
             is: "el-input",
             disabled:true,
           },
-          
+
         },
         {
           item:{
@@ -322,7 +322,7 @@ export default function useColumns(){
             is: "el-input",
             disabled:true,
           },
-         
+
         },
         {
           item:{
@@ -333,7 +333,7 @@ export default function useColumns(){
             is: "el-input",
             disabled:true,
           },
-          
+
         },
         {
           item:{
@@ -344,7 +344,7 @@ export default function useColumns(){
             is: "el-input",
             disabled:true,
           },
-         
+
         },
         {
           item:{
@@ -355,7 +355,7 @@ export default function useColumns(){
             is: "el-select",
             dictName: "sys_medicine", // 字典名
           },
-         
+
         },
         {
           item:{
@@ -365,18 +365,19 @@ export default function useColumns(){
           attr:{
             is: "el-input",
           },
-         
+
         },
         {
           item:{
             key:'medicalDevices',
-            title:'医疗器械',
+            // title:'医疗器械',
+            title:'管理类别',
           },
           attr:{
             is: "el-select",
             dictName: "medical_instruments", // 字典名
           },
-          
+
         },
         {
           item:{
@@ -387,7 +388,7 @@ export default function useColumns(){
             is: "el-select",
             dictName: "curing_type", // 字典名
           },
-         
+
         },
         {
           item:{
@@ -402,11 +403,11 @@ export default function useColumns(){
               dosageFrom:'id'
             }
           },
-          
+
         },
-  
+
       ]
-    }, 
+    },
   ]
 
   return {TableColumns,TabColumns}

+ 202 - 137
src/views/material/changeApply/add/index.vue

@@ -1,7 +1,7 @@
 <!-- 批量新增 -->
 <script>
 import useColumns from "./column";
-import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic';
+import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList,importInner} from '@/api/changeApply/basic';
 
 
 export default {
@@ -22,6 +22,7 @@ export default {
     ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
     ElPopoverTreeSelect: () =>
       import("@/components/popover-tree-select/index.vue"),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
 
   data() {
@@ -78,10 +79,10 @@ export default {
       },
       set(){},
     }
-  
+
   },
   watch: {
-    
+
   },
   methods: {
     setVisible(prop){
@@ -101,13 +102,12 @@ export default {
         this.params.status = '0';
         console.log(this.$store.state.user,'user');
         this.params.orgName = '德荣集团';
-        this.useRowAdd(this.tabName);
+        // this.useRowAdd(this.tabName);
       }
     },
 
     //
     async fetchItem(prop) {
-      console.log(prop,'prop----------------');
       try {
         // try
         this.loading = true;
@@ -117,7 +117,7 @@ export default {
         if(code == 200){
           this.params = data;
         }
-        
+
       } catch (err) {
         // catch
         console.error(err);
@@ -126,7 +126,7 @@ export default {
         this.loading = false;
       }
     },
-    
+
     //
     async hide() {
       const {
@@ -145,7 +145,7 @@ export default {
     },
     //
     async useRowAdd(prop) {
-      
+
       const { TableColumns } = this.TabColumns.find(
         ({ item: { key } }) => key === prop
       );
@@ -188,7 +188,7 @@ export default {
                 message:'物料信息不能不为空!'
               })
             }
-            
+
           } catch (err) {
             // catch
             console.error(err);
@@ -217,16 +217,71 @@ export default {
               title: msg,
             });
           }
-          
+
         } catch (error) {}
         finally{
           this.loading = false;
         }
 
-        
+
         // await;
       })
     },
+
+    async handelImport(fileList){
+
+      try {
+
+        let formData = new FormData();
+
+        formData.append('file',fileList[0].raw);
+
+        this.$modal.loading("正在上传文件,请稍候...");
+
+        let {code,data} = await importInner(formData);
+
+        if(code == 200) {
+
+          // let size = 20;
+          // let num = 1;
+          // let total = Math.ceil(data.length / size);
+
+          // let resultData = [...data];
+          
+          // let intervalPush = setInterval(()=>{
+
+          //   if(num > total) clearInterval(intervalPush);
+
+          //     resultData.slice(size*(num-1), (size*num) ).forEach(item =>{
+
+          //       this.params['materialBasic'].push(item);
+                this.params['materialBasic'].push(...data);
+
+          //     })
+
+          //   num++;
+
+          // },200);
+
+          let {setVisible} =  this.$refs.batchImport;
+
+          setVisible(false);
+
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.$modal.closeLoading();
+      }
+
+    },
+
+    async handleTemDownload(){
+
+      this.download('/material/change/downloadInner',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+    },
+
   },
   created() {
   },
@@ -247,8 +302,8 @@ export default {
       @open="beforeOpen"
       v-loading="loading"
     >
-      <div 
-        slot="title" 
+      <div
+        slot="title"
         style="display: flex;
             justify-content: space-between;
             align-items: center;"
@@ -288,140 +343,150 @@ export default {
           </component
         ></template>
       </el-super-form>
-      
-  
-      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
-        <el-tab-pane
-          v-for="({ item, TableColumns: columns }, index) in TabColumns"
-          :key="index"
-          :label="item.title"
-          :name="item.key"
-          lazy
-        >
-          <div style="height: 420px;display:flex">
-            <el-super-table
-              v-model="materialInfo[item.key]"
-              :dict="dict"
-              :ref="tabName"
-              :columns="columns"
-              :size="$attrs.size"
-            >
-              <template slot="materialName" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                >
-                </component>
-              </template>
-              <!-- 判断是否禁用 -->
-              <template slot="drug" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                  :disabled="!(scope.row.medicineMaterial ==='0') "
-                >
-                <el-option
-                    v-for="item in dict.type[scope.attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+
+
+      <div style="position: relative;">
+        <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+          <el-tab-pane
+            v-for="({ item, TableColumns: columns }, index) in TabColumns"
+            :key="index"
+            :label="item.title"
+            :name="item.key"
+            lazy
+          >
+            <div style="height: 420px;display:flex">
+              <el-super-table
+                v-model="materialInfo[item.key]"
+                :dict="dict"
+                :ref="tabName"
+                :columns="columns"
+                :size="$attrs.size"
+              >
+                <template slot="materialName" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
                   >
-                  </el-option>
-                </component>
-              </template>
-  
-              <template slot="registrationNo" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                  :disabled="!(scope.row.medicineMaterial ==='0') "
-                >
-                </component>
-              </template>
-  
-              <template slot="medicalDevices" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                  :disabled="!(scope.row.medicineMaterial ==='0') "
-                >
-                <el-option
-                    v-for="item in dict.type[scope.attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  </component>
+                </template>
+                <!-- 判断是否禁用 -->
+                <template slot="drug" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="!(scope.row.medicineMaterial ==='0') "
                   >
-                  </el-option>
-                </component>
-              </template>
-              <template slot="maintenanceType" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                  :disabled="!(scope.row.medicineMaterial ==='0') "
-                >
-                <el-option
-                    v-for="item in dict.type[scope.attr.dictName]"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
+                </template>
+  
+                <template slot="registrationNo" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="!(scope.row.medicineMaterial ==='0') "
                   >
-                  </el-option>
-                </component>
-              </template>
-              <template slot="dosageFromName" slot-scope="scope">
-                <component
-                  v-bind="scope.attr"
-                  v-model="scope.row[scope.item.key]"
-                  :size="$attrs.size"
-                  :source.sync="scope.row"
-                  :disabled="!(scope.row.medicineMaterial ==='0') "
-                >
-                </component>
-              </template>
-              
+                  </component>
+                </template>
   
-              <el-table-column fixed="right" label="操作" width="120" align="center">
-                <template slot="header" slot-scope="scope">
-                  <el-button
-                    type="text"
+                <template slot="medicalDevices" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
+                    :size="$attrs.size"
+                    :source.sync="scope.row"
+                    :disabled="!(scope.row.medicineMaterial ==='0') "
+                  >
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
+                </template>
+                <template slot="maintenanceType" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
                     :size="$attrs.size"
-                    @click="useRowAdd(tabName)"
+                    :source.sync="scope.row"
+                    :disabled="!(scope.row.medicineMaterial ==='0') "
                   >
-                    增行
-                  </el-button>
+                  <el-option
+                      v-for="item in dict.type[scope.attr.dictName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </component>
                 </template>
-                <template slot-scope="scope">
-                  <el-button
-                    type="text"
+                <template slot="dosageFromName" slot-scope="scope">
+                  <component
+                    v-bind="scope.attr"
+                    v-model="scope.row[scope.item.key]"
                     :size="$attrs.size"
-                    @click.native.prevent="useRowRemove(tabName, scope)"
+                    :source.sync="scope.row"
+                    :disabled="!(scope.row.medicineMaterial ==='0') "
                   >
-                  删除
-                  </el-button>
-                  <AmendantRecord
-                    v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
-                    v-model="scope.row"
-                  ></AmendantRecord>
+                  </component>
                 </template>
-              </el-table-column>
-            </el-super-table>
-          </div>
-        </el-tab-pane>
-      </el-tabs>
-
-      
-     
+  
+  
+                <el-table-column fixed="right" label="操作" width="120" align="center">
+                  <template slot="header" slot-scope="scope">
+                    <el-button
+                      type="text"
+                      :size="$attrs.size"
+                      @click="useRowAdd(tabName)"
+                    >
+                      增行
+                    </el-button>
+                  </template>
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      :size="$attrs.size"
+                      @click.native.prevent="useRowRemove(tabName, scope)"
+                    >
+                    删除
+                    </el-button>
+                    <AmendantRecord
+                      v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
+                      v-model="scope.row"
+                    ></AmendantRecord>
+                  </template>
+                </el-table-column>
+              </el-super-table>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 0px; right: 20px">
+          
+          <BatchImport
+            ref="batchImport"
+            @import="handelImport"
+            @temDownload="handleTemDownload"
+          ></BatchImport>
+        </el-row>
+      </div>
+
+
+
     </el-drawer>
 </template>
 

+ 11 - 1
src/views/material/changeApply/columns.js

@@ -19,7 +19,7 @@ export default function useColumns() {
     //   item: { key: "materialName", title: "物料名称" },
     //   attr: {},
     // },
-    { item: { key: "approver", title: "最后审批人" }, attr: {} },
+    { item: { key: "approverName", title: "最后审批人" }, attr: {} },
     { item: { key: "approvalTime", title: "最后审核时间" }, attr: {} },
     { item: { key: "createByName", title: "创建人" ,width:150, }, attr: {} },
     { item: { key: "createTime", title: "创建时间" }, attr: {} },
@@ -67,6 +67,16 @@ export default function useColumns() {
         clearable: true,
       },
     },
+    {
+      item: {
+        key: "code",
+        title: "单据编码",
+      },
+      attr: {
+        clearable: true,
+        is: "el-input",
+      },
+    },
   
   ].map(({ item, attr }) => ({
     attr,

+ 6 - 5
src/views/material/changeApply/index.vue

@@ -58,15 +58,15 @@
         >
           <el-table-column fixed="right" label="操作" width="150" align="center">
             <template slot-scope="scope">
-              <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
+              <el-button type="text" size="small" @click.stop="useSee(scope.row)">查看</el-button>
               <el-button  
                 v-if="scope.row.oaId && scope.row.oaId !=''" 
-                @click="jumpFlow(scope.row)" 
+                @click.stop="jumpFlow(scope.row)" 
                 type="text"
                 :size="size"
               >流程跳转</el-button>
-              <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
-              <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
+              <el-button @click.stop="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
+              <el-button type="text" size="small" @click.stop="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
             </template>
           </el-table-column>
         </el-super-table>
@@ -99,7 +99,7 @@ export default {
       size:'mini',
       tableList: [],
       TableColumns:TableColumns,
-      page: { pageNum: 1, pageSize: 10, total: 0 },
+      page: { pageNum: 1, pageSize: 50, total: 0 },
       params:params,
       SearchColumns:SearchColumns,
       optionType:'add',
@@ -200,6 +200,7 @@ export default {
  
   },
   created(){
+    this.params.code = this.$route.query.billCode
     this.useQuery(this.params, this.page);
   },
 }

+ 106 - 13
src/views/material/classify/index.vue

@@ -5,10 +5,12 @@
 
       <el-row :gutter="10" class="mb10">
         <div>
+          <el-button type="primary" size="mini" @click="mbDownload">模板下载</el-button>
+          <el-button type="primary" size="mini" @click="importMb">导入</el-button>
           <el-button type="primary" size="mini" plain @click="addClassify">新增</el-button>
           <el-button type="primary" size="mini" plain @click="editClassify">修改</el-button>
           <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName ? '全部分类': '过滤停用'}}</el-button>
-          <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button>
+          <!-- <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button> -->
         </div>
       </el-row>
 
@@ -74,7 +76,6 @@
                   <el-select
                     v-model="ruleForm.isEnable"
                     placeholder="启用状态"
-                    clearable
                     size="mini"
                     :disabled="disable"
                     style="width: 230px"
@@ -111,39 +112,32 @@
                 </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">
                 <el-form-item v-if="!disable">
-                  <el-button type="primary" @click="submitForm('ruleForm')"
+                  <el-button size="mini" type="primary" @click="submitForm('ruleForm')"
                     >保存</el-button
                   >
-                  <el-button @click="resetForm('ruleForm')">取消</el-button>
+                  <el-button size="mini" @click="resetForm('ruleForm')">取消</el-button>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -151,22 +145,71 @@
         </el-col>
       </el-row>
     </el-card>
+
+    <!-- 导入对话框 -->
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <!-- <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div> -->
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="submitFile">确 定</el-button>
+      <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+// 导入的token
+import { getToken } from "@/utils/auth";
 import {
   getTree,
   getDetail,
   add,
   delClassify,
   edit,
+  downLoadClassify,
 } from "@/api/classify/basic";
 export default {
   name: "classify",
   dicts: ["material_enable", "sys_assist_condtion"],
   data() {
     return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/classify/import"
+      },
       loading: false,
       filterText: "",
       data: [],
@@ -406,6 +449,56 @@ export default {
         this.getTreeData();
       }
     },
+    // 模板下载
+    mbDownload() {
+      this.$modal.loading("正在下载模板,请稍后...");
+      downLoadClassify({}).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对象
+        this.download.open = false
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
+    // 文件导入
+    importMb() {
+      this.upload.open = true
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getTreeData();
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+    // 提交上传文件
+    submitFile() {
+      this.$refs.upload.submit();
+    },
   },
 };
 </script>

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

@@ -137,7 +137,8 @@
             <el-row :gutter="10">
               <el-col :span="6">
                 <el-form-item label="厂家物料编码" prop="manufacturersMaterialCode">
-                  <el-input type="number" min="0" :disabled="disable"
+                  <!-- type="number" -->
+                  <el-input :disabled="disable"
                             v-model="basicForm.manufacturersMaterialCode"></el-input>
                 </el-form-item>
               </el-col>
@@ -257,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>
@@ -509,7 +510,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="6">
-              <el-form-item label="医疗器械" prop="medicalInstruments">
+              <el-form-item label="管理类别" prop="medicalInstruments">
                 <el-select v-model="basicForm2.medicalInstruments" placeholder="请选择" clearable
                            :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
@@ -769,7 +770,7 @@
           // 四级分类/物料分类
           classifyId: '',
           // 是否医药物料
-          isMedicine: '2',
+          isMedicine: '0',
           // DI
           diCode: '',
           // 物料名称
@@ -991,10 +992,10 @@
         }
       } else if (this.pageStu == 'edit') {
         // alert('修改页面')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
+        // console.log('页面状态', this.pageStu)
+        // console.log('数据', this.row)
         this.getDetails(this.row)
-        console.log('修改页面-批号库存管理状态', this.row.isInventoryStatus)
+        // console.log('修改页面-批号库存管理状态', this.row.isInventoryStatus)
         this.stockControl(this.row.isInventoryStatus)
         // 控制效期单位后面的是否可填写
         if (this.row.expiryDateManagerment == '0') {
@@ -1047,7 +1048,7 @@
           this.getInnerPackingUnitDetails(this.row.innerPackingUnit)
         }
       } else if (this.pageStu == 'add') {
-        // alert('新增页面')
+        this.controlMedic('0');
         console.log('页面状态', this.pageStu)
       } else if (this.pageStu === 'copy') {
         this.getDetails(this.row)
@@ -1126,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;
         }
       },
       // 选择采购组织时控制业务部门
@@ -1159,7 +1161,9 @@
       },
       // 用于回显四级分类树形选择
       getTreeDetails(id) {
+        console.log(id,'用于回显四级分类树形选择');
         getDetail(id).then(res => {
+          console.log(res,'用于回显四级分类树形选择');
           if (res.code === 200) {
             this.testOptions.push(res.data)
             this.basicForm.oneClass = res.data.oneClass
@@ -1257,7 +1261,7 @@
       getMidPackDetails(id) {
         getMidPack({id: id}).then(res => {
           if (res.code === 200) {
-            this.midPackOptions = res.data.tableBody
+            this.midPackOptions = res.data.tableBody;
           }
         })
       },
@@ -1268,6 +1272,8 @@
           if (res.code === 200) {
 
             this.basicForm = res.data;
+            const { id, name, nickName, } =
+            this.$store.state.user;
 
             if (this.pageStu === 'copy') {
 
@@ -1297,6 +1303,13 @@
 
               this.basicForm.updateTime = '';
 
+              this.basicForm.auditTime = '';
+
+              this.basicForm.proposerName = nickName;
+
+              this.basicForm.proposerId = name;
+              
+              this.basicForm.applyBillInfo.auditTime = '';
 
             }
 
@@ -1363,7 +1376,10 @@
           })
 
           // Promise.all([form1, form2]).then(() => {
-            if (this.basicForm.isMedicine == '0' && this.sysMaterialMedcineItemApply.length == 0) {
+            if (this.basicForm.isMedicine == '0' 
+                && this.sysMaterialMedcineItemApply.length == 0 
+                // && this.basicForm.oneClass !== "资产费用&7"
+                ) {
               this.$modal.notifyWarning("医药物料需要维护物料类别!");
 
             } else {
@@ -1408,7 +1424,10 @@
           })
 
           // Promise.all([form1, form2]).then(() => {
-            if (this.basicForm.isMedicine == '0' && this.sysMaterialMedcineItemApply.length == 0) {
+            if (this.basicForm.isMedicine == '0' 
+                && this.sysMaterialMedcineItemApply.length == 0 
+                // && this.basicForm.oneClass !== "资产费用&7"
+              ) {
               this.$modal.notifyWarning("医药物料需要维护物料类别!");
             } else {
               this.$modal.loading("保存中...");
@@ -1689,7 +1708,7 @@
           console.log('内包装单位回显', res)
           if (res.code === 200) {
             this.innerPackingUnitOptions = res.data.tableBody
-            console.log('1111', this.innerPackingUnitOptions)
+            // console.log('1111', this.innerPackingUnitOptions)
           }
         })
       },

+ 71 - 16
src/views/material/requisition/columns.js

@@ -87,6 +87,14 @@
         clearable:true,
       },
     },
+   {
+     item: { key: "materialCodes", title: "物料编码" },
+     attr: {
+       clearable: true,
+       is: "el-input",
+       placeholder: '多物料编码使用 , 隔开',
+     },
+   },
     {
       item: { key: "classifySearchList", title: "品类" },
       attr: {
@@ -108,14 +116,27 @@
         clearable: true,
       },
     },
-    {
-      item: { key: "createTimeString", title: "申请时间" },
-      attr: {
-        is: "el-date-picker", 
-        valueFormat: "yyyy-MM-dd" ,
-        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: {
+    //     is: "el-date-picker", 
+    //     valueFormat: "yyyy-MM-dd" ,
+    //     clearable: true,
+    //   },
+    // },
     {
       item: { key: "reviewedName", title: "最后审批人" },
       attr: {
@@ -128,14 +149,14 @@
         clearable: true,
       },
     },
-    {
-      item: { key: "auditTimeString", title: "审批时间" },
-      attr: {
-        is: "el-date-picker", 
-        valueFormat: "yyyy-MM-dd" ,
-        clearable: true,
-      },
-    },
+    // {
+    //   item: { key: "auditTimeString", title: "审批时间" },
+    //   attr: {
+    //     is: "el-date-picker", 
+    //     valueFormat: "yyyy-MM-dd" ,
+    //     clearable: true,
+    //   },
+    // },
     {
       item: { key: "manufacturerName", title: "生产厂家/代理人" },
       attr: {
@@ -155,6 +176,40 @@
         is: "el-input",
       },
     },
+    {
+      item:{
+        key: "createTimeString",
+        title: "申请时间",
+        span:12,
+      },
+      attr: {
+        clearable:true,
+        // is: "el-date-wrapper",
+        is: "el-date-picker",
+        type:"daterange",
+        rangeSeparator:"-",
+        startPlaceholder:"开始日期",
+        endPlaceholder:"结束日期",
+        valueFormat:"yyyy-MM-dd",
+      },
+    },
+    
+    {
+      item:{
+        key: "auditTimeString",
+        title: "审批时间",
+        span:12,
+      },
+      attr: {
+        clearable:true,
+        is: "el-date-picker",
+        type:"daterange",
+        rangeSeparator:"-",
+        startPlaceholder:"开始日期",
+        endPlaceholder:"结束日期",
+        valueFormat:"yyyy-MM-dd",
+      },
+    },
     
   
   ].map(({ item, attr }) => ({

+ 44 - 30
src/views/material/requisition/index.vue

@@ -26,10 +26,16 @@
           </el-button>
         </el-col>
         <el-col :span="1.5">
-          <el-button :size="size" @click="handleImport">批量导入</el-button>
-        </el-col>
-        <el-col :span="1.5">
-          <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
+          
+          <el-button-group >
+            <el-button :size="size" @click="handleImport">批量导入</el-button>
+            <!-- <el-button  
+            :size="size"
+              @click="handleDownload" 
+              v-hasPermi="['system:apply:export']"
+            >批量导出</el-button> -->
+            <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
+          </el-button-group>
         </el-col>
         <!-- 导入弹窗 -->
         <el-dialog 
@@ -89,16 +95,16 @@
               <el-button 
                 type="text" 
                 :size="size" 
-                @click="check(scope.row)"
+                @click.stop="check(scope.row)"
               >查看</el-button>
               <el-button 
-                @click="edit(scope.row)" 
+                @click.stop="edit(scope.row)" 
                 v-if="scope.row.status == 0 || scope.row.status == 3" 
                 type="text"
                 :size="size"
               >编辑</el-button>
               <el-button 
-                @click="jumpFlow(scope.row)" 
+                @click.stop="jumpFlow(scope.row)" 
                 v-if="scope.row.oaId && scope.row.oaId !=''" 
                 type="text"
                 :size="size"
@@ -106,7 +112,7 @@
               <el-button 
                 type="text" 
                 :size="size"
-                @click="deleteRow(scope.row)"
+                @click.stop="deleteRow(scope.row)"
                 v-if="scope.row.status == 0 || scope.row.status == 3"
               >删除</el-button>
             </template>
@@ -143,10 +149,10 @@
     name: 'requisition',
     dicts:[...initDicts([...SearchColumns,...TableColumns])],
     components: {
-      addReq,
-      ElSuperTable: () => import("@/components/super-table/index.vue"),
-      ElSuperSearch: () => import("@/components/super-search/index.vue"),
-    },
+    addReq,
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+},
     data() {
       const params = this.$init.params(SearchColumns);
       return {
@@ -156,7 +162,7 @@
         params:params,
         SearchColumns:SearchColumns,
         TableColumns:TableColumns,
-        pageStatus: { pageNum: 1, pageSize: 10, total: 0 },
+        pageStatus: { pageNum: 1, pageSize: 50, total: 0 },
         queryParams: {
           billCode: '',
           name: '',
@@ -192,6 +198,7 @@
 
     },
     mounted() {
+      this.params.billCode = this.$route.query.billCode
       this.getList(this.queryParams)
     },
     methods: {
@@ -300,9 +307,16 @@
       handleImport() {
         this.importData.show = true
       },
+      // 导出
+      handleDownload(){
+        let params = {
+          ...this.params
+        };
+        this.download('/system/apply/material/export', {...params}, `物料申请单${new Date().getTime()}.xlsx`);
+      },
       // 删除文件
       handleFileRemove(file, fileList) {
-        console.log('删除文件', file, 'file', fileList, 'fileList');
+        // console.log('删除文件', file, 'file', fileList, 'fileList');
         this.importData.list = fileList;
       },
       // 文件发生改变
@@ -330,7 +344,7 @@
                   this.importData.list = [];
                   if (res.data.flag) {
                     this.failLoad = true;
-                    console.log(res.data.datas)
+                    // console.log(res.data.datas)
                     let param = {failDatas: res.data.datas}
                     if (null != param) {
 
@@ -375,11 +389,11 @@
 
         this.checkedList = selection;
 
-        console.log(this.checkedList, 'this.checkedList');
+        // console.log(this.checkedList, 'this.checkedList');
 
       },
       getList(val) {
-        console.log('val', val)
+        // console.log('val', val)
         this.failLoad = true;
         
         getReqList({...this.params,...this.pageStatus}).then(res => {
@@ -409,7 +423,7 @@
         this.checkedList = selection;
       },
       check(row) {
-        console.log('查看详情', row)
+        // console.log('查看详情', row)
         this.isList = false
         this.isComponent = 'addReq'
         this.page = 'check'
@@ -417,7 +431,7 @@
         this.disable = true
       },
       edit(row) {
-        console.log('修改先加载详情', row)
+        // console.log('修改先加载详情', row)
         this.isList = false
         this.isComponent = 'addReq'
         this.page = 'edit'
@@ -425,7 +439,7 @@
         this.disable = false
       },
       commit(row) {
-        console.log('row', row)
+        // console.log('row', row)
       },
       deleteRow(row) {
         this.$confirm('是否删除此条数据?', '提示', {
@@ -445,16 +459,16 @@
         }).catch(() => {
         })
       },
-      handleSizeChange(val) {
-        console.log(`每页 ${val} 条`);
-        this.queryParams.pageSize = val
-        this.getList(this.queryParams)
-      },
-      handleCurrentChange(val) {
-        console.log(`当前页: ${val}`);
-        this.queryParams.pageNum = val
-        this.getList(this.queryParams)
-      }
+      // handleSizeChange(val) {
+      //   console.log(`每页 ${val} 条`);
+      //   this.queryParams.pageSize = val
+      //   this.getList(this.queryParams)
+      // },
+      // handleCurrentChange(val) {
+      //   console.log(`当前页: ${val}`);
+      //   this.queryParams.pageNum = val
+      //   this.getList(this.queryParams)
+      // }
     }
   }
 </script>

+ 31 - 6
src/views/purchase/DemandSummary/add.vue

@@ -41,14 +41,34 @@
         <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/> -->
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
         <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
-        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="120"/>
-        <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="120"/>
+        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="120">
+          <template slot-scope="scope">
+            {{scope.row.resDemandQty ? parseFloat(scope.row.resDemandQty).toFixed(0) : '0'}}
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="120">
+          <template slot-scope="scope">
+            <el-input clearable type="number" min="0" size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.puQtyRes"/>
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
-        <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="100"/>
+        <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="100">
+          <template slot-scope="scope">
+            {{scope.row.minOrderQty ? parseFloat(scope.row.minOrderQty).toFixed(0) : '0'}}
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="100"/>
-        <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="100"/>
+        <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="100">
+          <template slot-scope="scope">
+            {{scope.row.minBatch ? parseFloat(scope.row.minBatch).toFixed(0) : '0'}}
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="修改人" align="center" prop="updateByName" width="100"/>
-        <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="updateCause" width="150"/>
+        <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="updateCause" width="150">
+          <template slot-scope="scope">
+            <el-input clearable size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.updateCause"/>
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="业务备注" align="center" prop="remark" width="150"/>
         <el-table-column show-overflow-tooltip label="有效期" align="center" prop="expiry" width="150"/>
         <el-table-column show-overflow-tooltip label="要求交货日期" align="center" prop="deliveryDate" width="120"/>
@@ -89,7 +109,7 @@
         <el-table-column show-overflow-tooltip label="供应货位" align="center" prop="lastAllocationName" width="120"/>
         <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="orgName" width="250px">
           <template slot-scope="scope">
-              <el-input :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.orgName" @clear="clean(scope.row, '默认采购组织')" @focus="chooseMxHW(scope.$index, 'ORG_PARAM', true, '默认采购组织')">
+              <el-input clearable :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.orgName" @clear="clean(scope.row, '默认采购组织')" @focus="chooseMxHW(scope.$index, 'ORG_PARAM', true, '默认采购组织')">
                 <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
               </el-input>
           </template>
@@ -270,6 +290,11 @@ export default {
         }
       }).then(() => {
         this.loading = false
+        this.tableList.forEach(item => {
+          if(item.puQtyRes) {
+            item.puQtyRes = parseFloat(item.puQtyRes).toFixed(0)
+          }
+        })
       }).catch(err => {
         this.loading = false
       })

+ 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>

+ 106 - 35
src/views/purchase/DemandSummary/index.vue

@@ -235,7 +235,6 @@
         <el-table
           v-loading="loading"
           :data="tableList" 
-          fit
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
           class="exporttable"
@@ -246,11 +245,11 @@
           height="355"
           max-height="355"
           style="font-size: 12px;"
+          :cell-class-name="cellClassName"
           @selection-change="handleSelectionChange"
           @row-click="rowSelect"
           @row-dblclick="doubleClick"
           ref="table"
-          :key="isUpdate"
         >
           <el-table-column type="selection" width="60" fixed="left"/>
           <el-table-column show-overflow-tooltip  label="序号" type="index" align="center" width="50px" fixed="left"/>
@@ -263,12 +262,36 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.unit" label="单位" align="center" prop="unit"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.manufacturer" label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.demandNum" label="需求单位数" align="center" prop="demandNum" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="80px" />
-          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="80px" />
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforyear" label="近1月月均需求" align="center" prop="evensalesforyear" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforyear ? parseFloat(scope.row.evensalesforyear).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.evensalesforthrmonth" label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.evensalesforthrmonth ? parseFloat(scope.row.evensalesforthrmonth).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.netDemandNum" label="总最终净需求量" align="center" prop="netDemandNum" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.netDemandNum ? parseFloat(scope.row.netDemandNum).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.totalMonthlySales" label="总月销量" align="center" prop="totalMonthlySales" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.totalMonthlySales ? parseFloat(scope.row.totalMonthlySales).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.demandCycle" label="需求可用周期" align="center" prop="demandCycle" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.demandCycle ? parseFloat(scope.row.demandCycle).toFixed(1) : '0.0'}}
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip v-if="showColumn.dullQut" label="呆滞量" align="center" prop="dullQut" width="80px">
+            <template slot-scope="scope">
+              {{parseFloat(scope.row.dullQut).toFixed(2)}}
+            </template>
+          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.buyPeriod" label="采购周期" align="center" prop="buyPeriod" width="80px" />
           <el-table-column show-overflow-tooltip v-if="showColumn.centralPublicStock" label="中心公共库存" align="center" prop="centralPublicStock" width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.centralWarehouse" label="中心仓专属货位" align="center" prop="centralWarehouse" width="80px"/>
@@ -282,17 +305,21 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.minPackage" label="最小包装量" align="center" prop="minPackage"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minOrder" label="最小订货量" align="center" prop="minOrder"  width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.minBatch" label="最小批量" align="center" prop="minBatch"  width="80px"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.artificialAdjust" label="人工调整数" align="center" prop="artificialAdjust" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.artificialAdjust = scope.row.finalBuyQty - scope.row.suggestionPurchase}}
+            </template>
+          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.modifyReason" label="修改原因" align="center" prop="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"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1'|| lineDisable || scope.row.artificialAdjust == '0'" v-model="scope.row.modifyReason" @change="jilu(scope.$index)"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.suggestionPurchase" label="建议采购量" align="center" prop="suggestionPurchase"  width="80px"/>
           <!-- <el-table-column show-overflow-tooltip v-if="showColumn.status" label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
           <el-table-column show-overflow-tooltip v-if="showColumn.finalBuyQty" label="最终采购量" align="center" prop="finalBuyQty" width="80px">
             <template slot-scope="scope">
-                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
+                <el-input size="mini" :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty" @change="jilu(scope.$index)"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.materialClassifyTwoName" label="二级品类" align="center" prop="materialClassifyTwoName" width="120px"/>
@@ -315,7 +342,11 @@
           <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriod" label="有效期" align="center" prop="validityPeriod"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.validityPeriodUnit" label="有效期单位" align="center" prop="validityPeriodUnit" width="80px"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.businessType" label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
-          <el-table-column show-overflow-tooltip v-if="showColumn.safetyStock" label="安全库存量" align="center" prop="safetyStock" width="80px"/>
+          <el-table-column show-overflow-tooltip v-if="showColumn.safetyStock" label="安全库存量" align="center" prop="safetyStock" width="80px">
+            <template slot-scope="scope">
+              {{scope.row.safetyStock ? parseFloat(scope.row.safetyStock).toFixed(2) : '0.00'}}
+            </template>
+          </el-table-column>
           <el-table-column show-overflow-tooltip v-if="showColumn.billSource" label="单据来源" align="center" prop="billSource" :formatter="formatterSource"/>
           <el-table-column show-overflow-tooltip v-if="showColumn.registrant" label="注册人" align="center" prop="registrant" width="120px"/>
           <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
@@ -349,7 +380,7 @@
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
           :page-sizes="[10, 20, 50, 100, 200, 500]"
-          :page-size="10"
+          :page-size="50"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -441,7 +472,6 @@ export default {
             return '手工新增'
         }
       },
-      isUpdate: false,
       expanded: false,
       // 页面配置
       isList: true,
@@ -473,7 +503,7 @@ export default {
         isCustomerSpecified: '',
         isUrgency: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       },
       personOptions: [],
       classOptions: [],
@@ -507,6 +537,8 @@ export default {
       //   isPage: true,
       //   title: ''
       // }
+      // 用于保存临时记录修改行的数组
+      record:[]
     }
   },
   created() {
@@ -515,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) {
@@ -573,7 +610,7 @@ export default {
         isCustomerSpecified: '',
         isUrgency: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       }
       this.getList(this.queryParams)
     },
@@ -611,6 +648,7 @@ export default {
     handleCommand() {
       this.$modal.loading("正在导出数据,请稍后...");
       let param = this.queryParams
+      param.pageSize = this.total
       exportItems(param).then(res => {
         this.$modal.closeLoading();
         const blob = new Blob([res], {
@@ -667,7 +705,15 @@ export default {
       this.getList(this.queryParams)
     },
     saveList() {
-      editSummaryList(this.tableList).then(res => {
+      // 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
@@ -723,6 +769,8 @@ export default {
             this.$modal.notifySuccess("审核成功");
             this.getList(this.queryParams)
           }
+        }).catch(err => {
+          this.getList(this.queryParams)
         })
       }
     },
@@ -794,6 +842,7 @@ export default {
       }
       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
       }
@@ -834,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) {
@@ -859,7 +924,10 @@ export default {
       this.referCondition.isPage = isPage
       this.referCondition.title = title
       this.$refs.refer.init(this.referCondition)
-    }
+    },
+    jilu(index) {
+      this.record.push(index)
+    },
   }
 }
 </script>
@@ -894,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 {

+ 48 - 28
src/views/purchase/PurchaseDemandList/add.vue

@@ -215,7 +215,7 @@
           <ux-table-column resizable title="需求可用周期" align="center"  field="demandPeriod" width="80px"/>
           <ux-table-column resizable title="实际(业务)需求量" align="center"  field="qty" width="150px" :render-header="addRedStar" edit-render>
             <template v-slot:edit="scope">
-                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @input="getYLSL(scope)" @paste.native="pasteMe($event, scope, scope.rowIndex)"/>
+                <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.qty" @paste.native="pasteMe($event, scope, scope.rowIndex)"/>
             </template>
           </ux-table-column>
           <ux-table-column resizable title="紧急标识" align="center" field="isUrgency" width="100px" edit-render>
@@ -277,20 +277,24 @@
           <ux-table-column resizable title="有效期单位" align="center"  field="expiryUnit" width="100px"/>
           <ux-table-column resizable title="安全库存" align="center"  field="safeStock" width="100px"/>
           <ux-table-column resizable title="注册人" align="center"  field="registrant" width="100px"/>
-          <ux-table-column resizable title="预留比例" align="center" field="reservedProportion" width="120px" edit-render>
+          <!-- <ux-table-column resizable title="预留比例" align="center" field="reservedProportion" width="120px" edit-render>
             <template v-slot:edit="scope">
-                <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedProportion" @change="getYLSL(scope)" @clear="cleanYLSL(scope)">
+                <el-select clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedProportion" @clear="cleanYLSL(scope)">
                   <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
             </template>
-          </ux-table-column>
+          </ux-table-column> -->
           <ux-table-column resizable title="预留周期" align="center" field="reservedPeriod" width="120px" edit-render>
             <template v-slot:edit="scope">
                 <el-input type="number" min="0" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedPeriod"></el-input>
             </template>
           </ux-table-column>
-          <ux-table-column resizable title="预留数量" align="center"  field="reservedQty" width="120px"/>
+          <ux-table-column resizable title="预留数量" align="center"  field="reservedQty" width="120px" edit-render>
+            <template v-slot:edit="scope">
+                <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"/>
           <ux-table-column resizable title="近一月需求" align="center"  field="onemonthAvgVolume" width="100px"/>
           <ux-table-column resizable title="近三月需求" align="center"  field="threemonthAvgVolume" width="100px"/>
@@ -502,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'
 // 明细行选择物料参照
@@ -862,18 +866,6 @@ export default {
           return '总供应可满足'
       }
     },
-    // 获取预留数量
-    getYLSL(scope) {
-      if (scope.row.reservedProportion) {
-        scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
-      }
-      // 如果选择预留比例,预留周期必填
-      // if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
-      //   this.isYl = true
-      // } else {
-      //   this.isYl = false
-      // }
-    },
     // 清空
     cleanYLSL(scope) {
       scope.row.reservedQty = ''
@@ -975,9 +967,12 @@ export default {
                       this.back()
                     }
                   }).catch(err => {
-                    let errorList = JSON.parse(err.message).rowList
-                    console.log(errorList)
-                    this.gainRed(errorList)
+                    // 加入定时器防止报错关不掉遮罩
+                    setTimeout(() => {
+                      let errorList = JSON.parse(err.message).rowList
+                      console.log(errorList)
+                      this.gainRed(errorList)
+                    }, 500)
                     this.$modal.closeLoading();
                   })
                 } else if (this.sonPageStu == 'edit') {
@@ -995,9 +990,12 @@ export default {
                       this.back()
                     }
                   }).catch(err => {
-                    let errorList = JSON.parse(err.message).rowList
-                    console.log(errorList)
-                    this.gainRed(errorList)
+                    // 加入定时器防止报错关不掉遮罩
+                    setTimeout(() => {
+                      let errorList = JSON.parse(err.message).rowList
+                      // console.log(errorList)
+                      this.gainRed(errorList)
+                    },500)
                     this.$modal.closeLoading();
                   })
                 }
@@ -1084,10 +1082,32 @@ 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 => {
-        let errorList = JSON.parse(err.message).rowList
-        console.log(errorList)
-        this.gainRed(errorList)
+        // 加入定时器防止报错关不掉遮罩
+        setTimeout(() => {
+          let errorList = JSON.parse(err.message).rowList
+          console.log(errorList)
+          this.gainRed(errorList)
+        }, 500)
         this.$modal.closeLoading();
       })
     },
@@ -1853,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;

+ 48 - 6
src/views/purchase/PurchaseDemandList/index.vue

@@ -209,6 +209,7 @@
             <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 == '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>
           </template>
         </el-table-column>
@@ -220,7 +221,7 @@
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
           :page-sizes="[10, 20, 50, 100, 200, 500]"
-          :page-size="10"
+          :page-size="50"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -317,7 +318,9 @@ import Add from './add.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand } from '@/api/purchase/purchaseDemand.js'
+// 流程收回
+import { rebacktWork } from '@/api/purchase/workSpace.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand, confirmSubmit } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
@@ -366,7 +369,7 @@ export default {
       // 页面状态
       page: '',
       queryParams: {
-        code: '',
+        code: this.$route.query.billCode,
         customer: '',
         isCustomerSpecified: '',
         demandPersonal: '',
@@ -379,7 +382,7 @@ export default {
         materialCode: '',
         status: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       },
       referCondition: {
         type: '',
@@ -426,6 +429,8 @@ export default {
           return '已完成'
         case '3':
           return '已驳回'
+        case '9':
+          return '已回退'
       }
     },
     formatterBillType(row) {
@@ -480,7 +485,7 @@ export default {
         materialCode: '',
         status: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       }
       this.getList(this.queryParams)
     },
@@ -592,6 +597,8 @@ export default {
             downloadElement.click(); // 点击下载
             document.body.removeChild(downloadElement); // 下载完成移除元素
             window.URL.revokeObjectURL(href); // 释放blob对象
+          }).catch(err => {
+            this.$modal.closeLoading();
           })
         }
       } else {
@@ -613,6 +620,8 @@ export default {
           downloadElement.click(); // 点击下载
           document.body.removeChild(downloadElement); // 下载完成移除元素
           window.URL.revokeObjectURL(href); // 释放blob对象
+        }).catch(err => {
+          this.$modal.closeLoading();
         })
       }
     },
@@ -652,6 +661,39 @@ 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();
       })
@@ -674,7 +716,7 @@ export default {
         this.$modal.notifyWarning("请选中至少一条数据");
       } else {
         let param = this.ids.join()
-        this.$modal.confirm('确认信息').then(() => {
+        this.$modal.confirm('确认删除选中数据?').then(() => {
         delDemand(param).then(res => {
           if (res.code === 200) {
             this.$modal.notifySuccess("删除成功");

+ 17 - 9
src/views/purchase/apply/add/columns.js

@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -168,6 +169,7 @@ export default function useColumns() {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             value: 1,
             disabled: true,
@@ -187,6 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },
@@ -254,6 +257,7 @@ export default function useColumns() {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             disabled: true,
           },
@@ -326,8 +330,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer =
-                Number(taxPrice) - Number(recentlyPrice));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0);
             },
           },
         },
@@ -337,11 +340,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) : 0);
             },
           },
         },
@@ -349,9 +348,9 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : prop * 1;
+              return prop.yPurchaseQuantity
             },
           },
         },
@@ -383,6 +382,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice", title: "中标价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -390,6 +390,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice", title: "单价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -397,6 +398,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit", title: "利润比1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -409,6 +411,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice1", title: "中标价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -416,6 +419,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice1", title: "单价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -423,6 +427,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit1", title: "利润比2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -435,6 +440,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice2", title: "中标价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -442,6 +448,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice2", title: "单价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -449,6 +456,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit2", title: "利润比3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },

+ 10 - 7
src/views/purchase/apply/add/index.vue

@@ -86,7 +86,8 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: ""});
+            purchasequantity
+          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "", priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -101,6 +102,7 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
             updateByName: createByName,
@@ -122,7 +124,7 @@
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = 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
@@ -150,11 +152,12 @@
         const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
       },
       //
       async onRowAdd(prop, pushParams = {}) {
-        // this.$refs.superForm.validate(async (valid) => {
-        //   if (valid) {
+        this.$refs.superForm.validate(async (valid) => {
+          if (valid) {
             const {TabColumns} = this;
             const {TableColumns} = TabColumns.find(
               ({item: {key}}) => key === prop
@@ -164,8 +167,8 @@
               ...this.$init.params(TableColumns),
               ...pushParams,
             });
-        //   }
-        // });
+          }
+        });
       },
       //
       async onRowRemove(prop, scope) {
@@ -251,7 +254,7 @@
           :name="item.key"
           lazy
         >
-          <div v-loading="loading" style="height: 600px; display: flex">
+          <div v-loading="loading" style="height: 250px; display: flex">
             <el-super-table
               v-model="params[item.key]"
               :dict="dict"

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

@@ -2,7 +2,7 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "priceCode", title: "价格编码1", width: 150 }, attr: {} },
+    { item: { key: "priceCode", title: "价格编码", width: 150 }, attr: {} },
     {
       item: { key: "status", title: "状态", width: 100 },
       attr: { is: "el-dict-tag", dictName: "sys_status", width: 100 },
@@ -30,7 +30,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型", width: 100 },
-      attr: {},
+      attr: { is: "el-dict-tag", dictName: "price_source", width: 100 },
     },
   ].map(({ item, attr }) => ({
     attr,

+ 17 - 6
src/views/purchase/apply/copy/columns.js

@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -168,6 +169,7 @@ export default function useColumns() {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             value: 1,
             disabled: true,
@@ -187,6 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },
@@ -254,6 +257,7 @@ export default function useColumns() {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             disabled: true,
           },
@@ -326,9 +330,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer = (
-                Number(taxPrice) - Number(recentlyPrice)
-              ));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0);
             },
           },
         },
@@ -338,7 +340,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(2) : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) : 0);
             },
           },
         },
@@ -346,9 +348,9 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.yPurchaseQuantity
             },
           },
         },
@@ -381,6 +383,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice", title: "中标价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -388,6 +391,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice", title: "单价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -395,6 +399,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit", title: "利润比1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -407,6 +412,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice1", title: "中标价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -414,6 +420,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice1", title: "单价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -421,6 +428,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit1", title: "利润比2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -433,6 +441,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice2", title: "中标价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -440,6 +449,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice2", title: "单价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -447,6 +457,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit2", title: "利润比3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },

+ 8 - 4
src/views/purchase/apply/copy/index.vue

@@ -102,7 +102,8 @@ export default {
         const {
           recentlyPrice = "0",
           isApprovalFirst = "N",
-        } = await fetchExist({ puOrg, customer, supplier, materialCode });
+          purchasequantity
+        } = await fetchExist({ puOrg, customer, supplier, materialCode, priceType: prop.row.priceType });
         this.loading = false;
         await this.onRowAdd(this.tabName, {
           ...item,
@@ -117,6 +118,7 @@ export default {
           puUnitName: puUnitName,
           recentlyPrice,
           isApprovalFirst,
+          yPurchaseQuantity: purchasequantity,
           tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
           createByName: createByName,
           updateByName: createByName,
@@ -138,7 +140,7 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = 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
@@ -152,7 +154,8 @@ export default {
         const { TableColumns } = TabColumns.find(
           ({ item: { key } }) => key === tabName
         );
-        const { code, data } = await ITEM(prop);
+        console.log('看看prop', prop)
+        const { code, data } = await ITEM(prop, true);
         if (code === 200) {
           this.params = data;
           this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
@@ -200,6 +203,7 @@ export default {
       const { TabColumns, TableColumns } = useColumns();
       this.visible = false;
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
+      this.$emit("success");
     },
     //
     async onRowAdd(prop, pushParams = {}) {
@@ -305,7 +309,7 @@ export default {
           :name="item.key"
           lazy
         >
-          <div v-loading="loading" style="height: 600px; display: flex">
+          <div v-loading="loading" style="height: 250px; display: flex">
             <el-super-table
               v-model="params[item.key]"
               :dict="dict"

+ 18 - 11
src/views/purchase/apply/edit/columns.js

@@ -87,7 +87,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型" },
-      attr: { is: "el-input", disabled: true, readonly: true },
+      attr: { is: "el-select", dictName: "price_source", disabled: true, readonly: true },
     },
     {
       item: { key: "status", title: "单据状态" },
@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable:true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -168,6 +169,7 @@ export default function useColumns() {
           item: { key: "conversionRate", title: "采购换算率", required: true },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             value: 1,
             disabled: true,
@@ -187,6 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },
@@ -254,6 +257,7 @@ export default function useColumns() {
           item: { key: "recentlyPrice", title: "最近价格" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
             disabled: true,
           },
@@ -326,9 +330,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer = (
-                Number(taxPrice) - Number(recentlyPrice)
-              ));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0 );
             },
           },
         },
@@ -338,11 +340,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1): 0);
             },
           },
         },
@@ -350,9 +348,9 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.yPurchaseQuantity
             },
           },
         },
@@ -385,6 +383,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice", title: "中标价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -392,6 +391,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice", title: "单价1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -399,6 +399,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit", title: "利润比1" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -411,6 +412,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice1", title: "中标价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -418,6 +420,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice1", title: "单价2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -425,6 +428,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit1", title: "利润比2" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -437,6 +441,7 @@ export default function useColumns() {
           item: { width: 150, key: "bidPrice2", title: "中标价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -444,6 +449,7 @@ export default function useColumns() {
           item: { width: 150, key: "unitPrice2", title: "单价3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },
@@ -451,6 +457,7 @@ export default function useColumns() {
           item: { width: 150, key: "profit2", title: "利润比3" },
           attr: {
             is: "el-input-number",
+            min: 0,
             precision: CONFIG.precision,
           },
         },

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

@@ -131,7 +131,8 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: ""});
+            purchasequantity
+          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "",priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -146,12 +147,12 @@
             puUnitName: puUnitName,
             recentlyPrice,
             isApprovalFirst,
+            yPurchaseQuantity: purchasequantity,
             tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
             createByName: createByName,
             updateByName: createByName,
             id: null,
           });
-          console.log('isPriceAdjustment', isPriceAdjustment)
         }
       },
       // 
@@ -168,7 +169,7 @@
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = 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
@@ -182,7 +183,7 @@
           const {TableColumns} = TabColumns.find(
             ({item: {key}}) => key === tabName
           );
-          const {code, data} = await ITEM(prop);
+          const {code, data} = await ITEM(prop, false);
           if (code === 200) {
             this.params = data;
             this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
@@ -213,6 +214,7 @@
         const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
       },
       //
       async onRowAdd(prop, pushParams = {}) {
@@ -328,7 +330,7 @@
           :name="item.key"
           lazy
         >
-          <div v-loading="loading" style="height: 600px; display: flex">
+          <div v-loading="loading" style="height: 250px; display: flex">
             <el-super-table
               v-model="priceApply[item.key]"
               :dict="dict"

+ 208 - 98
src/views/purchase/apply/index.vue

@@ -1,99 +1,178 @@
 <script>
-import { dicts } from "./dicts";
-import useColumns from "./columns";
-import { LIST, mbDownload } from "@/api/business/purchase/apply";
+  import {dicts} from "./dicts";
+  import useColumns from "./columns";
+  import {LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
+  // 导入的token
+  import {getToken} from "@/utils/auth";
 
-export default {
-  name: "PuchaseApply",
-  dicts: dicts,
-  components: {
-    SeeButton: () => import("./see/index.vue"),
-    AddButton: () => import("./add/index.vue"),
-    CopyButton: () => import("./copy/index.vue"),
-    EditButton: () => import("./edit/index.vue"),
-    DeleButton: () => import("./delete/index.vue"),
-    SubmButton: () => import("./submit/index.vue"),
-    ElSuperTable: () => import("@/components/super-table/index.vue"),
-    ElSuperSearch: () => import("@/components/super-search/index.vue"),
-  },
-  data() {
-    const { TableColumns, SearchColumns } = useColumns();
-    const page = this.$init.page();
-    const params = this.$init.params(SearchColumns);
-    return {
-      size: "mini",
-      loading: false,
-      params: params,
-      page: page,
-      tableData: [],
-      selectData: [],
-      SearchColumns: SearchColumns,
-      TableColumns: TableColumns,
-    };
-  },
-  computed: {},
-  created() {
-    this.useQuery(this.params, this.page);
-  },
-  methods: {
-    //
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, rows, total } = await LIST(
-          { ...prop },
-          { pageNum, pageSize }
-        );
-        if (code === 200) {
-          this.tableData = rows.map((item, index) => ({
-            ...item,
-            $index: (pageNum - 1) * pageSize + index + 1,
-          }));
-          this.page.total = total;
-        }
-      } catch (err) {
-        // catch
-        console.error(err);
-      } finally {
-        // finally
-        this.loading = false;
-      }
+  export default {
+    name: "PuchaseApply",
+    dicts: dicts,
+    components: {
+      SeeButton: () => import("./see/index.vue"),
+      AddButton: () => import("./add/index.vue"),
+      CopyButton: () => import("./copy/index.vue"),
+      EditButton: () => import("./edit/index.vue"),
+      DeleButton: () => import("./delete/index.vue"),
+      SubmButton: () => import("./submit/index.vue"),
+      ElSuperTable: () => import("@/components/super-table/index.vue"),
+      ElSuperSearch: () => import("@/components/super-search/index.vue"),
     },
-    // 查 询
-    useQuery(prop, page) {
-      this.fetchList(prop, page);
+    data() {
+      const {TableColumns, SearchColumns} = useColumns();
+      const page = this.$init.page();
+      const params = this.$init.params(SearchColumns);
+      return {
+        // 导入参数
+        upload: {
+          // 是否显示弹出层(导入)
+          open: false,
+          // 弹出层标题(导入)
+          title: "数据导入",
+          // 是否禁用上传
+          isUploading: false,
+          // 是否更新已经存在的用户数据
+          updateSupport: 1,
+          // 设置上传的请求头部
+          headers: {Authorization: "Bearer " + getToken()},
+          // 上传的地址
+          url: process.env.VUE_APP_BASE_API + "/pu/priceApply/import"
+        },
+        size: "mini",
+        loading: false,
+        params: params,
+        page: page,
+        tableData: [],
+        selectData: [],
+        SearchColumns: SearchColumns,
+        TableColumns: TableColumns,
+      };
     },
-    // 重 置
-    useReset() {
-      this.page = this.$init.page();
-      this.params = this.$init.params(this.SearchColumns);
+    computed: {},
+    created() {
+      this.params.priceCode = this.$route.query.billCode
       this.useQuery(this.params, this.page);
     },
-    // 选 择
-    useSelect(prop) {
-      this.selectData = prop;
-    },
-    // 明 细
-    async useSee(prop) {
-      const { open } = this.$refs.SeeButton;
-      await open([prop]);
-    },
-    // 下载模板
-    downLoadMb() {
-      this.$modal.loading("正在下载模板,请稍后...");
-      mbDownload().then(res => {
-
-      }).catch(err => {
+    methods: {
+      //
+      async fetchList(prop, page) {
+        try {
+          this.loading = true;
+          const {pageNum, pageSize} = page;
+          const {code, rows, total} = await LIST(
+            {...prop},
+            {pageNum, pageSize}
+          );
+          if (code === 200) {
+            this.tableData = rows.map((item, index) => ({
+              ...item,
+              $index: (pageNum - 1) * pageSize + index + 1,
+            }));
+            this.page.total = total;
+          }
+        } catch (err) {
+          // catch
+          console.error(err);
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      },
+      // 查 询
+      useQuery(prop, page) {
+        this.fetchList(prop, page);
+      },
+      // 重 置
+      useReset() {
+        this.page = this.$init.page();
+        this.params = this.$init.params(this.SearchColumns);
+        this.useQuery(this.params, this.page);
+      },
+      // 选 择
+      useSelect(prop) {
+        this.selectData = prop;
+      },
+      // 明 细
+      async useSee(prop) {
+        const {open} = this.$refs.SeeButton;
+        await open([prop]);
+      },
+      // 下载模板
+      downLoadMb() {
+        this.$modal.loading("正在下载模板,请稍后...");
+        mbDownload().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); // 创建下载的链接
+          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对象
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+        this.upload.isUploading = true;
+        this.$modal.loading("正在导入数据,请稍后...");
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
         this.$modal.closeLoading();
-      })
-    },
-    // 导入数据
-    importMb() {
-      
+        this.upload.open = false;
+        this.upload.isUploading = false;
+        this.$refs.upload.clearFiles();
+        if (response.code == 200) {
+          this.$alert(response.data.msg, "导入结果", {dangerouslyUseHTMLString: true});
+          // 有失败的再次下载下来
+          if (response.data.flag) {
+            this.$modal.loading("正在下载导入失败数据,请稍后...");
+            failDownload({failDatas: response.data.datas}).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); // 创建下载的链接
+              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对象
+            }).catch(err => {
+              this.$modal.closeLoading();
+            })
+          }
+        }else{
+          this.$notify({
+            message: response.msg,
+            type: response.code == 200 ? 'success' : 'warning'
+          });
+        }
+        this.useQuery(this.params, this.page);
+      },
+      errorFile(err) {
+        this.$modal.closeLoading();
+        this.$modal.notifyError("文件已变动,请重新上传");
+      },
+      // 提交上传文件
+      submitFileForm() {
+        this.$refs.upload.submit();
+      },
+      // 导入数据
+      importMb() {
+        this.upload.title = "文件导入"
+        this.upload.open = true
+      },
     },
-  },
-};
+  };
 </script>
 
 <template>
@@ -179,17 +258,48 @@ export default {
       @pagination="useQuery(params, page)"
     >
     </el-super-table>
+    <!-- 文件导入对话框 -->
+    <el-dialog title="文件导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :on-error="errorFile"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <!-- <div class="el-upload__tip" slot="tip">
+          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+        </div> -->
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+        <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </el-card>
 </template>
 <style scoped lang="scss">
-.el-card {
-  width: calc(100% - 32px);
-  height: calc(100vh - 32px);
-  margin: 16px;
-  padding: 16px;
-  border-radius: 8px;
-}
-.el-button-group + .el-button-group {
-  margin: 0 0 0 8px;
-}
+  .el-card {
+    width: calc(100% - 32px);
+    height: calc(100vh - 32px);
+    margin: 16px;
+    padding: 16px;
+    border-radius: 8px;
+  }
+
+  .el-button-group + .el-button-group {
+    margin: 0 0 0 8px;
+  }
 </style>

+ 9 - 7
src/views/purchase/apply/see/columns.js

@@ -51,7 +51,10 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "sourceType", title: "来源单据类型" },
-      attr: {},
+      attr: {
+        is: "el-dict-tag",
+        dictName: "price_source",
+      },
     },
     {
       item: { width: 100, key: "status", title: "单据状态" },
@@ -169,7 +172,6 @@ export default function useColumns() {
         {
           item: { width: 100, key: "isPriceAdjustmentName", title: "调价类型" },
           attr: {
-            is: "el-dict-tag",
           },
         },
         {
@@ -212,11 +214,11 @@ export default function useColumns() {
         },
 
         {
-          item: { width: 100, key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0%");
             },
           },
         },
@@ -224,9 +226,9 @@ export default function useColumns() {
         {
           item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.yPurchaseQuantity
             },
           },
         },

+ 3 - 1
src/views/purchase/apply/see/index.vue

@@ -67,7 +67,7 @@ export default {
           total,
           rows: [{ id }],
         } = await LIST({ ...model }, { pageNum: prop, pageSize: 1 });
-        const { code, data } = await ITEM(id);
+        const { code, data } = await ITEM(id, false);
         if (code === 200) {
           this.params = data;
           this.params.$index = prop;
@@ -91,6 +91,7 @@ export default {
     },
     //
     async hide() {
+      console.log("关闭!!!!!!!", this.$props)
       const {
         TabColumns: [
           {
@@ -100,6 +101,7 @@ export default {
       } = useColumns();
       this.visible = false;
       this.tabName = tabName;
+      this.$emit("success");
     },
     async jumpOA() {
       toOA(this.$store.state.user.name, this.params.flowId).then(res => {

+ 21 - 7
src/views/purchase/catalogue/columns.js

@@ -46,15 +46,15 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_invalid" },
     },
     {
       item: { width: 100, key: "enableStatus", title: "启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_enable" },
     },
     {
       item: { width: 100, key: "materialStatus", title: "物料启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "material_enable" },
     },
     {
       item: { width: 100, key: "isDistribution", title: "配送价" },
@@ -92,6 +92,7 @@ export default function useColumns() {
       item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         referName: "ORG_PARAM",
         valueKey: "name",
         dataMapping: {
@@ -104,6 +105,7 @@ export default function useColumns() {
       item: { width: 100, key: "manufacturerName", title: "生产厂家" },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         referName: "MANUFACTURER_PARAM",
         valueKey: "name",
         dataMapping: {
@@ -116,6 +118,7 @@ export default function useColumns() {
       item: { width: 100, key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         referName: "SUPPLIER_PARAM",
         valueKey: "name",
         dataMapping: {
@@ -126,7 +129,7 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "applyCode", title: "来源单据" },
-      attr: { is: "el-input" },
+      attr: { clearable: true, is: "el-input" },
     },
     {
       item: {key: "materialCodeList", title: "物料编码"},
@@ -137,6 +140,14 @@ export default function useColumns() {
         referName: "MATERIAL_PARAM",
       },
     },
+    {
+      item: { key: "materialCodes", title: "物料编码"},
+      attr: {
+        clearable: true,
+        is: "el-input",
+        placeholder: '多物料编码使用 , 隔开',
+      },
+    },
     // {
     //   item: { width: 100, key: "materialCodeList", title: "物料编码" },
     //   attr: {
@@ -148,6 +159,7 @@ export default function useColumns() {
     {
       item: { key: "materialClassifyList", title: "物料一级分类"},
       attr: {
+        clearable: true,
         is: "el-popover-multiple-tree-select",
         referName: "MATERIALCLASSIFY_PARAM",
         valueKey: "code",
@@ -155,19 +167,20 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "source", title: "价格来源" },
-      attr: { is: "el-select", dictName: "price_source" },
+      attr: { clearable: true, is: "el-select", dictName: "price_source" },
     },
     {
       item: { width: 100, key: "status", title: "有效状态" },
-      attr: { is: "el-select", dictName: "is_effective" },
+      attr: { clearable: true, is: "el-select", dictName: "price_invalid" },
     },
     {
       item: { width: 100, key: "enableStatus", title: "启用状态", span: 4 },
-      attr: { is: "el-select", dictName: "is_effective" },
+      attr: { clearable: true, is: "el-select", dictName: "price_enable" },
     },
     {
       item: { width: 100, key: "createTime", title: "价格日期", span: 8 },
       attr: {
+        clearable: true,
         is: "el-date-picker",
         type: "datetimerange",
         rangeSeparator: "至",
@@ -179,6 +192,7 @@ export default function useColumns() {
     {
       item: { width: 100, key: "invalid", title: "价格失效日期", span: 8 },
       attr: {
+        clearable: true,
         is: "el-date-picker",
         type: "datetimerange",
         rangeSeparator: "至",

+ 28 - 2
src/views/purchase/catalogue/index.vue

@@ -1,7 +1,7 @@
 <script>
 import { dicts } from "./dicts";
 import useColumns from "./columns";
-import { LIST } from "@/api/business/purchase/catalogue";
+import { LIST, exportAll } from "@/api/business/purchase/catalogue";
 
 export default {
   name: "PuchaseCatalogue",
@@ -25,7 +25,7 @@ export default {
       selectData: [],
       TableColumns: TableColumns,
       SearchColumns: SearchColumns,
-      page: { pageNum: 1, pageSize: 20, total: 0 },
+      page: { pageNum: 1, pageSize: 50, total: 0 },
     };
   },
   computed: {},
@@ -90,6 +90,29 @@ export default {
       const { open } = this.$refs.SeeButton;
       await open([prop]);
     },
+    // 导出全部
+    exportAll() {
+      this.$modal.loading("正在导出数据,请稍后...");
+      exportAll().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对象
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
   },
 };
 </script>
@@ -150,6 +173,9 @@ export default {
           @success="useQuery(params, page)"
         ></exp-button>
       </el-button-group>
+      <el-button-group>
+        <el-button size="mini" @click="exportAll">全部导出</el-button>
+      </el-button-group>
     </div>
     <el-super-table
       v-model="tableData"

+ 7 - 4
src/views/purchase/catalogue/see/columns.js

@@ -30,7 +30,10 @@ export default function useColumns() {
     { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
     { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
     { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "source", title: "来源单据" }, attr: {} },
+    { item: { width:100,key: "source", title: "来源单据" }, attr: {
+      is: "el-dict-tag",
+      dictName: "price_source",
+    } },
     {
       item: { width:100,key: "convertRate", title: "换算率" },
       attr: {
@@ -42,15 +45,15 @@ export default function useColumns() {
     },
     {
       item: { width:100,key: "status", title: "有效状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_invalid" },
     },
     {
       item: { width:100,key: "enableStatus", title: "启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "price_enable" },
     },
     {
       item: { width:100,key: "materialStatus", title: "物料启用状态" },
-      attr: { is: "el-dict-tag", dictName: "is_effective" },
+      attr: { is: "el-dict-tag", dictName: "material_enable" },
     },
     {
       item: { width:100,key: "isDistribution", title: "配送价" },

+ 5 - 1
src/views/purchase/contract/columns.js

@@ -274,6 +274,7 @@ export default function useColumns() {
       item: { key: "buyerName", title: "采购员", width: 100 },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "CONTACTS_PARAM",
         dataMapping: {
@@ -289,6 +290,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "ORG_PARAM",
         dataMapping: {
@@ -330,9 +332,10 @@ export default function useColumns() {
       },
     },
     {
-      item: { width: 100, key: "status", title: "合同号" },
+      item: { width: 100, key: "code", title: "合同编码" },
       attr: {
         is: "el-input",
+        clearable: true,
       },
     },
     {
@@ -342,6 +345,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {

+ 309 - 0
src/views/purchase/ownership/index.vue

@@ -0,0 +1,309 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="68px">
+      <el-form-item label="来源单据">
+        <el-input
+          v-model="queryParams.source"
+          clearable
+          @keyup.enter.native="btnQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户">
+        <DrPopoverSelectV2
+          size="mini"
+          v-model="queryParams.customerName"
+          valueKey= "name"
+          referName="CUSTOMER_PARAM"
+          :dataMapping="{
+            customer: 'id',
+            customerName: 'name',
+          }"
+          :source.sync="queryParams"
+        >
+        </DrPopoverSelectV2>
+      </el-form-item>
+      <el-form-item label="物料">
+        <DrPopoverSelectV2
+          size="mini"
+          v-model="queryParams.materialName"
+          valueKey= "name"
+          referName="MATERIAL_PARAM"
+          :dataMapping="{
+            material: 'id',
+            materialName: 'name',
+          }"
+          :source.sync="queryParams"
+        >
+        </DrPopoverSelectV2>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="btnQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table
+      size="mini"
+      v-loading="loading"
+      :data="list"
+      height="700px"
+    >
+      <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+      <el-table-column show-overflow-tooltip width="200" label="来源单据" align="center" prop="source" />
+      <el-table-column show-overflow-tooltip width="200" label="客户" align="center" prop="customerName" />
+      <el-table-column show-overflow-tooltip width="150" label="物料编码" align="center" prop="materialCode" />
+      <el-table-column show-overflow-tooltip width="300" label="物料" align="center" prop="materialName" />
+      <el-table-column show-overflow-tooltip width="150" label="可用量" align="center" prop="qty" />
+      <el-table-column show-overflow-tooltip width="150" label="已用量" align="center" prop="usedQty" />
+      <el-table-column show-overflow-tooltip width="150" label="预留数量" align="center" prop="reservedQty" />
+      <el-table-column show-overflow-tooltip width="150" label="创建时间" align="center" prop="createTime" />
+      <el-table-column
+        width="250"
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="btnUpdate(scope.row)"
+            >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改任务对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="700px"
+      append-to-body
+    >
+      <el-form
+        size="mini"
+        ref="form"
+        :model="form"
+        label-width="80px"
+      >
+        <el-form-item label="单据来源">
+          <el-input
+            v-model="form.source"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="创建时间">
+          <el-input
+            v-model="form.createTime"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="客户">
+          <el-input
+            v-model="form.customerName"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="物料编码">
+          <el-input
+            v-model="form.materialCode"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="物料">
+          <el-input
+            v-model="form.materialName"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="可用量">
+          <el-input
+            type="number"
+            min="0"
+            size="mini"
+            v-model="form.qty"
+            @input='useFormQtyChange'
+          />
+        </el-form-item>
+        <el-form-item label="已用量">
+          <el-input
+            v-model="form.usedQty"
+            readonly
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="预留数量">
+          <el-input
+            v-model="form.reservedQty"
+            readonly
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button
+          size="mini"
+          type="primary"
+          @click="submitForm"
+          >确 定</el-button
+        >
+        <el-button size="mini" @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import {materialList,getDetail,update} from '@/api/purchase/ownership.js'
+
+export default {
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 列表数据
+      list: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        source: null,
+        customer: null,
+        customerName: null,
+        material: null,
+        materialName: null,
+      },
+      // 表单参数
+      form: {
+      },
+      //oldQty
+      oldQty: 0,
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询任务列表 */
+    getList() {
+      this.loading = true;
+      materialList(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        id: null,
+        ownerId: null,
+        material: null,
+        materialName: null,
+        unit: null,
+        unitName: null,
+        reservedQty: null,
+        reservedPeriod: null,
+        warehouse: null,
+        warehouseName: null,
+        allocation: null,
+        allocationName: null,
+        qty: null,
+        usedQty: null,
+        revision: null,
+        delFlag: null,
+        demandItemId: null,
+        materialCode: null,
+        source: null,
+        customerName: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    btnQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    btnResetQuery() {
+      // this.resetForm("queryForm");
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        source: null,
+        customer: null,
+        customerName: null,
+        material: null,
+        materialName: null,
+      };
+      this.btnQuery();
+    },
+    /** 修改按钮操作 */
+    btnUpdate(row) {
+      this.oldQty = null;
+      this.reset();
+      this.form.source = row.source;
+      this.form.customerName = row.customerName;
+      const id = row.id || this.ids
+      getDetail(id).then(response => {
+        this.form = {...this.form,...response.data};
+        this.open = true;
+        this.title = "修改预留";
+        this.oldQty = this.form.qty || 0;
+      });
+    },
+    /** 提交表单 */
+    submitForm() {
+      update(this.form).then(response => {
+        this.$modal.msgSuccess("修改成功");
+        this.open = false;
+        this.getList();
+      });
+    },
+    //值改变后
+    useFormQtyChange(val){
+      let cha = val - this.oldQty;
+      this.form.usedQty = this.form.usedQty - cha;
+      this.oldQty = val;
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+</style>

+ 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 === '')){
+
+  }
+
+
+}

+ 33 - 3
src/views/purchase/purchase-order/add/column.js

@@ -50,6 +50,7 @@ export const Columns = [
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     width: 200, 
+    require: true,
     isShow:true,
   },
   {
@@ -61,6 +62,8 @@ export const Columns = [
     dataMapping: {
       supplier: "id",
       supplierName: "name",
+      paymentAgreement: 'paymentId',
+      paymentAgreementName: 'paymentName',
     },
     queryParams: () => ({}),
     require: true,
@@ -78,6 +81,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     isShow:true,
+    disabled:true,
     require: true,
   },
   {
@@ -205,7 +209,8 @@ export const Columns = [
       pkOrg: params.puOrg,
     }),
     isShow:true,
-    require: true,
+    
+    // require: true,
   },
   {
     key: "goodsAllocationName",
@@ -552,7 +557,7 @@ export const TabColumns = [
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',
-          isMedcine:'isMedicineValue',
+          isMedcine:'isMedicineYN',
           manufacturer:'manufacturerId',
           manufacturerName:'manufacturerIdName',
           unit:'unitId',
@@ -704,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",
@@ -930,7 +952,7 @@ export const TabColumns = [
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',
-          isMedcine:'isMedicineValue',
+          isMedcine:'isMedicine',
           manufacturer:'manufacturerId',
           manufacturerName:'manufacturerIdName',
           unit:'unitId',
@@ -1021,4 +1043,12 @@ export const TabColumns = [
   },
 ];
 
+
+// 集采中心
+const PurColumns =[];
+const PurchaseTabColumns =[];
+
+// 事业发展部
+const CauseColumns =[];
+const CauseTabColumns =[];
 // export const initTabColumns = () => tabColumns;

+ 116 - 6
src/views/purchase/purchase-order/add/index.vue

@@ -24,15 +24,17 @@ export default {
   components: {
     FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
     popDialog: () => import("@/components/PopDialog/index.vue"),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
 
   data() {
     return {
       visible: false,
       loading:false,
+      tabLoading:false,
       columns: NewColumns,
       rules: initRules(NewColumns),
-
+      count:0,
       params: {
         ...initParams(NewColumns),
         puOrderItemList: [],
@@ -65,6 +67,27 @@ export default {
       },
       deep: true,
     },
+    "params.billType":{
+      handler(nVal, oVal){
+
+        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" },
+          ];
+
+          this.rules.goodsAllocationName = [
+            { required: true, message: "货位不能为空", trigger: "change" },
+          ];
+        }else{
+          this.rules.warehouseName = null;
+          this.rules.goodsAllocationName = null;
+        }
+
+        this.count++;
+      }
+    }
   },
   methods: {
     beforeOpen() {
@@ -80,7 +103,7 @@ export default {
         this.params.puDeptName = deptName;
         this.params.billDate = new Date().Format('yyyy-MM-dd');
         console.log(this.params,'this.params');
-        this.addTableRow();
+        // this.addTableRow();
       }
     },
     setVisible(prop,iscopy) {
@@ -388,7 +411,8 @@ export default {
               key != "buyerName" &&
               key != "puDept" &&
               key != "puDeptName" &&
-              key != "status"
+              key != "status" &&
+              key != "billDate" 
             ) {
               this.params[key] = "";
             } else {
@@ -499,6 +523,84 @@ export default {
     
     },
 
+    async handelImport(fileList){
+
+      try {
+
+        let formData = new FormData();
+
+        formData.append('file',fileList[0].raw);
+
+        this.$modal.loading("正在上传文件,请稍候...");
+
+        let {code,data} = await orderApi.orderImport(formData);
+
+        if(code == 200) {
+          this.tabLoading = true;
+          // puOrderExecuteList puOrderItemList
+
+          let size = 20;
+          let num = 1;
+          let total = Math.ceil(data['puOrderItemList'].length / size);
+
+          let resultData = {...data};
+          
+          let intervalPush = setInterval(()=>{
+
+            if(num > total){
+              
+              clearInterval(intervalPush);
+
+              this.tabLoading = false;
+            
+              this.handleGetPrice();
+            } 
+    
+            for (const key in resultData) {
+
+              resultData[key].slice(size*(num-1), (size*num) ).forEach(item =>{
+            
+
+                this.params[key].push(item);
+
+              })
+
+            }
+
+            num++;
+
+          },200);
+
+          // for (const key in data) {
+
+          //   this.params[key].push(...data[key]);
+
+          // }
+
+          
+          let {setVisible} =  this.$refs.batchImport;
+          
+          setVisible(false);
+          
+            
+          
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.$modal.closeLoading();
+        
+      }
+      
+    },
+    
+    async handleTemDownload(){
+
+      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+    },
+
+
   },
   created() {
     console.log("ADD CREATED", this.params);
@@ -524,6 +626,7 @@ export default {
       label-width="140px"
       :model="params"
       :rules="rules"
+      :key="count"
     >
       <el-card
         :body-style="{
@@ -568,7 +671,7 @@ export default {
                 :placeholder="column.placeholder"
                 :clearable="column.clearable"
                 :disabled="column.disabled"
-                style="width: 100%"
+                style="width: 100%;"
               >
               </el-input>
               <dr-popover-select
@@ -614,6 +717,7 @@ export default {
                 :clearable="column.clearable"
                 :placeholder="column.placeholder"
                 style="width: 100%"
+                filterable
                 @change="handleSelectChange(column.key,column.referName)"
               >
                 <el-option
@@ -685,7 +789,7 @@ export default {
         }"
         style="margin: 10px"
       >
-        <el-tabs v-model="tabName" style="width: 100%">
+        <el-tabs v-model="tabName" style="width: 100%" v-loading="tabLoading">
           <el-tab-pane
             v-for="(column, index) in tabColumns"
             :key="index"
@@ -756,6 +860,7 @@ export default {
                       @change="handleInputChange(scope.row, cColumn.key)"
                       :clearable="cColumn.clearable"
                       :disabled="cColumn.disabled"
+                      :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
                       size="mini"
                       style="width: 100%"
                     ></el-input-number>
@@ -763,7 +868,7 @@ export default {
                     <el-select
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
-                      
+                      filterable
                       size="mini"
                       :disabled="cColumn.disabled"
                       :clearable="cColumn.clearable"
@@ -811,6 +916,11 @@ export default {
           <el-button size="mini" @click="addTableRow(params[tabName])"
             >增行</el-button
           >
+          <BatchImport
+            ref="batchImport"
+            @import="handelImport"
+            @temDownload="handleTemDownload"
+          ></BatchImport>
         </el-row>
       </el-card>
     </el-form>

+ 141 - 86
src/views/purchase/purchase-order/column.js

@@ -471,6 +471,8 @@ export const TableColumns = [
 }));
 
 export const TabColumns = [
+
+
   {
     title: '物料信息',
     key: 'puOrderItemList',
@@ -544,6 +546,12 @@ export const TabColumns = [
         },
         
       },
+      { 
+        item:{key: "customerName", title: "收货客户" ,width:100,},
+        attr:{
+          isHidden:true,
+        },
+      },
       {
         item:{
           key: "isMedcine",
@@ -1086,24 +1094,27 @@ export const TabColumns = [
 export const SearchColumns = [
   {
     item:{
-      key: "source",
-      title: "订单来源",  
+      key: "orderCode",
+      title: "订单编号",  
     },
-    attr:{
+    attr: {
       clearable:true,
-      is: "el-select",
-      dictName: "order_source",
+      is: "el-input",
+      placeholder:'请输入订单编号,多个使用,隔开',
     },
   },
   {
     item:{
-      key: "orderCode",
-      title: "订单编号",  
+      key: "materialCode",
+      title: "物料编码",
     },
     attr: {
       clearable:true,
       is: "el-input",
-      placeholder:'请输入订单编号,多个使用,隔开',
+      placeholder:'请输入物料编码,多个使用,隔开',
+      // is: "el-popover-multiple-select-v2",
+      // valueKey: "code",
+      // referName: "MATERIAL_PARAM",
     },
   },
   {
@@ -1126,80 +1137,95 @@ export const SearchColumns = [
   },
   {
     item:{
-      key: "status",
-      title: "单据状态",
+      key: "puOrgIds",
+      title: "采购组织",
+    },
+    attr: {
+      clearable:true,
+      is: "el-popover-multiple-select-v2",
+      valueKey: "id",
+      referName: "ORG_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "source",
+      title: "订单来源",  
     },
     attr:{
       clearable:true,
       is: "el-select",
-      dictName: "documents_status",
+      dictName: "order_source",
     },
   },
   { 
     item:{
-      key: "supplierName", 
-      title: "供应商", 
+      key: "erpOrderCode",
+      title: "ERP订单号", 
     },
     attr: {
       clearable:true,
-      is: "el-popover-select-v2",
-      valueKey: "name",
-      referName: "SUPPLIER_PARAM",
+      is: "el-input",
     },
   },
-  {
+  { 
     item:{
-      key: "puOrgIds",
-      title: "采购组织",
+      key: "supplierName", 
+      title: "供应商", 
     },
     attr: {
       clearable:true,
-      is: "el-popover-multiple-select-v2",
-      valueKey: "id",
-      referName: "ORG_PARAM",
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "SUPPLIER_PARAM",
     },
   },
   {
     item:{
-      key: "materialCode",
-      title: "物料编码",
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
-      placeholder:'请输入物料编码,多个使用,隔开',
-      // is: "el-popover-multiple-select-v2",
-      // valueKey: "code",
-      // referName: "MATERIAL_PARAM",
+      key: "customerName",
+      title: "收货客户",
     },
+    attr:{
+      // clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "CUSTOMER_PARAM",
+      dataMapping: {
+        customer: 'id',
+        customerName: 'name'
+      },
+    }
   },
+
+  // 物料分类
+
   {
     item:{
-      key: "materialName",
-      title: "物料名称",
+      key: "status",
+      title: "单据状态",
     },
-    attr: {
+    attr:{
       clearable:true,
-      is: "el-popover-select-v2",
-      valueKey: "name",
-      referName: "MATERIAL_PARAM",
+      is: "el-select",
+      dictName: "documents_status",
     },
   },
   { 
     item:{
-      key: "deliveryStatus",
-      title: "erp发送状态", 
+      key: "demandCode",
+      title: "采购需求单号", 
     },
-    attr:{
+    attr: {
       clearable:true,
-      is: "el-select",
-      dictName: "order_delivery_status",
+      is: "el-input",
+      placeholder:'请输入采购需求单号,多个使用,隔开',
     },
   },
   { 
+    // 生产厂家
     item:{
-      key: "contractNo",
-      title: "合同号", 
+      key: "manufacturerName",
+      title: "生产厂家代理人",
     },
     attr: {
       clearable:true,
@@ -1208,14 +1234,14 @@ export const SearchColumns = [
   },
   {
     item:{
-      key: "projectNowName",
-      title: "在建工程项目",
+      key: "createByName",
+      title: "制单人",
     },
     attr: {
       clearable:true,
       is: "el-popover-select-v2",
+      referName: "CONTACTS_PARAM",
       valueKey: "name",
-      referName: "PROJECT_PARAM",
     },
   },
   {
@@ -1230,51 +1256,80 @@ export const SearchColumns = [
       valueKey: "code",
     },
   },
-  {
-    item:{
-      key: "billTypes",
-      title: "订单类型",
-    },
-    attr:{
-      is: "el-select",
-      multiple:true,
-      tags:true,
-      clearable:true,
-      dictName: "sys_order_type",
-    },
-  },
-  { 
-    item:{
-      key: "demandCode",
-      title: "采购需求单号", 
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
-      placeholder:'请输入采购需求单号,多个使用,隔开',
-    },
-  },
   { 
     item:{
-      key: "isDrug",
-      title: "物料药品属性", 
+      key: "deliveryStatus",
+      title: "erp发送状态", 
     },
-    attr: {
+    attr:{
       clearable:true,
       is: "el-select",
-      dictName: "sys_yes_no",
-    },
-  },
-  { 
-    item:{
-      key: "erpOrderCode",
-      title: "erp订单号", 
-    },
-    attr: {
-      clearable:true,
-      is: "el-input",
+      dictName: "order_delivery_status",
     },
   },
+  
+  // {
+  //   item:{
+  //     key: "materialName",
+  //     title: "物料名称",
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-popover-select-v2",
+  //     valueKey: "name",
+  //     referName: "MATERIAL_PARAM",
+  //   },
+  // },
+  
+  // { 
+  //   item:{
+  //     key: "contractNo",
+  //     title: "合同号", 
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-input",
+  //   },
+  // },
+  // {
+  //   item:{
+  //     key: "projectNowName",
+  //     title: "在建工程项目",
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-popover-select-v2",
+  //     valueKey: "name",
+  //     referName: "PROJECT_PARAM",
+  //   },
+  // },
+ 
+  // {
+  //   item:{
+  //     key: "billTypes",
+  //     title: "订单类型",
+  //   },
+  //   attr:{
+  //     is: "el-select",
+  //     multiple:true,
+  //     tags:true,
+  //     clearable:true,
+  //     dictName: "sys_order_type",
+  //   },
+  // },
+ 
+  // { 
+  //   item:{
+  //     key: "isDrug",
+  //     title: "物料药品属性", 
+  //   },
+  //   attr: {
+  //     clearable:true,
+  //     is: "el-select",
+  //     dictName: "sys_yes_no",
+  //   },
+  // },
+ 
 ].map(({ item, attr }) => ({
   attr,
   item: { ...item, hidden: true, span: item.span || 6 },

+ 151 - 4
src/views/purchase/purchase-order/edit/index.vue

@@ -8,12 +8,14 @@ export default {
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+    BatchImport: () => import("@/components/BatchImport/index.vue"),
   },
   data() {
     return {
       size: "mini",
       visible: false,
       loading: false,
+      tabLoading:false,
       columns: editColumns,
       rules: initRules(editColumns),
       params: {
@@ -55,6 +57,27 @@ export default {
       deep: true,
       immediate: true
     },
+    "params.billType":{
+      handler(nVal, oVal){
+
+        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" },
+          ];
+
+          this.rules.goodsAllocationName = [
+            { required: true, message: "货位不能为空", trigger: "change" },
+          ];
+        }else{
+          this.rules.warehouseName = null;
+          this.rules.goodsAllocationName = null;
+        }
+
+        this.count++;
+      }
+    }
   },
   methods: {
     setVisible(prop) {
@@ -322,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 {
+          }
+        }
+
+
       }
     },
     // 子表参照改变之后
@@ -438,6 +495,7 @@ export default {
         });
         if (code == 200) {
           this.params = data;
+          
         }
       } catch (error) {
 
@@ -478,6 +536,82 @@ export default {
 
       return Infinity;
     },
+
+    async handelImport(fileList){
+
+      try {
+
+        let formData = new FormData();
+
+        formData.append('file',fileList[0].raw);
+
+        this.$modal.loading("正在上传文件,请稍候...");
+
+        let {code,data} = await orderApi.orderImport(formData);
+
+        if(code == 200) {
+          this.tabLoading = true;
+          // puOrderExecuteList puOrderItemList
+
+          let size = 20;
+          let num = 1;
+          let total = Math.ceil(data['puOrderItemList'].length / size);
+
+          let resultData = {...data};
+          
+          let intervalPush = setInterval(()=>{
+
+            if(num > total){
+              
+              clearInterval(intervalPush);
+
+              this.tabLoading = false;
+            
+              this.handleGetPrice();
+            } 
+
+            for (const key in resultData) {
+
+              resultData[key].slice(size*(num-1), (size*num) ).forEach(item =>{
+
+                this.params[key].push(item);
+
+              })
+              
+            }
+
+            num++;
+
+          },200);
+
+          // for (const key in data) {
+
+          //   this.params[key].push(...data[key]);
+
+          // }
+          
+          let {setVisible} =  this.$refs.batchImport;
+          
+          setVisible(false);
+          
+          if(num > total) this.handleGetPrice();
+          
+        }
+        
+      } catch (error) {
+        
+      }finally{
+        this.$modal.closeLoading();
+        
+      }
+
+    },
+
+
+    async handleTemDownload(){
+
+      this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
+    },
   },
   created() {},
   mounted() { },
@@ -624,13 +758,14 @@ export default {
           </el-col>
         </el-row>
       </el-card>
+
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
         'flex-wrap': 'wrap',
         position: 'relative',
       }" style="margin: 10px">
-        <el-tabs v-model="tabName" style="width: 100%">
+        <el-tabs v-model="tabName" style="width: 100%" v-loading="tabLoading">
           <el-tab-pane 
             v-for="(column, index) in tabColumns" 
             :key="index" 
@@ -725,6 +860,7 @@ export default {
                     :precision="cColumn.precision"
                     :controls-position="cColumn.controlsPosition"
                     :max="getInputNumberMax(cColumn.key, scope.row)"
+                    :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
                     @change="handleInputChange(scope.row, cColumn.key)" 
                     :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" 
@@ -740,10 +876,15 @@ export default {
 
               <!-- 修订:不可删除、增行
               编辑:自制:可删可增 -->
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
+              <!-- v-if="!handleIsRevise()" -->
+              <el-table-column 
+                fixed="right" 
+                label="操作" 
+                width="120" >
+                <template slot-scope="scope"
+              >
+              <!-- v-if="!handleIsRevise()"  -->
                   <el-button 
-                    v-if="!handleIsRevise()" 
                     @click.native.prevent="delTableRow(params[tabName], scope.$index)" 
                     type="text" 
                     size="small"
@@ -757,6 +898,12 @@ export default {
         <el-row style="position: absolute; top: 20px; right: 20px">
           <el-button v-if="params.source == '3' && !handleIsRevise()" :size="size"
             @click="addTableRow(params[tabName])">增行</el-button>
+          <BatchImport
+            v-if="params.source == '3' && !handleIsRevise()"
+            ref="batchImport"
+            @import="handelImport"
+            @temDownload="handleTemDownload"
+          ></BatchImport>
         </el-row>
       </el-card>
     </el-form>

+ 4 - 3
src/views/purchase/purchase-order/edit/initColumn.js

@@ -66,9 +66,10 @@ export const forbidden = (isEdit,source) => {
     // 修订
     updateColumns.forEach(item => {
 
-      if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
-        item.key == 'supplierContactsName' || item.key == 'agentName' || 
-        item.key == 'rebateMoney' || item.key == 'remark') {
+      if (item.key == 'buyerName' || item.key == 'puDeptName'
+      || item.key === 'goodsAllocationName' || item.key === 'goodsWarehouseName' 
+      || item.key === 'warehouseName' || item.key == 'deductionMoney' 
+      || item.key == 'rebateMoney' ||item.key == 'remark' ) {
         item.disabled = false;
         item.readonly = false;
       } else {

+ 5 - 5
src/views/purchase/purchase-order/index.vue

@@ -63,6 +63,7 @@ export default {
     },
   },
   created() {
+    if(this.$route.query.billCode) this.params.orderCode = this.$route.query.billCode 
     this.fetchList(this.params, this.page);
     // this.handleRefreshList();
   },
@@ -367,9 +368,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();
@@ -377,7 +378,7 @@ export default {
                     }
                     
                   } catch (error) {
-                    
+                    instance.confirmButtonText = "确认";
                   }finally{
                     instance.confirmButtonLoading = false;
                   }
@@ -394,7 +395,7 @@ export default {
         finally{
           this.loading = false;
         }
-        })
+      })
      
     },
 
@@ -774,7 +775,6 @@ export default {
               convenitentOperation
               @select="handleTabSelect"
               @selection-change="handleTabSelectionChange"
-
             >
             </el-super-table>
           </div>

+ 35 - 5
src/views/purchase/task/columns.js

@@ -113,14 +113,24 @@ export default function useColumns() {
       },
     },
     {
-      item: {
-        key: "materialDesc",
-        title: "物料描述",
+      item: { 
+        key: "existPrice", 
+        title: "是否有价格",
       },
-      attr: {
-        is: "el-input",
+      attr: { 
+        is: "el-select", 
+        dictName: "sys_true_false" 
       },
     },
+    // {
+    //   item: {
+    //     key: "materialDesc",
+    //     title: "物料描述",
+    //   },
+    //   attr: {
+    //     is: "el-input",
+    //   },
+    // },
     {
       item: {
         key: "code",
@@ -200,6 +210,26 @@ export default function useColumns() {
         valueKey: "name",
       },
     },
+    // {
+    //   item: { 
+    //     key: "", 
+    //     title: "紧急标识",
+    //   },
+    //   attr: { 
+    //     is: "el-select", 
+    //     dictName: "sys_yes_no" 
+    //   },
+    // },
+    // {
+    //   item: { 
+    //     key: "", 
+    //     title: "补单标识",
+    //   },
+    //   attr: { 
+    //     is: "el-select", 
+    //     dictName: "sys_yes_no" 
+    //   },
+    // },
     {
       item: {
         key: "documentsCodes",

+ 13 - 14
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -19,12 +19,20 @@ export const TableColumns = [
      
     },
   },
+  {
+    item: { key: "taxPrice", title: "主含税单价", width: 150 },
+    attr: {
+      is: "el-computed-input-v2",
+      formatter: (prop) => {
+        return (prop * 1);
+      },
+    },
+  },
   
-  
-  // {
-  //   item: { key: "customerName", title: "客户" },
-  //   attr: {},
-  // },
+  {
+    item: { key: "customerName", title: "客户" },
+    attr: {},
+  },
   {
     item: { key: "priceType", title: "价格类型" ,width:145},
     attr: { is: "el-dict-tag", dictName: "sys_price_type" },
@@ -56,15 +64,6 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "taxPrice", title: "主含税单价",width:150 },
-    attr: {
-      is: "el-computed-input-v2",
-      formatter: (prop) => {
-        return (prop * 1);
-      },
-    },
-  },
-  {
     item: { key: "purchaseQuantity", title: "本次采购数量", fixed: true ,width:160},
     attr: {
       is: "el-input-number",

+ 4 - 0
src/views/purchase/task/xie-yi-zhi-cai/index.vue

@@ -66,10 +66,14 @@ export default {
             ...item,
             orderPriceVos: item.orderPriceVos.map((cItem) => ({
               ...item,
+              customerName:'',
+              customer:'',
               ...cItem,
               purchaseQuantity: item.orderPriceVos.length === 1 ? (item.puQty - item.executeQty) : undefined
             })),
           }));
+
+          console.log(this.data,'this.data');
           return true;
         } else {
           return false;

+ 2 - 2
src/views/purchase/task/zhuan-pai/index.vue

@@ -35,9 +35,9 @@ export default {
   methods: {
     //
     open(prop) {
-      let arr = prop.filter((element) => element.status != '0');
+      let arr = prop.filter((element) => element.status != '0' && element.status != '3');
       if(arr.length > 0){
-        this.$modal.notifyWarning("您所选的单据中存在非自由态,无法进行操作,请确认数据!");
+        this.$modal.notifyWarning("您所选的单据中存在非自由态或已驳回,无法进行操作,请确认数据!");
         return;
       }
       this.params = prop;

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

@@ -76,16 +76,28 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="客户">
-              <el-select clearable :disabled="sonDisable"
+              <DrPopoverSelectV2
+                size="mini"
+                v-model="basicForm.customerName"
+                valueKey= "name"
+                referName="CUSTOMER_PARAM"
+                :dataMapping="{
+                  customer: 'id',
+                  customerName: 'name',
+                }"
+                :source.sync="basicForm"
+              >
+              </DrPopoverSelectV2>
+
+              <!-- <el-select clearable :disabled="sonDisable"
                 size="mini"
                 v-model="basicForm.customer"
                 @clear="clean('客户')"
                 @focus="chooseRefer('CUSTOMER_PARAM', true, '客户')"
                 style="width: 200px"
               >
-                <!-- @change="controlDRHW"  -->
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id"/>
-              </el-select>
+              </el-select> -->
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -702,7 +714,7 @@
                   align="center"
                   prop="pi"
                 >
-                  <template slot-scope="scope">
+                  <!-- <template slot-scope="scope">
                     <el-form-item class="hang">
                       <el-input
                         :disabled="sonDisable"
@@ -710,7 +722,7 @@
                         v-model="scope.row.pi"
                       />
                     </el-form-item>
-                  </template>
+                  </template> -->
                 </el-table-column>
                 <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
                 <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
@@ -1611,6 +1623,7 @@ export default {
       this.sonDisable = false;
       this.basicForm.id = "";
       this.basicForm.code = "";
+      this.basicForm.status = "0";
       this.basicForm.createByName = "";
       this.basicForm.createBy = "";
       this.basicForm.createTime = "";
@@ -1622,9 +1635,13 @@ export default {
       this.basicForm.updateTime = "";
       this.basicForm.storageCode = "";
       this.basicForm.deliveryCode = "";
+      this.basicForm.billDate = new Date();
       // 复制新增把id,编码,创建人置为空,子表去掉id
       if (this.basicForm.materialInfo.length !== 0) {
         this.basicForm.materialInfo.forEach((item) => {
+          if (item.allotDate) {
+            item.allotDate = new Date();
+          }
           if (item.deliveryCode) {
             item.deliveryCode = "";
           }

+ 18 - 11
src/views/purchase/transferOrder/index.vue

@@ -97,6 +97,7 @@
           <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="status" width="100px" :formatter="formatterStatus"/>
           <el-table-column show-overflow-tooltip label="调出库存组织" align="center" prop="deliveryInventoryOrgName" width="200px"/>
           <el-table-column show-overflow-tooltip label="订单类型" align="center" prop="billType" width="220px" :formatter="formatterBillType"/>
+          <el-table-column show-overflow-tooltip label="制单人" align="center" prop="createByName" width="100px"/>
           <el-table-column show-overflow-tooltip label="单据日期" align="center" prop="billDate" width="100px"/>
           <el-table-column show-overflow-tooltip label="调拨方式" align="center" prop="allotType" width="180px">
             <template slot-scope="scope">
@@ -120,7 +121,6 @@
           <el-table-column show-overflow-tooltip label="利润中心" align="center" prop="liacenterName" width="150px"/>
           <!-- <el-table-column show-overflow-tooltip label="已同步WMS" align="center" prop="isSendWms" width="150px"/> -->
           <el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="150px"/>
-          <el-table-column show-overflow-tooltip label="制单人" align="center" prop="createByName" width="100px"/>
           <el-table-column show-overflow-tooltip label="制单日期" align="center" prop="createTime" width="150px"/>
           <!-- <el-table-column show-overflow-tooltip label="审批人" align="center" prop="code" width="150px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="审批日期" align="center" prop="code" width="150px"/> -->
@@ -146,7 +146,7 @@
           @current-change="handleCurrentChange"
           :current-page="queryParams.pageNum"
           :page-sizes="[10, 20, 50, 100, 200, 500]"
-          :page-size="10"
+          :page-size="50"
           layout="total, sizes, prev, pager, next, jumper"
           :total=total>
         </el-pagination>
@@ -154,6 +154,7 @@
         <el-tabs style="margin-top: 10px;">
           <el-tab-pane label="物料信息">
             <el-table
+            v-loading="itemLoading"
             :data="materialInfo" 
             fit
             :cell-style="{ borderColor: '#c0c0c0' }"
@@ -334,7 +335,7 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {getOrderList, delOrder, submitOrder } from '@/api/purchase/transferOrder.js'
+import {getOrderList, delOrder, submitOrder,listStAllotItem } from '@/api/purchase/transferOrder.js'
 export default {
   name: 'transferOrder',
   dicts: ['sys_allot_billtype'],
@@ -346,6 +347,7 @@ export default {
   data() {
     return {
       loading: true,
+      itemLoading: false,
       expanded: false,
       // 页面配置
       isList: true,
@@ -354,10 +356,10 @@ export default {
       queryParams: {
         deliveryInventoryOrg: '',
         storageInventoryOrg: '',
-        code: '',
+        code: this.$route.query.billCode,
         createBy:'',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       },
       //单据日期查询范围
       dateRange:[],
@@ -462,25 +464,31 @@ export default {
         code: '',
         createBy:'',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 50
       }
       this.getList(this.queryParams)
     },
     getList(params){
+      this.loading = true;
       getOrderList(this.addDateRange(params, this.dateRange)).then(res => {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
-          this.materialInfo = res.rows[0].stAllotMaterialList
         }
+        this.loading = false
       }).then(() => {
         // 合计不显示重绘
         this.$refs.multipleTable.doLayout()
-        this.loading = false
       }).catch(err => {
-        this.loading = false
       })
     },
+    getlistStAllotItem(pid){
+      this.itemLoading = true;
+      listStAllotItem(pid).then((response) => {
+        this.materialInfo = response.rows;
+        this.itemLoading = false;
+      });
+    },
     addOrder() {
       this.isList = false
       this.page = 'add'
@@ -522,8 +530,7 @@ export default {
     },
     // 选中某行
     select(row) {
-      console.log('选中', row)
-      this.materialInfo = row.stAllotMaterialList
+      this.getlistStAllotItem(row.id);
     },
     // 行内删除
     deleteids(row) {

+ 214 - 0
src/views/purchase/workSpace/index.vue

@@ -0,0 +1,214 @@
+<template>
+  <div id="workSpace">
+    <el-card style="position: relative;">
+      <el-form label-width="100px">
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+              <el-form-item label="单据标题">
+                <el-input
+                  v-model.trim="queryParams.docSubject"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+
+          <el-col :span="1.5">
+              <el-form-item label="单据类型">
+                <el-select multiple v-model="queryParams.modelIds" size="mini" style="width: 200px" clearable>
+                  <el-option v-for="dict in dict.type.oa_templete_id" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+        </el-row>
+      </el-form>
+
+      <div style="position: absolute;top: 18px;right: 10px;">
+        <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+        <el-button size="mini" plain @click="resetList">重置</el-button>
+      </div>
+
+      <div class="btn_grooup">
+        <!-- <el-button type="primary" size="mini" @click="audits">批量审批</el-button> -->
+      </div>
+
+      <el-table
+        v-loading="loading"
+        :data="tableList" 
+        fit
+        :cell-style="{ borderColor: '#c0c0c0' }"
+        :header-cell-style="{ borderColor: '#c0c0c0' }"
+        class="exporttable"
+        max-height="410"
+        border
+        highlight-current-row
+        style="font-size: 12px;"
+        @selection-change="handleSelectionChange"
+        @row-click="rowSelect"
+        @row-dblclick="doubleClick"
+        ref="tables"
+      >
+        <el-table-column type="selection" width="55" />
+        <el-table-column label="序号" type="index" align="center" width="50px"/>
+        <el-table-column show-overflow-tooltip label="标题" align="center" prop="docSubject"/>
+        <el-table-column show-overflow-tooltip label="创建人" align="center" prop="docCreate"/>
+        <el-table-column
+          fixed="right"
+          label="操作"
+          align="center"
+          width="180"
+          >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
+            <el-button type="text" size="mini" @click="audit(scope.row)">审批</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <el-pagination
+        background
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="queryParams.pageNum"
+        :page-sizes="[10, 20, 50, 100, 200, 500]"
+        :page-size="20"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total=total>
+      </el-pagination>
+
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { getWorkSpaceList, auditWork } from '@/api/purchase/workSpace.js'
+export default {
+  name: 'workSpace',
+  dicts: ['oa_templete_id'],
+  data() {
+    return {
+      queryParams: {
+        modelIds:[],
+        docSubject: '',
+        pageNum: 1,
+        pageSize: 20
+      },
+      loading: false,
+      tableList: [],
+      total: 0,
+      ids: []
+    }
+  },
+  created() {
+    this.getList(this.queryParams)
+  },
+  methods: {
+    getList(params){
+      getWorkSpaceList(params).then(res => {
+        if (res.code === 200) {
+          this.tableList = res.rows
+          this.total = res.total
+        }
+      }).then(() => {
+        this.loading = false
+      }).catch(err => {
+        this.loading = false
+      })
+    },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        modelIds:[],
+        docSubject: '',
+        pageNum: 1,
+        pageSize: 20
+      }
+      this.searchList()
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.ids = selection
+      // console.log('选中数组', this.ids.join())
+    },
+    rowSelect(row) {
+      this.$refs.tables.toggleRowSelection(row);
+    },
+    doubleClick(row) {
+      this.check(row)
+    },
+    audits() {
+      if(this.ids.length == 0) {
+        this.$modal.notifyWarning("请选中至少一条数据");
+      } else {
+        this.$modal.confirm('确认审批选中单据?').then(() => {
+        this.$modal.loading("审批中...");
+        auditWork(this.ids).then(res => {
+          if (res.code === 200) {
+            this.$modal.closeLoading();
+            this.$modal.notifySuccess("审批成功");
+            this.searchList()
+          }
+        })
+        }).catch(() => {
+          this.$modal.closeLoading();
+          this.searchList()
+        })
+      } 
+    },
+    check(row) {
+      console.log(row)
+      this.$router.push({path: row.linkUrl ,query: {billCode: row.billCode}})
+    },
+    audit(row) {
+      this.$modal.loading("审批中...");
+      auditWork([row]).then(res => {
+        if(res.code === 200) {
+          this.$modal.closeLoading();
+          this.$modal.notifySuccess("审批成功");
+          this.searchList()
+        }
+      }).catch(() => {
+        this.$modal.closeLoading();
+        this.searchList()
+      })
+    },
+    handleSizeChange(val) {
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    handleCurrentChange(val) {
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+#workSpace {
+  padding: 12px;
+  box-sizing: border-box;
+  overflow-y: scroll;
+}
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>
+<style>
+.exporttable {
+  border: solid 1px #c0c0c0;
+}
+.el-table .el-table__header-wrapper th {
+  font-size: 14px;
+}
+</style>

+ 11 - 5
src/views/system/table-template/auth-dialog.vue

@@ -1,6 +1,7 @@
 <script>
 import { role, auth } from "@/api/system/table-template";
-import { listRole } from "@/api/system/role";
+// import { listRole } from "@/api/system/role";
+import { listOptionselect } from "@/api/system/role";
 export default {
   name: "AuthDialog",
   data() {
@@ -19,10 +20,15 @@ export default {
       this.form.id = id;
       this.loading = true;
       this.dialogFormVisible = true;
-      listRole({ id })
+      listOptionselect({ id })
         .then((res) => {
-          let { rows, total } = res;
-          this.roleList = rows.map((item) => ({
+          // let { rows, total } = res;
+          // this.roleList = rows.map((item) => ({
+          //   key: item.roleId,
+          //   label: item.roleName,
+          // }));
+          let { data } = res;
+          this.roleList = data.map((item) => ({
             key: item.roleId,
             label: item.roleName,
           }));
@@ -65,7 +71,7 @@ export default {
   <el-dialog
     width="fit-content"
     destroy-on-close
-    title="权"
+    title="权"
     :visible.sync="dialogFormVisible"
   >
     <el-transfer

+ 1 - 1
vue.config.js

@@ -46,7 +46,7 @@ module.exports = {
         // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.21:8000/drp-admin`, //CKF本地
-        // target: `http://172.16.13.43:8000/drp-admin`, //lz's localhost
+        // target: `http://172.16.61.99:8000/drp-admin`, //lz's localhost
         //  target: `http://127.0.0.1:8000/drp-admin`,
         changeOrigin: true,
         pathRewrite: {