Procházet zdrojové kódy

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

002390 před 2 roky
rodič
revize
f85e5c51ac
66 změnil soubory, kde provedl 6912 přidání a 5140 odebrání
  1. 1 0
      package.json
  2. 42 14
      src/api/business/purchase/contract.js
  3. 36 0
      src/api/business/purchase/purchase-order.js
  4. 47 17
      src/components/FileUpload/index.vue
  5. 16 9
      src/components/Refers/refers.vue
  6. 73 0
      src/components/computed-input/index.vue
  7. 1 9
      src/components/popover-select/api/index.js
  8. 39 0
      src/components/popover-select/components/ADDRESS_PARAM.js
  9. 20 2
      src/components/popover-select/components/MATERIAL_PARAM.js
  10. 10 10
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  11. 10 3
      src/components/popover-select/components/TAX_RATE_PARAM.js
  12. 69 68
      src/components/popover-select/index.vue
  13. 1 10
      src/components/popover-tree-select/api/index.js
  14. 0 178
      src/components/popover-tree-select/components/index.vue
  15. 199 83
      src/components/popover-tree-select/index.vue
  16. 124 124
      src/layout/components/Navbar.vue
  17. 3 0
      src/main.js
  18. 1 11
      src/utils/init/index.js
  19. 43 1
      src/utils/request.js
  20. 68 54
      src/utils/ruoyi.js
  21. 1636 1624
      src/views/material/basicFile/details.vue
  22. 520 391
      src/views/material/changeApply/add.vue
  23. 15 14
      src/views/material/requisition/add.vue
  24. 57 57
      src/views/purchase/DemandSummary/add.vue
  25. 99 54
      src/views/purchase/DemandSummary/index.vue
  26. 19 19
      src/views/purchase/MaterialClassDivision/index.vue
  27. 188 115
      src/views/purchase/PurchaseDemandList/add.vue
  28. 37 16
      src/views/purchase/PurchaseDemandList/index.vue
  29. 0 514
      src/views/purchase/apply/add/column.js
  30. 17 7
      src/views/purchase/apply/add/index.vue
  31. 8 4
      src/views/purchase/apply/column.js
  32. 42 0
      src/views/purchase/apply/delete/index.vue
  33. 0 268
      src/views/purchase/apply/edit/index.vue
  34. 76 97
      src/views/purchase/apply/index.vue
  35. 2 2
      src/views/purchase/apply/see/index.vue
  36. 2 2
      src/views/purchase/catalogue/edit/index.vue
  37. 32 64
      src/views/purchase/catalogue/index.vue
  38. 46 14
      src/views/purchase/contract/add/index.vue
  39. 72 22
      src/views/purchase/contract/column.js
  40. 40 0
      src/views/purchase/contract/delete/index.vue
  41. 107 33
      src/views/purchase/contract/edit/index.vue
  42. 34 0
      src/views/purchase/contract/export/index.vue
  43. 117 0
      src/views/purchase/contract/import/index.vue
  44. 96 94
      src/views/purchase/contract/index.vue
  45. 4 4
      src/views/purchase/contract/see/index.vue
  46. 17 17
      src/views/purchase/deliveryAddress/index.vue
  47. 1 1
      src/views/purchase/purchase-content/index.vue
  48. 364 91
      src/views/purchase/purchase-order/add/column.js
  49. 370 186
      src/views/purchase/purchase-order/add/index.vue
  50. 295 52
      src/views/purchase/purchase-order/column.js
  51. 241 0
      src/views/purchase/purchase-order/components/FileUploadCenter/index.vue
  52. 278 115
      src/views/purchase/purchase-order/edit/index.vue
  53. 71 0
      src/views/purchase/purchase-order/edit/initColumn.js
  54. 316 94
      src/views/purchase/purchase-order/index.vue
  55. 220 71
      src/views/purchase/purchase-order/see/index.vue
  56. 42 0
      src/views/purchase/task/close/index.vue
  57. 61 65
      src/views/purchase/task/column.js
  58. 2 2
      src/views/purchase/task/documents-return/index.vue
  59. 35 0
      src/views/purchase/task/export/index.vue
  60. 6 5
      src/views/purchase/task/first-direct/index.vue
  61. 113 148
      src/views/purchase/task/index.vue
  62. 2 2
      src/views/purchase/task/modify-buyer/index.vue
  63. 2 2
      src/views/purchase/task/see/index.vue
  64. 233 130
      src/views/purchase/transferOrder/add.vue
  65. 159 143
      src/views/purchase/transferOrder/index.vue
  66. 15 8
      vue.config.js

+ 1 - 0
package.json

@@ -38,6 +38,7 @@
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
   },
   "dependencies": {
+    "@gby/deep-copy": "^4.0.0",
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.24.0",
     "clipboard": "2.0.8",

+ 42 - 14
src/api/business/purchase/contract.js

@@ -16,6 +16,22 @@ export function ADD(data) {
   });
 }
 
+export function EXPORT(data) {
+  return request({
+    url: "/pu/contract/export",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function IMPORT(params) {
+  return request({
+    url: "/pu/contract/importData",
+    method: "GET",
+    params: params,
+  });
+}
+
 export function EDIT(data) {
   return request({
     url: "/pu/contract/edit",
@@ -45,29 +61,41 @@ export function CODE() {
   });
 }
 
+const switchUrl = (prop) => {
+  if (prop === "contractItemList") return "/pu/contract/item";
+  if (prop === "contractClauseList") return "/pu/contract/clause";
+  if (prop === "contractExpenseList") return "/pu/contract/expense";
+  if (prop === "contractAgreementList") return "/pu/contract/agreement";
+  if (prop === "contractApplyOrgList") return "/pu/contract/org";
+};
+
 export function TABLELIST(params, name) {
-  let url = "";
-  if (name === "contractItemList") url = "/pu/contract/item/list";
-  if (name === "contractClauseList") url = "/pu/contract/clause/list";
-  if (name === "contractExpenseList") url = "/pu/contract/expense/list";
-  if (name === "contractAgreementList") url = "/pu/contract/agreement/list";
-  if (name === "contractApplyOrgList") url = "/pu/contract/org/list";
   return request({
-    url: url,
+    url: `${switchUrl(name)}/list`,
     method: "GET",
     params: params,
   });
 }
 
+export function TABLEADD(data, name) {
+  return request({
+    url: `${switchUrl(name)}/add`,
+    method: "POST",
+    data: data,
+  });
+}
+
+export function TABLEEDIT(data, name) {
+  return request({
+    url: `${switchUrl(name)}`,
+    method: "PUT",
+    data: data,
+  });
+}
+
 export function TABLEROMOVE(data, name) {
-  let url = "";
-  if (name === "contractItemList") url = "/pu/contract/item";
-  if (name === "contractClauseList") url = "/pu/contract/clause";
-  if (name === "contractExpenseList") url = "/pu/contract/expense";
-  if (name === "contractAgreementList") url = "/pu/contract/agreement";
-  if (name === "contractApplyOrgList") url = "/pu/contract/org";
   return request({
-    url: `${url}/${data}`,
+    url: `${switchUrl(name)}/${data}`,
     method: "DELETE",
   });
 }

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

@@ -1,4 +1,5 @@
 import request from "@/utils/request";
+import axios from "axios";
 
 // 采购订单修订列表
 const list = (data, page) => {
@@ -80,6 +81,38 @@ const documentsReturn = (data) => {
   });
 }
 
+// 采购订单退回
+const close = (data) => {
+  return request({
+    url: `/pu/order/close`,
+    method: "post",
+    data,
+  });
+}
+
+// 采购订单发送NC
+const toNc = (data) => {
+  return request({
+    url: `/pu/order/toNc`,
+    method: "post",
+    data,
+  });
+}
+// 付款协议  https://sy.derom.com/apiproxy/service/ssoRegServlet?userCode=000156&busiCenter=001
+const payRequest = (userCode) => {
+
+  return new Promise(resolve => {
+    // 当前 Promise 的状态由传入的 Promise 去决定
+    axios.get(`/sy-derom/apiproxy/service/ssoRegServlet?userCode=${userCode}&busiCenter=001`)
+    .then(res =>{
+      if(res.status == 200){
+        resolve(res.data)
+      }
+    })
+  })
+  
+}
+
 export default {
   list,
   details,
@@ -90,5 +123,8 @@ export default {
   remove,
   getPrice,
   documentsReturn,
+  close,
+  toNc,
+  payRequest,
 
 }

+ 47 - 17
src/components/FileUpload/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="upload-file">
     <el-upload
+      drag
       multiple
       :action="uploadFileUrl"
       :before-upload="handleBeforeUpload"
@@ -15,7 +16,12 @@
       ref="fileUpload"
     >
       <!-- 上传按钮 -->
-      <el-button size="mini" type="primary">选取文件</el-button>
+      <!-- <el-button size="mini" type="primary">选取文件</el-button> -->
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
@@ -41,11 +47,12 @@
         v-for="(file, index) in fileList"
       >
         <el-link
-          :href="`${baseUrl}${file.url}`"
+          :href="`${baseUrl}?id=${file.id}`"
           :underline="false"
           target="_blank"
         >
-          <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
+          <!-- <span class="el-icon-document"> {{ getFileName(file.name) }} </span> -->
+          <span class="el-icon-document"> {{ file.name }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
           <el-link :underline="false" @click="handleDelete(index)" type="danger"
@@ -89,9 +96,13 @@ export default {
   data() {
     return {
       number: 0,
+      separator: ";",
       uploadList: [],
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_BASE_API + "/pu/contract/upload", // 上传文件服务器地址
+      baseUrl: "https://sy.derom.com/document-center/fastdfs/download",
+      uploadFileUrl:
+        process.env.NODE_ENV == "development"
+          ? "/drp-file/document-center/fastdfs/upload"
+          : "/document-center/fastdfs/upload",
       headers: {
         Authorization: "Bearer " + getToken(),
       },
@@ -104,15 +115,23 @@ export default {
         if (val) {
           let temp = 1;
           // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(",");
-          console.log("list", list);
+          const list = Array.isArray(val)
+            ? val
+            : this.value.split(this.separator);
           // 然后将数组转为对象数组
+          // this.fileList = list.map((item) => {
+          //   if (typeof item === "string") {
+          //     item = { name: item, url: item };
+          //   }
+          //   item.uid = item.uid || new Date().getTime() + temp++;
+          //   return item;
+          // });
           this.fileList = list.map((item) => {
-            if (typeof item === "string") {
-              item = { name: item, url: item };
-            }
-            item.uid = item.uid || new Date().getTime() + temp++;
-            return item;
+            item = JSON.parse(item);
+            return {
+              ...item,
+              uid: item.uid || new Date().getTime() + temp++,
+            };
           });
         } else {
           this.fileList = [];
@@ -167,8 +186,12 @@ export default {
     },
     // 上传成功回调
     handleUploadSuccess(res, file) {
-      if (res.code === 200) {
-        this.uploadList.push({ name: res.fileName, url: res.fileName });
+      if (res.code * 1 === 200) {
+        this.uploadList.push({
+          id: res.id,
+          url: res.filepath,
+          name: res.filename,
+        });
         this.uploadedSuccessfully();
       } else {
         this.number--;
@@ -181,7 +204,7 @@ export default {
     // 删除文件
     handleDelete(index) {
       this.fileList.splice(index, 1);
-      this.$emit("input", this.listToString(this.fileList));
+      this.$emit("input", this.listToString(this.fileList, this.separator));
     },
     // 上传结束处理
     uploadedSuccessfully() {
@@ -189,7 +212,7 @@ export default {
         this.fileList = this.fileList.concat(this.uploadList);
         this.uploadList = [];
         this.number = 0;
-        this.$emit("input", this.listToString(this.fileList));
+        this.$emit("input", this.listToString(this.fileList, this.separator));
         this.$modal.closeLoading();
       }
     },
@@ -203,10 +226,17 @@ export default {
     },
     // 对象转成指定字符串分隔
     listToString(list, separator) {
+      list = list.map((file) =>
+        JSON.stringify({
+          id: file.id,
+          url: file.url,
+          name: file.name,
+        })
+      );
       let strs = "";
       separator = separator || ",";
       for (let i in list) {
-        strs += list[i].url + separator;
+        strs += list[i] + separator;
       }
       return strs != "" ? strs.substr(0, strs.length - 1) : "";
     },

+ 16 - 9
src/components/Refers/refers.vue

@@ -18,14 +18,11 @@
           </el-header>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
-              @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)" style="width: 100%">
-              <el-table-column type="selection" header-align="center" align="center" width="50">
-              </el-table-column>
-              <el-table-column prop="id" header-align="center" align="center" sortable="custom" min-width="90" label="id">
-              </el-table-column>
-              <el-table-column prop="name" header-align="center" align="center" sortable="custom" min-width="90"
-                label="名称">
-              </el-table-column>
+              @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)">
+              <el-table-column type="selection" header-align="center" align="center" width="50"/>
+              <el-table-column prop="id" header-align="center" align="center" min-width="90" label="id"/>
+              <el-table-column prop="name" header-align="center" align="center" min-width="90" label="名称"/>
+              <el-table-column v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
             </el-table>
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
               :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
@@ -57,6 +54,7 @@ export default {
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
       total: 0,
+      orgName: false,
       orders: [],
       loading: false,
       visible: false,
@@ -94,6 +92,11 @@ export default {
         console.log('res', res)
         this.dataList = res.rows;
         this.total = res.total
+        if(res.rows.length !== 0 && res.rows[0].orgName) {
+          this.orgName = true
+        } else {
+          this.orgName = false
+        }
         this.loading = false;
         this.$nextTick(() => {
           this.setSelectRow();
@@ -151,7 +154,7 @@ export default {
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .userDialog {
   .el-dialog__body {
     padding: 10px 0px 0px 10px;
@@ -168,4 +171,8 @@ export default {
     }
   }
 }
+::v-deep .el-table__header-wrapper .el-checkbox {
+  // display: none;//设置不成功,页面卡顿
+  visibility: hidden;
+}
 </style>

+ 73 - 0
src/components/computed-input/index.vue

@@ -0,0 +1,73 @@
+<template>
+  <!-- <el-input
+    v-model="value"
+    readonly
+    :size="size"
+    :placeholder="placeholder"
+    style="width: 100%"
+  ></el-input> -->
+  <span>{{ value || "- -" }}</span>
+</template>
+
+<script>
+export default {
+  name: "ComputedInput",
+  props: {
+    // v-model
+    value: {
+      type: [Number, String],
+      require: true,
+    },
+    // v-model
+    computed: {
+      type: Function,
+      default: () => {
+        return () => {};
+      },
+      require: true,
+    },
+    // 源数据
+    source: {
+      type: Object,
+      require: true,
+    },
+    // 组件大小
+    size: {
+      type: String,
+      dafault: () => {
+        return "mini";
+      },
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      dafault: () => {
+        return "";
+      },
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    newSource() {
+      return this.$props.source;
+    },
+  },
+  watch: {
+    newSource: {
+      handler: function (newProp) {
+        const { computed } = this.$props;
+        this.$emit("input", computed(newProp));
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  methods: {},
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 1 - 9
src/components/popover-select/api/index.js

@@ -1,14 +1,6 @@
 import request from "@/utils/request";
 
-export function list(url, params) {
-  return request({
-    url: `/pu/contract/${url}/list`,
-    method: "get",
-    params: params,
-  });
-}
-
-export function refer(data, params) {
+export function REFER(data, params) {
   return request({
     url: "/refer/query",
     method: "POST",

+ 39 - 0
src/components/popover-select/components/ADDRESS_PARAM.js

@@ -0,0 +1,39 @@
+// 收货地址
+export default [
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
+  {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "仓库",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "address",
+    title: "地址",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "contactsName",
+    title: "联系人",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "contactsPhone",
+    title: "电话",
+    type: "Input",
+    search: true,
+  },
+];

+ 20 - 2
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -1,13 +1,31 @@
 export default [
   {
     key: "code",
-    title: "物料编码",
+    title: "编码",
     type: "Input",
     search: true,
   },
   {
     key: "name",
-    title: "物料名称",
+    title: "名称",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "specification",
+    title: "规格",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "manufacturerIdName",
+    title: "生产厂家",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "unitIdName",
+    title: "单位",
     type: "Input",
     search: true,
   },

+ 10 - 10
src/components/popover-select/components/PSNLICENSE_PARAM.js

@@ -1,20 +1,20 @@
-// 处理方式
+// 人员证照参照
 export default [
-  // {
-  //   key: "id",
-  //   title: "ID",
-  //   type: "Input",
-  //   search: true,
-  // },
   {
-    key: "code",
-    title: "编码",
+    key: "id",
+    title: "ID",
     type: "Input",
     search: true,
   },
+  // {
+  //   key: "code",
+  //   title: "编码",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "name",
-    title: "处理方式",
+    title: "名称",
     type: "Input",
     search: true,
   },

+ 10 - 3
src/components/popover-select/components/TAX_RATE_PARAM.js

@@ -1,6 +1,4 @@
-// 货位
 export default [
-  // 树
   {
     key: "id",
     title: "ID",
@@ -15,8 +13,17 @@ export default [
   },
   {
     key: "name",
-    title: "货位",
+    title: "名称",
     type: "Input",
     search: true,
   },
+  {
+    key: "ntaxrate",
+    title: "税率",
+    type: "ComputedInput",
+    computed: (prop) => {
+      const { ntaxrate } = prop;
+      return ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
+    },
+  },
 ];

+ 69 - 68
src/components/popover-select/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { refer } from "./api/index";
+import { REFER } from "./api/index";
 export default {
   name: "PopoverSelect",
   props: {
@@ -29,8 +29,8 @@ export default {
     },
     // 默认查询参数
     queryParams: {
-      type: Object,
-      default: () => ({}),
+      type: Function,
+      default: () => {},
     },
     // 组件大小
     size: {
@@ -83,9 +83,7 @@ export default {
   data() {
     return {
       width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      layout: "total, prev, pager, next, sizes, jumper",
-      pageSizes: [25, 50, 100],
+      page: { pageNum: 1, pageSize: 10, total: 0 },
       visible: false,
       loading: false,
       model: {
@@ -119,27 +117,27 @@ export default {
     // open dialog
     async open() {
       this.visible = true;
-      await this.resetList();
+      await this.useReset();
+      console.log("open", this.selectData);
     },
     // hide dialog
     async hide() {
       this.visible = false;
+      // this.$emit("input", []);
+      console.log("hide", this.selectData);
     },
     // fetch list
     async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await refer(prop, {
+        const { code, rows, total } = await REFER(prop, {
           pageNum,
           pageSize,
         });
         if (code === 200) {
           this.data = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -148,59 +146,33 @@ export default {
       }
     },
     // reset list
-    async resetList() {
-      const { type, queryParams } = this.$props;
+    async useReset() {
+      const { type, source, queryParams } = this.$props;
       this.model = {
-        ...queryParams,
-        ...this.model,
-        search: "",
         type,
+        search: "",
+        ...this.model,
+        ...queryParams(source),
       };
       await this.fetchList(this.model, this.page);
     },
     // query list
-    async queryList() {
+    async useQuery() {
       await this.fetchList(this.model, this.page);
     },
-    // row click
-    rowClick(prop) {
-      const { multiple } = this.$props;
-      // 单选
-      if (!multiple) this.$refs.multipleTable.clearSelection();
-      [prop].forEach((row) => this.$refs.multipleTable.toggleRowSelection(row));
-    },
-    // row double click
-    async rowDblclick(prop) {
-      const { multiple } = this.$props;
-      if (!multiple) await this.confirm([prop]);
-    },
-    // selection change
-    selectionChange(prop) {
-      this.selectData = prop;
-    },
-    // page size change
-    async pageSizeChange(prop) {
-      this.page.pageSize = prop;
-      await this.queryList();
-    },
-    // page number change
-    async pageNumberChange(prop) {
-      this.page.pageNum = prop;
-      await this.queryList();
-    },
     // confirm
-    async confirm(prop) {
+    async useConfirm(prop) {
       const { multiple } = this.$props;
       await this.hide();
-      await this.update(multiple ? prop : prop[0]);
+      await this.useUpdate(multiple ? prop : prop[0]);
     },
     // delete tag
-    deleteTag(prop) {
+    useDelete(prop) {
       this.selectData.splice(prop, 1);
-      this.update(this.selectData);
+      this.useUpdate(this.selectData);
     },
     // update
-    update(prop) {
+    useUpdate(prop) {
       const { source, multiple, valueKey, dataMapping, type } = this.$props;
       // update v-model
       const vModel = multiple
@@ -213,7 +185,24 @@ export default {
       }
       this.$emit("update:source", source);
       // emit change
-      this.$emit("change", prop, source, type);
+      this.$emit("change", prop, type, source);
+    },
+    // row click
+    rowClick(prop) {
+      const { multiple } = this.$props;
+      // 单选
+      if (!multiple) this.$refs.multipleTable.clearSelection();
+      [prop].forEach((row) => this.$refs.multipleTable.toggleRowSelection(row));
+    },
+    // row double click
+    // async rowDblclick(prop) {
+    //   const { multiple } = this.$props;
+    //   if (!multiple) await this.useConfirm([prop]);
+    // },
+    // selection change
+    selectionChange(prop) {
+      this.selectData = prop;
+      console.log("selectionChange", prop);
     },
   },
   created() {},
@@ -222,7 +211,7 @@ export default {
 };
 </script>
 <template>
-  <div>
+  <div class="popover-select">
     <el-input
       v-model="innerValue"
       :size="size"
@@ -257,13 +246,13 @@ export default {
         <el-form-item prop="search">
           <el-input
             v-model="model.search"
-            @change="queryList"
-            @keydown.enter="queryList"
+            @change="useQuery"
+            @keydown.enter="useQuery"
           >
           </el-input>
         </el-form-item>
         <el-form-item>
-          <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+          <el-button icon="el-icon-refresh" @click="useReset"></el-button>
         </el-form-item>
         <el-table
           ref="multipleTable"
@@ -273,10 +262,15 @@ export default {
           highlight-current-row
           style="width: 100%; margin-bottom: 20px"
           @row-click="rowClick"
-          @row-dblclick="rowDblclick"
+          @row-dblclick="useConfirm([$event])"
           @selection-change="selectionChange"
         >
-          <el-table-column width="55" type="selection" align="center">
+          <el-table-column
+            v-if="multiple"
+            width="55"
+            type="selection"
+            align="center"
+          >
           </el-table-column>
           <el-table-column
             v-for="(column, index) in TableColumnTemp"
@@ -286,24 +280,31 @@ export default {
             :width="column.width"
             show-overflow-tooltip
           >
+            <template slot-scope="scope">
+              <dr-computed-input
+                v-if="column.type === 'ComputedInput'"
+                v-model="scope.row[column.key]"
+                :source="scope.row"
+                :computed="column.computed"
+                :placeholder="column.placeholder"
+                style="width: 100%"
+              ></dr-computed-input>
+              <span v-else> {{ scope.row[column.key] }}</span>
+            </template>
           </el-table-column>
         </el-table>
-        <el-pagination
-          :layout="layout"
+        <pagination
           :total="page.total"
-          :page-sizes="pageSizes"
-          :small="size === 'mini'"
-          :page-size="page.pageSize"
-          :current-page="page.pageNum"
-          background
-          @size-change="pageSizeChange"
-          @current-change="pageNumberChange"
-        >
-        </el-pagination>
+          :page.sync="page.pageNum"
+          :limit.sync="page.pageSize"
+          @pagination="useQuery"
+        />
       </el-form>
       <div style="margin-top: 20px; text-align: right">
         <el-button :size="size" @click="hide"> 取 消 </el-button>
-        <el-button :size="size" @click="confirm(selectData)"> 确 定 </el-button>
+        <el-button :size="size" @click="useConfirm(selectData)">
+          确 定
+        </el-button>
       </div>
     </el-dialog>
     <div
@@ -340,7 +341,7 @@ export default {
               alignItems: 'center',
               margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
             }"
-            @close="deleteTag(index)"
+            @close="useDelete(index)"
           >
             {{ tag.name }}
           </el-tag>

+ 1 - 10
src/components/popover-tree-select/api/index.js

@@ -1,18 +1,9 @@
 import request from "@/utils/request";
 
-export function list(url, params) {
-  return request({
-    url: `/pu/contract/${url}/list`,
-    method: "get",
-    params: params,
-  });
-}
-
-export function refer(data, params) {
+export function REFER(data) {
   return request({
     url: "/refer/query",
     method: "POST",
     data: data,
-    params: params,
   });
 }

+ 0 - 178
src/components/popover-tree-select/components/index.vue

@@ -1,178 +0,0 @@
-<script>
-import { refer } from "../api/index";
-
-export default {
-  name: "TableDialog",
-  props: ["type", "title", "multiple", "queryParams"],
-  components: {},
-  data() {
-    const { type } = this.$props;
-    const TableColumns = require(`./${type}`).default.filter(
-      (element) => element.key
-    );
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      params: { search: "", isPage: true },
-      // table
-      data: [],
-      tableColumns: TableColumns,
-      radio: "",
-      multipleSelection: [],
-      defaultProps: {
-        label: "name",
-        children: "children",
-      },
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      this.radio = "";
-      this.multipleSelection = [];
-      this.fetchList(this.params);
-    },
-    // fetch table data
-    async fetchList(prop) {
-      try {
-        this.loading = true;
-        const { type, queryParams } = this.$props;
-        const { code, msg, rows } = await refer({
-          type: type,
-          ...prop,
-          ...queryParams,
-        });
-        if (code === 200) {
-          this.data = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // setting up to fetch table data
-    queryList() {
-      this.fetchList(this.params);
-    },
-    // reset to fetch table data
-    resetList() {
-      this.params.search = "";
-      this.fetchList(this.params);
-    },
-    // click select row data
-    handleSelect(data) {
-      this.multipleSelection = [data];
-    },
-    // double click select row data and confirm
-    handleDoubleClickSelect(row) {
-      this.confirm([row]);
-    },
-    // multiple select row data
-    handleMultipleSelect(prop, data) {
-      if (prop) {
-        this.multipleSelection.push(data);
-      } else {
-        const { code } = data;
-        const index = this.multipleSelection.findIndex(
-          (item) => item.code === code
-        );
-        this.multipleSelection.splice(index, 1);
-      }
-    },
-    // confirm
-    confirm(prop) {
-      this.setVisible(false);
-      this.$emit("confirm", prop);
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-dialog
-    :title="`${title}(${multiple ? '多选' : '单选'})`"
-    :width="width"
-    :visible.sync="visible"
-    :close-on-click-modal="false"
-    append-to-body
-    destroy-on-close
-    @open="beforeOpen"
-  >
-    <el-form :size="size" :inline="true" :model="params" @submit.native.prevent>
-      <el-form-item prop="search">
-        <el-input
-          v-model="params.search"
-          @keydown.enter="queryList"
-          @change="queryList"
-        >
-        </el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button icon="el-icon-refresh" @click="resetList"></el-button>
-      </el-form-item>
-    </el-form>
-    <el-tree
-      v-if="multiple"
-      v-loading="loading"
-      :data="data"
-      :props="defaultProps"
-      accordion
-      node-key="id"
-    >
-      <div slot-scope="{ node, data }">
-        <el-checkbox
-          v-model="data.checked"
-          @click.native.stop
-          @change="handleMultipleSelect($event, data)"
-          style="margin: 0 5px 0 0"
-        >
-        </el-checkbox>
-        <span> {{ data.name }}</span>
-      </div>
-    </el-tree>
-    <el-radio-group v-else v-model="radio" style="width: 100%">
-      <el-tree
-        v-loading="loading"
-        :data="data"
-        :props="defaultProps"
-        accordion
-        node-key="id"
-      >
-        <div slot-scope="{ node, data }">
-          <el-radio
-            :label="data.code"
-            @click.native.stop="handleSelect(data)"
-            @dblclick.native.stop="handleDoubleClickSelect(data)"
-            style="margin: 0 5px 0 0"
-          >
-            {{ data.name }}
-          </el-radio>
-        </div>
-      </el-tree>
-    </el-radio-group>
-    <div style="margin-top: 20px; text-align: right">
-      <el-button :size="size" @click="visible = false">取 消</el-button>
-      <el-button :size="size" type="primary" @click="confirm(multipleSelection)"
-        >确 定</el-button
-      >
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 199 - 83
src/components/popover-tree-select/index.vue

@@ -1,4 +1,5 @@
 <script>
+import { REFER } from "./api/index";
 export default {
   name: "PopoverTreeSelect",
   props: {
@@ -20,16 +21,12 @@ export default {
     // 作为 value 唯一标识的键名,绑定值
     valueKey: {
       type: String,
-      default: "name",
-    },
-    // 作为 value 唯一标识的键名,显示值
-    showKey: {
-      type: String,
+      default: "code",
     },
     // 默认查询参数
     queryParams: {
-      type: Object,
-      default: () => ({}),
+      type: Function,
+      default: () => {},
     },
     // 组件大小
     size: {
@@ -66,99 +63,226 @@ export default {
     // 参照内外映射
     dataMapping: Object,
   },
-  components: {
-    TableDialog: () => import("./components/index.vue"),
-  },
+  components: {},
   data() {
     return {
-      // popover宽度
-      width: "",
-      // 选中data
+      width: "50%",
+      visible: false,
+      loading: false,
+      params: {
+        search: "",
+        isPage: true,
+      },
       data: [],
+      selectData: [],
+      defaultProps: {
+        label: "name",
+        children: "children",
+      },
     };
   },
   computed: {
-    showValue() {
-      const { showKey, valueKey } = this.$props;
-      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
+    innerValue() {
+      const { value, multiple } = this.$props;
+      return multiple ? "" : value;
+    },
+    TableColumnTemp() {
+      const { type } = this.$props;
+      const documents = require(`./components/${type}`).default;
+      return documents.filter((document) => document.key);
     },
   },
   watch: {
     "$props.value": {
-      handler: function (newProp, oldProp) {
-        if (!newProp) {
-          this.data = [];
-        }
+      handler: function (newProp) {
+        if (!newProp) this.selectData = [];
       },
       immediate: true,
     },
   },
   methods: {
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.TableDialog;
-        setVisible(true);
-      });
-    },
-    // 新增操作
-    handleAdd(prop) {
-      this.data = prop;
-      this.handleUpdate(this.data);
-    },
-    // 删除操作
-    handleDelete(prop) {
-      this.data.splice(prop, 1);
-      this.handleUpdate(this.data);
-    },
-    // 更新操作
-    handleUpdate(prop) {
-      const { source, multiple, valueKey, dataMapping } = this.$props;
-      // 多选
-      if (multiple) {
-        const updateData = prop.map((item) => item[valueKey]);
-        this.$emit("input", updateData);
-      }
-      // 单选
-      if (!multiple) {
-        const updateData = prop[0][valueKey];
-        this.$emit("input", updateData);
-        // 更新映射数据
-        for (let key in dataMapping) {
-          source[key] = prop[0][dataMapping[key]];
+    // open dialog
+    async open() {
+      this.visible = true;
+      await this.useReset();
+    },
+    // hide dialog
+    async hide() {
+      this.visible = false;
+    },
+    // fetch list
+    async fetchList(prop) {
+      try {
+        this.loading = true;
+        const { code, rows, total } = await REFER(prop);
+        if (code === 200) {
+          this.data = rows;
         }
-        this.$emit("update:source", source);
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    // reset list
+    async useReset() {
+      const { type, source, queryParams } = this.$props;
+      this.model = {
+        type,
+        search: "",
+        ...this.model,
+        ...queryParams(source),
+      };
+      await this.fetchList(this.model);
+    },
+    // query list
+    async useQuery() {
+      await this.fetchList(this.model);
+    },
+    // confirm
+    async useConfirm(prop) {
+      const { multiple } = this.$props;
+      await this.hide();
+      await this.useUpdate(multiple ? prop : prop[0]);
+    },
+    // delete tag
+    useDelete(prop) {
+      this.selectData.splice(prop, 1);
+      this.useUpdate(this.selectData);
+    },
+    // update
+    useUpdate(prop) {
+      const { source, multiple, valueKey, dataMapping, type } = this.$props;
+      // update v-model
+      const vModel = multiple
+        ? prop.map((item) => item[valueKey])
+        : prop[valueKey];
+      this.$emit("input", vModel);
+      // update data mapping
+      for (let key in dataMapping) {
+        source[key] = prop[dataMapping[key]];
+      }
+      this.$emit("update:source", source);
+      // emit change
+      this.$emit("change", prop, type, source);
+    },
+    // click select row data
+    handleSelect(data) {
+      this.selectData = [data];
+    },
+    // double click select row data and confirm
+    handleDoubleClickSelect(row) {
+      this.useConfirm([row]);
+    },
+    // multiple select row data
+    handleMultipleSelect(prop, data) {
+      if (prop) {
+        this.selectData.push(data);
+      } else {
+        const { code } = data;
+        const index = this.selectData.findIndex((item) => item.code === code);
+        this.selectData.splice(index, 1);
       }
-      //
-      this.$emit("change", prop, source);
     },
   },
-  created() {
-    this.$nextTick(() => {
-      const { clientWidth } = this.$refs.PopoverTreeSelect;
-      this.width = clientWidth;
-    });
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <div ref="PopoverTreeSelect" style="position: relative">
+  <div class="popover-tree-select">
     <el-input
-      v-model="showValue"
+      v-model="innerValue"
       :size="size"
       :disabled="disabled"
+      :readonly="readonly"
       :clearable="clearable"
       :placeholder="placeholder"
-      readonly
-      style="width: 100%; cursor: pointer"
-      @click.native.stop="handleAsyncOpenDialog"
     >
-      <template #suffix>
-        <el-icon class="el-icon-more"></el-icon>
-      </template>
+      <el-button
+        :disabled="disabled"
+        slot="append"
+        icon="el-icon-search"
+        @click="open"
+      ></el-button>
     </el-input>
+
+    <el-dialog
+      :title="`${title}(${multiple ? '多选' : '单选'})`"
+      :width="width"
+      :visible.sync="visible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      @close="hide"
+    >
+      <el-form
+        v-loading="loading"
+        :size="size"
+        :inline="true"
+        :model="params"
+        @submit.native.prevent
+      >
+        <el-form-item prop="search">
+          <el-input
+            v-model="params.search"
+            @keydown.enter="useQuery"
+            @change="useQuery"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button icon="el-icon-refresh" @click="useReset"></el-button>
+        </el-form-item>
+      </el-form>
+      <el-tree
+        v-if="multiple"
+        :data="data"
+        :props="defaultProps"
+        accordion
+        node-key="id"
+      >
+        <div slot-scope="{ node, data }">
+          <el-checkbox
+            v-model="data.checked"
+            @click.native.stop
+            @change="handleMultipleSelect($event, data)"
+            style="margin: 0 5px 0 0"
+          >
+          </el-checkbox>
+          <span> {{ data.name }}</span>
+        </div>
+      </el-tree>
+      <el-radio-group v-else v-model="radio" style="width: 100%">
+        <el-tree
+          v-loading="loading"
+          :data="data"
+          :props="defaultProps"
+          accordion
+          node-key="id"
+        >
+          <div slot-scope="{ node, data }">
+            <el-radio
+              :label="data.code"
+              @click.native.stop="handleSelect(data)"
+              @dblclick.native.stop="handleDoubleClickSelect(data)"
+              style="margin: 0 5px 0 0"
+            >
+              {{ data.name }}
+            </el-radio>
+          </div>
+        </el-tree>
+      </el-radio-group>
+      <div style="margin-top: 20px; text-align: right">
+        <el-button :size="size" @click="visible = false">取 消</el-button>
+        <el-button :size="size" type="primary" @click="useConfirm(selectData)"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
     <div
       style="
         position: absolute;
@@ -169,7 +293,7 @@ export default {
         overflow: hidden;
       "
     >
-      <div v-if="multiple && data.length">
+      <div v-if="multiple && selectData.length">
         <el-popover
           :offset="-10"
           :width="width"
@@ -180,10 +304,10 @@ export default {
           placement="bottom-start"
         >
           <el-tag slot="reference" :size="size" style="margin-right: 10px">
-            + {{ data.length }}
+            + {{ selectData.length }}
           </el-tag>
           <el-tag
-            v-for="(item, index) in data"
+            v-for="(tag, index) in selectData"
             :size="size"
             hit
             closable
@@ -191,23 +315,15 @@ export default {
               display: 'flex',
               justifyContent: 'space-between',
               alignItems: 'center',
-              margin: data.length - 1 === index ? '0' : '0 0 5px 0',
+              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
             }"
-            @close="handleDelete(index)"
+            @close="useDelete(index)"
           >
-            {{ item.name }}
+            {{ tag.name }}
           </el-tag>
         </el-popover>
       </div>
     </div>
-    <table-dialog
-      ref="TableDialog"
-      :type="type"
-      :title="title"
-      :multiple="multiple"
-      :query-params="queryParams"
-      @confirm="handleAdd"
-    ></table-dialog>
   </div>
 </template>
 <style scoped></style>

+ 124 - 124
src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
     <div class="right-menu">
       <template v-if="device!=='mobile'">
         <!-- <search id="header-search" class="right-menu-item" /> -->
-        
+
         <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip> -->
@@ -47,154 +47,154 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import Breadcrumb from '@/components/Breadcrumb'
-import TopNav from '@/components/TopNav'
-import Hamburger from '@/components/Hamburger'
-import Screenfull from '@/components/Screenfull'
-import SizeSelect from '@/components/SizeSelect'
-import Search from '@/components/HeaderSearch'
-import RuoYiGit from '@/components/RuoYi/Git'
-import RuoYiDoc from '@/components/RuoYi/Doc'
-
-export default {
-  components: {
-    Breadcrumb,
-    TopNav,
-    Hamburger,
-    Screenfull,
-    SizeSelect,
-    Search,
-    RuoYiGit,
-    RuoYiDoc
-  },
-  computed: {
-    ...mapGetters([
-      'sidebar',
-      'avatar',
-      'device'
-    ]),
-    setting: {
-      get() {
-        return this.$store.state.settings.showSettings
+  import { mapGetters } from 'vuex'
+  import Breadcrumb from '@/components/Breadcrumb'
+  import TopNav from '@/components/TopNav'
+  import Hamburger from '@/components/Hamburger'
+  import Screenfull from '@/components/Screenfull'
+  import SizeSelect from '@/components/SizeSelect'
+  import Search from '@/components/HeaderSearch'
+  import RuoYiGit from '@/components/RuoYi/Git'
+  import RuoYiDoc from '@/components/RuoYi/Doc'
+
+  export default {
+    components: {
+      Breadcrumb,
+      TopNav,
+      Hamburger,
+      Screenfull,
+      SizeSelect,
+      Search,
+      RuoYiGit,
+      RuoYiDoc
+    },
+    computed: {
+      ...mapGetters([
+        'sidebar',
+        'avatar',
+        'device'
+      ]),
+      setting: {
+        get() {
+          return this.$store.state.settings.showSettings
+        },
+        set(val) {
+          this.$store.dispatch('settings/changeSetting', {
+            key: 'showSettings',
+            value: val
+          })
+        }
       },
-      set(val) {
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'showSettings',
-          value: val
-        })
+      topNav: {
+        get() {
+          return this.$store.state.settings.topNav
+        }
       }
     },
-    topNav: {
-      get() {
-        return this.$store.state.settings.topNav
+    methods: {
+      toggleSideBar() {
+        this.$store.dispatch('app/toggleSideBar')
+      },
+      async logout() {
+        this.$confirm('确定注销并退出系统吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.$store.dispatch('LogOut').then(() => {
+            location.href = process.env.VUE_APP_CONTEXT_PATH + '/index';
+          })
+        }).catch(() => {});
       }
     }
-  },
-  methods: {
-    toggleSideBar() {
-      this.$store.dispatch('app/toggleSideBar')
-    },
-    async logout() {
-      this.$confirm('确定注销并退出系统吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.$store.dispatch('LogOut').then(() => {
-          location.href = process.env.VUE_APP_CONTEXT_PATH + '/index';
-        })
-      }).catch(() => {});
-    }
   }
-}
 </script>
 
 <style lang="scss" scoped>
-.navbar {
-  height: 50px;
-  overflow: hidden;
-  position: relative;
-  background: #fff;
-  box-shadow: 0 1px 4px rgba(0,21,41,.08);
-
-  .hamburger-container {
-    line-height: 46px;
-    height: 100%;
-    float: left;
-    cursor: pointer;
-    transition: background .3s;
-    -webkit-tap-highlight-color:transparent;
-
-    &:hover {
-      background: rgba(0, 0, 0, .025)
-    }
-  }
-
-  .breadcrumb-container {
-    float: left;
-  }
-
-  .topmenu-container {
-    position: absolute;
-    left: 50px;
-  }
+  .navbar {
+    height: 50px;
+    overflow: hidden;
+    position: relative;
+    background: #fff;
+    box-shadow: 0 1px 4px rgba(0,21,41,.08);
+
+    .hamburger-container {
+      line-height: 46px;
+      height: 100%;
+      float: left;
+      cursor: pointer;
+      transition: background .3s;
+      -webkit-tap-highlight-color:transparent;
 
-  .errLog-container {
-    display: inline-block;
-    vertical-align: top;
-  }
+      &:hover {
+        background: rgba(0, 0, 0, .025)
+      }
+    }
 
-  .right-menu {
-    float: right;
-    height: 100%;
-    line-height: 50px;
+    .breadcrumb-container {
+      float: left;
+    }
 
-    &:focus {
-      outline: none;
+    .topmenu-container {
+      position: absolute;
+      left: 50px;
     }
 
-    .right-menu-item {
+    .errLog-container {
       display: inline-block;
-      padding: 0 8px;
-      height: 100%;
-      font-size: 18px;
-      color: #5a5e66;
-      vertical-align: text-bottom;
+      vertical-align: top;
+    }
 
-      &.hover-effect {
-        cursor: pointer;
-        transition: background .3s;
+    .right-menu {
+      float: right;
+      height: 100%;
+      line-height: 50px;
 
-        &:hover {
-          background: rgba(0, 0, 0, .025)
-        }
+      &:focus {
+        outline: none;
       }
-    }
-
-    .avatar-container {
-      margin-right: 30px;
 
-      .avatar-wrapper {
-        margin-top: 5px;
-        position: relative;
+      .right-menu-item {
+        display: inline-block;
+        padding: 0 8px;
+        height: 100%;
+        font-size: 18px;
+        color: #5a5e66;
+        vertical-align: text-bottom;
 
-        .user-avatar {
+        &.hover-effect {
           cursor: pointer;
-          width: 40px;
-          height: 40px;
-          border-radius: 10px;
+          transition: background .3s;
+
+          &:hover {
+            background: rgba(0, 0, 0, .025)
+          }
         }
+      }
 
-        .el-icon-caret-bottom {
-          cursor: pointer;
-          position: absolute;
-          right: -20px;
-          top: 25px;
-          font-size: 12px;
+      .avatar-container {
+        margin-right: 30px;
+
+        .avatar-wrapper {
+          margin-top: 5px;
+          position: relative;
+
+          .user-avatar {
+            cursor: pointer;
+            width: 40px;
+            height: 40px;
+            border-radius: 10px;
+          }
+
+          .el-icon-caret-bottom {
+            cursor: pointer;
+            position: absolute;
+            right: -20px;
+            top: 25px;
+            font-size: 12px;
+          }
         }
       }
     }
   }
-}
 </style>

+ 3 - 0
src/main.js

@@ -51,6 +51,8 @@ import DictData from "@/components/DictData";
 import PopoverSelect from "@/components/popover-select/index.vue";
 //
 import PopoverTreeSelect from "@/components/popover-tree-select/index.vue";
+//
+import ComputedInput from "@/components/computed-input/index.vue";
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts;
@@ -73,6 +75,7 @@ Vue.component("ImageUpload", ImageUpload);
 Vue.component("ImagePreview", ImagePreview);
 Vue.component("DrPopoverSelect", PopoverSelect);
 Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
+Vue.component("DrComputedInput", ComputedInput);
 
 Vue.use(directive);
 Vue.use(plugins);

+ 1 - 11
src/utils/init/index.js

@@ -33,14 +33,4 @@ export const initRules = (prop) => {
   return rules;
 };
 
-const pageSizes = [25, 50, 100];
-
-const layout = "total, prev, pager, next, sizes, jumper";
-
-const page = { pageNum: 1, pageSize: 25, total: 0 };
-
-export const initPageSizes = () => pageSizes;
-
-export const initLayout = () => layout;
-
-export const initPage = () => ({ pageNum: 1, pageSize: 25, total: 0 });
+export const initPage = () => ({ pageNum: 1, pageSize: 10, total: 0 });

+ 43 - 1
src/utils/request.js

@@ -27,6 +27,8 @@ service.interceptors.request.use(
     const isToken = (config.headers || {}).isToken === false;
     // 是否需要防止数据重复提交
     const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
+    // 是否存在列表查询
+    const isQueryList = config.url.includes("/list");
     if (getToken() && !isToken) {
       config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }
@@ -38,7 +40,7 @@ service.interceptors.request.use(
       config.url = url;
     }
     if (
-      !isRepeatSubmit &&
+      !isRepeatSubmit && !isQueryList &&
       (config.method === "post" || config.method === "put")
     ) {
       const requestObj = {
@@ -128,6 +130,7 @@ service.interceptors.response.use(
       // Message({ message: msg, type: "warning" });
       return Promise.reject("error");
     } else if (code !== 200) {
+      console.log("code", code);
       Notification.error({ title: msg });
       return Promise.reject("error");
     } else {
@@ -188,4 +191,43 @@ export function download(url, params, filename, config) {
     });
 }
 
+// // 通用上传方法
+// export function upload(url, params, filename, config) {
+//   downloadLoadingInstance = Loading.service({
+//     text: "正在上传数据,请稍候",
+//     spinner: "el-icon-loading",
+//     background: "rgba(255, 255, 255, 0.7)",
+//   });
+//   return service
+//     .post(url, params, {
+//       transformRequest: [
+//         (params) => {
+//           return tansParams(params);
+//         },
+//       ],
+//       headers: { "Content-Type": "application/x-www-form-urlencoded" },
+//       responseType: "blob",
+//       ...config,
+//     })
+//     .then(async (data) => {
+//       const isBlob = blobValidate(data);
+//       if (isBlob) {
+//         const blob = new Blob([data]);
+//         saveAs(blob, filename);
+//       } else {
+//         const resText = await data.text();
+//         const rspObj = JSON.parse(resText);
+//         const errMsg =
+//           errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
+//         Message.error(errMsg);
+//       }
+//       downloadLoadingInstance.close();
+//     })
+//     .catch((r) => {
+//       console.error(r);
+//       Message.error("下载文件出现错误,请联系管理员!");
+//       downloadLoadingInstance.close();
+//     });
+// }
+
 export default service;

+ 68 - 54
src/utils/ruoyi.js

@@ -1,5 +1,3 @@
-
-
 /**
  * 通用js方法封装处理
  * Copyright (c) 2019 ruoyi
@@ -8,22 +6,25 @@
 // 日期格式化
 export function parseTime(time, pattern) {
   if (arguments.length === 0 || !time) {
-    return null
+    return null;
   }
-  const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
-  let date
-  if (typeof time === 'object') {
-    date = time
+  const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}";
+  let date;
+  if (typeof time === "object") {
+    date = time;
   } else {
-    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
-      time = parseInt(time)
-    } else if (typeof time === 'string') {
-      time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
+    if (typeof time === "string" && /^[0-9]+$/.test(time)) {
+      time = parseInt(time);
+    } else if (typeof time === "string") {
+      time = time
+        .replace(new RegExp(/-/gm), "/")
+        .replace("T", " ")
+        .replace(new RegExp(/\.[\d]{3}/gm), "");
     }
-    if ((typeof time === 'number') && (time.toString().length === 10)) {
-      time = time * 1000
+    if (typeof time === "number" && time.toString().length === 10) {
+      time = time * 1000;
     }
-    date = new Date(time)
+    date = new Date(time);
   }
   const formatObj = {
     y: date.getFullYear(),
@@ -32,18 +33,20 @@ export function parseTime(time, pattern) {
     h: date.getHours(),
     i: date.getMinutes(),
     s: date.getSeconds(),
-    a: date.getDay()
-  }
+    a: date.getDay(),
+  };
   const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
-    let value = formatObj[key]
+    let value = formatObj[key];
     // Note: getDay() returns 0 on Sunday
-    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+    if (key === "a") {
+      return ["日", "一", "二", "三", "四", "五", "六"][value];
+    }
     if (result.length > 0 && value < 10) {
-      value = '0' + value
+      value = "0" + value;
     }
-    return value || 0
-  })
-  return time_str
+    return value || 0;
+  });
+  return time_str;
 }
 
 // 表单重置
@@ -56,14 +59,19 @@ export function resetForm(refName) {
 // 添加日期范围
 export function addDateRange(params, dateRange, propName) {
   let search = params;
-  search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
+  search.params =
+    typeof search.params === "object" &&
+    search.params !== null &&
+    !Array.isArray(search.params)
+      ? search.params
+      : {};
   dateRange = Array.isArray(dateRange) ? dateRange : [];
-  if (typeof (propName) === 'undefined') {
-    search.params['beginTime'] = dateRange[0];
-    search.params['endTime'] = dateRange[1];
+  if (typeof propName === "undefined") {
+    search.params["beginTime"] = dateRange[0];
+    search.params["endTime"] = dateRange[1];
   } else {
-    search.params['begin' + propName] = dateRange[0];
-    search.params['end' + propName] = dateRange[1];
+    search.params["begin" + propName] = dateRange[0];
+    search.params["end" + propName] = dateRange[1];
   }
   return search;
 }
@@ -75,20 +83,20 @@ export function selectDictLabel(datas, value) {
   }
   var actions = [];
   Object.keys(datas).some((key) => {
-    if (datas[key].value == ('' + value)) {
+    if (datas[key].value == "" + value) {
       actions.push(datas[key].label);
       return true;
     }
-  })
+  });
   if (actions.length === 0) {
     actions.push(value);
   }
-  return actions.join('');
+  return actions.join("");
 }
 
 // 回显数据字典(字符串、数组)
 export function selectDictLabels(datas, value, separator) {
-  if (value === undefined || value.length ===0) {
+  if (value === undefined || value.length === 0) {
     return "";
   }
   if (Array.isArray(value)) {
@@ -100,30 +108,32 @@ export function selectDictLabels(datas, value, separator) {
   Object.keys(value.split(currentSeparator)).some((val) => {
     var match = false;
     Object.keys(datas).some((key) => {
-      if (datas[key].value == ('' + temp[val])) {
+      if (datas[key].value == "" + temp[val]) {
         actions.push(datas[key].label + currentSeparator);
         match = true;
       }
-    })
+    });
     if (!match) {
       actions.push(temp[val] + currentSeparator);
     }
-  })
-  return actions.join('').substring(0, actions.join('').length - 1);
+  });
+  return actions.join("").substring(0, actions.join("").length - 1);
 }
 
 // 字符串格式化(%s )
 export function sprintf(str) {
-  var args = arguments, flag = true, i = 1;
+  var args = arguments,
+    flag = true,
+    i = 1;
   str = str.replace(/%s/g, function () {
     var arg = args[i++];
-    if (typeof arg === 'undefined') {
+    if (typeof arg === "undefined") {
       flag = false;
-      return '';
+      return "";
     }
     return arg;
   });
-  return flag ? str : '';
+  return flag ? str : "";
 }
 
 // 转换字符串,undefined,null等转化为""
@@ -148,7 +158,7 @@ export function mergeRecursive(source, target) {
     }
   }
   return source;
-};
+}
 
 /**
  * 构造树型结构数据
@@ -159,9 +169,9 @@ export function mergeRecursive(source, target) {
  */
 export function handleTree(data, id, parentId, children) {
   let config = {
-    id: id || 'id',
-    parentId: parentId || 'parentId',
-    childrenList: children || 'children'
+    id: id || "id",
+    parentId: parentId || "parentId",
+    childrenList: children || "children",
   };
 
   var childrenListMap = {};
@@ -202,19 +212,23 @@ export function handleTree(data, id, parentId, children) {
 }
 
 /**
-* 参数处理
-* @param {*} params  参数
-*/
+ * 参数处理
+ * @param {*} params  参数
+ */
 export function tansParams(params) {
-  let result = ''
+  let result = "";
   for (const propName of Object.keys(params)) {
     const value = params[propName];
     var part = encodeURIComponent(propName) + "=";
-    if (value !== null && value !== "" && typeof (value) !== "undefined") {
-      if (typeof value === 'object') {
+    if (value !== null && value !== "" && typeof value !== "undefined") {
+      if (typeof value === "object") {
         for (const key of Object.keys(value)) {
-          if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
-            let params = propName + '[' + key + ']';
+          if (
+            value[key] !== null &&
+            value[key] !== "" &&
+            typeof value[key] !== "undefined"
+          ) {
+            let params = propName + "[" + key + "]";
             var subPart = encodeURIComponent(params) + "=";
             result += subPart + encodeURIComponent(value[key]) + "&";
           }
@@ -224,10 +238,10 @@ export function tansParams(params) {
       }
     }
   }
-  return result
+  return result;
 }
 
 // 验证是否为blob格式
 export function blobValidate(data) {
-  return data.type !== 'application/json'
+  return data.type !== "application/json";
 }

+ 1636 - 1624
src/views/material/basicFile/details.vue

@@ -10,7 +10,7 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleSave"
-              v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
+                       v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
               保存
             </el-button>
           </el-button-group>
@@ -57,7 +57,8 @@
         <!-- 维护新版本 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本</el-button>
+            <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本
+            </el-button>
           </el-button-group>
         </el-col>
 
@@ -128,7 +129,7 @@
 
                 <!-- 基本信息展示表单 -->
                 <el-form v-if="activeMainTab == 'material'" :inline="true" label-position="right"
-                  :hide-required-asterisk="true" :model="basicData.value">
+                         :hide-required-asterisk="true" :model="basicData.value">
 
                   <el-row :gutter="10">
                     <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
@@ -140,14 +141,14 @@
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
                           <el-checkbox :label="f.name" name="type" v-model="basicData.value[f.prop]" true-label="0"
-                            false-label="2" :disabled="handleJudge(f)">
+                                       false-label="2" :disabled="handleJudge(f)">
                           </el-checkbox>
                         </el-form-item>
 
                         <!-- 下拉框   -->
                         <el-form-item v-else-if="f.attribute == 'select'"
-                          :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
-                          :prop="f.apiUrl ? `${f.prop}Name` : f.prop">
+                                      :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
+                                      :prop="f.apiUrl ? `${f.prop}Name` : f.prop">
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
                           <template slot="label">
@@ -161,16 +162,16 @@
 
                           <!-- 参照 -->
                           <el-select v-if="f.apiUrl" v-model="basicData.value[`${f.prop}Name`]" placeholder="请选择"
-                            :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
-                            @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
+                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
+                                     @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
                             <div slot="empty"></div>
                           </el-select>
 
                           <!-- 字典 -->
                           <el-select v-if="f.dictId" v-model="basicData.value[f.prop]" placeholder="请选择"
-                            :key="basicData.value[f.prop]" :disabled="handleJudge(f)">
+                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)">
                             <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
-                              :value="d.dictValue">
+                                       :value="d.dictValue">
                             </el-option>
 
                           </el-select>
@@ -198,7 +199,7 @@
                           </template>
 
                           <el-input size="small" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
-                            :readonly="handleJudge(f)">
+                                    :readonly="handleJudge(f)">
                           </el-input>
                         </el-form-item>
 
@@ -210,16 +211,16 @@
 
                 <!-- 其他展示为列表 -->
                 <el-table v-else :data="mainMsg.value" @cell-dblclick="handleMaindbClick"
-                  @selection-change="handleMainChange">
-                  <el-table-column type="selection" width="55" />
-                  <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center" />
+                          @selection-change="handleMainChange">
+                  <el-table-column type="selection" width="55"/>
+                  <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center"/>
                   <el-table-column v-for="m in  mainMsg.form" v-if="m.show" :label="m.name" align="center"
-                    :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
+                                   :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
                     <template slot-scope="scope">
                       {{ m.attribute == 'select' ? scope.row[`${m.prop}Name`] :
-                        (m.attribute == 'checkbox' ?
-                          (scope.row[m.prop] == '0' ? '√' : '')
-                          : scope.row[m.prop])
+                      (m.attribute == 'checkbox' ?
+                      (scope.row[m.prop] == '0' ? '√' : '')
+                      : scope.row[m.prop])
                       }}
                     </template>
                   </el-table-column>
@@ -230,12 +231,13 @@
               <!-- 副信息 -->
               <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>
 
                     <el-form v-if="activeViceTab == 'material_medcine'" :inline="true" label-position="right"
-                      :hide-required-asterisk="true" :model="medcineData.value" class="md-vice-content">
+                             :hide-required-asterisk="true" :model="medcineData.value" class="md-vice-content">
 
                       <el-row :gutter="10">
                         <el-col :span="8" v-for="m in medcineData.form" style="text-align: right;">
@@ -246,8 +248,8 @@
                             <!-- 多选框 -->
                             <el-form-item v-if="m.attribute == 'checkbox'">
                               <el-checkbox :label="m.name" name="type" v-model="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                true-label="0" false-label="2">
+                                           :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                           true-label="0" false-label="2">
                               </el-checkbox>
                             </el-form-item>
 
@@ -256,9 +258,9 @@
 
                               <!-- 参照弹窗 -->
                               <el-select v-if="m.apiUrl" v-model="medcineData.value[`${m.prop}Name`]" placeholder="请选择"
-                                :key="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
+                                         :key="medcineData.value[m.prop]"
+                                         :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                         @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
                                 <!-- <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue":label="d.dictLabel" :value="d.dictValue"></el-option> -->
 
@@ -267,12 +269,12 @@
 
                               <!-- 下拉选择 -->
                               <el-select v-else v-model="medcineData.value[m.prop]" placeholder="请选择"
-                                :key="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
+                                         :key="medcineData.value[m.prop]"
+                                         :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                         @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
                                 <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue"
-                                  :label="d.dictLabel" :value="d.dictValue">
+                                           :label="d.dictLabel" :value="d.dictValue">
                                 </el-option>
 
                               </el-select>
@@ -287,7 +289,7 @@
                             <!-- 文本、数字、textarae -->
                             <el-form-item v-else :label="m.name">
                               <el-input size="small" v-model="medcineData.value[m.prop]" :type="m.attribute || 'text'"
-                                :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
+                                        :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
                               </el-input>
                             </el-form-item>
                           </template>
@@ -301,15 +303,16 @@
 
                     <!-- 辅计量 -->
                     <el-table v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
-                      class="material-table">
-                      <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55" align="center" />
+                              class="material-table">
+                      <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55"
+                                       align="center"/>
                       <el-table-column v-for="v in  unitDetails.form" v-if="v.show" :label="v.name" align="center"
-                        :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
+                                       :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
                           {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
-                            (v.attribute == 'checkbox' ?
-                              (scope.row[v.prop] == '0' ? '√' : '')
-                              : scope.row[v.prop])
+                          (v.attribute == 'checkbox' ?
+                          (scope.row[v.prop] == '0' ? '√' : '')
+                          : scope.row[v.prop])
                           }}
                         </template>
                       </el-table-column>
@@ -317,16 +320,16 @@
 
                     <!-- 辅助属性 -->
                     <el-table v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
-                      class="material-table">
+                              class="material-table">
                       <el-table-column type="index" v-if="propertyDetail.form.length" label="序号" width="55"
-                        align="center" />
+                                       align="center"/>
                       <el-table-column v-for="v in  propertyDetail.form" v-if="v.show" :label="v.name" align="center"
-                        :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
+                                       :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
                           {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
-                            (v.attribute == 'checkbox' ?
-                              (scope.row[v.prop] == '0' ? '√' : '')
-                              : scope.row[v.prop])
+                          (v.attribute == 'checkbox' ?
+                          (scope.row[v.prop] == '0' ? '√' : '')
+                          : scope.row[v.prop])
                           }}
                         </template>
                       </el-table-column>
@@ -368,19 +371,22 @@
 
     <!-- 维护物料类别弹窗 -->
     <el-dialog title="物料类别维护" :visible.sync="materialType.show" :before-close="handleCloseTypeDetails"
-      :close-on-press-escape="false" :close-on-click-modal="false" width="80%" center class="materialType">
+               :close-on-press-escape="false" :close-on-click-modal="false" width="80%" center class="materialType">
 
       <!-- 操作按钮 -->
       <el-row :gutter="10" class="mb10">
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行</el-button>
-            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行</el-button>
+            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行
+            </el-button>
+            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行
+            </el-button>
           </el-button-group>
           <el-button-group>
             <el-button size="small" @click="handleMaterialTypeRow('edit')" v-hasPermi="['system:material:add']">{{
               materialType.isEdit
-              ? '保存' : '修改' }}</el-button>
+              ? '保存' : '修改' }}
+            </el-button>
             <el-button size="small" v-if="materialType.isEdit" @click="handleMaterialTypeRow('cancal')">取消</el-button>
             <el-button size="small" @click="handleMaterialTypeRow">刷新</el-button>
           </el-button-group>
@@ -388,21 +394,22 @@
       </el-row>
       <!-- 表格数据 -->
       <el-table :data="materialType.value" stripe style="width: 100%" max-height="350" v-loading="materialType.loading"
-        :key="refer" @selection-change="handleSelectionType">
-        <el-table-column type="selection" width="30" />
-        <el-table-column type="index" width="50" label="序号" />
+                :key="refer" @selection-change="handleSelectionType">
+        <el-table-column type="selection" width="30"/>
+        <el-table-column type="index" width="50" label="序号"/>
         <el-table-column v-for="mt in materialType.form" v-if="mt.show" :label="mt.name" width="180">
 
           <template slot-scope="scope">
             <!-- :prop="mt.prop" -->
             <!-- 多选框 -->
             <el-checkbox size="small" v-if="mt.attribute == 'checkbox'" :disabled="!(materialType.isEdit && mt.edit)"
-              true-label="0" false-label="2" v-model="scope.row[mt.prop]" />
+                         true-label="0" false-label="2" v-model="scope.row[mt.prop]"/>
 
             <!-- 下拉框 / 参照弹窗---- 药品类别编码 scope.row[`${mt.prop}Name`] -->
             <el-select size="small" v-else-if="mt.attribute == 'select' && mt.apiUrl" placeholder="请选择"
-              :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]"
-              @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
+                       :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]"
+                       :key="scope.row[mt.prop]"
+                       @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
               <div slot="empty"></div>
             </el-select>
 
@@ -412,7 +419,7 @@
                 :value="d.dictValue"></el-option></el-select> -->
 
             <!-- 其他类型 -->
-            <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)" />
+            <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)"/>
           </template>
 
         </el-table-column>
@@ -432,8 +439,8 @@
 
     <!-- 其他页签的操作 -->
     <el-dialog :title="otherDeatils.title" :visible.sync="otherDeatils.show" show-close width="70%"
-      :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
-      class="otherDialog">
+               :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
+               class="otherDialog">
       <div v-loading="otherDeatils.loading">
         <!-- 其他标签页操作  修改、删除 -->
         <el-row :gutter="10" class="mb10">
@@ -476,7 +483,7 @@
 
               <!-- 展示表单 -->
               <el-form :inline="true" label-position="right" :key="refer" :hide-required-asterisk="true"
-                :model="otherDeatils.value">
+                       :model="otherDeatils.value">
 
                 <el-row :gutter="10">
                   <el-col :span="8" v-for="f in otherDeatils.form" style="text-align: right;">
@@ -484,7 +491,7 @@
                       <!-- 多选框 -->
                       <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" class="od-msg-checkedbx">
                         <el-checkbox :label="f.name" name="type" v-model="otherDeatils.value[f.prop]" true-label="0"
-                          false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
+                                     false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
                         </el-checkbox>
                       </el-form-item>
 
@@ -492,17 +499,17 @@
                       <el-form-item v-else-if="f.attribute == 'select'" :label="f.name">
 
                         <el-select v-if="f.apiUrl" v-model="otherDeatils.value[`${f.prop}Name`]" placeholder="请选择"
-                          :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
-                          @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
+                                   :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
+                                   @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
 
                           <div slot="empty"></div>
                         </el-select>
 
                         <!-- 字典-下拉 -->
                         <el-select v-if="f.dictId" v-model="otherDeatils.value[f.prop]" placeholder="请选择"
-                          :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
+                                   :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
                           <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
-                            :value="d.dictValue">
+                                     :value="d.dictValue">
                           </el-option>
                         </el-select>
 
@@ -517,7 +524,7 @@
                       <!--attribute 文本 数字 文本域 为null -->
                       <el-form-item v-else :label="f.name">
                         <el-input size="small" v-model="otherDeatils.value[f.prop]" :type="f.attribute || 'text'"
-                          :readonly="!(otherDeatils.isEdit && f.edit)">
+                                  :readonly="!(otherDeatils.isEdit && f.edit)">
                         </el-input>
                       </el-form-item>
                     </template>
@@ -556,30 +563,30 @@
 
     <!-- 参照弹窗 -->
     <el-dialog :title="MoreDataDialog.msg.name" :visible.sync="MoreDataDialog.show" width="70%" class="MoreDataDialog"
-      :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
+               :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
       <div>
         <el-row>
           <el-col :span="1.5">
-            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer" />
+            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer"/>
           </el-col>
         </el-row>
         <!-- 树形 -->
         <el-tree class="referTree" v-loading="MoreDataDialog.loading" v-if="MoreDataDialog.type == 'tree'"
-          :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
-          :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
+                 :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
+                 :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
         </el-tree>
         <!-- queryMedcineItemDrug -->
         <!-- 列表 -->
         <div v-else>
           <el-table :data="MoreDataDialog.list" v-loading="MoreDataDialog.loading" style="width: 100%"
-            @row-click="handleCurentRow" highlight-current-row>
-            <el-table-column type="index" label="序号" width="55" align="center" />
-            <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name" />
+                    @row-click="handleCurentRow" highlight-current-row>
+            <el-table-column type="index" label="序号" width="55" align="center"/>
+            <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name"/>
           </el-table>
 
           <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-            :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
-            layout="total, sizes, prev, pager, next, jumper" :total="queryParams.total">
+                         :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
+                         layout="total, sizes, prev, pager, next, jumper" :total="queryParams.total">
           </el-pagination>
         </div>
 
@@ -595,1746 +602,1751 @@
 </template>
 
 <script>
-import drTabs from '../components/dr-tabs.vue';
-import detailsTabs from '../config/detailsTabs';
-import materialApi from '@/api/material/basic';
-import { getDicts as getDicts } from '@/api/system/dict/data'
-import arrayUtils from '../tools/arrayUtils';
-
-export default {
-  name: 'material-details',
-  // dicts: [],
-  components: {
-    drTabs
-  },
-  data() {
-    return {
-      count: 1,
-      refer: 1,
-      loading: false,
-      // 维护新版本
-      maintainNewVersion: false,
-      // 详情固定标签页
-      detailsTabs,
-      defaultProps: {
-        children: 'childrens',
-        label: 'name'
-      },
-      drugProps: {
-        children: 'childrens',
-        label: function (data, node) {
-          return data.code + ' ' + data.name
-        }
-        // 'name'
-      },
-      // 标签页当前激活状态
-      activeMainTab: 'material',
-      activeViceTab: 'material_medcine',
-      materialId: this.$route.params.id,
-      collapseActive: ['basic', '',],
-      // 修改按钮 是否激活
-      updateButtonGroup: false,
-      // 基本信息下的页签
-      basicMessage: [
-        {
-          label: '医药行业',
-          code: 'material_medcine',
-          isShow: true,
+  import drTabs from '../components/dr-tabs.vue';
+  import detailsTabs from '../config/detailsTabs';
+  import materialApi from '@/api/material/basic';
+  import {getDicts as getDicts} from '@/api/system/dict/data'
+  import arrayUtils from '../tools/arrayUtils';
+
+  export default {
+    name: 'material-details',
+    // dicts: [],
+    components: {
+      drTabs
+    },
+    data() {
+      return {
+        count: 1,
+        refer: 1,
+        loading: false,
+        // 维护新版本
+        maintainNewVersion: false,
+        // 详情固定标签页
+        detailsTabs,
+        defaultProps: {
+          children: 'childrens',
+          label: 'name'
         },
-        {
-          label: '辅计量管理',
-          code: 'material_unit',
-          isShow: true,
+        drugProps: {
+          children: 'childrens',
+          label: function (data, node) {
+            return data.code + ' ' + data.name
+          }
+          // 'name'
         },
-        {
-          label: '辅助属性',
-          code: 'material_property',
-          isShow: true,
+        // 标签页当前激活状态
+        activeMainTab: 'material',
+        activeViceTab: 'material_medcine',
+        materialId: this.$route.params.id,
+        collapseActive: ['basic', '',],
+        // 修改按钮 是否激活
+        updateButtonGroup: false,
+        // 基本信息下的页签
+        basicMessage: [
+          {
+            label: '医药行业',
+            code: 'material_medcine',
+            isShow: true,
+          },
+          {
+            label: '辅计量管理',
+            code: 'material_unit',
+            isShow: true,
+          },
+          {
+            label: '辅助属性',
+            code: 'material_property',
+            isShow: true,
+          },
+        ],
+        // 基本信息
+        basicData: {
+          value: {},
+          form: []
+        },
+        // 物料类别
+        materialType: {
+          show: false,
+          value: [],
+          form: [],
+          loading: false,
+          checkedList: [],
+          isEdit: false,
+        },
+        // 医药行业
+        medcineData: {
+          value: {},
+          form: []
+        },
+        // 辅助属性
+        propertyDetail: {
+          value: [],
+          form: []
+        },
+        // 辅计量管理
+        unitDetails: {
+          value: [],
+          form: []
+        },
+        // 主标签信息
+        mainMsg: {
+          form: [],
+          value: [],
+          checkedList: [],
+        },
+        // 副信息
+        viceMsg: {
+          form: [],
+          value: [],
+        },
+        // 操作弹窗
+        optionDialog: {
+          show: false,
+          op: ''
+        },
+        // 其他页签操作弹窗
+        otherDeatils: {
+          loading: false,
+          show: false,
+          title: '',
+          // 查询关键字-物料id
+          queryKey: '',
+          isEdit: false,
+          // 详情表头
+          from: [],
+          // 详情值
+          value: {}
+        },
+        // 编辑-更多数据展示弹窗_ 参照
+        MoreDataDialog: {
+          loading: false,
+          show: false,
+          // 查询关键字
+          key: '',
+          // 需要查看参照的表单头信息
+          msg: '',
+          type: 'table',
+          // 查询出的参照数据
+          list: [],
+          // 查询出的参照表头
+          form: [],
+          // 选中的参照数据
+          value: '',
+          // 参照最后应该赋值的地方
+          target: {
+            name: '',
+            prop: ''
+          }
+        },
+        // 参照分页参数
+        queryParams: {
+          pageNum: 1,
+          total: 0,
+          pageSize: 10,
         },
-      ],
-      // 基本信息
-      basicData: {
-        value: {},
-        form: []
-      },
-      // 物料类别
-      materialType: {
-        show: false,
-        value: [],
-        form: [],
-        loading: false,
-        checkedList: [],
-        isEdit: false,
-      },
-      // 医药行业
-      medcineData: {
-        value: {},
-        form: []
-      },
-      // 辅助属性
-      propertyDetail: {
-        value: [],
-        form: []
-      },
-      // 辅计量管理
-      unitDetails: {
-        value: [],
-        form: []
-      },
-      // 主标签信息
-      mainMsg: {
-        form: [],
-        value: [],
-        checkedList: [],
-      },
-      // 副信息
-      viceMsg: {
-        form: [],
-        value: [],
-      },
-      // 操作弹窗
-      optionDialog: {
-        show: false,
-        op: ''
-      },
-      // 其他页签操作弹窗
-      otherDeatils: {
-        loading: false,
-        show: false,
-        title: '',
-        // 查询关键字-物料id
-        queryKey: '',
-        isEdit: false,
-        // 详情表头
-        from: [],
-        // 详情值
-        value: {}
-      },
-      // 编辑-更多数据展示弹窗_ 参照
-      MoreDataDialog: {
-        loading: false,
-        show: false,
-        // 查询关键字
-        key: '',
-        // 需要查看参照的表单头信息
-        msg: '',
-        type: 'table',
-        // 查询出的参照数据
-        list: [],
-        // 查询出的参照表头
-        form: [],
-        // 选中的参照数据
-        value: '',
-        // 参照最后应该赋值的地方
-        target: {
-          name: '',
-          prop: ''
-        }
-      },
-      // 参照分页参数
-      queryParams: {
-        pageNum: 1,
-        total: 0,
-        pageSize: 10,
-      },
-    }
-  },
-
-  methods: {
-    // 判断效期管理
-    handleJudge(attribute) {
-      // 维护新版本才能修改:批号及库存状态管理(isInventoryStatus)、
-      if (attribute.prop == 'isInventoryStatus') {
-        return !(this.maintainNewVersion && attribute.edit);
-      }
-      // 序列号管理(serialNoManager):维护新版本 && 批号及库存状态管理
-      else if (attribute.prop == 'serialNoManager') {
-
-        if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['serialNoManager'] = '2';
-
-        return !(this.maintainNewVersion && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
-
-      }
-      // 批号及库存状态管理(isInventoryStatus) 控制 效期管理是否展示(expiryDateManagerment)
-      else if (attribute.prop == 'expiryDateManagerment') {
-
-        if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['expiryDateManagerment'] = '2';
-
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
-      }
-      // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
-      // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
-
-      else if (attribute.prop == 'expiryUnitId'
-        || attribute.prop == 'usefulLife'
-        || attribute.prop == 'usefulLifeUnitId'
-        || attribute.prop == 'recentWarningPeriod'
-      ) {
-        if (this.basicData.value['expiryDateManagerment'] == '2') {
-
-          this.basicData.value['expiryUnitId'] = '';
-          this.basicData.value['usefulLife'] = '';
-          this.basicData.value['usefulLifeUnitId'] = '';
-          this.basicData.value['recentWarningPeriod'] = '';
-        }
-
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
-      }
-      // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
-      else if (attribute.prop == 'businessDepartment') {
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
-      }
-      else {
-        // 其他属性是否可编辑
-        return !(this.updateButtonGroup && attribute.edit);
-      }
-
-
-    },
-    // 返回
-    handleBack() {
-      this.$store.dispatch('tagsView/delView', this.$route)
-      this.$router.go(-1)
-      // this.$router.push({
-      //   path: `/basic/material/basicFile`,
-      // });
-
-    },
-    // 附件按钮
-    handleFile() {
-      console.log('附件按钮');
-    },
-    // 改变分页情况
-    handleChangePage(type) {
-      switch (type) {
-        case 'first':
-          console.log('第一页');
-          break;
-        case 'pre':
-          console.log('上一页');
-          break;
-        case 'next':
-          console.log('下一页');
-          break;
-        case 'end':
-          console.log('最后页');
-          break;
       }
     },
-    // 切换主信息标签
-    handleMainTabClick(e) {
 
-      this.activeMainTab = detailsTabs[e.index].code;
+    methods: {
+      // 判断效期管理
+      handleJudge(attribute) {
+        // 维护新版本才能修改:批号及库存状态管理(isInventoryStatus)、
+        if (attribute.prop == 'isInventoryStatus') {
+          return !(this.maintainNewVersion && attribute.edit);
+        }
+        // 序列号管理(serialNoManager):维护新版本 && 批号及库存状态管理
+        else if (attribute.prop == 'serialNoManager') {
 
-      this.collapseActive.splice(1, 1, this.activeMainTab);
-      console.log(this.collapseActive, 'this.collapseActive');
+          if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['serialNoManager'] = '2';
 
-      this.handleOtherListRefresh();
+          return !(this.maintainNewVersion && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
 
-    },
-    // 切换副表信息
-    handleViceTabClick(e) {
-      console.log(this.basicMessage[e.index], '切换标签');
-      this.activeViceTab = this.basicMessage[e.index].code;
+        }
+        // 批号及库存状态管理(isInventoryStatus) 控制 效期管理是否展示(expiryDateManagerment)
+        else if (attribute.prop == 'expiryDateManagerment') {
 
-      switch (this.activeViceTab) {
+          if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['expiryDateManagerment'] = '2';
 
-        // 医药行业
-        case 'material_medcine':
-          this.getTagList('material_medcine', (form) => {
-            this.medcineData.form = form;
-            this.getMedcineDetails(this.materialId, 'material_medcine');
-          })
-          break;
-        // 辅计量管理
-        case 'material_unit':
-          this.getTagList('material_unit', (form) => {
-            console.log(form, 'form');
-            this.unitDetails.form = form;
-            this.getUnitList(this.materialId);
-          });
-          break;
-        // 辅助属性
-        case 'material_property':
-          this.getTagList('material_property', (form) => {
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
+        }
+          // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
+        // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
+
+        else if (attribute.prop == 'expiryUnitId'
+          || attribute.prop == 'usefulLife'
+          || attribute.prop == 'usefulLifeUnitId'
+          || attribute.prop == 'recentWarningPeriod'
+        ) {
+          if (this.basicData.value['expiryDateManagerment'] == '2') {
+
+            this.basicData.value['expiryUnitId'] = '';
+            this.basicData.value['usefulLife'] = '';
+            this.basicData.value['usefulLifeUnitId'] = '';
+            this.basicData.value['recentWarningPeriod'] = '';
+          }
 
-            this.propertyDetail.form = form;
-            this.getPropertyList(this.materialId);
-          });
-          break;
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
+        }
+        // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+        else if (attribute.prop == 'businessDepartment') {
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
+        } else {
+          // 其他属性是否可编辑
+          return !(this.updateButtonGroup && attribute.edit);
+        }
 
-        default:
-          break;
-      }
-    },
-    // 主标签页 列表双击
-    handleMaindbClick(e) {
-      console.log(e, '主标签页 列表双击');
-      this.otherDeatils.queryKey = e.id;
-      this.otherDeatils.show = true;
-      let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
-      console.log(activeTab, 'activeTab');
-      this.otherDeatils.title = activeTab.label;
-
-      this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
-    },
-    // 主页签 列表数据选择
-    handleMainChange(e) {
-      console.log(e, '主页签 列表数据选择');
-      this.mainMsg.checkedList = e;
-    },
-    // 上传图片
-    handleUpImage() {
-      console.log('上传图片');
-    },
-    // 编辑状态下,参照弹窗显示查询数据
-    handleQueryMore(msg, val, target) {
-      this.MoreDataDialog.loading = true;
-      let _this = this;
-      console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
 
-      this.MoreDataDialog.show = true;
-      this.MoreDataDialog.msg = msg;
-      this.MoreDataDialog.target = target;
+      },
+      // 返回
+      handleBack() {
+        this.$store.dispatch('tagsView/delView', this.$route)
+        this.$router.go(-1)
+        // this.$router.push({
+        //   path: `/basic/material/basicFile`,
+        // });
 
-      let par = { param: this.MoreDataDialog.key };
+      },
+      // 附件按钮
+      handleFile() {
+        console.log('附件按钮');
+      },
+      // 改变分页情况
+      handleChangePage(type) {
+        switch (type) {
+          case 'first':
+            console.log('第一页');
+            break;
+          case 'pre':
+            console.log('上一页');
+            break;
+          case 'next':
+            console.log('下一页');
+            break;
+          case 'end':
+            console.log('最后页');
+            break;
+        }
+      },
+      // 切换主信息标签
+      handleMainTabClick(e) {
 
-      this[target.name].form.map(t => {
+        this.activeMainTab = detailsTabs[e.index].code;
 
-        if (t.relevance && t.relevance != '') {
+        this.collapseActive.splice(1, 1, this.activeMainTab);
+        console.log(this.collapseActive, 'this.collapseActive');
 
-          let reList = t.relevance.split(',');
-          console.log(reList, 'reList-------------------');
-          reList.forEach(i => {
-            par[i] = this.basicData.value[i]
-          })
-          console.log(par, 'par/////////////////////////');
-        }
-      })
+        this.handleOtherListRefresh();
 
-      this.getExecuteMethods(msg.apiUrl, par, (data) => {
+      },
+      // 切换副表信息
+      handleViceTabClick(e) {
+        console.log(this.basicMessage[e.index], '切换标签');
+        this.activeViceTab = this.basicMessage[e.index].code;
+
+        switch (this.activeViceTab) {
+
+          // 医药行业
+          case 'material_medcine':
+            this.getTagList('material_medcine', (form) => {
+              this.medcineData.form = form;
+              this.getMedcineDetails(this.materialId, 'material_medcine');
+            })
+            break;
+          // 辅计量管理
+          case 'material_unit':
+            this.getTagList('material_unit', (form) => {
+              console.log(form, 'form');
+              this.unitDetails.form = form;
+              this.getUnitList(this.materialId);
+            });
+            break;
+          // 辅助属性
+          case 'material_property':
+            this.getTagList('material_property', (form) => {
 
-        console.log(data, '编辑状态下,弹窗显示查询数据');
-        _this.MoreDataDialog.type = data.type;
-        if (data.type == 'tree') {
+              this.propertyDetail.form = form;
+              this.getPropertyList(this.materialId);
+            });
+            break;
 
-          _this.MoreDataDialog.list = arrayUtils.filterTreeData(data.tableBody);
-        } else {
-          _this.MoreDataDialog.list = data.tableBody;
-          _this.MoreDataDialog.form = data.tableHeader;
+          default:
+            break;
         }
-        this.refer++;
-        // this.count++;s
-        console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
-        console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
-
+      },
+      // 主标签页 列表双击
+      handleMaindbClick(e) {
+        console.log(e, '主标签页 列表双击');
+        this.otherDeatils.queryKey = e.id;
+        this.otherDeatils.show = true;
+        let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+        console.log(activeTab, 'activeTab');
+        this.otherDeatils.title = activeTab.label;
 
-      })
-    },
-    // 参照改变分页大小
-    handleSizeChange(e) {
-      this.queryParams.pageSize = e;
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
-    },
-    // 参照改变当前页
-    handleCurrentChange(e) {
-      this.queryParams.pageNum = e;
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
-    },
-    // 根据apiUrl获取对应参照的值
-    getExecuteMethods(methodName, param, cb) {
+        this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+      },
+      // 主页签 列表数据选择
+      handleMainChange(e) {
+        console.log(e, '主页签 列表数据选择');
+        this.mainMsg.checkedList = e;
+      },
+      // 上传图片
+      handleUpImage() {
+        console.log('上传图片');
+      },
+      // 编辑状态下,参照弹窗显示查询数据
+      handleQueryMore(msg, val, target) {
+        this.MoreDataDialog.loading = true;
+        let _this = this;
+        console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
 
-      let page = {
-        pageSize: this.queryParams.pageSize,
-        pageNum: this.queryParams.pageNum,
-      }
+        this.MoreDataDialog.show = true;
+        this.MoreDataDialog.msg = msg;
+        this.MoreDataDialog.target = target;
 
-      let params = { ...param };
-      // 业务部门需要  依据默认采购组组织查询
-      if (methodName == "queryOperatingDepptTree") {
+        let par = {param: this.MoreDataDialog.key};
 
-        params['puOrgId'] = this.basicData.value['purchasingOrganization']
+        this[target.name].form.map(t => {
 
-      }
+          if (t.relevance && t.relevance != '') {
 
-      materialApi.executeMethods(methodName, params, page).then(res => {
-        this.MoreDataDialog.loading = false;
-        if (res.code == 200) {
-          this.queryParams.total = res.data.total;
-          cb(res.data);
-        }
-      })
-    },
-    // 获取物料基本信息详细信息
-    getMaterialDetails(id, templateCode) {
-      let _this = this;
-      materialApi.materialDetails(
-        id,
-        templateCode,
-      ).then(res => {
-        this.loading = false;
-        console.log(res, '物料基本信息');
-        let { code, data } = res;
-        if (code == 200) {
-
-          _this.basicData.value = data.data;
-
-          for (const key in data.data) {
-            _this.basicData.value[key] = (typeof data.data[key] === 'number') ? String(data.data[key]) : data.data[key];
+            let reList = t.relevance.split(',');
+            console.log(reList, 'reList-------------------');
+            reList.forEach(i => {
+              par[i] = this.basicData.value[i]
+            })
+            console.log(par, 'par/////////////////////////');
           }
+        })
 
-          // _this.handleAddReferLabel('basicData');
-
-        }
-      })
-    },
-    // 添加参照中的label
-    // handleAddReferLabel(dataName) {
-    //   let _this = this;
-    //   this[dataName].form.map(item => {
-    //     // 查参照
-    //     if (item.apiUrl && item.apiUrl != '') {
-
-    //       let param = {};
-
-    //       if (item.relevance && item.relevance != '') {
-    //         let reList = item.relevance.split(',');
-    //         console.log(reList, 'reList-------------------');
-    //         reList.forEach(i => {
-    //           param[i] = this.basicData.value[i]
-    //         })
-    //         console.log(param, 'param/////////////////////////');
-    //       }
-
-    //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
-    //         let { tableBody } = data;
-
-    //         // 维护物料类别  --- 属于列表中获取label
-    //         if (dataName == 'materialType') {
-
-    //           _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
-
-    //             let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
-    //             console.log(Blabel, 'Blabel``````````````````````````');
-    //             d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-    //             return d;
-    //           }))
-
-    //         } else {
-
-    //           let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
-    //           console.log(Blabel, 'Blabel``````````````````````````');
-    //           _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-    //         }
-
-    //         // this.count++;
-    //         this.loading = false;
-    //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
-    //       })
-    //     }
-    //   })
-    //   this.materialType.loading = false;
-
-    // },
-
-
-    // 查询财务信息列表
-    getFinanceList(materialId) {
-      materialApi.financeList({ materialId }).then(res => {
-        console.log(res, '查询财务信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询计划信息列表
-    getPlanList(materialId) {
-      materialApi.planList({ materialId }).then(res => {
-        console.log(res, '查询计划信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询成本信息列表
-    getCostList(materialId) {
-      materialApi.costList({ materialId }).then((res) => {
-        console.log(res, '成本信息列表+表头');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询利润中心列表
-    getCenterList(materialId) {
-      materialApi.centerList({ materialId }).then(res => {
-        console.log(res, '查询利润中心信息');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询采购中心列表
-    getPurchaseList(materialId) {
-      materialApi.purchaseList({ materialId }).then(res => {
-        console.log(res, '查询采购中心');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 获取库存信息列表
-    getInventoryList(materialId) {
-      materialApi.inventoryList({ materialId }).then(res => {
-        console.log(res, '获取库存信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
+        this.getExecuteMethods(msg.apiUrl, par, (data) => {
 
-    // 查询其他标签页列表详情
-    getOtherListDetails(type, id) {
-      console.log(type, id, '查询其他标签页列表详情');
-      this.otherDeatils.form = this.mainMsg.form;
-      console.log(this.otherDeatils.form, 'this.otherDeatils.form');
-      this.otherDeatils.loading = true;
-      switch (type) {
-        // 财物信息
-        case 'material_finance':
-          this.getFinanceDetails(id);
-          break;
-        // 利润中心信息
-        case 'profit_center':
-          this.getCenterDetails(id);
-          break;
-        // 采购信息
-        case 'material_purchase':
-          this.getPurchaseDetails(id);
-          break;
-        // 库存信息
-        case 'material_inventory':
-          this.getInventoryDetails(id);
-          break;
-        // 计划信息
-        case 'material_plan':
-          this.getPlanDetails(id);
-          break;
-        // 成本信息
-        case 'material_cost':
-          this.getCostDetails(id);
-          break;
-        default: break;
-      }
-    },
-    // 查询财务信息详情
-    getFinanceDetails(id) {
-      materialApi.financeDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        let _this = this;
-        console.log('查询财务信息详情', res);
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取利润中心详情
-    getCenterDetails(id) {
-      let _this = this;
-      materialApi.centerDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        console.log(res, '获取利润中心详情');
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取采购详细信息详情
-    getPurchaseDetails(id) {
-      let _this = this;
-      materialApi.purchaseDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        console.log(res, '获取采购详细信息详情');
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取成本信息详情
-    getCostDetails(id) {
-      let _this = this;
-      materialApi.costDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        console.log(res, '获取成本信息详情');
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取计划信息详情
-    getPlanDetails(id) {
-      let _this = this;
-      materialApi.planDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        console.log(res, '获取计划信息详情');
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取库存详细信息详情
-    getInventoryDetails(id) {
-      let _this = this;
-      materialApi.inventoryDetails(id).then(res => {
-        this.otherDeatils.loading = false;
-        console.log(res, '获取库存详细信息详情');
-        if (res.code == 200) {
-          this.otherDeatils.value = res.data.data;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
+          console.log(data, '编辑状态下,弹窗显示查询数据');
+          _this.MoreDataDialog.type = data.type;
+          if (data.type == 'tree') {
 
+            _this.MoreDataDialog.list = arrayUtils.filterTreeData(data.tableBody);
+          } else {
+            _this.MoreDataDialog.list = data.tableBody;
+            _this.MoreDataDialog.form = data.tableHeader;
+          }
+          this.refer++;
+          // this.count++;s
+          console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
+          console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
 
 
+        })
+      },
+      // 参照改变分页大小
+      handleSizeChange(e) {
+        this.queryParams.pageSize = e;
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+      },
+      // 参照改变当前页
+      handleCurrentChange(e) {
+        this.queryParams.pageNum = e;
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+      },
+      // 根据apiUrl获取对应参照的值
+      getExecuteMethods(methodName, param, cb) {
 
-    /* 二级标签页 */
-    // 根据物料id获取医药行业信息详细信息
-    getMedcineDetails(id) {
-      let _this = this;
-      console.log(id);
-      materialApi.medcineDetailsInfo(id).then((res) => {
-        this.loading = false;
-        console.log(res, '医药行业');
-        let { code, data } = res;
-        if (code == 200) {
-          _this.medcineData.value = data.data || {};
-          // this.medcineData.form = data.form;
-          // _this.handleAddReferLabel('medcineData');
-          console.log(' _this.medcineData', _this.medcineData, res);
-        }
-      })
-    },
-    // 获取物料辅助属性详细信息+表单列段属性
-    getPropertyDetails(id) {
-      materialApi.propertyDetails(id).then(res => {
-        console.log(res, '物料辅助属性详细信息');
-        if (res.code == 200) {
-          this.propertyDetail.value = res.data.data || [];
-        }
-      })
-    },
-    // 查询物料辅助属性列表+表头字段
-    getPropertyList(materialId) {
-      materialApi.propertyList({ materialId }).then(res => {
-        console.log(res, '料辅助属性列表');
-        if (res.code == 200) {
-          this.propertyDetail.value = res.data.data || [];
+        let page = {
+          pageSize: this.queryParams.pageSize,
+          pageNum: this.queryParams.pageNum,
         }
-      })
-    },
-    //获取辅助计量单位基本信息+表单列段属性
-    getUnitDetails(materialId) {
-      materialApi.unitDetails(materialId).then(res => {
-        console.log(res, '辅助计量单位基本信息');
-        if (res.code == 200) {
-          this.unitDetails.value = res.data.tableBody.rows || [];
-        }
-      })
-    },
-    //获取辅计量管理列表信息
-    getUnitList(materialId) {
-      materialApi.unitList({ materialId }).then(res => {
-        console.log(res, '辅计量管理列表信息');
-        if (res.code == 200) {
-          this.unitDetails.value = res.data.tableBody.rows || [];
-        }
-      })
-    },
-    // 获取物料列表表头
-    getTagList(templateCode, cb) {
-      let _this = this
-      materialApi.tagList({ templateCode }).then(res => {
-        console.log(res, `获取${templateCode}表头`);
-        let dictIdList = [];
-        if (res.code == 200) {
-
-          res.data.map(item => {
-
-            // 查字典
-            if (item.dictId && item.dictId != '') {
-              // 通过接口获取有dict的对应的数据
-              getDicts(item.dictId).then(dict => {
-                if (dict.data) {
-                  item['dictValue'] = dict.data;
-                }
-              })
-            }
 
-          })
-
-          // 动态更改dict
-          // res.data.forEach(item => {
-          //   if (item.dictId) {
-          //     // 请求接口
-          //     dictIdList.push(item.dictId);
-          //   }
-          // })
-          // console.log(dictIdList, 'dictIdList');
-          // _this.dict = [..._this.dict, ...dictIdList];
-          // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
+        let params = {...param};
+        // 业务部门需要  依据默认采购组组织查询
+        if (methodName == "queryOperatingDepptTree") {
 
-          // console.log(_this.dict, 'dicts');
+          params['puOrgId'] = this.basicData.value['purchasingOrganization']
 
-          return cb(res.data);
-        }
-      })
-    },
-    // 根据物料id获取物料类别维护列表
-    getMedcineitemList(materialId) {
-      let _this = this;
-      materialApi.medcineitemList({ materialId }).then(res => {
-        this.materialType.loading = false;
-        console.log(res, '根据物料id获取物料类别维护列表');
-        if (res.code == 200) {
-          _this.materialType.value = res.data.tableBody.rows;
-          // _this.handleAddReferLabel('materialType');
         }
-      })
-    },
 
+        materialApi.executeMethods(methodName, params, page).then(res => {
+          this.MoreDataDialog.loading = false;
+          if (res.code == 200) {
+            this.queryParams.total = res.data.total;
+            cb(res.data);
+          }
+        })
+      },
+      // 获取物料基本信息详细信息
+      getMaterialDetails(id, templateCode) {
+        let _this = this;
+        materialApi.materialDetails(
+          id,
+          templateCode,
+        ).then(res => {
+          this.loading = false;
+          console.log(res, '物料基本信息');
+          let {code, data} = res;
+          if (code == 200) {
 
-    // 新增
-    handleInster() {
-      this.$message({
-        message: '物料只能通过申请审批增加,不能在节点直接录入!',
-        type: 'warning'
-      });
-    },
-    // 除基本信息之后的修改
-    handleOtherEdit() {
-      console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
+            _this.basicData.value = data.data;
 
-      if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
-        this.otherDeatils.show = true;
-        this.otherDeatils.isEdit = true;
-        let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
-        this.otherDeatils.title = activeTab.label;
-        this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
-        console.log(this.otherDeatils, 'this.otherDeatils');
-        // 查询其他标签页列表详情
-        this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+            for (const key in data.data) {
+              _this.basicData.value[key] = (typeof data.data[key] === 'number') ? String(data.data[key]) : data.data[key];
+            }
 
+            // _this.handleAddReferLabel('basicData');
 
-      } else {
-        this.$message({
-          message: '修改请选择单个数据!',
-          type: 'warning'
-        });
-      }
-    },
-    // 其他标签详情弹窗-刷新
-    handleOtherRefresh() {
-      this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
-    },
-    // 其他标签详情弹窗-删除
-    handleOtherDel() {
-      let ids = this.mainMsg.checkedList.map(i => i.id);
+          }
+        })
+      },
+      // 添加参照中的label
+      // handleAddReferLabel(dataName) {
+      //   let _this = this;
+      //   this[dataName].form.map(item => {
+      //     // 查参照
+      //     if (item.apiUrl && item.apiUrl != '') {
+
+      //       let param = {};
+
+      //       if (item.relevance && item.relevance != '') {
+      //         let reList = item.relevance.split(',');
+      //         console.log(reList, 'reList-------------------');
+      //         reList.forEach(i => {
+      //           param[i] = this.basicData.value[i]
+      //         })
+      //         console.log(param, 'param/////////////////////////');
+      //       }
+
+      //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
+      //         let { tableBody } = data;
+
+      //         // 维护物料类别  --- 属于列表中获取label
+      //         if (dataName == 'materialType') {
+
+      //           _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
+
+      //             let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
+      //             console.log(Blabel, 'Blabel``````````````````````````');
+      //             d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
+      //             return d;
+      //           }))
+
+      //         } else {
+
+      //           let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
+      //           console.log(Blabel, 'Blabel``````````````````````````');
+      //           _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
+      //         }
+
+      //         // this.count++;
+      //         this.loading = false;
+      //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
+      //       })
+      //     }
+      //   })
+      //   this.materialType.loading = false;
+
+      // },
+
+
+      // 查询财务信息列表
+      getFinanceList(materialId) {
+        materialApi.financeList({materialId}).then(res => {
+          console.log(res, '查询财务信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询计划信息列表
+      getPlanList(materialId) {
+        materialApi.planList({materialId}).then(res => {
+          console.log(res, '查询计划信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询成本信息列表
+      getCostList(materialId) {
+        materialApi.costList({materialId}).then((res) => {
+          console.log(res, '成本信息列表+表头');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询利润中心列表
+      getCenterList(materialId) {
+        materialApi.centerList({materialId}).then(res => {
+          console.log(res, '查询利润中心信息');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询采购中心列表
+      getPurchaseList(materialId) {
+        materialApi.purchaseList({materialId}).then(res => {
+          console.log(res, '查询采购中心');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 获取库存信息列表
+      getInventoryList(materialId) {
+        materialApi.inventoryList({materialId}).then(res => {
+          console.log(res, '获取库存信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
 
-      console.log(`${this.activeMainTab}其他标签详情弹窗-删除---id合集`, ids);
-      if (ids.length) {
-        switch (this.activeMainTab) {
+      // 查询其他标签页列表详情
+      getOtherListDetails(type, id) {
+        console.log(type, id, '查询其他标签页列表详情');
+        this.otherDeatils.form = this.mainMsg.form;
+        console.log(this.otherDeatils.form, 'this.otherDeatils.form');
+        this.otherDeatils.loading = true;
+        switch (type) {
           // 财物信息
           case 'material_finance':
-            this.handleDelFinance(ids);
+            this.getFinanceDetails(id);
             break;
           // 利润中心信息
           case 'profit_center':
-            this.handledDelCenter(ids);
+            this.getCenterDetails(id);
             break;
           // 采购信息
           case 'material_purchase':
-            this.handledelPurchase(ids);
+            this.getPurchaseDetails(id);
             break;
           // 库存信息
           case 'material_inventory':
-            this.handleDelInventory(ids);
+            this.getInventoryDetails(id);
             break;
           // 计划信息
           case 'material_plan':
-            this.handleDelPlan(ids);
+            this.getPlanDetails(id);
             break;
           // 成本信息
           case 'material_cost':
-            this.handleDelCost(ids);
+            this.getCostDetails(id);
+            break;
           default:
             break;
         }
-      } else {
-        this.$message({
-          message: '请选择需要删除的数据!',
-          type: 'warning'
-        });
-      }
-    },
-    // 其他标签页刷新
-    handleOtherListRefresh() {
-      switch (this.activeMainTab) {
-
-        // 基本信息
-        case 'material':
-          this.getTagList('material', (form) => {
-            this.basicData.form = form;
-            this.getMaterialDetails(this.materialId, 'material');
-          })
-          break;
-        // 财物信息
-        case 'material_finance':
-          this.getTagList('material_finance', (form) => {
-            this.mainMsg.form = form;
-            this.getFinanceList(this.materialId);
-          });
-          break;
-        // 利润中心信息
-        case 'profit_center':
-          this.getTagList('profit_center', (form) => {
-            this.mainMsg.form = form;
-            this.getCenterList(this.materialId);
-          });
-          break;
-        // 采购信息
-        case 'material_purchase':
-          this.getTagList('material_purchase', (form) => {
-            this.mainMsg.form = form;
-            this.getPurchaseList(this.materialId);
-          });
-          break;
-        // 库存信息
-        case 'material_inventory':
-          this.getTagList('material_inventory', (form) => {
-            this.mainMsg.form = form;
-            this.getInventoryList(this.materialId);
-          });
-          break;
-        // 计划信息
-        case 'material_plan':
-          this.getTagList('material_plan', (form) => {
-            this.mainMsg.form = form;
-            this.getPlanList(this.materialId);
-          });
-          break;
-        // 成本信息
-        case 'material_cost':
-          this.getTagList('material_cost', (form) => {
-            this.mainMsg.form = form;
-            this.getCostList(this.materialId);
-          });
-          break;
-        default: break;
-      }
-    },
-    // 修改
-    handleBasicEdit() {
-      console.log('修改基本信息');
-      this.updateButtonGroup = true;
-      // this.count++;
-      //需要禁止点击其他标签
-      // this.detailsTabs = this.detailsTabs.map(item => {
-      //   item['disabled'] = true;
-      //   return item
-      // })
-      console.log(this.detailsTabs, 'this.detailsTabs ');
-
-    },
-    // 删除
-    handleDel() {
-      console.log('删除----基本信息');
+      },
+      // 查询财务信息详情
+      getFinanceDetails(id) {
+        materialApi.financeDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          let _this = this;
+          console.log('查询财务信息详情', res);
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取利润中心详情
+      getCenterDetails(id) {
+        let _this = this;
+        materialApi.centerDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          console.log(res, '获取利润中心详情');
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取采购详细信息详情
+      getPurchaseDetails(id) {
+        let _this = this;
+        materialApi.purchaseDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          console.log(res, '获取采购详细信息详情');
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取成本信息详情
+      getCostDetails(id) {
+        let _this = this;
+        materialApi.costDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          console.log(res, '获取成本信息详情');
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取计划信息详情
+      getPlanDetails(id) {
+        let _this = this;
+        materialApi.planDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          console.log(res, '获取计划信息详情');
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取库存详细信息详情
+      getInventoryDetails(id) {
+        let _this = this;
+        materialApi.inventoryDetails(id).then(res => {
+          this.otherDeatils.loading = false;
+          console.log(res, '获取库存详细信息详情');
+          if (res.code == 200) {
+            this.otherDeatils.value = res.data.data;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
 
-    },
-    // 复制
-    handleCopy() {
-      console.log('复制');
-    },
-    //查询
-    handleQuery() {
 
-    },
-    // 刷新
-    handleRefresh() {
-      console.log('刷新');
-      this.handleRest();
-    },
-    // 过滤
-    handleFilter(e) {
-      console.log(e, '过滤');
-    },
-    filterCondition(type) {
-      return {
-        type
-      }
-    },
-    // 维护物料类别 
-    handleMaterialType() {
-      console.log('维护物料类别');
-      this.materialType.show = true;
-
-      this.materialType.loading = true;
-      this.getTagList('material_medcine_item', (form) => {
-        this.materialType.form = form;
-        this.getMedcineitemList(this.materialId);
-      });
-    },
-    // 启用
-    handleIsInvoke(e) {
-      console.log('启用', this.basicData.value.isEnable);
-
-      let param = {
-        isEnable: this.basicData.value.isEnable == '已启用' ? '2' : '0',
-        id: this.basicData.value.id
-      };
-      console.log(param, '启用/停用param');
-      materialApi.updateEnableMaterial(param).then(res => {
-        console.log(res, '启用/停用');
-        if (res.code == 200) this.handleRefresh();
-      })
-    },
-    // 维护新版本
-    handleNewVersion() {
-      let _this = this;
-      let data = {
-        // 物料编码
-        code: this.basicData.value.code
-      }
-      materialApi.versions(data).then(res => {
-        console.log(res, '维护新版本');
-        if (res.code == 200) {
-          _this.maintainNewVersion = res.data.result;
-        }
-      })
-    },
-    // 维护物料保存
-    handleSaveNewVersion(cb) {
-      let data = {
-        // 物料编码
-        materialCode: this.basicData.value.code,
-        //序列号管理; 2= 否,0= 是	
-        serialNoManager: this.basicData.value.serialNoManager,
-        // 批号及库存状态管理;2=否,0=是
-        isInventoryStatus: this.basicData.value.isInventoryStatus,
-      }
-      materialApi.saveVersions(data).then(res => {
-        console.log(res, '维护物料保存');
-
-        if (res.code == 200) {
-          cb();
-        }
-      })
-        .catch((error) => {
+      /* 二级标签页 */
+      // 根据物料id获取医药行业信息详细信息
+      getMedcineDetails(id) {
+        let _this = this;
+        console.log(id);
+        materialApi.medcineDetailsInfo(id).then((res) => {
           this.loading = false;
+          console.log(res, '医药行业');
+          let {code, data} = res;
+          if (code == 200) {
+            _this.medcineData.value = data.data || {};
+            // this.medcineData.form = data.form;
+            // _this.handleAddReferLabel('medcineData');
+            console.log(' _this.medcineData', _this.medcineData, res);
+          }
         })
-    },
-    // 取消保存
-    handleCancel() {
-      console.log('取消保存');
-      this.optionDialog.op = '取消';
-      this.optionDialog.show = true;
-    },
-    // 保存修改
-    handleSave() {
-      console.log('保存修改');
-      this.loading = true;
-      // 普通保存修改
-      this.updateButtonGroup && this.handleSaveMaterial(() => {
-        this.updateButtonGroup = false;
-        this.handleRefresh();
-      });
-
-      // 维护新版本保存修改
-      this.maintainNewVersion && this.handleSaveNewVersion(() => {
-        this.maintainNewVersion = false;
-        this.handleRefresh();
-      })
-    },
-    // 物料类别列表选中
-    handleSelectionType(list) {
-      console.log('物料类别列表选中', list);
-      this.materialType.checkedList = list;
-    },
-    // 物料类别增删行
-    handleMaterialTypeRow(op) {
-      let _this = this;
-      switch (op) {
-        // 增行
-        case 'add':
-          let rowObj = {};
+      },
+      // 获取物料辅助属性详细信息+表单列段属性
+      getPropertyDetails(id) {
+        materialApi.propertyDetails(id).then(res => {
+          console.log(res, '物料辅助属性详细信息');
+          if (res.code == 200) {
+            this.propertyDetail.value = res.data.data || [];
+          }
+        })
+      },
+      // 查询物料辅助属性列表+表头字段
+      getPropertyList(materialId) {
+        materialApi.propertyList({materialId}).then(res => {
+          console.log(res, '料辅助属性列表');
+          if (res.code == 200) {
+            this.propertyDetail.value = res.data.data || [];
+          }
+        })
+      },
+      //获取辅助计量单位基本信息+表单列段属性
+      getUnitDetails(materialId) {
+        materialApi.unitDetails(materialId).then(res => {
+          console.log(res, '辅助计量单位基本信息');
+          if (res.code == 200) {
+            this.unitDetails.value = res.data.tableBody.rows || [];
+          }
+        })
+      },
+      //获取辅计量管理列表信息
+      getUnitList(materialId) {
+        materialApi.unitList({materialId}).then(res => {
+          console.log(res, '辅计量管理列表信息');
+          if (res.code == 200) {
+            this.unitDetails.value = res.data.tableBody.rows || [];
+          }
+        })
+      },
+      // 获取物料列表表头
+      getTagList(templateCode, cb) {
+        let _this = this
+        materialApi.tagList({templateCode}).then(res => {
+          console.log(res, `获取${templateCode}表头`);
+          let dictIdList = [];
+          if (res.code == 200) {
+
+            res.data.map(item => {
+
+              // 查字典
+              if (item.dictId && item.dictId != '') {
+                // 通过接口获取有dict的对应的数据
+                getDicts(item.dictId).then(dict => {
+                  if (dict.data) {
+                    item['dictValue'] = dict.data;
+                  }
+                })
+              }
 
-          for (const key in _this.materialType.value[0]) {
-            if (Object.hasOwnProperty.call(_this.materialType.value[0], key)) {
+            })
 
-              rowObj[key] = '';
+            // 动态更改dict
+            // res.data.forEach(item => {
+            //   if (item.dictId) {
+            //     // 请求接口
+            //     dictIdList.push(item.dictId);
+            //   }
+            // })
+            // console.log(dictIdList, 'dictIdList');
+            // _this.dict = [..._this.dict, ...dictIdList];
+            // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
 
-            }
+            // console.log(_this.dict, 'dicts');
+
+            return cb(res.data);
           }
-          rowObj['insertId'] = new Date().getTime();
-          this.materialType.value.push(rowObj);
-          console.log(this.materialType.value, '物料类别增行rowObj后');
-
-          break;
-        // 删行
-        case 'del':
-          console.log('物料类别删行', _this.materialType.checkedList);
-          if (_this.materialType.checkedList.length) {
-            _this.materialType.checkedList.map(c => {
-              _this.materialType.value = _this.materialType.value.filter(m => {
-                if (m.id && m.id != '' && m.id != c.id) {
-                  return m;
-                } else if (m.insertId && m.insertId != '' && m.insertId != c.insertId) {
-                  return m
-                }
-              })
+        })
+      },
+      // 根据物料id获取物料类别维护列表
+      getMedcineitemList(materialId) {
+        let _this = this;
+        materialApi.medcineitemList({materialId}).then(res => {
+          this.materialType.loading = false;
+          console.log(res, '根据物料id获取物料类别维护列表');
+          if (res.code == 200) {
+            _this.materialType.value = res.data.tableBody.rows;
+            // _this.handleAddReferLabel('materialType');
+          }
+        })
+      },
+
+
+      // 新增
+      handleInster() {
+        this.$message({
+          message: '物料只能通过申请审批增加,不能在节点直接录入!',
+          type: 'warning'
+        });
+      },
+      // 除基本信息之后的修改
+      handleOtherEdit() {
+        console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
+
+        if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
+          this.otherDeatils.show = true;
+          this.otherDeatils.isEdit = true;
+          let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+          this.otherDeatils.title = activeTab.label;
+          this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
+          console.log(this.otherDeatils, 'this.otherDeatils');
+          // 查询其他标签页列表详情
+          this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+
+
+        } else {
+          this.$message({
+            message: '修改请选择单个数据!',
+            type: 'warning'
+          });
+        }
+      },
+      // 其他标签详情弹窗-刷新
+      handleOtherRefresh() {
+        this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
+      },
+      // 其他标签详情弹窗-删除
+      handleOtherDel() {
+        let ids = this.mainMsg.checkedList.map(i => i.id);
+
+        console.log(`${this.activeMainTab}其他标签详情弹窗-删除---id合集`, ids);
+        if (ids.length) {
+          switch (this.activeMainTab) {
+            // 财物信息
+            case 'material_finance':
+              this.handleDelFinance(ids);
+              break;
+            // 利润中心信息
+            case 'profit_center':
+              this.handledDelCenter(ids);
+              break;
+            // 采购信息
+            case 'material_purchase':
+              this.handledelPurchase(ids);
+              break;
+            // 库存信息
+            case 'material_inventory':
+              this.handleDelInventory(ids);
+              break;
+            // 计划信息
+            case 'material_plan':
+              this.handleDelPlan(ids);
+              break;
+            // 成本信息
+            case 'material_cost':
+              this.handleDelCost(ids);
+            default:
+              break;
+          }
+        } else {
+          this.$message({
+            message: '请选择需要删除的数据!',
+            type: 'warning'
+          });
+        }
+      },
+      // 其他标签页刷新
+      handleOtherListRefresh() {
+        switch (this.activeMainTab) {
+
+          // 基本信息
+          case 'material':
+            this.getTagList('material', (form) => {
+              this.basicData.form = form;
+              this.getMaterialDetails(this.materialId, 'material');
             })
-          } else {
-            this.$message({
-              message: '请选择需要删除的信息!',
-              type: 'warning'
+            break;
+          // 财物信息
+          case 'material_finance':
+            this.getTagList('material_finance', (form) => {
+              this.mainMsg.form = form;
+              this.getFinanceList(this.materialId);
+            });
+            break;
+          // 利润中心信息
+          case 'profit_center':
+            this.getTagList('profit_center', (form) => {
+              this.mainMsg.form = form;
+              this.getCenterList(this.materialId);
+            });
+            break;
+          // 采购信息
+          case 'material_purchase':
+            this.getTagList('material_purchase', (form) => {
+              this.mainMsg.form = form;
+              this.getPurchaseList(this.materialId);
+            });
+            break;
+          // 库存信息
+          case 'material_inventory':
+            this.getTagList('material_inventory', (form) => {
+              this.mainMsg.form = form;
+              this.getInventoryList(this.materialId);
             });
+            break;
+          // 计划信息
+          case 'material_plan':
+            this.getTagList('material_plan', (form) => {
+              this.mainMsg.form = form;
+              this.getPlanList(this.materialId);
+            });
+            break;
+          // 成本信息
+          case 'material_cost':
+            this.getTagList('material_cost', (form) => {
+              this.mainMsg.form = form;
+              this.getCostList(this.materialId);
+            });
+            break;
+          default:
+            break;
+        }
+      },
+      // 修改
+      handleBasicEdit() {
+        console.log('修改基本信息');
+        this.updateButtonGroup = true;
+        // this.count++;
+        //需要禁止点击其他标签
+        // this.detailsTabs = this.detailsTabs.map(item => {
+        //   item['disabled'] = true;
+        //   return item
+        // })
+        console.log(this.detailsTabs, 'this.detailsTabs ');
+
+      },
+      // 删除
+      handleDel() {
+        console.log('删除----基本信息');
+
+      },
+      // 复制
+      handleCopy() {
+        console.log('复制');
+      },
+      //查询
+      handleQuery() {
+
+      },
+      // 刷新
+      handleRefresh() {
+        console.log('刷新');
+        this.handleRest();
+      },
+      // 过滤
+      handleFilter(e) {
+        console.log(e, '过滤');
+      },
+      filterCondition(type) {
+        return {
+          type
+        }
+      },
+      // 维护物料类别
+      handleMaterialType() {
+        console.log('维护物料类别');
+        this.materialType.show = true;
+
+        this.materialType.loading = true;
+        this.getTagList('material_medcine_item', (form) => {
+          this.materialType.form = form;
+          this.getMedcineitemList(this.materialId);
+        });
+      },
+      // 启用
+      handleIsInvoke(e) {
+        console.log('启用', this.basicData.value.isEnable);
+
+        let param = {
+          isEnable: this.basicData.value.isEnable == '已启用' ? '2' : '0',
+          id: this.basicData.value.id
+        };
+        console.log(param, '启用/停用param');
+        materialApi.updateEnableMaterial(param).then(res => {
+          console.log(res, '启用/停用');
+          if (res.code == 200) this.handleRefresh();
+        })
+      },
+      // 维护新版本
+      handleNewVersion() {
+        let _this = this;
+        let data = {
+          // 物料编码
+          code: this.basicData.value.code
+        }
+        materialApi.versions(data).then(res => {
+          console.log(res, '维护新版本');
+          if (res.code == 200) {
+            _this.maintainNewVersion = res.data.result;
+            // 维护版本消息展示 by shiy 2023/05/31
+            if (!res.data.result) {
+              this.$message({
+                message: res.data.msg,
+                type: 'warning'
+              });
+            }
+          }
+        })
+      },
+      // 维护物料保存
+      handleSaveNewVersion(cb) {
+        let data = {
+          // 物料编码
+          materialCode: this.basicData.value.code,
+          //序列号管理; 2= 否,0= 是
+          serialNoManager: this.basicData.value.serialNoManager,
+          // 批号及库存状态管理;2=否,0=是
+          isInventoryStatus: this.basicData.value.isInventoryStatus,
+        }
+        materialApi.saveVersions(data).then(res => {
+          console.log(res, '维护物料保存');
+
+          if (res.code == 200) {
+            cb();
           }
-          break;
-        // 取消
-        case 'cancal':
-          this.materialType.isEdit = false;
-          this.handleMaterialTypeRow();
-          break;
-        // 保存、修改
-        case 'edit':
-
-          if (_this.materialType.isEdit) {
-            // 编辑状态
-            let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
-            console.log(nullList, 'nullList');
-            if (!nullList.length && _this.materialType.value.length) {
-              console.log('物料类别保存', _this.materialType.value);
-              let params = {
-                materialId: _this.materialId,
-                medcineItems: _this.materialType.value
+        })
+          .catch((error) => {
+            this.loading = false;
+          })
+      },
+      // 取消保存
+      handleCancel() {
+        console.log('取消保存');
+        this.optionDialog.op = '取消';
+        this.optionDialog.show = true;
+      },
+      // 保存修改
+      handleSave() {
+        console.log('保存修改');
+        this.loading = true;
+        // 普通保存修改
+        this.updateButtonGroup && this.handleSaveMaterial(() => {
+          this.updateButtonGroup = false;
+          this.handleRefresh();
+        });
+
+        // 维护新版本保存修改
+        this.maintainNewVersion && this.handleSaveNewVersion(() => {
+          this.maintainNewVersion = false;
+          this.handleRefresh();
+        })
+      },
+      // 物料类别列表选中
+      handleSelectionType(list) {
+        console.log('物料类别列表选中', list);
+        this.materialType.checkedList = list;
+      },
+      // 物料类别增删行
+      handleMaterialTypeRow(op) {
+        let _this = this;
+        switch (op) {
+          // 增行
+          case 'add':
+            let rowObj = {};
+
+            for (const key in _this.materialType.value[0]) {
+              if (Object.hasOwnProperty.call(_this.materialType.value[0], key)) {
+
+                rowObj[key] = '';
+
               }
-              materialApi.medcineitemBatchSave(params).then(res => {
-                console.log(res, '保存物料类型');
-                if (res.code == 200) {
-                  _this.materialType.isEdit = false;
-                  _this.handleMaterialTypeRow();
-                }
+            }
+            rowObj['insertId'] = new Date().getTime();
+            this.materialType.value.push(rowObj);
+            console.log(this.materialType.value, '物料类别增行rowObj后');
+
+            break;
+          // 删行
+          case 'del':
+            console.log('物料类别删行', _this.materialType.checkedList);
+            if (_this.materialType.checkedList.length) {
+              _this.materialType.checkedList.map(c => {
+                _this.materialType.value = _this.materialType.value.filter(m => {
+                  if (m.id && m.id != '' && m.id != c.id) {
+                    return m;
+                  } else if (m.insertId && m.insertId != '' && m.insertId != c.insertId) {
+                    return m
+                  }
+                })
               })
-              // 保存
             } else {
               this.$message({
-                message: '不能保存空数据或存在数据为空!',
+                message: '请选择需要删除的信息!',
                 type: 'warning'
               });
             }
-          } else {
-            // 非编辑状态
-            console.log('物料类别修改');
-            this.materialType.isEdit = true;
-          }
-          break;
-        // 刷新
-        default:
-          console.log('物料类别刷新');
-          if (this.materialType.isEdit) {
-            this.$message({
-              message: '请先保存数据!',
-              type: 'warning'
-            })
-          } else {
-            this.materialType.loading = true;
-            this.getTagList('material_medcine_item', (form) => {
-              this.materialType.form = form;
-              this.getMedcineitemList(this.materialId);
-            });
-          }
-          break;
-
-      }
-    },
-    // 物料类别弹窗关闭前
-    handleCloseTypeDetails(done) {
+            break;
+          // 取消
+          case 'cancal':
+            this.materialType.isEdit = false;
+            this.handleMaterialTypeRow();
+            break;
+          // 保存、修改
+          case 'edit':
+
+            if (_this.materialType.isEdit) {
+              // 编辑状态
+              let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
+              console.log(nullList, 'nullList');
+              if (!nullList.length && _this.materialType.value.length) {
+                console.log('物料类别保存', _this.materialType.value);
+                let params = {
+                  materialId: _this.materialId,
+                  medcineItems: _this.materialType.value
+                }
+                materialApi.medcineitemBatchSave(params).then(res => {
+                  console.log(res, '保存物料类型');
+                  if (res.code == 200) {
+                    _this.materialType.isEdit = false;
+                    _this.handleMaterialTypeRow();
+                  }
+                })
+                // 保存
+              } else {
+                this.$message({
+                  message: '不能保存空数据或存在数据为空!',
+                  type: 'warning'
+                });
+              }
+            } else {
+              // 非编辑状态
+              console.log('物料类别修改');
+              this.materialType.isEdit = true;
+            }
+            break;
+          // 刷新
+          default:
+            console.log('物料类别刷新');
+            if (this.materialType.isEdit) {
+              this.$message({
+                message: '请先保存数据!',
+                type: 'warning'
+              })
+            } else {
+              this.materialType.loading = true;
+              this.getTagList('material_medcine_item', (form) => {
+                this.materialType.form = form;
+                this.getMedcineitemList(this.materialId);
+              });
+            }
+            break;
 
-      console.log('物料类别弹窗关闭前');
-      this.materialType.isEdit ? this.$message({
-        message: '请先保存数据!',
-        type: 'warning'
-      }) : done();
+        }
+      },
+      // 物料类别弹窗关闭前
+      handleCloseTypeDetails(done) {
 
-    },
-    // 保存修改并新增
-    handleSaveAdd() {
-      console.log('保存修改并新增');
-    },
-    // 其他标签页弹窗取消操作
-    handleOtherCancel() {
-      console.log('其他标签页弹窗取消操作');
-      this.optionDialog.show = true;
-      this.optionDialog.op = '修改';
-    },
-    // 其他标签页弹窗保存
-    async handleOtherSave() {
-      console.log('其他标签页弹窗保存', this.activeMainTab);
-      let data = this.otherDeatils.value;
-      console.log(data, 'params');
-      switch (this.activeMainTab) {
-        // 财物信息
-        case 'material_finance':
-          await this.handleSaveFinance(data);
-          break;
-        // 利润中心信息
-        case 'profit_center':
-          await this.handleSaveCenter(data);
-          break;
-        // 采购信息
-        case 'material_purchase':
-          await this.handleSavePurchase(data);
-          break;
-        // 库存信息
-        case 'material_inventory':
-          await this.handleSaveInventoryEdit(data);
-          break;
-        // 计划信息
-        case 'material_plan':
-          await this.handleSavePlan(data);
-          break;
-        // 成本信息
-        case 'material_cost':
-          await this.handleSaveCost(data);
-          break;
-        default: break;
-      }
-      this.handleOtherRefresh();
-    },
-    // 其他页签详情弹窗关闭事件
-    handleCloseOtherDetails(done) {
-      console.log('其他页签详情弹窗关闭事件');
-      // 处于编辑状态
-      if (this.otherDeatils.isEdit) {
-        this.$message({
-          message: '请先退出编辑操作',
+        console.log('物料类别弹窗关闭前');
+        this.materialType.isEdit ? this.$message({
+          message: '请先保存数据!',
           type: 'warning'
-        });
-      } else {
-        done();
-      }
-    },
-    // 折叠菜单改变
-    handleCollapseChange(val) {
-      console.log(val, '折叠菜单改变');
-    },
-    // 更新导入
-    handleUpdateImport() {
-      console.log('更新导入');
-    },
-    // 确认弹窗操作
-    handleComfirmOption() {
-      console.log('确认弹窗操作');
+        }) : done();
 
-      this.optionDialog.show = false;
+      },
+      // 保存修改并新增
+      handleSaveAdd() {
+        console.log('保存修改并新增');
+      },
+      // 其他标签页弹窗取消操作
+      handleOtherCancel() {
+        console.log('其他标签页弹窗取消操作');
+        this.optionDialog.show = true;
+        this.optionDialog.op = '修改';
+      },
+      // 其他标签页弹窗保存
+      async handleOtherSave() {
+        console.log('其他标签页弹窗保存', this.activeMainTab);
+        let data = this.otherDeatils.value;
+        console.log(data, 'params');
+        switch (this.activeMainTab) {
+          // 财物信息
+          case 'material_finance':
+            await this.handleSaveFinance(data);
+            break;
+          // 利润中心信息
+          case 'profit_center':
+            await this.handleSaveCenter(data);
+            break;
+          // 采购信息
+          case 'material_purchase':
+            await this.handleSavePurchase(data);
+            break;
+          // 库存信息
+          case 'material_inventory':
+            await this.handleSaveInventoryEdit(data);
+            break;
+          // 计划信息
+          case 'material_plan':
+            await this.handleSavePlan(data);
+            break;
+          // 成本信息
+          case 'material_cost':
+            await this.handleSaveCost(data);
+            break;
+          default:
+            break;
+        }
+        this.handleOtherRefresh();
+      },
+      // 其他页签详情弹窗关闭事件
+      handleCloseOtherDetails(done) {
+        console.log('其他页签详情弹窗关闭事件');
+        // 处于编辑状态
+        if (this.otherDeatils.isEdit) {
+          this.$message({
+            message: '请先退出编辑操作',
+            type: 'warning'
+          });
+        } else {
+          done();
+        }
+      },
+      // 折叠菜单改变
+      handleCollapseChange(val) {
+        console.log(val, '折叠菜单改变');
+      },
+      // 更新导入
+      handleUpdateImport() {
+        console.log('更新导入');
+      },
+      // 确认弹窗操作
+      handleComfirmOption() {
+        console.log('确认弹窗操作');
 
-      // 取消基本信息修改
-      if (this.updateButtonGroup) {
-        this.updateButtonGroup = false;
-        this.handleRest();
+        this.optionDialog.show = false;
 
-      }
+        // 取消基本信息修改
+        if (this.updateButtonGroup) {
+          this.updateButtonGroup = false;
+          this.handleRest();
 
-      // 取消其他主页签详情弹窗修改
-      if (this.otherDeatils.isEdit) {
-        this.otherDeatils.isEdit = false;
-        this.handleOtherRefresh();
-      }
+        }
 
-      // 取消维护新版本修改
-      if (this.maintainNewVersion) {
-        console.log('取消维护新版本修改');
-        this.maintainNewVersion = false;
-        this.handleRefresh();
-      }
-    },
-    // 参照弹窗过滤
-    handleFilterRefer() {
-      // this.MoreDataDialog.key =
-      console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
+        // 取消其他主页签详情弹窗修改
+        if (this.otherDeatils.isEdit) {
+          this.otherDeatils.isEdit = false;
+          this.handleOtherRefresh();
+        }
 
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+        // 取消维护新版本修改
+        if (this.maintainNewVersion) {
+          console.log('取消维护新版本修改');
+          this.maintainNewVersion = false;
+          this.handleRefresh();
+        }
+      },
+      // 参照弹窗过滤
+      handleFilterRefer() {
+        // this.MoreDataDialog.key =
+        console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
 
-    },
-    // 操作提示弹窗关闭
-    handleOptionCancal() {
-      this.optionDialog.show = false;
-      this.otherDeatils.isEdit = true;
-    },
-    // 树形节点选择
-    handleNodeClick(e) {
-      console.log(e, '树形节点选择', this.MoreDataDialog.target);
-      // let node = { ...e, name: e.label }
-      this.MoreDataDialog.value = e;
-    },
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
 
-    // 修改-更多数据表格——选择行
-    handleCurentRow(row) {
-      console.log(row, '修改-更多数据表格——选择行');
-      this.MoreDataDialog.value = row;
-    },
-    // 参照弹窗确认
-    handleConfirmRefer() {
+      },
+      // 操作提示弹窗关闭
+      handleOptionCancal() {
+        this.optionDialog.show = false;
+        this.otherDeatils.isEdit = true;
+      },
+      // 树形节点选择
+      handleNodeClick(e) {
+        console.log(e, '树形节点选择', this.MoreDataDialog.target);
+        // let node = { ...e, name: e.label }
+        this.MoreDataDialog.value = e;
+      },
 
-      let _this = this;
-      console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
+      // 修改-更多数据表格——选择行
+      handleCurentRow(row) {
+        console.log(row, '修改-更多数据表格——选择行');
+        this.MoreDataDialog.value = row;
+      },
+      // 参照弹窗确认
+      handleConfirmRefer() {
 
-      let confirm = true;
+        let _this = this;
+        console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
 
-      if (this.MoreDataDialog.target.name == 'basicData') {
-        //  基本信息
-        this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        let confirm = true;
 
-        this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+        if (this.MoreDataDialog.target.name == 'basicData') {
+          //  基本信息
+          this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
+          this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-        console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
-        // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
-        if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
+          console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
-          this.basicData.value['businessDepartment'] = '';
-          this.basicData.value['businessDepartmentName'] = '';
+          console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
+          // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+          if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
 
-        }
+            this.basicData.value['businessDepartment'] = '';
+            this.basicData.value['businessDepartmentName'] = '';
 
+          }
 
-      } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
-        //  医药信息
-        this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
-        this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+          //  医药信息
+          this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
+          this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-        console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
+          console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
-      } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
+          console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
 
-        //  其他页签
-        this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
 
-        this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+          //  其他页签
+          this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
+          this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-      } else if (this.MoreDataDialog.target.name == 'materialType') {
+          console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
 
-        // 物料类别
-        console.log('确认时选择的数据', this.MoreDataDialog.value);
-
-        this.materialType.value = this.materialType.value.map(m => {
-          if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
-            (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
-          ) {
-            let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
-            console.log(drug, 'drug------------------------------------');
-            if (drug.length) {
-              _this.$message({
-                message: '不能维护相同的物料类别!',
-                type: 'warning'
-              });
-              confirm = false;
-            } else {
-              m.drugId = _this.MoreDataDialog.value['id'];
-              m.drugCode = _this.MoreDataDialog.value['code'];
-              m.drugName = _this.MoreDataDialog.value['name'];
+        } else if (this.MoreDataDialog.target.name == 'materialType') {
+
+          // 物料类别
+          console.log('确认时选择的数据', this.MoreDataDialog.value);
+
+          this.materialType.value = this.materialType.value.map(m => {
+            if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
+              (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
+            ) {
+              let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
+              console.log(drug, 'drug------------------------------------');
+              if (drug.length) {
+                _this.$message({
+                  message: '不能维护相同的物料类别!',
+                  type: 'warning'
+                });
+                confirm = false;
+              } else {
+                m.drugId = _this.MoreDataDialog.value['id'];
+                m.drugCode = _this.MoreDataDialog.value['code'];
+                m.drugName = _this.MoreDataDialog.value['name'];
+              }
             }
-          }
-          return m;
-        })
+            return m;
+          })
 
-        console.log(this.materialType.value, '修改之后-----this.materialType.value');
-      }
+          console.log(this.materialType.value, '修改之后-----this.materialType.value');
+        }
 
-      if (confirm) {
-        // this.count++;
-        this.refer++;
+        if (confirm) {
+          // this.count++;
+          this.refer++;
+          this.MoreDataDialog.show = false;
+          this.MoreDataDialog.key = '';
+          this.MoreDataDialog.value = {};
+        }
+      },
+      // 取消-关闭参照弹窗
+      handleConcalRefer() {
+        console.log('关闭参照弹窗');
         this.MoreDataDialog.show = false;
         this.MoreDataDialog.key = '';
-        this.MoreDataDialog.value = {};
-      }
-    },
-    // 取消-关闭参照弹窗
-    handleConcalRefer() {
-      console.log('关闭参照弹窗');
-      this.MoreDataDialog.show = false;
-      this.MoreDataDialog.key = '';
-    },
-    // 关闭参照弹窗前
-    handleCloseRefer(done) {
-      this.MoreDataDialog.key = '';
-      done();
-    },
+      },
+      // 关闭参照弹窗前
+      handleCloseRefer(done) {
+        this.MoreDataDialog.key = '';
+        done();
+      },
 
 
-    // 删除利润中心信息
-    handledDelCenter(ids) {
-      console.log('删除利润中心信息');
-      materialApi.delCenter(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除库存信息
-    handleDelInventory(ids) {
-      console.log('删除库存信息');
-      materialApi.delInventory(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除成本信息
-    handleDelCost(ids) {
-      console.log('删除成本信息');
-      materialApi.delCost(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除计划信息
-    handleDelPlan(ids) {
-      console.log('删除计划信息');
-      materialApi.delPlan(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
+      // 删除利润中心信息
+      handledDelCenter(ids) {
+        console.log('删除利润中心信息');
+        materialApi.delCenter(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除库存信息
+      handleDelInventory(ids) {
+        console.log('删除库存信息');
+        materialApi.delInventory(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除成本信息
+      handleDelCost(ids) {
+        console.log('删除成本信息');
+        materialApi.delCost(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除计划信息
+      handleDelPlan(ids) {
+        console.log('删除计划信息');
+        materialApi.delPlan(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
 
-      })
-    },
-    // 删除财物信息
-    handleDelFinance(ids) {
-      console.log('删除财物信息');
-      materialApi.delFinance(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除采购信息
-    handledelPurchase(ids) {
-      console.log('删除采购信息');
-      materialApi.delPurchase(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      });
-    },
+        })
+      },
+      // 删除财物信息
+      handleDelFinance(ids) {
+        console.log('删除财物信息');
+        materialApi.delFinance(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除采购信息
+      handledelPurchase(ids) {
+        console.log('删除采购信息');
+        materialApi.delPurchase(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        });
+      },
 
 
-    // 保存物料以及相关页签
-    handleSaveMaterial(cb) {
-      let param = {
-        ...this.basicData.value,
-        materialMedcine: this.medcineData.value,
-        materialMedcineItem: {}
-      };
-      // diCode
-      param.diCode = param.diCode.replace(/ /g, '');
-      console.log(param, '保存物料以及相关页签param');
-      materialApi.insertMaterialInfo(param).then(res => {
-
-        console.log(res, '保存物料以及相关页签');
-        if (res.code == 200) cb();
-      }).catch((error) => {
-        this.loading = false;
-      })
-    },
-    // 保存财务信息——单个数据
-    handleSaveFinance(data) {
-      console.log(data, '保存财务信息——单个数据');
-      materialApi.financeEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
-    // 保存利润中心信息
-    handleSaveCenter(data) {
-      console.log(data, '保存利润中心信息');
-      materialApi.centerEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
-    // 保存采购信息
-    handleSavePurchase(data) {
-      console.log(data, '保存采购信息');
-      materialApi.purchaseEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
-    // 保存库存信息
-    handleSaveInventoryEdit(data) {
-      console.log(data, '保存库存信息');
-      materialApi.inventoryEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
-    // 保存计划信息
-    handleSavePlan(data) {
-      console.log(data, '保存计划信息');
-      materialApi.planEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
-    // 保存成本信息
-    handleSaveCost(data) {
-      console.log(data, '保存成本信息');
-      materialApi.costEdit(data).then(res => {
-        if (res.code == 200) {
-          this.otherDeatils.isEdit = false;
-        }
-      })
-    },
+      // 保存物料以及相关页签
+      handleSaveMaterial(cb) {
+        let param = {
+          ...this.basicData.value,
+          materialMedcine: this.medcineData.value,
+          materialMedcineItem: {}
+        };
+        // diCode
+        param.diCode = param.diCode.replace(/ /g, '');
+        console.log(param, '保存物料以及相关页签param');
+        materialApi.insertMaterialInfo(param).then(res => {
+
+          console.log(res, '保存物料以及相关页签');
+          if (res.code == 200) cb();
+        }).catch((error) => {
+          this.loading = false;
+        })
+      },
+      // 保存财务信息——单个数据
+      handleSaveFinance(data) {
+        console.log(data, '保存财务信息——单个数据');
+        materialApi.financeEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
+      // 保存利润中心信息
+      handleSaveCenter(data) {
+        console.log(data, '保存利润中心信息');
+        materialApi.centerEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
+      // 保存采购信息
+      handleSavePurchase(data) {
+        console.log(data, '保存采购信息');
+        materialApi.purchaseEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
+      // 保存库存信息
+      handleSaveInventoryEdit(data) {
+        console.log(data, '保存库存信息');
+        materialApi.inventoryEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
+      // 保存计划信息
+      handleSavePlan(data) {
+        console.log(data, '保存计划信息');
+        materialApi.planEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
+      // 保存成本信息
+      handleSaveCost(data) {
+        console.log(data, '保存成本信息');
+        materialApi.costEdit(data).then(res => {
+          if (res.code == 200) {
+            this.otherDeatils.isEdit = false;
+          }
+        })
+      },
 
 
-    // 重新加载
-    async handleRest() {
-      this.loading = true;
-      // 基本信息
-      await this.getTagList('material', (form) => {
-        this.basicData.form = form;
-        this.getMaterialDetails(this.materialId, 'material');
-      })
-      // 医疗行业
-      await this.getTagList('material_medcine', (form) => {
-        form.forEach((item) => {
-          this.medcineData.value[item.prop] = ''
+      // 重新加载
+      async handleRest() {
+        this.loading = true;
+        // 基本信息
+        await this.getTagList('material', (form) => {
+          this.basicData.form = form;
+          this.getMaterialDetails(this.materialId, 'material');
+        })
+        // 医疗行业
+        await this.getTagList('material_medcine', (form) => {
+          form.forEach((item) => {
+            this.medcineData.value[item.prop] = ''
+          })
+          this.medcineData.form = form;
+          this.getMedcineDetails(this.materialId, 'material_medcine');
         })
-        this.medcineData.form = form;
-        this.getMedcineDetails(this.materialId, 'material_medcine');
-      })
+
+      },
 
     },
 
-  },
+    watch: {
+      // 监听主标签修改标识,控制其他标签是否禁止点击
+      'updateButtonGroup': function (nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        this.detailsTabs = this.detailsTabs.map(item => {
+          item['disabled'] = nVal;
+          return item;
+        })
+      },
+      'maintainNewVersion': function (nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        this.detailsTabs = this.detailsTabs.map(item => {
+          item['disabled'] = nVal;
+          return item;
+        })
+      },
 
-  watch: {
-    // 监听主标签修改标识,控制其他标签是否禁止点击
-    'updateButtonGroup': function (nVal, oVal) {
-      console.log(nVal, 'nVal', oVal, 'oVal');
-      this.detailsTabs = this.detailsTabs.map(item => {
-        item['disabled'] = nVal;
-        return item;
-      })
-    },
-    'maintainNewVersion': function (nVal, oVal) {
-      console.log(nVal, 'nVal', oVal, 'oVal');
-      this.detailsTabs = this.detailsTabs.map(item => {
-        item['disabled'] = nVal;
-        return item;
-      })
     },
 
-  },
-
-  created() {
-    console.log(this, 'created');
-    // 基本信息
-    this.handleRest();
-    if (window.name === '') {
-      console.log('页面首次被加载')
-      this.$route.query.isEdit && this.handleBasicEdit();
-    } else {
-      console.log('页面被刷新')
-    }
+    created() {
+      console.log(this, 'created');
+      // 基本信息
+      this.handleRest();
+      if (window.name === '') {
+        console.log('页面首次被加载')
+        this.$route.query.isEdit && this.handleBasicEdit();
+      } else {
+        console.log('页面被刷新')
+      }
 
+    }
   }
-}
 </script>
 
 <style lang="scss">
-.material-details {
-  padding: 12px;
-  height: calc(100vh - 158px);
-  box-sizing: border-box;
-
-  .el-card__body {
-    height: calc(100vh - 160px);
-    box-sizing: border-box;
+  .material-details {
     padding: 12px;
-    overflow-y: auto;
-    overflow-x: auto;
+    height: calc(100vh - 158px);
+    box-sizing: border-box;
 
-    .el-select {
-      width: 100%;
+    .el-card__body {
+      height: calc(100vh - 160px);
+      box-sizing: border-box;
+      padding: 12px;
+      overflow-y: auto;
+      overflow-x: auto;
+
+      .el-select {
+        width: 100%;
+      }
     }
-  }
 
-  .md-content {
-    margin-top: 12px;
-    // height: calc(100vh - 260px);
-    height: calc(100vh - 228px);
-    box-sizing: border-box;
+    .md-content {
+      margin-top: 12px;
+      // height: calc(100vh - 260px);
+      height: calc(100vh - 228px);
+      box-sizing: border-box;
 
 
+      .md-basic {
+        overflow: auto;
 
-    .md-basic {
-      overflow: auto;
+        .md-main {
+          // height: calc(100vh - 625px);
+          margin-bottom: 10px;
 
-      .md-main {
-        // height: calc(100vh - 625px);
-        margin-bottom: 10px;
+          .el-table__body {
+            // height: calc(100vh - 300px);
+          }
 
-        .el-table__body {
-          // height: calc(100vh - 300px);
+          .el-form {
+            max-height: 200px;
+            overflow-y: auto;
+            overflow-x: hidden;
+
+            .el-checkbox {
+              padding: 0 58%;
+            }
+          }
         }
 
-        .el-form {
-          max-height: 200px;
+        .md-vice-content {
+          height: 140px;
           overflow-y: auto;
           overflow-x: hidden;
-
-          .el-checkbox {
-            padding: 0 58%;
-          }
         }
       }
 
-      .md-vice-content {
-        height: 140px;
-        overflow-y: auto;
-        overflow-x: hidden;
-      }
-    }
-
-    .md-auditInfo {
+      .md-auditInfo {
 
-      .el-divider--horizontal {
-        margin: 20px 0px 15px;
+        .el-divider--horizontal {
+          margin: 20px 0px 15px;
+        }
       }
+
     }
 
-  }
+    // .md-content>.el-tabs {
+    //   height: calc(100vh - 280px);
+    // }
 
-  // .md-content>.el-tabs {
-  //   height: calc(100vh - 280px);
-  // }
+    .otherDialog {
 
-  .otherDialog {
+      .el-collapse-item__content {
+        padding-bottom: 12px;
+      }
 
-    .el-collapse-item__content {
-      padding-bottom: 12px;
-    }
+      .el-form {
+        .el-checkbox {
+          width: 100%;
+          padding: 0 10%;
+        }
+      }
 
-    .el-form {
-      .el-checkbox {
-        width: 100%;
-        padding: 0 10%;
+      .el-dialog__body {
+        padding: 12px 20px;
+        height: 80%;
+        overflow: auto;
+      }
+
+      .od-msg {
+        max-height: 220px;
+        box-sizing: border-box;
+        overflow-y: auto;
+        overflow-x: hidden;
       }
-    }
 
-    .el-dialog__body {
-      padding: 12px 20px;
-      height: 80%;
-      overflow: auto;
+      // .el-dialog__header {
+      //   background-color: rgb(244, 244, 244);
+      // }
     }
 
-    .od-msg {
-      max-height: 220px;
-      box-sizing: border-box;
-      overflow-y: auto;
-      overflow-x: hidden;
+    .el-dialog__header {
+      background-color: rgb(244, 244, 244);
     }
 
-    // .el-dialog__header {
-    //   background-color: rgb(244, 244, 244);
-    // }
-  }
+    .MoreDataDialog {
 
-  .el-dialog__header {
-    background-color: rgb(244, 244, 244);
-  }
+      .el-dialog__body {
+        height: 500px;
+        padding: 20px 15px;
 
-  .MoreDataDialog {
+        .el-table {
+          margin-top: 10px;
 
-    .el-dialog__body {
-      height: 500px;
-      padding: 20px 15px;
+          .el-table__body-wrapper {
+            height: 300px;
+            overflow-y: auto;
+            overflow-x: hidden;
+          }
+        }
 
-      .el-table {
-        margin-top: 10px;
+        .el-pagination {
+          text-align: right;
+          margin-top: 5px;
+        }
 
-        .el-table__body-wrapper {
-          height: 300px;
-          overflow-y: auto;
+        .referTree {
+          height: 390px;
           overflow-x: hidden;
+          overflow-y: auto;
         }
       }
 
-      .el-pagination {
-        text-align: right;
-        margin-top: 5px;
-      }
 
-      .referTree {
-        height: 390px;
-        overflow-x: hidden;
-        overflow-y: auto;
+      .more-button {
+        margin-top: 10px;
+        text-align: right;
       }
     }
 
 
-
-    .more-button {
-      margin-top: 10px;
-      text-align: right;
-    }
   }
 
+  // 修改下拉框样式
+  #selected {
+    /*很关键:将默认的select选择框样式清除*/
+    //   appearance: none;
+    //   -moz-appearance: none;
+    //   -webkit-appearance: none;
+    //   /*为下拉小箭头留出一点位置,避免被文字覆盖*/
+    //   padding-right: 14px;
+    //   /*自定义图片*/
+    //   background: url("../images/search@2x.png") no-repeat scroll right center transparent;
+    //   /*自定义图片的大小*/
+    //   background-size: 16px 16px;
+
+    //   /*将小箭头的样式去去掉*/
+    //   .el-icon-arrow-up:before {
+    //     content: '';
+    //   }
+    // }
 
-}
-
-// 修改下拉框样式
-#selected {
-  /*很关键:将默认的select选择框样式清除*/
-  //   appearance: none;
-  //   -moz-appearance: none;
-  //   -webkit-appearance: none;
-  //   /*为下拉小箭头留出一点位置,避免被文字覆盖*/
-  //   padding-right: 14px;
-  //   /*自定义图片*/
-  //   background: url("../images/search@2x.png") no-repeat scroll right center transparent;
-  //   /*自定义图片的大小*/
-  //   background-size: 16px 16px;
-
-  //   /*将小箭头的样式去去掉*/
-  //   .el-icon-arrow-up:before {
-  //     content: '';
-  //   }
-  // }
-
-}
+  }
 </style>
 
 <style scoped>
-.md-content>>>.el-form-item,
-.otherDialog>>>.el-form-item {
-  margin-bottom: 10px;
-}
-
-.md-content>>>.el-tabs--border-card>.el-tabs__content {
-  padding-bottom: 8px;
-}
-
-.md-content .md-auditInfo>>>.el-form-item {
-  margin-bottom: 0px;
-}
-
-.md-main>>>.el-form-item,
-.md-vice>>>.el-form-item,
-.od-msg>>>.el-form-item {
-  width: 100%;
-  box-sizing: border-box;
-}
-
-.md-main>>>.el-form-item__label,
-.md-vice>>>.el-form-item__label,
-.od-msg>>>.el-form-item__label {
-  width: 40%;
-}
-
-.od-msg>>>.el-checkbox__input {
-  width: 15%;
-}
-
-.md-main>>>.el-form-item__content,
-.md-vice>>>.el-form-item__content,
-.od-msg>>>.el-form-item__content {
-  width: 60%;
-  box-sizing: border-box;
-  height: 36px;
-}
-
-.od-msg>>>.el-checkbox__label {
-  width: 85%;
-  box-sizing: border-box;
-}
-
-
-.od-msg-checkedbx>>>.el-form-item__content {
-  width: 80%;
-  box-sizing: border-box;
-}
-
-.od-msg-checkedbx>>>.el-checkbox {
-  width: 75%;
-  box-sizing: border-box;
-}
-
-.md-content>>>.el-form-item__label,
-.otherDialog>>>.el-form-item__label,
-.od-msg>>>.el-form-item__label,
-.od-msg>>>.el-checkbox__label {
-  font-weight: normal;
-  /* text-align: left;
-  width: 28%; */
-  white-space: nowrap;
-  /* IE6 需要定义宽度 */
-  overflow: hidden;
-
-  -o-text-overflow: ellipsis;
-  /* Opera */
-  text-overflow: ellipsis;
-  /* IE, Safari (WebKit) */
-  /* -moz-binding: url('ellipsis.xml#ellipsis'); */
-  /* Firefox */
-}
-
-.otherDialog>>>.el-form-item__label {
-  font-size: 12px;
-}
-
-.md-main>>>.material-table {
-  height: 100%;
-}
-
-.md-vice>>>.material-table {
-  height: 140px;
-  overflow-y: auto;
-  overflow-x: auto;
-}
-
->>>.referTree {
-  margin-top: 10px;
-}
-
-/* .md-main>>>.el-table .el-table__body {
-  height: calc(100vh - 300px);
-} */
-
-/* .otherDialog>>>.el-collapse-item__content {
-  padding-bottom: 12px;
-}
-
-.otherDialog>>>.el-dialog__body {
-  padding: 12px 20px;
-} */
+  .md-content >>> .el-form-item,
+  .otherDialog >>> .el-form-item {
+    margin-bottom: 10px;
+  }
+
+  .md-content >>> .el-tabs--border-card > .el-tabs__content {
+    padding-bottom: 8px;
+  }
+
+  .md-content .md-auditInfo >>> .el-form-item {
+    margin-bottom: 0px;
+  }
+
+  .md-main >>> .el-form-item,
+  .md-vice >>> .el-form-item,
+  .od-msg >>> .el-form-item {
+    width: 100%;
+    box-sizing: border-box;
+  }
+
+  .md-main >>> .el-form-item__label,
+  .md-vice >>> .el-form-item__label,
+  .od-msg >>> .el-form-item__label {
+    width: 40%;
+  }
+
+  .od-msg >>> .el-checkbox__input {
+    width: 15%;
+  }
+
+  .md-main >>> .el-form-item__content,
+  .md-vice >>> .el-form-item__content,
+  .od-msg >>> .el-form-item__content {
+    width: 60%;
+    box-sizing: border-box;
+    height: 36px;
+  }
+
+  .od-msg >>> .el-checkbox__label {
+    width: 85%;
+    box-sizing: border-box;
+  }
+
+
+  .od-msg-checkedbx >>> .el-form-item__content {
+    width: 80%;
+    box-sizing: border-box;
+  }
+
+  .od-msg-checkedbx >>> .el-checkbox {
+    width: 75%;
+    box-sizing: border-box;
+  }
+
+  .md-content >>> .el-form-item__label,
+  .otherDialog >>> .el-form-item__label,
+  .od-msg >>> .el-form-item__label,
+  .od-msg >>> .el-checkbox__label {
+    font-weight: normal;
+    /* text-align: left;
+    width: 28%; */
+    white-space: nowrap;
+    /* IE6 需要定义宽度 */
+    overflow: hidden;
+
+    -o-text-overflow: ellipsis;
+    /* Opera */
+    text-overflow: ellipsis;
+    /* IE, Safari (WebKit) */
+    /* -moz-binding: url('ellipsis.xml#ellipsis'); */
+    /* Firefox */
+  }
+
+  .otherDialog >>> .el-form-item__label {
+    font-size: 12px;
+  }
+
+  .md-main >>> .material-table {
+    height: 100%;
+  }
+
+  .md-vice >>> .material-table {
+    height: 140px;
+    overflow-y: auto;
+    overflow-x: auto;
+  }
+
+  >>> .referTree {
+    margin-top: 10px;
+  }
+
+  /* .md-main>>>.el-table .el-table__body {
+    height: calc(100vh - 300px);
+  } */
+
+  /* .otherDialog>>>.el-collapse-item__content {
+    padding-bottom: 12px;
+  }
+
+  .otherDialog>>>.el-dialog__body {
+    padding: 12px 20px;
+  } */
 </style>

+ 520 - 391
src/views/material/changeApply/add.vue

@@ -31,8 +31,8 @@
             <el-col :span="8">
               <el-form-item label="医药物料" prop="medicineMaterial">
                 <el-select v-model="basicForm.medicineMaterial" placeholder="医药物料" clearable :disabled="disable"
-                  @change="controlMedic">
-                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+                           @change="controlMedic">
+                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -59,8 +59,8 @@
             <el-col :span="8">
               <el-form-item label="生产厂家/代理人" prop="factory">
                 <el-select ref="factoryOrman" v-model="basicForm.factory" placeholder="生产厂家/代理人" clearable
-                  :disabled="disable" @focus="chooseFactory">
-                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id" />
+                           :disabled="disable" @focus="chooseFactory">
+                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id"/>
                 </el-select>
                 <!-- <el-input :disabled="disable" v-model="basicForm.factory">
                   <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
@@ -78,7 +78,7 @@
               <el-form-item label="存储条件" prop="storageConditions">
                 <el-select v-model="basicForm.storageConditions" placeholder="存储条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_storage_condition" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -86,7 +86,7 @@
               <el-form-item label="运输条件" prop="transportCondition">
                 <el-select v-model="basicForm.transportCondition" placeholder="运输条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_conditions_carriage" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -98,6 +98,25 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
+              <el-form-item label="业务线" prop="businessLine"
+                            :rules="{ required: isOneClass, message: '骨科、介入、检验、普耗、设备类物料产线必须输入对应的业务线', trigger: 'blur' }">
+                <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable :disabled="disable"
+                           @focus="chooseLine">
+                  <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="生产许可证/经营许可证/备案号" prop="remark">
+                <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="DI码" prop="remark">
+                <el-input :disabled="disable" v-model="basicForm.diCode"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
               <el-form-item label="备注" prop="remark">
                 <el-input :disabled="disable" v-model="basicForm.remark"></el-input>
               </el-form-item>
@@ -133,10 +152,11 @@
         <el-form :model="basicForm2" ref="basic2" label-width="160px">
           <el-row :gutter="20">
             <el-col :span="8">
-              <el-form-item label="药品" prop="drug">
+              <el-form-item label="药品" prop="drug"
+                            :rules="{ required: !isControl, message: '请选择是否药品', trigger: 'change' }">
                 <el-select v-model="basicForm2.drug" placeholder="请选择" clearable :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.sys_medicine" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -148,9 +168,9 @@
             <el-col :span="8">
               <el-form-item label="医疗器械" prop="medicalDevices">
                 <el-select v-model="basicForm2.medicalDevices" placeholder="请选择" clearable
-                  :disabled="disable || isControl">
+                           :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.medical_instruments" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -159,9 +179,18 @@
             <el-col :span="8">
               <el-form-item label="养护类型" prop="maintenanceType">
                 <el-select v-model="basicForm2.maintenanceType" placeholder="请选择" clearable
-                  :disabled="disable || isControl">
+                           :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.curing_type" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="剂型" prop="dosageFrom"
+                            :rules="{ required: !isControl, message: '请选择剂型', trigger: 'change' }">
+                <el-select ref="doses" v-model="basicForm2.dosageFrom" placeholder="请选择" clearable
+                           :disabled="disable || isControl" @focus="chooseDose">
+                  <el-option v-for="item in doseOptions" :key="item.id" :label="item.name" :value="item.id"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -177,7 +206,7 @@
         </el-row> -->
         <!-- <el-row>
           <el-col :span="12">
-            <el-table 
+            <el-table
             :data="basicForm2.medicineTypeChanges"
             class="request-table"
             @selection-change="handleSelectionChange"
@@ -205,9 +234,9 @@
 
       <el-tab-pane label="修改记录" name="third">
         <el-table :data="basicForm.changeRecords" class="request-table">
-          <el-table-column label="字段名称" align="center" prop="pageCondtion" />
-          <el-table-column label="变更前" align="center" prop="beforeChangeValue" />
-          <el-table-column label="变更后" align="center" prop="afterChangeValue" />
+          <el-table-column label="字段名称" align="center" prop="pageCondtion"/>
+          <el-table-column label="变更前" align="center" prop="beforeChangeValue"/>
+          <el-table-column label="变更后" align="center" prop="afterChangeValue"/>
         </el-table>
       </el-tab-pane>
 
@@ -275,7 +304,8 @@
     <div class="btn_group">
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="save"
-          v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+                   v-if="pageStu == 'add' || pageStu == 'edit'">保存
+        </el-button>
       </el-col>
       <el-col :span="1.5" style="margin: 0 10px;">
         <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
@@ -285,404 +315,503 @@
       </el-col>
     </div>
 
-    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true" />
+    <popDialog ref="contractSelect" @doSubmit="selectionsToInput" :selectData="selectData" :single="true"/>
 
-    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true" />
+    <factory ref="factory" @doSubmit="acceptFactory" :selectData="selectData2" :single="true"/>
 
-    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true" />
+    <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
+
+    <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
+    <serviceline ref="line" @doSubmit="acceptLine" :selectData="selectData8" :single="true"/>
   </div>
 </template>
 
 <script>
-import popDialog from '@/components/PopDialog/index.vue'
-import factory from '@/components/PopDialog/productFactory.vue'
-import { addChangeList, getMaterialDetails, getChangeDetails, editChangeList } from '@/api/changeApply/basic'
-// 生产厂商/代理人调用用于回显
-import { getProductFactory } from '@/api/changeApply/basic'
-// 四级分类
-import fourClass from '@/components/PopDialog/fourClass.vue'
-// 调用物料分类详情接口用于数据回显
-import { getDetail } from '@/api/classify/basic';
-export default {
-  name: 'applyAdd',
-  dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
-  components: {
-    popDialog,
-    factory,
-    fourClass
-  },
-  props: ['pageStu', 'row', 'disable'],
-  model: {
-    prop: 'isList',
-    event: 'jugislist'
-  },
-  data() {
-    return {
-      factoryOptions: [],
-      tabValue: 'first',
-      isControl: true,
-      basicForm: {
-        code: '',
-        orgId: '德荣集团',
-        // 物料id
-        materialId: '',
-        materialCode: '',
-        materialName: '',
-        materialClassifyId: '',
-        medicineMaterial: '2',
-        oneClass: '',
-        twoClass: '',
-        threeClass: '',
-        fourClass: '',
-        specification: '',
-        model: '',
-        factory: '',
-        registrant: '',
-        storageConditions: '',
-        transportCondition: '',
-        leadTime: '',
-        remark: '',
-        // 修改记录
-        changeRecords: [],
-        // 单据信息字段
-        createBy: '',
-        applicationTime: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: '',
-        approver: '',
-        approvalTime: '',
-        status: ''
-      },
-      options: [{
-        value: '0',
-        label: '是'
-      }, {
-        value: '2',
-        label: '否'
-      }],
-      statusOptions: [{
-        value: '0', label: '未提交'
-      }, {
-        value: '1', label: '审批中'
-      }, {
-        value: '2', label: '已完成'
-      }, {
-        value: '3', label: '已驳回'
-      },],
-      basicRules: {
-        materialCode: [{ required: true, message: '请选择物料编码', trigger: 'blur' }],
-        materialName: [{ required: true, message: '请填写物料名称', trigger: 'blur' }],
-        specification: [{ required: true, message: '请填写规格', trigger: 'blur' }],
-        materialClassifyId: [{ required: true, message: '请选择物料分类', trigger: 'blur' }],
-        // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
-        factory: [{ required: true, message: '请选择生产厂家/代理人', trigger: 'blur' }],
-        registrant: [{ required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur' }],
-        storageConditions: [{ required: true, message: '请选择存储条件', trigger: 'blur' }],
-        // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
-        leadTime: [{ required: true, message: '请填写交货周期', trigger: 'blur' }],
-      },
-      basicForm2: {
-        drug: '',
-        registrationNo: '',
-        medicalDevices: '',
-        maintenanceType: '',
-        // 医药属性子表
-        // medicineTypeChanges:[
-        // ],
-      },
-      // tableList: [],
-      // 子表选中
-      ids: [],
-      // 弹窗
-      name: '',
-      selectData: [],
-      selectData2: [],
-      selectData3: []
-    }
-  },
-  // watch: {
-  //   value: {
-  //     handler (newVal) {
-  //       this.selectData = []
-  //       if (newVal) {
-  //         newVal.split(',').forEach((id) => { // 回显拿数据
-  //           this.contractService.queryById(id).then(({data}) => {
-  //             if (data && data.id !== '') {
-  //               this.selectData.push(data)
-  //             }
-  //           })
-  //         })
-  //       }
-  //     },
-  //     immediate: true,
-  //     deep: false
-  //   },
-  //   selectData: {
-  //     handler (newVal) {
-  //       this.name = newVal.map(contract => contract.contractName).join(',')
-  //     },
-  //     immediate: false,
-  //     deep: false
-  //   }
-  // },
-  mounted() {
-    this.$nextTick(() => {
-      // console.log('页面状态',this.pageStu)
-      if (this.pageStu == 'check') {
-        // alert('详情页面:')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
-        this.getDetails(this.row)
-        // 生产厂家代理人用于回显
-        if (this.row.factory) {
-          this.getFactoryDetails(this.row.factory)
-        }
-      } else if (this.pageStu == 'edit') {
-        // alert('修改页面')
-        console.log('页面状态', this.pageStu)
-        console.log('数据', this.row)
-        this.getDetails(this.row)
-        // 控制医药属性是否能够填写
-        if (this.row.medicineMaterial == '0') {
-          this.isControl = false
-        } else {
-          this.isControl = true
-        }
-        // 生产厂家代理人用于回显
-        if (this.row.factory) {
-          this.getFactoryDetails(this.row.factory)
-        }
-      } else if (this.pageStu == 'add') {
-        // alert('新增页面')
-        console.log('页面状态', this.pageStu)
-      }
-    })
-  },
-  methods: {
-    // 生产厂家/代理人用于回显
-    getFactoryDetails(id) {
-      getProductFactory({ id: id }).then(res => {
-        if (res.code === 200) {
-          this.factoryOptions = res.data.tableBody
-        }
-      })
-    },
-    // 选择是否医药物料时控制医药属性
-    controlMedic(val) {
-      console.log('val', val)
-      if (val == '0') {
-        this.isControl = false
-      } else {
-        this.basicForm2.drug = ''
-        this.basicForm2.registrationNo = ''
-        this.basicForm2.medicalDevices = ''
-        this.basicForm2.maintenanceType = ''
-        this.isControl = true
-      }
-    },
-    handleClick(tab, event) {
-      console.log(tab, event);
-      console.log('页面状态', this.pageStu)
-    },
-    // 如果是详情进入,则调用详情接口
-    getDetails(row) {
-      getChangeDetails(row.id).then(res => {
-        if (res.code === 200) {
-          this.basicForm = res.data
-          if (res.data.medicineChange) {
-            this.basicForm2 = res.data.medicineChange
-          }
-        }
-      })
-    },
-    save() {
-      // alert('保存传status:0')
-      let sparams = { ...this.basicForm, ...{ status: 0 } }
-      sparams.medicineChange = this.basicForm2
-      console.log('保存参数', sparams)
-      this.$refs['basic'].validate((valid) => {
-        if (valid) {
-          addChangeList(sparams).then(res => {
-            if (res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: 'success'
-              });
-              this.back()
-            }
-          })
-        }
-      })
+  import popDialog from '@/components/PopDialog/index.vue'
+  import factory from '@/components/PopDialog/productFactory.vue'
+  import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic'
+  import {getDose, getLine} from '@/api/requisition/basic'
+  // 生产厂商/代理人调用用于回显
+  import {getProductFactory} from '@/api/changeApply/basic'
+  // 四级分类
+  import fourClass from '@/components/PopDialog/fourClass.vue'
+  import dose from '@/components/PopDialog/dose.vue'
+  import serviceline from '@/components/PopDialog/serviceline.vue'
+  // 调用物料分类详情接口用于数据回显
+  import {getDetail} from '@/api/classify/basic';
+
+  export default {
+    name: 'applyAdd',
+    dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
+    components: {
+      popDialog,
+      factory,
+      dose,
+      serviceline,
+      fourClass
     },
-    submit() {
-      // alert('提交传status:1')
-      let sparams = { ...this.basicForm, ...{ status: 1 } }
-      sparams.medicineChange = this.basicForm2
-      console.log('提交参数', sparams)
-      this.$refs['basic'].validate((valid) => {
-        if (valid) {
-          editChangeList(sparams).then(res => {
-            if (res.code === 200) {
-              this.$message({
-                message: res.msg,
-                type: 'success'
-              });
-              this.back()
-            }
-          })
-        }
-      })
+    props: ['pageStu', 'row', 'disable'],
+    model: {
+      prop: 'isList',
+      event: 'jugislist'
     },
-    back() {
-      this.$emit('jugislist', true)
-      let queryParams = {
-        pageNum: 1,
-        pageSize: 10
+    data() {
+      return {
+        factoryOptions: [],
+        // 剂型
+        doseOptions: [],
+        selectData9: [],
+        selectData8: [],
+        tabValue: 'first',
+        isControl: true,
+        // 业务线
+        lineOptions: [],
+        isOneClass: false,
+        basicForm: {
+          code: '',
+          orgId: '德荣集团',
+          // 物料id
+          materialId: '',
+          materialCode: '',
+          materialName: '',
+          materialClassifyId: '',
+          medicineMaterial: '2',
+          oneClass: '',
+          twoClass: '',
+          threeClass: '',
+          fourClass: '',
+          specification: '',
+          model: '',
+          factory: '',
+          registrant: '',
+          storageConditions: '',
+          transportCondition: '',
+          leadTime: '',
+          remark: '',
+          // 修改记录
+          changeRecords: [],
+          // 单据信息字段
+          createBy: '',
+          applicationTime: '',
+          createTime: '',
+          updateBy: '',
+          updateTime: '',
+          approver: '',
+          approvalTime: '',
+          status: '',
+          // 业务线
+          businessLine: '',
+          // 生产许可证/经营许可证/备案号
+          productionPermit: '',
+          // di码
+          diCode: ''
+        },
+        options: [{
+          value: '0',
+          label: '是'
+        }, {
+          value: '2',
+          label: '否'
+        }],
+        statusOptions: [{
+          value: '0', label: '未提交'
+        }, {
+          value: '1', label: '审批中'
+        }, {
+          value: '2', label: '已完成'
+        }, {
+          value: '3', label: '已驳回'
+        },],
+        basicRules: {
+          materialCode: [{required: true, message: '请选择物料编码', trigger: 'blur'}],
+          materialName: [{required: true, message: '请填写物料名称', trigger: 'blur'}],
+          specification: [{required: true, message: '请填写规格', trigger: 'blur'}],
+          materialClassifyId: [{required: true, message: '请选择物料分类', trigger: 'blur'}],
+          // model: [{required: true, message: '请填写型号', trigger: 'blur'}],
+          factory: [{required: true, message: '请选择生产厂家/代理人', trigger: 'blur'}],
+          registrant: [{required: true, message: '请填写注册人/上市许可持有人', trigger: 'blur'}],
+          storageConditions: [{required: true, message: '请选择存储条件', trigger: 'blur'}],
+          // transportCondition: [{required: true, message: '请选择运输条件', trigger: 'blur'}],
+          leadTime: [{required: true, message: '请填写交货周期', trigger: 'blur'}],
+        },
+        basicForm2: {
+          drug: '',
+          registrationNo: '',
+          medicalDevices: '',
+          maintenanceType: '',
+          // 剂型
+          dosageFrom: ''
+          // 医药属性子表
+          // medicineTypeChanges:[
+          // ],
+        },
+        // tableList: [],
+        // 子表选中
+        ids: [],
+        // 弹窗
+        name: '',
+        selectData: [],
+        selectData2: [],
+        selectData3: []
       }
-      this.$emit('refresh', queryParams)
     },
-    // 子表增删行
-    // handleSelectionChange(val) {
-    //   this.ids = val
-    //   console.log('this.ids',this.ids)
-    // },
-    // addLine() {
-    //   //添加行数
-    //   let newValue = {
-    //     sort:'',
-    //     medicineCode: '',
-    //     medicineName: '',
-    //   };
-    //   this.basicForm2.medicineTypeChanges.push(newValue);
-    // },
-    // handleDelete(index) {
-    //   if(this.ids.length == 0) {
-    //     this.$message({
-    //       message: '请选择删除条目',
-    //       type: 'warning'
-    //     });
-    //   } else {
-    //     // console.log('index',index)
-    //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
-    //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
-    //      !this.ids.some(ele =>
-    //      ele.sort == item.sort))
+    // watch: {
+    //   value: {
+    //     handler (newVal) {
+    //       this.selectData = []
+    //       if (newVal) {
+    //         newVal.split(',').forEach((id) => { // 回显拿数据
+    //           this.contractService.queryById(id).then(({data}) => {
+    //             if (data && data.id !== '') {
+    //               this.selectData.push(data)
+    //             }
+    //           })
+    //         })
+    //       }
+    //     },
+    //     immediate: true,
+    //     deep: false
+    //   },
+    //   selectData: {
+    //     handler (newVal) {
+    //       this.name = newVal.map(contract => contract.contractName).join(',')
+    //     },
+    //     immediate: false,
+    //     deep: false
     //   }
     // },
-    // testsave() {
-    //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
-    //   console.log('暂存表单1', this.basicForm)
-    //   let params = {...this.basicForm, ...this.basicForm2}
-    //   console.log('暂存总表单', params)
-    // },
-    // 设置选中
-    selectionsToInput(selections) {
-      console.log('父组件拿到的:', selections)
-      this.selectData = selections
-      this.$emit('getInfo', this.selectData)
-      getMaterialDetails(selections[0].id).then(res => {
-        console.log('res', res)
-        if (res.code === 200) {
-          let data = res.data.data
-          // 物料id
-          this.basicForm.materialId = data.id
-          // 物料分类Id
-          this.basicForm.materialClassifyId = data.classifyId
-          this.basicForm.materialCode = data.code
-          this.basicForm.materialName = data.name
-          this.basicForm.medicineMaterial = data.isMedicine
-          this.basicForm.oneClass = data.oneClass
-          this.basicForm.twoClass = data.twoClass
-          this.basicForm.threeClass = data.threeClass
-          this.basicForm.fourClass = data.fourClass
-          this.basicForm.specification = data.specification
-          this.basicForm.model = data.model
-          this.basicForm.factory = data.manufacturerId
-          this.basicForm.registrant = data.registrant
-          this.basicForm.storageConditions = data.storageCondition
-          this.basicForm.transportCondition = data.transportationCondition
-          this.basicForm.leadTime = data.deliveryPeriod
-          if (data.manufacturerId) {
-            this.getFactoryDetails(data.manufacturerId)
-          }
-          if (data.medcines.length !== 0) {
-            this.basicForm2.drug = data.medcines[0].isDrug
-            this.basicForm2.registrationNo = data.medcines[0].registrationNo
-            this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
-            this.basicForm2.maintenanceType = data.medcines[0].curingType
+    mounted() {
+      this.$nextTick(() => {
+        // console.log('页面状态',this.pageStu)
+        if (this.pageStu == 'check') {
+          // alert('详情页面:')
+          console.log('页面状态', this.pageStu)
+          console.log('数据', this.row)
+          this.getDetails(this.row)
+          // 生产厂家代理人用于回显
+          if (this.row.factory) {
+            this.getFactoryDetails(this.row.factory)
           }
+        } else if (this.pageStu == 'edit') {
+          // alert('修改页面')
+          console.log('页面状态', this.pageStu)
+          console.log('数据', this.row)
+          this.getDetails(this.row)
           // 控制医药属性是否能够填写
-          if (this.basicForm.medicineMaterial == '0') {
+          if (this.row.medicineMaterial == '0') {
             this.isControl = false
           } else {
             this.isControl = true
           }
+          // 生产厂家代理人用于回显
+          if (this.row.factory) {
+            this.getFactoryDetails(this.row.factory)
+          }
+        } else if (this.pageStu == 'add') {
+          // alert('新增页面')
+          console.log('页面状态', this.pageStu)
         }
       })
     },
-    // selectionsToInput2 (selections) {
-    //   console.log('选择的数据',selections)
-    //   this.basicForm.factory = selections[0].manufactureName
-    // },
-    // 显示列表
-    test01() {
-      console.log('测试点击')
-      this.$refs.contractSelect.init()
-    },
-    // test02() {
-    //   console.log('测试弹窗2');
-    //   this.$refs.contractSelect2.init()
-    // },
-    // 选择生产厂家/代理人
-    acceptFactory(selections) {
-      console.log('选择的数据', selections)
-      this.factoryOptions = selections
-      this.basicForm.factory = selections[0].id
-      this.getFactoryDetails(selections[0].id)
-    },
-    // 生产厂家/代理人显示列表
-    chooseFactory() {
-      this.$refs.factoryOrman.blur()
-      this.$refs.factory.init()
-    },
-    // 选择四级分类
-    acceptFourClass(selections) {
-      console.log('收到的四级分类', selections)
-      this.basicForm.materialClassifyId = selections.id
-      this.getTreeDetails(selections.id)
-    },
-    // 四级分类显示列表
-    chooseFourClass() {
-      this.$refs.fourClass.init()
-    },
-    // 选择四级分类后需要根据id再次查询一下123级分类
-    getTreeDetails(id) {
-      getDetail(id).then(res => {
-        if (res.code === 200) {
-          this.basicForm.oneClass = res.data.oneClass
-          this.basicForm.twoClass = res.data.twoClass
-          this.basicForm.threeClass = res.data.threeClass
-          this.basicForm.fourClass = res.data.fourClass
+    methods: {
+      // 剂型显示列表
+      chooseDose() {
+        this.$refs.doses.blur()
+        this.$refs.dose.init()
+      },
+      // 选择剂型-树形
+      acceptDose(selections) {
+        this.doseOptions.push(selections)
+        this.basicForm2.dosageFrom = selections.id
+        this.getDoseDetails(selections.id)
+      },
+      // 剂型回显
+      getDoseDetails(id) {
+        getDose({id: id}).then(res => {
+          console.log('剂型', res)
+          if (res.code === 200) {
+            this.doseOptions = res.data.tableBody
+          }
+        })
+      },
+      // 生产厂家/代理人用于回显
+      getFactoryDetails(id) {
+        getProductFactory({id: id}).then(res => {
+          if (res.code === 200) {
+            this.factoryOptions = res.data.tableBody
+          }
+        })
+      },
+      // 选择是否医药物料时控制医药属性
+      controlMedic(val) {
+        console.log('val', val)
+        if (val == '0') {
+          this.isControl = false
+          // 初始化剂型为其他
+          this.basicForm2.dosageFrom = '0001A11000000000BX7Z'
+          this.getDoseDetails(this.basicForm2.dosageFrom)
+        } else {
+          this.basicForm2.drug = ''
+          this.basicForm2.registrationNo = ''
+          this.basicForm2.medicalDevices = ''
+          this.basicForm2.maintenanceType = ''
+          this.isControl = true
         }
-      })
-    },
+      },
+      handleClick(tab, event) {
+        console.log(tab, event);
+        console.log('页面状态', this.pageStu)
+      },
+      // 如果是详情进入,则调用详情接口
+      getDetails(row) {
+        getChangeDetails(row.id).then(res => {
+          if (res.code === 200) {
+            this.basicForm = res.data
+            if (res.data.medicineChange) {
+              this.basicForm2 = res.data.medicineChange
+            }
+            // 剂型回显
+            if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
+              this.getDoseDetails(res.data.medicineChange.dosageFrom)
+            }
+            // 业务线回显
+            if (res.data.businessLine) {
+              this.getLineDetails(res.data.businessLine)
+            }
+          }
+        })
+      },
+      save() {
+        // alert('保存传status:0')
+        let sparams = {...this.basicForm, ...{status: 0}}
+        sparams.medicineChange = this.basicForm2
+        console.log('保存参数', sparams)
+        this.$refs['basic'].validate((valid) => {
+          if (valid) {
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                addChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
+              }
+            })
+          }
+        })
+      },
+      submit() {
+        // alert('提交传status:1')
+        let sparams = {...this.basicForm, ...{status: 1}}
+        sparams.medicineChange = this.basicForm2
+        console.log('提交参数', sparams)
+        this.$refs['basic'].validate((valid) => {
+          if (valid) {
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                editChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
+              }
+            })
+          }
+        })
+      },
+      back() {
+        this.$emit('jugislist', true)
+        let queryParams = {
+          pageNum: 1,
+          pageSize: 10
+        }
+        this.$emit('refresh', queryParams)
+      },
+      // 子表增删行
+      // handleSelectionChange(val) {
+      //   this.ids = val
+      //   console.log('this.ids',this.ids)
+      // },
+      // addLine() {
+      //   //添加行数
+      //   let newValue = {
+      //     sort:'',
+      //     medicineCode: '',
+      //     medicineName: '',
+      //   };
+      //   this.basicForm2.medicineTypeChanges.push(newValue);
+      // },
+      // handleDelete(index) {
+      //   if(this.ids.length == 0) {
+      //     this.$message({
+      //       message: '请选择删除条目',
+      //       type: 'warning'
+      //     });
+      //   } else {
+      //     // console.log('index',index)
+      //     // this.basicForm2.medicineTypeChanges.splice(index, 1);
+      //     this.basicForm2.medicineTypeChanges = this.basicForm2.medicineTypeChanges.filter(item =>
+      //      !this.ids.some(ele =>
+      //      ele.sort == item.sort))
+      //   }
+      // },
+      // testsave() {
+      //   console.log('暂存表格:', this.basicForm2.medicineTypeChanges)
+      //   console.log('暂存表单1', this.basicForm)
+      //   let params = {...this.basicForm, ...this.basicForm2}
+      //   console.log('暂存总表单', params)
+      // },
+      // 设置选中
+      selectionsToInput(selections) {
+        console.log('父组件拿到的:', selections)
+        this.selectData = selections
+        this.$emit('getInfo', this.selectData)
+        getMaterialDetails(selections[0].id).then(res => {
+          console.log('res', res)
+          if (res.code === 200) {
+            let data = res.data.data
+            // 物料id
+            this.basicForm.materialId = data.id
+            // 物料分类Id
+            this.basicForm.materialClassifyId = data.classifyId
+            this.basicForm.materialCode = data.code
+            this.basicForm.materialName = data.name
+            this.basicForm.medicineMaterial = data.isMedicine
+            this.basicForm.oneClass = data.oneClass
+            this.basicForm.twoClass = data.twoClass
+            this.basicForm.threeClass = data.threeClass
+            this.basicForm.fourClass = data.fourClass
+            this.basicForm.specification = data.specification
+            this.basicForm.model = data.model
+            this.basicForm.factory = data.manufacturerId
+            this.basicForm.registrant = data.registrant
+            this.basicForm.storageConditions = data.storageCondition
+            this.basicForm.transportCondition = data.transportationCondition
+            this.basicForm.leadTime = data.deliveryPeriod
+            this.basicForm.diCode = data.diCode
+            this.basicForm.businessLine = data.businessLine
+            this.basicForm.productionPermit = data.productionPermit
+            if (data.manufacturerId) {
+              this.getFactoryDetails(data.manufacturerId)
+            }
+            if (data.businessLine) {
+              this.getLineDetails(data.businessLine)
+            }
+            if (data.medcines.length !== 0) {
+              this.basicForm2.drug = data.medcines[0].isDrug
+              this.basicForm2.registrationNo = data.medcines[0].registrationNo
+              this.basicForm2.medicalDevices = data.medcines[0].medicalInstruments
+              this.basicForm2.maintenanceType = data.medcines[0].curingType
+              this.basicForm2.dosageFrom = data.medcines[0].dosageFrom
+              if (data.medcines[0].dosageFrom) {
+                this.getDoseDetails(data.medcines[0].dosageFrom)
+              }
+            }
+            // 控制医药属性是否能够填写
+            if (this.basicForm.medicineMaterial == '0') {
+              this.isControl = false
+            } else {
+              this.isControl = true
+            }
+          }
+        })
+      },
+      // selectionsToInput2 (selections) {
+      //   console.log('选择的数据',selections)
+      //   this.basicForm.factory = selections[0].manufactureName
+      // },
+      // 显示列表
+      test01() {
+        console.log('测试点击')
+        this.$refs.contractSelect.init()
+      },
+      // test02() {
+      //   console.log('测试弹窗2');
+      //   this.$refs.contractSelect2.init()
+      // },
+      // 选择生产厂家/代理人
+      acceptFactory(selections) {
+        console.log('选择的数据', selections)
+        this.factoryOptions = selections
+        this.basicForm.factory = selections[0].id
+        this.getFactoryDetails(selections[0].id)
+      },
+      // 生产厂家/代理人显示列表
+      chooseFactory() {
+        this.$refs.factoryOrman.blur()
+        this.$refs.factory.init()
+      },
+      // 选择四级分类
+      acceptFourClass(selections) {
+        console.log('收到的四级分类', selections)
+        this.basicForm.materialClassifyId = selections.id
+        this.getTreeDetails(selections.id)
+      },
+      // 四级分类显示列表
+      chooseFourClass() {
+        this.$refs.fourClass.init()
+      },
+      // 选择四级分类后需要根据id再次查询一下123级分类
+      getTreeDetails(id) {
+        getDetail(id).then(res => {
+          if (res.code === 200) {
+            this.basicForm.oneClass = res.data.oneClass
+            this.basicForm.twoClass = res.data.twoClass
+            this.basicForm.threeClass = res.data.threeClass
+            this.basicForm.fourClass = res.data.fourClass
+            const classjudge = res.data.oneClass
+            if (classjudge.includes('介入耗材&5') || classjudge.includes('骨科耗材&2') || classjudge.includes('普通耗材&3') || classjudge.includes('医用设备&1') || classjudge.includes('体外诊断&4')) {
+              this.isOneClass = true
+            } else {
+              this.isOneClass = false
+            }
+          }
+        })
+      },
+      // 选择业务线
+      acceptLine(selections) {
+        this.lineOptions = selections
+        this.basicForm.businessLine = selections[0].id
+        this.getLineDetails(selections[0].id)
+      },
+      // 业务线显示列表
+      chooseLine() {
+        this.$refs.lines.blur()
+        this.$refs.line.init()
+      },
+      // 业务线回显
+      getLineDetails(id) {
+        getLine({id: id}).then(res => {
+          console.log('业务线', res)
+          if (res.code === 200) {
+            this.lineOptions = res.data.tableBody
+          }
+        })
+      },
+    }
   }
-}
 </script>
 
 <style lang="scss" scoped>
-.apply_add {
-  height: calc(100vh - 84px);
-  padding: 12px;
-  box-sizing: border-box;
-  overflow-y: auto;
-}
+  .apply_add {
+    height: calc(100vh - 84px);
+    padding: 12px;
+    box-sizing: border-box;
+    overflow-y: auto;
+  }
 
-.btn_group {
-  width: 100%;
-  margin: 20px 0;
-  display: flex;
-  justify-content: center;
-}
-</style>
+  .btn_group {
+    width: 100%;
+    margin: 20px 0;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 15 - 14
src/views/material/requisition/add.vue

@@ -158,8 +158,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="税类编码" prop="rateCode">
-                  <el-input :disabled="disable" v-model="basicForm.rateCode"></el-input>
+                <el-form-item label="运输条件" prop="transportationCondition">
+                  <el-select v-model="basicForm.transportationCondition" placeholder="请选择" clearable :disabled="disable">
+                    <el-option v-for="item in dict.type.sys_conditions_carriage" :key="item.value" :label="item.label"
+                      :value="item.value" />
+                  </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="8">
@@ -233,14 +236,6 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="运输条件" prop="transportationCondition">
-                  <el-select v-model="basicForm.transportationCondition" placeholder="请选择" clearable :disabled="disable">
-                    <el-option v-for="item in dict.type.sys_conditions_carriage" :key="item.value" :label="item.label"
-                      :value="item.value" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="8">
                 <el-form-item label="物料税类" prop="materialRate">
                   <el-select ref="taxs" v-model="basicForm.materialRate" placeholder="请选择" clearable :disabled="disable"
                     @focus="chooseTax">
@@ -248,6 +243,11 @@
                   </el-select>
                 </el-form-item>
               </el-col>
+              <el-col :span="8">
+                <el-form-item label="税类编码" prop="rateCode">
+                  <el-input disabled v-model="basicForm.rateCode"></el-input>
+                </el-form-item>
+              </el-col>
             </el-row>
             <el-row :gutter="20">
               <el-col :span="8">
@@ -354,8 +354,8 @@
                 </el-form-item>
               </el-col>
               <el-col :span="8">
-                <el-form-item label="生产许可证/经营许可证/备案号" prop="productionPermit"
-                  :rules="{ required: !isControl, message: '请填写生产许可证/经营许可证/备案号', trigger: 'change' }">
+                <el-form-item label="生产许可证" prop="productionPermit"
+                  :rules="{ required: !isControl, message: '请填写生产许可证', trigger: 'change' }">
                   <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
                 </el-form-item>
               </el-col>
@@ -1064,7 +1064,7 @@ export default {
           this.basicForm.twoClass = res.data.twoClass
           this.basicForm.threeClass = res.data.threeClass
           const classjudge = res.data.oneClass
-          if (classjudge == '介入耗材5' || classjudge == '骨科耗材2' || classjudge == '普通耗材3' || classjudge == '医用设备1' || classjudge == '体外诊断4') {
+          if (classjudge.includes('介入耗材&5') || classjudge.includes('骨科耗材&2') || classjudge.includes('普通耗材&3') || classjudge.includes('医用设备&1') || classjudge.includes('体外诊断&4')) {
             this.isOneClass = true
           } else {
             this.isOneClass = false
@@ -1397,6 +1397,7 @@ export default {
     acceptTax(selections) {
       this.taxOptions = selections
       this.basicForm.materialRate = selections[0].id
+      this.basicForm.rateCode = selections[0].code
       this.getTaxDetails(selections[0].id)
     },
     // 物料税类显示列表
@@ -1537,4 +1538,4 @@ export default {
   display: flex;
   justify-content: center;
 }
-</style>
+</style>

+ 57 - 57
src/views/purchase/DemandSummary/add.vue

@@ -15,29 +15,29 @@
           max-height="680"
           @selection-change="handleSelectionChange"
         >
-        <el-table-column type="selection" width="55" />
-        <el-table-column label="序号" align="center" type="index"/>
-        <el-table-column label="行号" align="center" prop="rowNo"/>
-        <el-table-column label="物料编码" align="center" prop="materialCode"/>
-        <el-table-column label="品名" align="center" prop="materialName"/>
-        <el-table-column label="规格" align="center" prop="specification"/>
-        <el-table-column label="单位" align="center" prop="unit"/>
-        <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-        <el-table-column label="末级供应仓库存量" align="center" prop="lastWarehouseQty"/>
-        <el-table-column label="月销量" align="center" prop="totalMonthlySales"/>
-        <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
-        <el-table-column label="最终净需求量" align="center" prop="resDemandQty"/>
-        <el-table-column label="最终采购量" align="center" prop="puQtyRes"/>
-        <el-table-column label="需求客户" align="center" prop="customerName"/>
-        <el-table-column label="最小订货量" align="center" prop="minOrderQty"/>
-        <el-table-column label="最小包装量" align="center" prop="minPackage"/>
-        <el-table-column label="最小批量" align="center" prop="minBatch"/>
-        <el-table-column label="修改人" align="center" prop="updateByName"/>
-        <el-table-column label="修改原因" align="center" prop="updateCause"/>
-        <el-table-column label="业务备注" align="center" prop="remark"/>
-        <el-table-column label="有效期" align="center" prop="expiry"/>
-        <el-table-column label="要求交货日期" align="center" prop="deliveryDate"/>
-        <el-table-column label="紧急标识" align="center" prop="isUrgency">
+        <el-table-column show-overflow-tooltip type="selection" width="55" />
+        <el-table-column show-overflow-tooltip label="序号" align="center" type="index"/>
+        <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/>
+        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode"/>
+        <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
+        <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
+        <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
+        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150"/>
+        <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="buyPeriod"/>
+        <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150"/>
+        <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="150"/>
+        <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName"/>
+        <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="150"/>
+        <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="150"/>
+        <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="150"/>
+        <el-table-column show-overflow-tooltip label="修改人" align="center" prop="updateByName" width="150"/>
+        <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="updateCause" width="150"/>
+        <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="150"/>
+        <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.isUrgency"
@@ -49,7 +49,7 @@
             </el-switch>
           </template>
         </el-table-column>
-        <el-table-column label="补单标识" align="center" prop="isReplenishment">
+        <el-table-column show-overflow-tooltip label="补单标识" align="center" prop="isReplenishment">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.isReplenishment"
@@ -61,27 +61,27 @@
             </el-switch>
           </template>
         </el-table-column>
-        <el-table-column label="需求单单号" align="center" prop="code"/>
-        <el-table-column label="供应仓库" align="center" prop="lastWarehouseName"/>
-        <el-table-column label="供应货位" align="center" prop="lastAllocationName"/>
-        <el-table-column label="业务类型" align="center" prop="billType"/>
-        <el-table-column label="行状态" align="center" prop="status"/>
-        <el-table-column label="收货仓库" align="center" prop="deliveryWarehouseName"/>
-        <el-table-column label="收货货位" align="center" prop="deliveryAllocationName"/>
-        <el-table-column label="采购员" align="center" prop="buyerName"/>
-        <el-table-column label="制单人" align="center" prop="billMaker"/>
-        <el-table-column label="审核人员" align="center" prop="approver"/>
-        <!-- <el-table-column label="请购单号" align="center" prop="code"/> -->
-        <el-table-column label="品类" align="center" prop="materialCategory"/>
-        <el-table-column label="注册人" align="center" prop="registrant"/>
-        <el-table-column label="集团预测分类" align="center" prop="forecastClassify"/>
-        <el-table-column label="修改时间" align="center" prop="updateTime"/>
-        <el-table-column label="采购员编码" align="center" prop="buyer"/>
-        <el-table-column label="采购组织" align="center" prop="orgName"/>
-        <el-table-column label="有效期单位" align="center" prop="expiryUnit"/>
-        <!-- <el-table-column label="业务部门" align="center" prop="businessDeptName"/> -->
-        <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
-        <el-table-column label="批号锁定标识" align="center" prop="isBatchLock">
+        <el-table-column show-overflow-tooltip label="需求单单号" align="center" prop="code" width="150"/>
+        <el-table-column show-overflow-tooltip label="供应仓库" align="center" prop="lastWarehouseName" width="150"/>
+        <el-table-column show-overflow-tooltip label="供应货位" align="center" prop="lastAllocationName" width="150"/>
+        <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="150"/>
+        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="150"/>
+        <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="150"/>
+        <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="150"/>
+        <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150"/>
+        <el-table-column show-overflow-tooltip label="制单人" align="center" prop="billMaker" width="150"/>
+        <el-table-column show-overflow-tooltip label="审核人员" align="center" prop="approver" width="150"/>
+        <!-- <el-table-column show-overflow-tooltip label="请购单号" align="center" prop="code"/> -->
+        <el-table-column show-overflow-tooltip label="品类" align="center" prop="materialCategory" width="150"/>
+        <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="150"/>
+        <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassify" width="150"/>
+        <el-table-column show-overflow-tooltip label="修改时间" align="center" prop="updateTime" width="150"/>
+        <el-table-column show-overflow-tooltip label="采购员编码" align="center" prop="buyer" width="150"/>
+        <el-table-column show-overflow-tooltip label="采购组织" align="center" prop="orgName" width="150"/>
+        <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="expiryUnit" width="150"/>
+        <!-- <el-table-column show-overflow-tooltip label="业务部门" align="center" prop="businessDeptName"/> -->
+        <el-table-column show-overflow-tooltip label="需求部门" align="center" prop="demandDeptName" width="150"/>
+        <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="150">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.isBatchLock"
@@ -93,17 +93,17 @@
             </el-switch>
           </template>
         </el-table-column>
-        <el-table-column label="采购需求单审批人" align="center" prop="approveName"/>
-        <el-table-column label="需求单审批时间" align="center" prop="approverFinishTime"/>
-        <el-table-column label="需求单提交时间" align="center" prop="createTime"/>
-        <el-table-column label="需求单提交人" align="center" prop="createByName"/>
-        <!-- <el-table-column label="处理需求时间" align="center" prop="processTime"/> -->
-        <!-- <el-table-column label="处理需求人员" align="center" prop="processPersonal"/> -->
-        <el-table-column label="处理确认人" align="center" prop="affirmer"/>
-        <el-table-column label="处理确认时间" align="center" prop="affirmerTime"/>
-        <!-- <el-table-column label="转请购时间" align="center" prop="code"/>
-        <el-table-column label="转请购人员" align="center" prop="code"/> -->
-        <el-table-column label="价格类型" align="center" prop="priceType"/>
+        <el-table-column show-overflow-tooltip label="采购需求单审批人" align="center" prop="approveName" width="150"/>
+        <el-table-column show-overflow-tooltip label="需求单审批时间" align="center" prop="approverFinishTime" width="150"/>
+        <el-table-column show-overflow-tooltip label="需求单提交时间" align="center" prop="createTime" width="150"/>
+        <el-table-column show-overflow-tooltip label="需求单提交人" align="center" prop="createByName" width="150"/>
+        <!-- <el-table-column show-overflow-tooltip label="处理需求时间" align="center" prop="processTime"/> -->
+        <!-- <el-table-column show-overflow-tooltip label="处理需求人员" align="center" prop="processPersonal"/> -->
+        <el-table-column show-overflow-tooltip label="处理确认人" align="center" prop="affirmer" width="150"/>
+        <el-table-column show-overflow-tooltip label="处理确认时间" align="center" prop="affirmerTime" width="150"/>
+        <!-- <el-table-column show-overflow-tooltip label="转请购时间" align="center" prop="code"/>
+        <el-table-column show-overflow-tooltip label="转请购人员" align="center" prop="code"/> -->
+        <el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="150"/>
       </el-table>
     </el-card>
 
@@ -185,7 +185,7 @@ export default {
         let param = this.ids.join()
         shutDownSummary(param).then(res => {
           if (res.code === 200) {
-            this.$modal.msgSuccess("取消成功");
+            this.$modal.msgSuccess("操作成功");
             this.getDetails(this.row)
           }
         })

+ 99 - 54
src/views/purchase/DemandSummary/index.vue

@@ -27,7 +27,7 @@
               @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-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
             </el-select>
             </el-form-item>
           </el-col>
@@ -233,6 +233,22 @@
               </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="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
         </div>
         </CollapseTransition>
       </el-form>
@@ -263,84 +279,85 @@
           :data="tableList" 
           fit
           show-summary
+          :summary-method="getSummaries"
           max-height="480"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="55" />
-          <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
-          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
-          <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
-          <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
-          <el-table-column label="规格" align="center" prop="specification" width="200px"/>
-          <el-table-column label="单位" align="center" prop="unit"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
-          <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
-          <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
-          <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
-          <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
-          <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
-          <el-table-column label="呆滞量" align="center" prop="dullQut"/>
-          <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
-          <el-table-column label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
-          <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
-          <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
-          <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
-          <el-table-column label="电商仓库" align="center" prop="commerceWarehouse"/>
-          <el-table-column label="采购在途" align="center" prop="buyTransit"/>
-          <el-table-column label="借出在途" align="center" prop="lendTransit"/>
-          <el-table-column label="调拨在途" align="center" prop="transferTransit"/>
-          <el-table-column label="库存总计" align="center" prop="stockTotal"/>
-          <el-table-column label="最小包装量" align="center" prop="minPackage" width="100px"/>
-          <el-table-column label="最小订货量" align="center" prop="minOrder" width="100px"/>
-          <el-table-column label="最小批量" align="center" prop="minBatch"/>
-          <el-table-column label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
-          <el-table-column label="修改原因" align="center" prop="modifyReason" width="150px">
+          <el-table-column type="selection" width="60" />
+          <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
+          <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="180px"/>
+          <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180px"/>
+          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" width="200px"/>
+          <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
+          <el-table-column show-overflow-tooltip label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column show-overflow-tooltip label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+          <el-table-column show-overflow-tooltip label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
+          <el-table-column show-overflow-tooltip label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
+          <el-table-column show-overflow-tooltip label="总月销量" align="center" prop="totalMonthlySales"/>
+          <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
+          <el-table-column show-overflow-tooltip label="呆滞量" align="center" prop="dullQut"/>
+          <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="buyPeriod"/>
+          <el-table-column show-overflow-tooltip label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
+          <el-table-column show-overflow-tooltip label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
+          <el-table-column show-overflow-tooltip label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
+          <el-table-column show-overflow-tooltip label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
+          <el-table-column show-overflow-tooltip label="电商仓库" align="center" prop="commerceWarehouse"/>
+          <el-table-column show-overflow-tooltip label="采购在途" align="center" prop="buyTransit"/>
+          <el-table-column show-overflow-tooltip label="借出在途" align="center" prop="lendTransit"/>
+          <el-table-column show-overflow-tooltip label="调拨在途" align="center" prop="transferTransit"/>
+          <el-table-column show-overflow-tooltip label="库存总计" align="center" prop="stockTotal"/>
+          <el-table-column show-overflow-tooltip label="最小包装量" align="center" prop="minPackage" width="100px"/>
+          <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrder" width="100px"/>
+          <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch"/>
+          <el-table-column show-overflow-tooltip label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
+          <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
-          <el-table-column label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
-          <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
-          <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
+          <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
+          <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
+          <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
-          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
-          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
-          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
-          <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
+          <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
                   <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
+          <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
                   <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="有效期" align="center" prop="validityPeriod"/>
-          <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
-          <el-table-column label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
-          <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
-          <el-table-column label="单据来源" align="center" prop="billSource"/>
-          <el-table-column label="行号" align="center" prop="rowNo"/>
-          <el-table-column label="注册人" align="center" prop="registrant"/>
+          <el-table-column show-overflow-tooltip label="有效期" align="center" prop="validityPeriod"/>
+          <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
+          <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
+          <el-table-column show-overflow-tooltip label="安全库存量" align="center" prop="safetyStock" width="100px"/>
+          <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="billSource"/>
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/>
+          <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant"/>
           <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
-          <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
-          <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
-          <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
-          <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
+          <el-table-column show-overflow-tooltip label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
+          <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
+          <el-table-column show-overflow-tooltip label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
+          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
           <!-- <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/> -->
           <!-- <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/> -->
-          <el-table-column label="需求单位" align="center" prop="demandUnit"/>
-          <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
+          <el-table-column show-overflow-tooltip label="需求单位" align="center" prop="demandUnit"/>
+          <el-table-column show-overflow-tooltip label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
           <el-table-column
           fixed="right"
           label="操作"
@@ -458,6 +475,7 @@ export default {
         demandDate: '',
         auditTime: '',
         yesTime: '',
+        approverFinishTime: '',
         pageNum: 1,
         pageSize: 5
       },
@@ -499,6 +517,31 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 指定列合计
+    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)
@@ -506,6 +549,7 @@ export default {
     reset() {
       this.queryParams = {
         rowStatus: [],
+        buyer: '',
         buyerName: '',
         materialName: '',
         manufacturer: '',
@@ -640,7 +684,8 @@ export default {
     selectionsToInput(selection) {
       if (this.referCondition.title == '采购员') {
         this.personOptions = selection
-        this.queryParams.buyerName = selection[0].code
+        this.queryParams.buyer = selection[0].code
+        this.queryParams.buyerName = selection[0].name
       }
       if (this.referCondition.title == '业务部门') {
         this.deptOptions = selection
@@ -686,7 +731,7 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialName = selection.id
+      this.queryParams.materialName = selection.name
     },
     // 搜索区物料编码
     chooseMaterial() {

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

@@ -212,25 +212,25 @@
           max-height="480"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55" />
-          <el-table-column label="物料分类编码" align="center" prop="materialClassify"/>
-          <el-table-column label="物料分类名称" align="center" width="200" prop="materialClassifyName" />
-          <el-table-column label="一级分类名称" align="center" prop="materialClassifyOneName" />
-          <el-table-column label="二级分类名称" align="center" width="150" prop="materialClassifyTwoName" />
-          <el-table-column label="三级分类名称" align="center" width="150" prop="materialClassifyThreeName"/>
-          <el-table-column label="四级分类名称" align="center" width="150" prop="materialClassifyFourName" />
-          <el-table-column label="物料编码" align="center" width="150" prop="material" />
-          <el-table-column label="物料名称" align="center" prop="materialName" />
-          <el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
-          <el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
-          <el-table-column label="采购员" align="center" width="150" prop="buyerName" />
-          <el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
-          <el-table-column label="部门" align="center" width="150" prop="puDeptName" />
-          <el-table-column label="创建人" align="center" width="150" prop="createdByName" />
-          <el-table-column label="创建时间" align="center" width="150" prop="createdTime" />
-          <el-table-column label="修改人" align="center" width="150" prop="updatedByName" />
-          <el-table-column label="修改时间" align="center" width="150" prop="updatedTime" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip label="物料分类编码" align="center" prop="materialClassify"/>
+          <el-table-column show-overflow-tooltip label="物料分类名称" align="center" width="200" prop="materialClassifyName" />
+          <el-table-column show-overflow-tooltip label="一级分类名称" align="center" prop="materialClassifyOneName" />
+          <el-table-column show-overflow-tooltip label="二级分类名称" align="center" width="150" prop="materialClassifyTwoName" />
+          <el-table-column show-overflow-tooltip label="三级分类名称" align="center" width="150" prop="materialClassifyThreeName"/>
+          <el-table-column show-overflow-tooltip label="四级分类名称" align="center" width="150" prop="materialClassifyFourName" />
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" width="150" prop="material" />
+          <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" />
+          <el-table-column show-overflow-tooltip label="生产厂商" align="center" width="150" prop="manufacturer" />
+          <el-table-column show-overflow-tooltip label="所属组织" align="center" width="120" prop="orgName"/>
+          <el-table-column show-overflow-tooltip label="订单员" align="center" width="150" prop="orderPersonalName" />
+          <el-table-column show-overflow-tooltip label="采购员" align="center" width="150" prop="buyerName" />
+          <el-table-column show-overflow-tooltip label="订单部门" align="center" width="150" prop="orderDeptName" />
+          <el-table-column show-overflow-tooltip label="部门" align="center" width="150" prop="puDeptName" />
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="150" prop="createdByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="150" prop="createdTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="150" prop="updatedByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="150" prop="updatedTime" />
           <el-table-column
           fixed="right"
           label="操作"

+ 188 - 115
src/views/purchase/PurchaseDemandList/add.vue

@@ -15,8 +15,8 @@
          </el-col>
 
         <el-col :span="1.5">
-            <el-form-item label="组织">
-              <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
+            <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
+              <el-select clearable size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('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>
@@ -41,8 +41,8 @@
           </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="需求客户">
-              <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+            <el-form-item label="需求客户" prop="customer" :rules="{ required: true, message: '请选择需求客户', trigger: 'blur' }">
+              <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('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>
@@ -62,7 +62,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求人员">
-                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-select clearable size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('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>
@@ -70,7 +70,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select clearable v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -82,10 +82,11 @@
           </el-col>
 
           <el-col :span="1.5">
-            <el-form-item label="需求日期">
+            <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
               <el-date-picker
                 v-model="basicForm.demandDate"
                 :disabled="sonDisable"
+                clearable
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -106,7 +107,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -115,7 +116,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
+              <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -162,42 +163,42 @@
           max-height="300"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection"/>
-          <el-table-column label="序号" type="index" align="center"/>
-          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus" width="150px"/>
-          <el-table-column label="行号" align="center" prop="rowNo" />
-          <!-- <el-table-column label="业务部门名称" align="center" width="180px"/> -->
-          <!-- <el-table-column label="业务部门" align="center" width="180px"/> -->
-          <el-table-column label="需求客户" align="center"  prop="demandCustomerName" width="200px"/>
-          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
+          <el-table-column show-overflow-tooltip type="selection"/>
+          <el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
+          <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="150px"/>
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo" />
+          <!-- <el-table-column show-overflow-tooltip label="业务部门名称" align="center" width="180px"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="业务部门" align="center" width="180px"/> -->
+          <el-table-column show-overflow-tooltip label="需求客户" align="center"  prop="demandCustomerName" width="200px"/>
+          <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
+          <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
+          <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
+          <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留比例" align="center" prop="reservedProportion" width="150px">
+          <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
@@ -208,69 +209,69 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留周期" align="center" prop="reservedPeriod" width="150px">
+          <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
+          <el-table-column show-overflow-tooltip label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
+                <el-input readonly size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="采购员名称" align="center" prop="buyerName" width="120px"/>
-          <el-table-column label="采购员" align="center"  prop="buyer"/>
-          <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
+          <el-table-column show-overflow-tooltip label="采购员名称" align="center" prop="buyerName" width="120px"/>
+          <el-table-column show-overflow-tooltip label="采购员" align="center"  prop="buyer"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="物料名称" align="center"  prop="materialName" width="230px" />
-          <el-table-column label="规格" align="center"  prop="specification" />
-          <el-table-column label="型号" align="center"  prop="model"/>
-          <el-table-column label="单位" align="center"  prop="unitName"/>
-          <el-table-column label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
-          <el-table-column label="注册人" align="center"  prop="registrant" width="150px"/>
-          <el-table-column label="采购周期" align="center"  prop="puPeriod" width="150px">
+          <el-table-column show-overflow-tooltip label="物料名称" align="center"  prop="materialName" width="230px" />
+          <el-table-column show-overflow-tooltip label="规格" align="center"  prop="specification" />
+          <el-table-column show-overflow-tooltip label="型号" align="center"  prop="model"/>
+          <el-table-column show-overflow-tooltip label="单位" align="center"  prop="unitName"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
+          <el-table-column show-overflow-tooltip label="注册人" align="center"  prop="registrant" width="150px"/>
+          <el-table-column show-overflow-tooltip label="采购周期" align="center"  prop="puPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期" align="center"  prop="expiry" width="120px"/>
-          <el-table-column label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
-          <el-table-column label="最小包装" align="center"  prop="minPackage" width="120px"/>
-          <el-table-column label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
-          <el-table-column label="最小批量" align="center"  prop="minBatch" width="120px"/>
-          <el-table-column label="安全库存" align="center"  prop="safeStock" width="120px">
+          <el-table-column show-overflow-tooltip label="有效期" align="center"  prop="expiry" width="120px"/>
+          <el-table-column show-overflow-tooltip label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
+          <el-table-column show-overflow-tooltip label="最小包装" align="center"  prop="minPackage" width="120px"/>
+          <el-table-column show-overflow-tooltip label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
+          <el-table-column show-overflow-tooltip label="最小批量" align="center"  prop="minBatch" width="120px"/>
+          <el-table-column show-overflow-tooltip label="安全库存" align="center"  prop="safeStock" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="月均销量" align="center"  prop="averageQtyMonth" width="120px"/>
-          <el-table-column label="实际(业务)需求量" align="center"  prop="qty" width="120px">
+          <el-table-column show-overflow-tooltip label="月均销量" align="center"  prop="averageQtyMonth" width="120px"/>
+          <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="120px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="需求可用周期" align="center"  prop="demandPeriod" width="120px"/>
-          <el-table-column label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
-          <el-table-column label="交货日期" align="center"  prop="deliveryDate" width="230px">
+          <el-table-column show-overflow-tooltip label="需求可用周期" align="center"  prop="demandPeriod" width="120px"/>
+          <el-table-column show-overflow-tooltip label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
+          <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'deliveryDate'" :rules="{ required: true, message: '请填写交货日期', trigger: 'blur' }">
                 <el-date-picker
                   v-model="scope.row.deliveryDate"
                   :readonly="sonDisable"
@@ -283,12 +284,12 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单标识" align="center"  prop="isReplenishment" width="100px">
+          <el-table-column show-overflow-tooltip label="补单标识" align="center"  prop="isReplenishment" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isReplenishment"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -297,7 +298,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
+          <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                   <el-switch
@@ -311,50 +312,50 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="业务备注" align="center"  prop="remark" width="150px">
+          <el-table-column show-overflow-tooltip label="业务备注" align="center"  prop="remark" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
               </el-form-item>
             </template>
           </el-table-column> 
-          <el-table-column label="采购备注" align="center"  prop="puRemark" width="150px"/>
-          <!-- <el-table-column label="末级供应仓库存量" align="center"  prop="lastWarehouseQty" /> -->
-          <el-table-column label="调拨占有量" align="center"  prop="superiorAllotQty" width="150px"/>
-          <el-table-column label="最终净需求量" align="center"  prop="resDemandQty" width="150px">
+          <el-table-column show-overflow-tooltip label="采购备注" align="center"  prop="puRemark" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center"  prop="lastWarehouseQty" /> -->
+          <el-table-column show-overflow-tooltip label="调拨占有量" align="center"  prop="superiorAllotQty" width="150px"/>
+          <el-table-column show-overflow-tooltip label="最终净需求量" align="center"  prop="resDemandQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
+          <el-table-column show-overflow-tooltip label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.deliveryWarehouseName">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
+          <el-table-column show-overflow-tooltip label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.deliveryAllocationName">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="收货货位编码" align="center"  prop="deliveryAllocation" width="200px"/> -->
-          <el-table-column label="末级供应仓库" align="center"  prop="lastWarehouseName" width="200px"/>
-          <el-table-column label="末级供应货位" align="center"  prop="lastAllocationName" width="200px"/>
-          <el-table-column label="紧急标识" align="center" prop="isUrgency" width="100px">
+          <!-- <el-table-column show-overflow-tooltip label="收货货位编码" align="center"  prop="deliveryAllocation" width="200px"/> -->
+          <el-table-column show-overflow-tooltip label="末级供应仓库" align="center"  prop="lastWarehouseName" width="200px"/>
+          <el-table-column show-overflow-tooltip label="末级供应货位" align="center"  prop="lastAllocationName" width="200px"/>
+          <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isUrgency"
-                  :disabled="sonDisable"
+                  disabled
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
@@ -363,13 +364,13 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
-          <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
-          <!-- <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
-          <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/>
-          <el-table-column label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/>
-          <el-table-column label="可用量" align="center"  prop="availableQty"/>
-          <el-table-column label="调拨状态" align="center"  prop="statusAllot" width="100px">
+          <el-table-column show-overflow-tooltip label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>yu
+          <el-table-column show-overflow-tooltip label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
+          <!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/> -->
+          <el-table-column show-overflow-tooltip label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
@@ -383,23 +384,23 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
+          <el-table-column show-overflow-tooltip label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplier">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplier'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
+                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+                  <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
+          <el-table-column show-overflow-tooltip label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplierName"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="周期单位" align="center"  prop="periodUnit" width="150px">
+          <!-- <el-table-column show-overflow-tooltip label="周期单位" align="center"  prop="periodUnit" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
@@ -409,23 +410,23 @@
               </el-form-item>
             </template>
           </el-table-column> -->
-          <el-table-column label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
-          <el-table-column label="中心仓可用量" align="center"  prop="centralWarehouseQty" width="200px"/>
-          <el-table-column label="调拨单号" align="center"  prop="allotCode"></el-table-column>
-          <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
+          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
+          <el-table-column show-overflow-tooltip label="中心仓可用量" align="center"  prop="centralWarehouseQty" width="200px"/>
+          <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
+          <el-table-column show-overflow-tooltip label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable size="small" v-model="scope.row.deliveryAddressName" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
-          <el-table-column label="联系人" align="center"  prop="contacts"/>
-          <el-table-column label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
-          <el-table-column label="详细地址" align="center"  prop="address" width="200px"/>
-          <el-table-column label="价格类型" align="center"  prop="priceType" width="150px">
+          <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
+          <el-table-column show-overflow-tooltip label="联系人" align="center"  prop="contacts"/>
+          <el-table-column show-overflow-tooltip label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
+          <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
+          <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
@@ -499,6 +500,8 @@ export default {
       // 不能直接改变props传来的值
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
+      // BDZT是补单供应商是否可以编辑条件
+      BDZT: true,
       dialog: {
         config: false
       },
@@ -545,6 +548,7 @@ export default {
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
+      isBDXQ: false
     }
   },
   created() {
@@ -556,6 +560,27 @@ export default {
     }
   },
   methods: {
+    // 更改业务类型调整明细行内补单或紧急标识
+    changeBillType() {
+      if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.isBDXQ = true
+        this.BDZT = false
+        this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
+      } else {
+        this.isBDXQ = false
+        this.BDZT = true
+        this.basicForm.puDemandItemList.forEach(item => { 
+          item.isReplenishment = 'N' 
+          item.additionalSupplier = null
+          item.additionalSupplierName = null
+        })
+      }
+      if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
+      } else {
+        this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
+      }
+    },
     hangStatus(row) {
       switch (row.status) {
         case '0':
@@ -598,23 +623,27 @@ export default {
     },
     async save() {
       if(this.basicForm.puDemandItemList.length !== 0) {
-        if(this.sonPageStu == 'add') {
-          await this.handleData()
-          await addDemand(this.basicForm).then(res => {
-            console.log(333)
-            if (res.code === 200) {
-              this.$modal.msgSuccess("保存成功");
-              this.back()
-            }
-          })
-        } else if (this.sonPageStu == 'edit') {
-          editDemand(this.basicForm).then(res => {
-            if (res.code === 200) {
-              this.$modal.msgSuccess("编辑成功");
-              this.back()
+        this.$refs['basic'].validate((valid) => {
+          if(valid) {
+            if(this.sonPageStu == 'add') {
+              this.handleData()
+              addDemand(this.basicForm).then(res => {
+                console.log(333)
+                if (res.code === 200) {
+                  this.$modal.msgSuccess("保存成功");
+                  this.back()
+                }
+              })
+            } else if (this.sonPageStu == 'edit') {
+              editDemand(this.basicForm).then(res => {
+                if (res.code === 200) {
+                  this.$modal.msgSuccess("编辑成功");
+                  this.back()
+                }
+              })
             }
-          })
-        }
+          }
+        })
       } else {
         this.$modal.msgWarning("明细信息不能为空!");
       }
@@ -636,8 +665,6 @@ export default {
         status: null,
         businessDept: null,
         businessDeptName: null,
-        customer: this.basicForm.customer,
-        customerName: this.basicForm.customerName,
         materialCategory: null,
         buyer: null,
         buyerName: null,
@@ -677,8 +704,8 @@ export default {
         demandPeriod: null,
         forecastClassify: null,
         deliveryDate: null,
-        isUrgency: 'N',
-        isReplenishment: 'N',
+        isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+        isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
         isBatchLock: 'N',
         remark: null,
         puRemark: null,
@@ -703,8 +730,10 @@ export default {
         additionalSupplier: null,
         additionalSupplierName: null,
         periodUnit: null,
-        demandCustomer: null,
-        demandCustomerName: null,
+        demandCustomer: this.basicForm.customer,
+        demandCustomerName: this.basicForm.customerName,
+        businessDept: this.basicForm.demandDept,
+        businessDeptName: null,
         lastStockOrg: null,
         lastStockOrgName: null,
         superiorStockOrg: null,
@@ -736,6 +765,12 @@ export default {
         transportationCondition: null,
       }
       this.basicForm.puDemandItemList.push(newLine)
+      // 补单需求状态改变
+      if (this.basicForm.billType == 'BDXQ') {
+        this.BDZT = false
+      } else {
+        this.BDZT = true
+      }
     },
     delLine(index) {
       console.log('删除行:', index)
@@ -761,7 +796,7 @@ export default {
           let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
           getDemandSonDetail(params).then(res => {
             if (res.code === 200) {
-              reciveForm.puDemandItemList = res.rows
+              reciveForm.puDemandItemList = res.data
               console.log('reciveForm',reciveForm)
               this.basicForm = reciveForm
               if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
@@ -769,6 +804,14 @@ export default {
               if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
               // 详情时将收货仓库id赋值给stordocId
+              // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
+              if(this.basicForm.billType == 'BDXQ') {
+                 this.BDZT = false 
+                 this.isBDXQ = true
+              } else {
+                 this.BDZT = true
+                 this.isBDXQ = false
+              }
             }
           })
         }
@@ -817,6 +860,12 @@ export default {
         this.basicForm.customer = selection[0].id
         this.basicForm.customerName = selection[0].name
         this.basicForm.customerCode = selection[0].code
+        if(this.basicForm.puDemandItemList.length !== 0) {
+          this.basicForm.puDemandItemList.forEach(item => {
+            item.demandCustomerName = this.basicForm.customerName
+            item.demandCustomer = this.basicForm.customer
+          })
+        }
       }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
@@ -841,7 +890,7 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
         this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
@@ -944,7 +993,31 @@ export default {
       } else {
         this.$modal.msgWarning("请先选择收货仓库");
       }
-    }
+    },
+    // 明细行清空收货仓库,货位,收货地址档案等
+    clearHang(index, title) {
+      if (title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
+        this.basicForm.puDemandItemList[index].deliveryWarehouse = null
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货货位') {
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货地址') {
+        this.basicForm.puDemandItemList[index].deliveryAddressName = null
+        this.basicForm.puDemandItemList[index].deliveryAddress = null
+        this.basicForm.puDemandItemList[index].contacts = null
+        this.basicForm.puDemandItemList[index].contactsPhone = null
+        this.basicForm.puDemandItemList[index].address = null
+      }
+      if (title == '选择补单供应商') {
+        this.basicForm.puDemandItemList[index].additionalSupplierName = null
+        this.basicForm.puDemandItemList[index].additionalSupplier = null
+      }
+    },
   }
 }
 </script>

+ 37 - 16
src/views/purchase/PurchaseDemandList/index.vue

@@ -94,6 +94,21 @@
             </el-form-item>
           </el-col>
           <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="small"
+                style="width: 200px"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="1.5">
             <el-form-item label="备注">
             <el-input
               v-model.trim="queryParams.remark"
@@ -142,21 +157,22 @@
           max-height="350"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55" />
-          <el-table-column label="编码" align="center" width="200" prop="code"/>
-          <el-table-column label="需求日期" align="center" width="120" prop="demandDate"/>
-          <el-table-column label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
-          <!-- <el-table-column label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
-          <el-table-column label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
-          <!-- <el-table-column label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
-          <el-table-column label="需求人员" align="center" prop="demandPersonalName" />
-          <el-table-column label="需求客户" align="center" prop="customerName" width="150"/>
-          <el-table-column label="需求部门" align="center" prop="demandDeptName" width="150"/>
-          <!-- <el-table-column label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
-          <!-- <el-table-column label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
-          <el-table-column label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
-          <el-table-column label="组织" align="center" width="200" prop="orgName"/>
-          <el-table-column label="备注" align="center" width="150" prop="remark" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip label="编码" align="center" width="200" prop="code"/>
+          <el-table-column show-overflow-tooltip label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column show-overflow-tooltip label="审批结束日期" align="center" width="150" prop="approverFinishTime"/>
+          <el-table-column show-overflow-tooltip label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
+          <!-- <el-table-column show-overflow-tooltip label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
+          <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
+          <!-- <el-table-column show-overflow-tooltip label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
+          <el-table-column show-overflow-tooltip label="需求人员" align="center" prop="demandPersonalName" />
+          <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName" width="150"/>
+          <el-table-column show-overflow-tooltip label="需求部门" align="center" prop="demandDeptName" width="150"/>
+          <!-- <el-table-column show-overflow-tooltip label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
+          <!-- <el-table-column show-overflow-tooltip label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
+          <el-table-column show-overflow-tooltip label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
+          <el-table-column show-overflow-tooltip label="组织" align="center" width="200" prop="orgName"/>
+          <el-table-column show-overflow-tooltip label="备注" align="center" width="150" prop="remark" />
           <el-table-column
           fixed="right"
           label="操作"
@@ -194,6 +210,7 @@
       :disabled="upload.isUploading"
       :on-progress="handleFileUploadProgress"
       :on-success="handleFileSuccess"
+      :on-error="errorFile"
       :auto-upload="false"
       drag
       >
@@ -245,7 +262,7 @@ export default {
         // 是否禁用上传
         isUploading: false,
         // 是否更新已经存在的用户数据
-        updateSupport: 0,
+        updateSupport: 1,
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
@@ -266,6 +283,7 @@ export default {
         billType: '',
         demandDept: '',
         demandDate: '',
+        approverFinishTime: '',
         remark: '',
         pageNum: 1,
         pageSize: 5
@@ -407,6 +425,9 @@ export default {
       this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
       this.getList(this.queryParams);
     },
+    errorFile(err) {
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();

+ 0 - 514
src/views/purchase/apply/add/column.js

@@ -1,514 +0,0 @@
-export const Columns = [
-  {
-    key: "puOrgName",
-    title: "采购组织",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "code", title: "合同编码", type: "Input" },
-  {
-    key: "lastPuMoney",
-    title: "上年度采购额",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "buyerName",
-    title: "采购员",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierName",
-    title: "供应商",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "contractType",
-    title: "合同类型",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_contract_type",
-    },
-  },
-  {
-    key: "puMoneyYear",
-    title: "本年度采购额",
-    type: "InputNumber",
-    require: true,
-  },
-  {
-    key: "puDeptName",
-    title: "采购部门",
-    type: "InputDialog",
-    config: {
-      componentName: "DEPT_PARAM",
-      dataMapping: {
-        puDept: "code",
-        puDeptName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "supplierTier",
-    title: "供应商层级",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_supplier_tier",
-    },
-  },
-  { key: "contractName", title: "合同名称", type: "Input", require: true },
-  {
-    key: "grossRateAverage",
-    title: "平均毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "approveFlow",
-    title: "审批流程",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_approve_flow",
-    },
-  },
-  {
-    key: "consumableClass",
-    title: "耗材类别",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_consumable_class",
-    },
-  },
-  {
-    key: "effectiveDate",
-    title: "合同生效日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "brandGrossRate",
-    title: "同类品牌及毛利率",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractFormat",
-    title: "合同格式",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "productName",
-    title: "产品类别&名称",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "endDate",
-    title: "合同终止日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "invoiceTax",
-    title: "发票税率",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        invoiceTax: "mattaxesname",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "emergencyDegree",
-    title: "紧急程度",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_emergency_degree",
-    },
-  },
-  { key: "project", title: "项目医院", type: "Input", require: true },
-  {
-    key: "signDate",
-    title: "合同签订日期",
-    type: "DatePicker",
-    require: true,
-  },
-  {
-    key: "deliveryType",
-    title: "交货方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_delivery_type",
-    },
-  },
-  {
-    key: "source",
-    title: "合同来源",
-    type: "Input",
-    value: "自制",
-    disabled: true,
-  },
-  {
-    key: "contractPartycName",
-    title: "合同丙方",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        contractPartyc: "code",
-        contractPartycName: "name",
-      },
-    },
-  },
-  {
-    key: "guaranteePeriodEnd",
-    title: "质保期限",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "freightMethods",
-    title: "运费承担方式",
-    type: "Select",
-    config: {
-      optionsName: "purchase_contract_freight_methods",
-    },
-  },
-  {
-    key: "signDate",
-    title: "合同创建时间",
-    type: "DatePicker",
-    disabled: true,
-  },
-  {
-    key: "isTarget",
-    title: "是否有指标",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_target",
-    },
-  },
-  {
-    key: "contractTarget",
-    title: "合同指标",
-    type: "Input",
-    require: true,
-    placeholder: '当【是否有指标】="有"时,必填',
-  },
-  {
-    key: "exemptionPostageCondtion",
-    title: "包邮条件",
-    type: "Input",
-    placeholder:
-      "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
-    span: 12,
-  },
-  {
-    key: "isRebate",
-    title: "是否有返利",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "purchase_contract_is_rebate",
-    },
-  },
-  {
-    key: "rebatePolicy",
-    title: "返利政策",
-    type: "Input",
-    placeholder: '当【是否有返利】="有"时,必填',
-    span: 18,
-  },
-  { key: "externalContract", title: "外部合同号", type: "Input" },
-  {
-    key: "rollbackPolicy",
-    title: "退换货政策",
-    type: "Input",
-    require: true,
-  },
-  {
-    key: "contractContent",
-    title: "合同主要内容",
-    type: "Textarea",
-    require: true,
-    span: 24,
-  },
-  { key: "refusalReasons", title: "拒绝理由", type: "Input", span: 24 },
-  { key: "enquiryCode", title: "询价单号", type: "Input" },
-  { key: "externalFile", title: "对外附件", type: "Upload", span: 24 },
-  { key: "puFile", title: "采购商盖章合同附件", type: "Upload", span: 24 },
-  {
-    key: "supplierFile",
-    title: "供应商盖章合同附件",
-    type: "Upload",
-    span: 24,
-  },
-  { key: "projectCode", title: "项目编号", type: "Input" },
-  { key: "projectName", title: "项目名称", type: "Input" },
-  { key: "area", title: "区域", type: "Input" },
-  { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
-  {
-    key: "paymentAgreementName",
-    title: "付款协议",
-    type: "InputDialog",
-    config: {
-      componentName: "PAYAGREEMENT_PARAM",
-      dataMapping: {
-        paymentAgreement: "code",
-        paymentAgreementName: "name",
-      },
-    },
-    require: true,
-  },
-  {
-    key: "taxPrice",
-    title: "价税合计",
-    type: "InputNumber",
-  },
-  {
-    key: "currencyName",
-    title: "币种",
-    type: "InputDialog",
-    config: {
-      componentName: "CURRENCY_PARAM",
-      dataMapping: {
-        currency: "code",
-        currencyName: "name",
-      },
-    },
-    require: true,
-  },
-  { key: "guaranteePeriod", title: "质保期", type: "Input" },
-
-  // { key: "buyerName", title: "采购员名称" },
-  // { key: "supplierName", title: "供应商名称" },
-
-  // { key: "puDeptName", title: "采购部门名称" },
-
-  // { key: "contractPartycName", title: "合同丙方名称" },
-
-  // { key: "currencyName", title: "币种名称" },
-  // { key: "tenantId", title: "租户号" },
-  // { key: "revision", title: "乐观锁" },
-  // { key: "createByName", title: "创建人" },
-  // { key: "updateByName", title: "创建人名称" },
-  // { key: "delFlag", title: "删除标记" },
-];
-
-export const TabColumns = [
-  {
-    show: {
-      contractType: [1, 2],
-    },
-    title: "物料基本信息",
-    key: "contractItemList",
-    tableColumns: [
-      { title: "物料编码", key: "material", width: 200 },
-      {
-        title: "物料名称",
-        key: "materialName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "规格",
-        key: "specification",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "品牌",
-        key: "brand",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "生产厂家", key: "manufacturer", type: "Input", width: 200 },
-      {
-        title: "采购单位",
-        key: "puUnit",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      {
-        title: "税率%",
-        key: "tax",
-        type: "InputDialog",
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-        width: 200,
-      },
-      {
-        title: "采购数量",
-        key: "qty",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      {
-        title: "含税单价",
-        key: "taxPrice",
-        type: "InputNumber",
-
-        width: 200,
-      },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
-      { title: "无税单价", key: "taxFreePrice" },
-      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
-      {
-        title: "注册证号及备案凭证号",
-        key: "registration",
-        type: "Input",
-        width: 200,
-      },
-      {
-        title: "收货客户",
-        key: "customerName",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "SUPPLIER_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-    ],
-  },
-  {
-    title: "合同条款",
-    key: "contractClauseList",
-    tableColumns: [
-      { title: "条款编码", key: "code", type: "Input" },
-      { title: "条款名称", key: "name", type: "Input" },
-      { title: "条款内容", key: "content", type: "Input" },
-      { title: "变量序号", key: "variableRowno" },
-      { title: "变量内容", key: "variableContent", type: "Input" },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "合同费用",
-    key: "contractExpenseList",
-    tableColumns: [
-      { title: "费用编码", key: "code", type: "Input" },
-      { title: "费用名称", key: "name", type: "Input" },
-      {
-        title: "费用金额",
-        key: "money",
-        type: "InputNumber",
-        width: 200,
-      },
-      { title: "备注", key: "remark", type: "Input" },
-    ],
-  },
-  {
-    title: "付款协议信息",
-    key: "contractAgreementList",
-    tableColumns: [
-      {
-        title: "付款阶段",
-        key: "satge",
-        type: "InputNumber",
-        width: 200,
-      },
-      {
-        title: "付款起点",
-        key: "origin",
-        type: "InputDialog",
-        width: 200,
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "code",
-            materialName: "name",
-          },
-        },
-      },
-      { title: "账期天数", key: "paymetDays", type: "Input", width: 200 },
-      { title: "付款比例%", key: "ratio", type: "Input", width: 200 },
-      { title: "付款金额", key: "money", type: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
-      { title: "结算方式", key: "paymentMeans", type: "Input", width: 200 },
-      { title: "备注", key: "remark", type: "Input", width: 200 },
-      { title: "需进度确认", key: "schedule", type: "Select", width: 200 },
-    ],
-  },
-  {
-    title: "合同执行组织范围",
-    key: "contractApplyOrgList",
-    tableColumns: [
-      { title: "组织名称", key: "orgName", type: "Input" },
-      { title: "组织编码", key: "org", type: "Input" },
-    ],
-  },
-];

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

@@ -46,13 +46,14 @@ export default {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
           try {
+            this.params.id = undefined;
             const { code, msg } = await ADD({
               ...this.params,
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
-              this.$notify.success({ title: msg });
+              this.$emit("success");
+              
             } else {
               this.$notify.warning({ title: msg });
             }
@@ -113,13 +114,22 @@ export default {
               style="width: 100%"
             >
             </dr-popover-select>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <file-upload
               v-if="column.inputType === 'Upload'"
               v-model="params[column.key]"

+ 8 - 4
src/views/purchase/apply/column.js

@@ -128,7 +128,12 @@ export const TableColumns = [
     disabled: true,
     readonly: true,
   },
-  { key: "isEffective", title: "是否已推价格", inputType: "Switch" },
+  {
+    key: "isEffective",
+    title: "是否已推价格",
+    inputType: "Select",
+    referName: "sys_yes_no",
+  },
   {
     key: "effectiveDate",
     title: "生效日期",
@@ -210,8 +215,7 @@ export const SearchColumns = [
   {
     key: "isEffective",
     title: "是否已推价格",
-    inputType: "Switch",
-    activeValue: "1",
-    inactiveValue: "0",
+    inputType: "Select",
+    referName: "sys_yes_no",
   },
 ];

+ 42 - 0
src/views/purchase/apply/delete/index.vue

@@ -0,0 +1,42 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/apply";
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否删除数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(async () => {
+          try {
+            this.loading = true;
+            const { id } = prop;
+            const { code } = await REMOVE(id);
+            if (code === 200) {
+              this.$emit("success");
+            }
+          } catch (err) {
+            // catch
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 0 - 268
src/views/purchase/apply/edit/index.vue

@@ -1,268 +0,0 @@
-<script>
-import { Columns, TabColumns } from "../add/column";
-import {
-  edit,
-  item,
-  itemTableList,
-} from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-
-export default {
-  name: "EditDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-   
-  },
-  data() {
-    return {
-      size: "mini",
-      visible: false,
-      loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
-      params: {
-        ...initParams(NewColumns),
-        contractItemList: [],
-        contractClauseList: [],
-        contractExpenseList: [],
-        contractAgreementList: [],
-        contractApplyOrgList: [],
-      },
-
-      tabColumns: NewTabColumns,
-      tabName: "contractItemList",
-    };
-  },
-  computed: {},
-  watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
-    },
-    tabName: function (newProp) {
-      const { id } = this.params;
-      this.fetchTable(id, newProp);
-    },
-  },
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // 查询详细
-    async fetchItem(prop) {
-      try {
-        this.loading = true;
-        const { code, msg, data } = await item(prop);
-        if (code === 200) {
-          this.params = data;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 查询详情关联TABLE
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 新增行
-    addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
-    },
-    // 删除行
-    delTableRow(prop, index) {
-      prop.splice(index, 1);
-    },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
-    },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-    // 保存并新增
-    async handleSubmit() {
-      try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await edit({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        // this.setVisible(false);
-      }
-    },
-    beforeOpen() { },
-  },
-  created() {
-    console.log("ADD CREATED");
-  },
-  mounted() { },
-  destroyed() { },
-};
-</script>
-<template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" label-position="right" label-width="135px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-          ">
-          <h3>编辑</h3>
-          <div style="text-align: right">
-            <el-button :size="size" @click="handleCancel">取 消</el-button>
-            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
-              <dr-popover-select v-if="column.type === 'InputDialog'" v-model="params[column.key]" :source.sync="params"
-                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :title="column.title"
-                :disabled="column.disabled" :readonly="column.readonly" :clearable="column.clearable"
-                :placeholder="column.placeholder">
-              </dr-popover-select>
-              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
-              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
-              <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-                <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
-                </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
-              </el-select>
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <!-- <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div> -->
-              </el-upload>
-            </el-form-item>
-          </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-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
-            <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column label="序号">
-                <template slot-scope="scope">
-                  {{ scope.$index + 1 }}
-                </template>
-              </el-table-column>
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
-                <template slot-scope="scope">
-                  <span v-if="!cColumn.type">
-                    {{ scope.row[cColumn.key] }}</span>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
-                  <dr-popover-select v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
-                  </dr-popover-select>
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
-                </template>
-              </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
-                  </el-button>
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-tab-pane>
-        </el-tabs>
-        <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
-        </el-row>
-      </el-card>
-    </el-form>
-  </el-drawer>
-</template>

+ 76 - 97
src/views/purchase/apply/index.vue

@@ -1,13 +1,14 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { LIST, REMOVE } from "@/api/business/purchase/apply";
-import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+import { LIST } from "@/api/business/purchase/apply";
+import { initPage, initDicts, initParams } from "@/utils/init";
 export default {
   name: "PuchaseApply",
+  dicts: [...initDicts(SearchColumns), ...initDicts(TableColumns)],
   components: {
-    AddDialog: () => import("./add/index.vue"),
-    SeeDialog: () => import("./see/index.vue"),
-    // Editdialog: () => import("./edit/index.vue"),
+    AddModel: () => import("./add/index.vue"),
+    SeeModel: () => import("./see/index.vue"),
+    DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
     return {
@@ -17,14 +18,12 @@ export default {
       params: initParams(SearchColumns),
       tableData: [],
       tableColumns: TableColumns,
-      page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
+      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
   created() {
-    this.queryList(this.params, this.page);
+    this.useQuery(this.params, this.page);
   },
   methods: {
     //
@@ -32,7 +31,7 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await LIST({
+        const { code, rows, total } = await LIST({
           pageNum,
           pageSize,
           ...prop,
@@ -40,71 +39,46 @@ export default {
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
-    // 查询操作
-    queryList(prop, page) {
+    // 查 
+    useQuery(prop, page) {
       this.fetchList(prop, page);
     },
-    // 重置操作
-    resetList() {
+    // 重 
+    useReset() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.queryList(this.params, this.page);
+      this.useQuery(this.params, this.page);
     },
-    // 删除操作
-    async deleteItem(prop) {
-      try {
-        this.loading = true;
-        const { id } = prop;
-        const { code, msg } = await REMOVE(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.queryList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 页大小变
-    sizeChange(prop) {
-      this.page.pageSize = prop;
-      this.queryList(this.params, this.page);
-    },
-    // 当前页变
-    currentChange(prop) {
-      this.page.pageNum = prop;
-      this.queryList(this.params, this.page);
-    },
-    // 打开新增dialog
-    async openAddDialog(prop) {
-      const { open } = this.$refs.AddDialog;
-      await open(prop);
+    // 删 除
+    async useDelete(prop) {
+      const { id } = prop;
+      const { open } = this.$refs.DeleteModel;
+      await open(id);
     },
-    // 打开查看dialog
-    async openSeeDialog(prop) {
+    // 删 除
+    async useDelete(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeDialog;
+      const { open } = this.$refs.DeleteModel;
       await open(id);
     },
-    // 打开编辑dialog
-    async openEditDialog(prop) {
+    // 新 增
+    async useAdd() {
+      const { open } = this.$refs.AddModel;
+      await open();
+    },
+    // 明 细
+    async useSee(prop) {
       const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.EditdialogFef;
-      await setVisible(true);
-      await fetchItem(id);
+      const { open } = this.$refs.SeeModel;
+      await open(id);
     },
   },
 };
@@ -113,12 +87,20 @@ export default {
 <template>
   <el-card
     v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
+    style="
+      width: calc(100% - 20px);
+      height: 100%;
+      margin: 10px;
+      padding: 0 20px 20px 0;
+    "
     :body-style="{ padding: 0 }"
   >
-    <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <!-- <edit-dialog ref="EditdialogFef" @close="resetList"></edit-dialog> -->
+    <see-model ref="SeeModel"></see-model>
+    <add-model ref="AddModel" @success="useReset"></add-model>
+    <delete-model
+      ref="DeleteModel"
+      @success="useQuery(params, page)"
+    ></delete-model>
     <el-form
       :size="size"
       :model="params"
@@ -138,14 +120,25 @@ export default {
               v-model="params[column.key]"
               :placeholder="column.placeholder"
               style="width: 100%"
+              @keyup.enter.native="useQuery(params, page)"
             ></el-input>
-            <el-switch
-              v-if="column.inputType === 'Switch'"
+            <el-select
+              v-if="column.inputType === 'Select'"
               v-model="params[column.key]"
-              active-value="1"
-              inactive-value="0"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+              @keyup.enter.native="useQuery(params, page)"
             >
-            </el-switch>
+              <el-option
+                v-for="item in dict.type[column.referName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
             <dr-popover-select
               v-if="column.inputType === 'PopoverSelect'"
               v-model="params[column.key]"
@@ -158,32 +151,23 @@ export default {
               :value-key="column.valueKey"
               :placeholder="column.placeholder"
               :data-mapping="column.dataMapping"
+              @keyup.enter.native="useQuery(params, page)"
             >
             </dr-popover-select>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
-          <el-form-item label-width="0">
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-search"
-              @click="queryList(params, page)"
-            ></el-button>
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-refresh"
-              @click="resetList"
-            ></el-button>
-          </el-form-item>
-        </el-col>
       </el-row>
     </el-form>
+    <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useQuery(params, page)">
+        查 询
+      </el-button>
+      <el-button :size="size" @click="useReset"> 重 置 </el-button>
+    </el-row>
     <el-table
       :size="size"
       :data="tableData"
-      @row-dblclick="openSeeDialog"
+      @row-dblclick="openSeeModel"
       style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column
@@ -198,7 +182,7 @@ export default {
       <el-table-column fixed="right" label="操作" width="200">
         <template slot-scope="scope">
           <el-button
-            @click.native.prevent="openAddDialog(scope.row)"
+            @click.native.prevent="useAdd(scope.row)"
             type="text"
             size="small"
           >
@@ -212,7 +196,7 @@ export default {
             编 辑
           </el-button> -->
           <el-button
-            @click.native.prevent="deleteItem(scope.row)"
+            @click.native.prevent="useDelete(scope.row)"
             type="text"
             size="small"
           >
@@ -221,16 +205,11 @@ export default {
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      :layout="layout"
-      style="margin: 16px 0"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="useQuery(params, page)"
+    />
   </el-card>
 </template>

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

@@ -32,10 +32,10 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await ITEM(prop);
+        const { code,data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
+          
         } else {
           this.$notify.warning({ title: msg });
         }

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

@@ -51,8 +51,8 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
-              this.$notify.success({ title: msg });
+              this.$emit("success");
+              
             } else {
               this.$notify.warning({ title: msg });
             }

+ 32 - 64
src/views/purchase/catalogue/index.vue

@@ -1,13 +1,11 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
 import { LIST } from "@/api/business/purchase/catalogue";
-import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+import { initPage, initParams } from "@/utils/init";
 export default {
   name: "PuchaseCatalogue",
   components: {
-    // AddDrawer: () => import("./add/index.vue"),
-    // SeeDrawer: () => import("./see/index.vue"),
-    EditDialog: () => import("./edit/index.vue"),
+    EditModel: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -17,14 +15,12 @@ export default {
       params: initParams(SearchColumns),
       tableData: [],
       tableColumns: TableColumns,
-      page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
+      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
   created() {
-    this.queryList(this.params, this.page);
+    this.useQuery(this.params, this.page);
   },
   methods: {
     //
@@ -32,7 +28,7 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await LIST({
+        const { code, rows, total } = await LIST({
           pageNum,
           pageSize,
           ...prop,
@@ -40,40 +36,28 @@ export default {
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
-    // 查询操作
-    queryList() {
-      this.fetchList(this.params, this.page);
+    // 查 
+    useQuery(prop, page) {
+      this.fetchList(prop, page);
     },
-    // 重置操作
-    resetList() {
+    // 重 
+    useReset() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
+      this.useQuery(this.params, this.page);
     },
-    // 页大小变
-    sizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // 当前页变
-    currentChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // 打开编辑dialog
-    async openEditDialog(prop) {
+    // 编 辑
+    async useEdit(prop) {
       return;
-      const { open } = this.$refs.Editdialog;
+      const { open } = this.$refs.EditModel;
       await open(prop);
     },
   },
@@ -88,7 +72,7 @@ export default {
   >
     <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
     <!-- <add-drawer ref="AddDrawerFef" @close="resetList"></add-drawer> -->
-    <edit-dialog ref="Editdialog" @submit-success="resetList"></edit-dialog>
+    <!-- <edit-model ref="EditModel" @success="resetList"></edit-model> -->
     <el-form
       :size="size"
       :model="params"
@@ -110,12 +94,14 @@ export default {
                   v-model="params[column.key]"
                   :placeholder="column.placeholder"
                   style="width: 100%"
+                  @keyup.enter.native="useQuery(params, page)"
                 ></el-input>
                 <el-switch
                   v-if="column.inputType === 'Switch'"
                   v-model="params[column.key]"
                   active-value="1"
                   inactive-value="0"
+                  @keyup.enter.native="useQuery(params, page)"
                 >
                 </el-switch>
                 <dr-popover-select
@@ -130,36 +116,23 @@ export default {
                   :value-key="column.valueKey"
                   :placeholder="column.placeholder"
                   :data-mapping="column.dataMapping"
+                  @keyup.enter.native="useQuery(params, page)"
                 >
                 </dr-popover-select>
               </el-form-item>
             </el-col>
           </el-row>
         </el-col>
-        <el-col :span="1" :offset="1">
-          <el-row style="display: flex; flex-wrap: wrap">
-            <el-col :span="24" style="margin-bottom: 20px">
-              <el-button
-                circle
-                :size="size"
-                icon="el-icon-search"
-                @click="queryList(params, page)"
-              ></el-button>
-            </el-col>
-            <el-col :span="24">
-              <el-button
-                circle
-                :size="size"
-                icon="el-icon-refresh"
-                @click="resetList"
-              ></el-button>
-            </el-col>
-          </el-row>
-        </el-col>
       </el-row>
     </el-form>
+    <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useQuery(params, page)">
+        查 询
+      </el-button>
+      <el-button :size="size" @click="useReset"> 重 置 </el-button>
+    </el-row>
     <el-table
-      @row-dblclick="openEditDialog"
+      @row-dblclick="useEdit"
       :data="tableData"
       :size="size"
       style="width: 100%; margin: 20px 0 0 0"
@@ -174,16 +147,11 @@ export default {
       >
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      :layout="layout"
-      style="margin: 16px 0"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="useQuery(params, page)"
+    />
   </el-card>
 </template>

+ 46 - 14
src/views/purchase/contract/add/index.vue

@@ -1,5 +1,6 @@
 <script>
 import { Columns, TabColumns } from "../column";
+import { REFER } from "@/components/popover-select/api";
 import { ADD, CODE } from "@/api/business/purchase/contract";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
@@ -8,9 +9,11 @@ export default {
   dicts: Array.from(
     new Set([
       ...initDicts(Columns),
-      ...initDicts(TabColumns.map((item) => item.tableColumns))
-        .flat()
-        .filter((cItem) => cItem.inputType === "Select"),
+      ...initDicts(
+        TabColumns.map((item) => item.tableColumns)
+          .flat()
+          .filter((item) => item.inputType === "Select")
+      ),
     ])
   ),
   components: {},
@@ -48,8 +51,8 @@ export default {
       const {
         deptId: puDept,
         deptName: puDeptName,
-        id: buyer,
-        name: buyerName,
+        name: buyer,
+        nickName: buyerName,
         orgId: puOrg,
         orgName: puOrgName,
       } = this.$store.state.user;
@@ -75,12 +78,35 @@ export default {
         const code = await CODE();
         this.params.code = code;
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
     //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
     rowAdd(prop) {
       const tab = this.tabColumns.find((element) => element.key === prop);
       this.params[prop].push(initParams(tab.tableColumns));
@@ -90,10 +116,6 @@ export default {
       prop.splice(index, 1);
     },
     //
-    sava() {
-      this.visible = false;
-    },
-    //
     submit(prop) {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
@@ -111,8 +133,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
-              this.$notify.success({ title: msg });
+              this.$emit("success");
             } else {
               this.$notify.warning({ title: msg });
             }
@@ -127,7 +148,9 @@ export default {
       });
     },
   },
-  created() {},
+  created() {
+    console.log(this);
+  },
   mounted() {},
   destroyed() {},
 };
@@ -244,6 +267,7 @@ export default {
                 :prop="cColumn.key"
                 :label="cColumn.title"
                 :width="cColumn.width"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-input
@@ -255,6 +279,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
                   <dr-popover-select
                     v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"
@@ -267,6 +299,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
                   >
                   </dr-popover-select>
                   <el-input-number
@@ -326,7 +359,6 @@ export default {
       </el-form-item>
       <el-form-item label-width="0" style="text-align: right">
         <el-button :size="size" @click="hide">取 消</el-button>
-        <el-button :size="size" @click="sava">保 存</el-button>
         <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
       </el-form-item>
     </el-form>

+ 72 - 22
src/views/purchase/contract/column.js

@@ -108,8 +108,9 @@ export const Columns = [
   {
     key: "contractFormat",
     title: "合同格式",
-    inputType: "Input",
+    inputType: "Select",
     require: true,
+    referName: "puarchase_contract_contract_format",
   },
   {
     key: "productName",
@@ -129,7 +130,7 @@ export const Columns = [
     inputType: "PopoverSelect",
     referName: "TAX_RATE_PARAM",
     dataMapping: {
-      invoiceTax: "name",
+      invoiceTax: "ntaxrate",
     },
     require: true,
   },
@@ -246,21 +247,21 @@ export const Columns = [
     title: "对外附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "puFile",
     title: "采购商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "supplierFile",
     title: "供应商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   { key: "projectCode", title: "项目编号", inputType: "Input" },
   { key: "projectName", title: "项目名称", inputType: "Input" },
@@ -314,6 +315,10 @@ export const TabColumns = [
         dataMapping: {
           material: "code",
           materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
         },
       },
       { title: "物料编码", key: "material", width: 200 },
@@ -355,28 +360,56 @@ export const TabColumns = [
         inputType: "PopoverSelect",
         referName: "TAX_RATE_PARAM",
         dataMapping: {
-          tax: "name",
+          tax: "ntaxrate",
         },
-
         width: 200,
       },
       {
         title: "采购数量",
         key: "qty",
         inputType: "InputNumber",
-
         width: 200,
       },
       {
         title: "含税单价",
         key: "taxPrice",
         inputType: "InputNumber",
-
         width: 200,
       },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
-      { title: "无税单价", key: "taxFreePrice" },
-      { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          const taxMoney = (qty * taxPrice).toFixed(8);
+          return taxMoney === "NaN" ? null : taxMoney;
+        },
+      },
+      {
+        title: "无税单价",
+        key: "taxFreePrice",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { tax, taxPrice } = prop;
+          const newTax = Number(tax) / 100;
+          const taxFreePrice = (taxPrice / (1 + newTax)).toFixed(8);
+          return taxFreePrice === "NaN" ? null : taxFreePrice;
+        },
+      },
+      {
+        title: "无税金额合计",
+        key: "taxFreeMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxFreePrice } = prop;
+          const taxFreeMoney = (qty * taxFreePrice).toFixed(8);
+          return taxFreeMoney === "NaN" ? null : taxFreeMoney;
+        },
+      },
       {
         title: "注册证号及备案凭证号",
         key: "registration",
@@ -437,19 +470,27 @@ export const TabColumns = [
       {
         title: "付款起点",
         key: "origin",
-        inputType: "PopoverSelect",
         width: 200,
-        referName: "MATERIAL_PARAM",
-        dataMapping: {
-          material: "code",
-          materialName: "name",
-        },
+        inputType: "Select",
+        referName: "puarchase_contract_origin",
       },
       { title: "账期天数", key: "paymetDays", inputType: "Input", width: 200 },
       { title: "付款比例%", key: "ratio", inputType: "Input", width: 200 },
       { title: "付款金额", key: "money", inputType: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
+      {
+        title: "是否预付款",
+        key: "isAdvance",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
       {
         title: "结算方式",
         key: "paymentMeans",
@@ -474,8 +515,17 @@ export const TabColumns = [
     title: "合同执行组织范围",
     key: "contractApplyOrgList",
     tableColumns: [
-      { title: "组织名称", key: "orgName", inputType: "Input" },
-      { title: "组织编码", key: "org", inputType: "Input" },
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
     ],
   },
 ];

+ 40 - 0
src/views/purchase/contract/delete/index.vue

@@ -0,0 +1,40 @@
+<script>
+import { REMOVE } from "@/api/business/purchase/contract";
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否删除数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(async () => {
+          try {
+            const { code } = await REMOVE(prop);
+            if (code === 200) {
+              this.$emit("success");
+            }
+          } catch (err) {
+            // catch
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 107 - 33
src/views/purchase/contract/edit/index.vue

@@ -4,8 +4,11 @@ import {
   EDIT,
   ITEM,
   TABLELIST,
+  TABLEADD,
+  TABLEEDIT,
   TABLEROMOVE,
 } from "@/api/business/purchase/contract";
+import { REFER } from "@/components/popover-select/api";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
@@ -39,11 +42,32 @@ export default {
   },
   computed: {},
   watch: {
-    "params.contractType": function (newProp) {
-      this.tabColumns = TabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
-      );
-      this.tabName = this.tabColumns[0].key;
+    "params.contractType": {
+      handler: function (newProp) {
+        if (newProp === "1") {
+          this.params.contractItemList = [];
+          this.tabColumns = TabColumns.filter(
+            (element) => element.key !== "contractItemList"
+          );
+        } else {
+          this.tabColumns = TabColumns;
+        }
+        this.tabName = this.tabColumns[0].key;
+      },
+      immediate: true,
+    },
+    "params.contractItemList": {
+      handler: function (newProp, oldProp) {
+        console.log(newProp, oldProp);
+        if (newProp.length === oldProp.length) {
+          const index = newProp.findIndex(
+            (item, index) =>
+              JSON.stringify(item) === JSON.stringify(oldProp[index])
+          );
+          console.log(index);
+        }
+      },
+      deep: true,
     },
   },
   methods: {
@@ -62,18 +86,16 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await ITEM(prop);
+        const { code, data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
           this.tabName = this.tabColumns[0].key;
           this.fetchTable(this.params.code, this.tabName);
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
@@ -81,38 +103,77 @@ export default {
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await TABLELIST({ contractId: prop }, name);
+        const { code, rows } = await TABLELIST({ contractId: prop }, name);
         if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
+          this.params[name] = rows.map((item) => ({
+            ...item,
+            status: "success",
+          }));
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
     //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate === "0E-8" ? "0.00000000" : ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
     rowAdd(prop) {
       const tab = this.tabColumns.find((element) => element.key === prop);
       this.params[prop].push(initParams(tab.tableColumns));
     },
     //
-    async rowDelete(prop, { row: { id }, $index }) {
+    async rowDelete(prop, { row: { id } }) {
       try {
         this.loading = true;
-        const { code, msg } = await TABLEROMOVE(id, prop);
+        const { code } = await TABLEROMOVE(id, prop);
         if (code === 200) {
-          this.params[prop].splice($index, 1);
-          this.$notify.success({ title: msg });
+          this.fetchTable(this.params.code, this.tabName);
+        }
+      } catch (err) {
+        // catch
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //
+    async rowSubmit(prop, { row }) {
+      try {
+        this.loading = true;
+        const { contractId } = row;
+        if (contractId) {
+          await TABLEEDIT(row, prop);
         } else {
-          this.$notify.warning({ title: msg });
+          const { code } = this.params;
+          await TABLEADD({ ...row, contractId: code }, prop);
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
@@ -125,7 +186,7 @@ export default {
             const createByName = this.params.buyerName;
             const updateById = this.$store.state.user.id;
             const updateByName = this.$store.state.user.name;
-            const { code, msg } = await EDIT({
+            const { code } = await EDIT({
               createById,
               createByName,
               updateById,
@@ -134,15 +195,12 @@ export default {
             });
             if (code === 200) {
               this.hide();
-              this.$emit("submit-success");
-              this.$notify.success({ title: msg });
-            } else {
-              this.$notify.warning({ title: msg });
+              this.$emit("success");
             }
           } catch (err) {
-            //
+            // catch
           } finally {
-            //
+            // finally
           }
         } else {
           return false;
@@ -268,6 +326,7 @@ export default {
               </el-table-column>
               <el-table-column
                 v-for="(cColumn, cIndex) in column.tableColumns"
+                show-overflow-tooltip
                 :key="cIndex"
                 :prop="cColumn.key"
                 :label="cColumn.title"
@@ -283,6 +342,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
                   <dr-popover-select
                     v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"
@@ -295,6 +362,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
                   >
                   </dr-popover-select>
                   <el-input-number
@@ -326,7 +394,7 @@ export default {
                   <span v-else> {{ scope.row[cColumn.key] }}</span>
                 </template>
               </el-table-column>
-              <el-table-column fixed="right" label="操作" width="75">
+              <el-table-column fixed="right" label="操作" width="100">
                 <template slot="header" slot-scope="scope">
                   <el-button
                     circle
@@ -337,13 +405,19 @@ export default {
                   </el-button>
                 </template>
                 <template slot-scope="scope">
+                  <!-- v-if="scope.row.status !== 'success'" -->
+                  <el-button
+                    circle
+                    icon="el-icon-check"
+                    :size="size"
+                    @click.native.prevent="rowSubmit(tabName, scope)"
+                  >
+                  </el-button>
                   <el-button
                     circle
                     icon="el-icon-minus"
                     :size="size"
-                    @click.native.prevent="
-                      rowDelete(params[tabName], scope.$index)
-                    "
+                    @click.native.prevent="rowDelete(tabName, scope)"
                   >
                   </el-button>
                 </template>

+ 34 - 0
src/views/purchase/contract/export/index.vue

@@ -0,0 +1,34 @@
+<script>
+export default {
+  name: "ExportDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否确认导出所有数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          this.download(
+            "pu/contract/export",
+            { ...prop },
+            `contract_${new Date().getTime()}.xlsx`
+          );
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 117 - 0
src/views/purchase/contract/import/index.vue

@@ -0,0 +1,117 @@
+<script>
+import { getToken } from "@/utils/auth";
+import { IMPORTTEMPLATE } from "@/api/business/purchase/contract";
+export default {
+  name: "ImportDialog",
+  data() {
+    return {
+      visible: false,
+      upload: {
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {
+          Authorization: "Bearer " + getToken(),
+        },
+        // 上传的地址
+        url: "/drp-file/document-center/fastdfs/upload",
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.visible = true;
+    },
+    //
+    hide() {
+      this.visible = false;
+    },
+    //
+    async importTemplate() {
+      try {
+        const { msg, code } = await IMPORTTEMPLATE();
+        if (code === 200) {
+          this.download(msg, {});
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        // catch
+      } finally {
+        // finally
+      }
+    },
+    // 文件上传中处理
+    progress(event, file, fileList) {
+      console.log(event, file, fileList);
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    success(response, file, fileList) {
+      const { message: msg } = response;
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(msg, "导入结果", {
+        dangerouslyUseHTMLString: true,
+      });
+      this.getList();
+    },
+    //
+    confirm() {
+      this.$refs.upload.submit();
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-dialog title="导入" width="fit-content" :visible.sync="visible">
+    <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="progress"
+      :on-success="success"
+      :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"
+        style="display: flex; align-items: center"
+      >
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+        <el-link
+          type="info"
+          style="font-size: 12px; margin-left: 10px"
+          @click="importTemplate"
+        >
+          下载模板
+        </el-link>
+      </div>
+      <div class="el-upload__tip" style="color: red" slot="tip">
+        提示:仅允许导入“xls”或“xlsx”格式文件!
+      </div>
+    </el-upload>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="confirm">确 定</el-button>
+      <el-button @click="hide">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>

+ 96 - 94
src/views/purchase/contract/index.vue

@@ -1,13 +1,17 @@
 <script>
-import { LIST, REMOVE } from "@/api/business/purchase/contract";
+import { LIST } from "@/api/business/purchase/contract";
+import { initPage, initDicts, initParams } from "@/utils/init";
 import { Columns as TableColumns, SearchColumns } from "./column";
-import { initPage, initParams, initLayout, initPageSizes } from "@/utils/init";
 export default {
   name: "PuchaseContract",
+  dicts: initDicts(TableColumns),
   components: {
-    AddDialog: () => import("./add/index.vue"),
-    SeeDialog: () => import("./see/index.vue"),
-    EditDialog: () => import("./edit/index.vue"),
+    AddModel: () => import("./add/index.vue"),
+    SeeModel: () => import("./see/index.vue"),
+    EditModel: () => import("./edit/index.vue"),
+    ExportModel: () => import("./export/index.vue"),
+    ImportModel: () => import("./import/index.vue"),
+    DeleteModel: () => import("./delete/index.vue"),
   },
   data() {
     return {
@@ -17,14 +21,12 @@ export default {
       params: initParams(SearchColumns),
       tableData: [],
       tableColumns: TableColumns,
-      page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
+      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
   created() {
-    this.queryList(this.params, this.page);
+    this.useQuery(this.params, this.page);
   },
   methods: {
     //
@@ -32,7 +34,7 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await LIST({
+        const { code, rows, total } = await LIST({
           pageNum,
           pageSize,
           ...prop,
@@ -40,71 +42,58 @@ export default {
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
-    // 查询操作
-    queryList(prop, page) {
+    // 查 
+    useQuery(prop, page) {
       this.fetchList(prop, page);
     },
-    // 重置操作
-    resetList() {
+    // 重 
+    useReset() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.queryList(this.params, this.page);
+      this.useQuery(this.params, this.page);
     },
-    // 删除操作
-    async deleteItem(prop) {
-      try {
-        this.loading = true;
-        const { id } = prop;
-        const { code, msg } = await REMOVE(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.queryList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
-    // 页大小变
-    sizeChange(prop) {
-      this.page.pageSize = prop;
-      this.queryList(this.params, this.page);
-    },
-    // 当前页变
-    currentChange(prop) {
-      this.page.pageNum = prop;
-      this.queryList(this.params, this.page);
-    },
-    // 打开新增drawer
-    async openAddDialog() {
-      const { open } = this.$refs.AddDialog;
+    // 新 增
+    async useAdd() {
+      const { open } = this.$refs.AddModel;
       await open();
     },
-    // 打开查看drawer
-    async openSeeDialog(prop) {
+    // 删 除
+    async useDelete(prop) {
+      const { id } = prop;
+      const { open } = this.$refs.DeleteModel;
+      await open(id);
+    },
+    // 编 辑
+    async useEdit(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeDialog;
+      const { open } = this.$refs.EditModel;
       await open(id);
     },
-    // 打开编辑drawer
-    async openEditDialog(prop) {
+    // 明 细
+    async useSee(prop) {
       const { id } = prop;
-      const { open } = this.$refs.EditDialog;
+      const { open } = this.$refs.SeeModel;
       await open(id);
     },
+    // 导 出
+    async useExport(prop) {
+      const { pageNum, pageSize } = this.page;
+      const { open } = this.$refs.ExportModel;
+      await open({ ...prop, pageNum, pageSize });
+    },
+    // 导 入
+    async useImport() {
+      const { open } = this.$refs.ImportModel;
+      await open();
+    },
   },
 };
 </script>
@@ -112,18 +101,30 @@ export default {
 <template>
   <el-card
     v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
+    style="
+      width: calc(100% - 20px);
+      height: 100%;
+      margin: 10px;
+      padding: 0 20px 20px 0;
+    "
     :body-style="{ padding: 0 }"
   >
-    <see-dialog ref="SeeDialog"></see-dialog>
-    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
-    <edit-dialog ref="EditDialog" @submit-success="resetList"></edit-dialog>
+    <see-model ref="SeeModel"></see-model>
+    <add-model ref="AddModel" @success="useReset"></add-model>
+    <edit-model ref="EditModel" @success="useQuery(params, page)"></edit-model>
+    <export-model ref="ExportModel"></export-model>
+    <import-model ref="ImportModel"></import-model>
+    <delete-model
+      ref="DeleteModel"
+      @success="useQuery(params, page)"
+    ></delete-model>
     <el-form
       :size="size"
       :model="params"
       label-width="75px"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col
@@ -135,36 +136,25 @@ export default {
             <el-input
               v-model="params[column.key]"
               :placeholder="column.placeholder"
+              @keyup.enter.native="useQuery(params, page)"
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
-          <el-form-item label-width="0">
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-search"
-              @click="queryList(params, page)"
-            ></el-button>
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-refresh"
-              @click="resetList"
-            ></el-button>
-          </el-form-item>
-        </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">
-        <el-button :size="size" @click="openAddDialog"> 新 增 </el-button>
-      </el-col>
+    <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useQuery(params, page)">
+        查 询
+      </el-button>
+      <el-button :size="size" @click="useReset"> 重 置 </el-button>
+      <el-button :size="size" @click="useAdd"> 新 增 </el-button>
+      <el-button :size="size" @click="useExport(params)"> 导 出 </el-button>
+      <el-button :size="size" @click="useImport"> 导 入 </el-button>
     </el-row>
     <el-table
       :size="size"
       :data="tableData"
-      @row-dblclick="openSeeDialog"
+      @row-dblclick="useSee"
       style="width: 100%; margin: 20px 0 0 0"
     >
       <el-table-column
@@ -173,38 +163,50 @@ export default {
         :prop="column.key"
         :label="column.title"
         :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
+        show-overflow-tooltip
       >
+        <template slot-scope="scope">
+          <dict-tag
+            v-if="column.inputType === 'Select'"
+            :size="size"
+            :value="scope.row[column.key]"
+            :options="dict.type[column.referName]"
+          />
+          <el-button
+            v-else-if="column.inputType === 'Upload'"
+            type="text"
+            size="small"
+            @click.native.prevent="useEdit(scope.row)"
+          >
+            点击查看
+          </el-button>
+          <span v-else>{{ scope.row[column.key] }}</span>
+        </template>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button
-            @click.native.prevent="openEditDialog(scope.row)"
             type="text"
             size="small"
+            @click.native.prevent="useEdit(scope.row)"
           >
             编 辑
           </el-button>
           <el-button
-            @click.native.prevent="deleteItem(scope.row)"
             type="text"
             size="small"
+            @click.native.prevent="useDelete(scope.row)"
           >
             删 除
           </el-button>
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      :layout="layout"
-      style="margin: 16px 0"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="useQuery(params, page)"
+    />
   </el-card>
 </template>

+ 4 - 4
src/views/purchase/contract/see/index.vue

@@ -49,10 +49,10 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await ITEM(prop);
+        const { code,data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
+          
           this.tabName = this.tabColumns[0].key;
           this.fetchTable(this.params.code, this.tabName);
         } else {
@@ -68,10 +68,10 @@ export default {
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await TABLELIST({ contractId: prop }, name);
+        const { code,rows } = await TABLELIST({ contractId: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
-          this.$notify.success({ title: msg });
+          
         } else {
           this.$notify.warning({ title: msg });
         }

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

@@ -173,23 +173,23 @@
           max-height="480"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55" />
-          <el-table-column label="仓库属性" align="center" prop="warehouseProperty"/>
-          <el-table-column label="仓库档案名称" align="center" width="200" prop="warehouseCode"/>
-          <el-table-column label="收货仓库编码" align="center" prop="code" />
-          <el-table-column label="收货仓库名称" align="center" width="150" prop="name"/>
-          <el-table-column label="详细地址" align="center" width="150" prop="address"/>
-          <el-table-column label="物料分类" align="center" width="150" prop="materialClassifyName" />
-          <el-table-column label="联系人" align="center" width="150" prop="contactsName" />
-          <el-table-column label="联系人电话" align="center" prop="contactsPhone" />
-          <el-table-column label="NC档案ID" align="center" width="150" prop="createTime" />
-          <el-table-column label="备注" align="center" width="120" prop="remark" />
-          <el-table-column label="创建人" align="center" width="150" prop="createByName" />
-          <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
-          <el-table-column label="修改人" align="center" width="150" prop="updateByName" />
-          <el-table-column label="修改时间" align="center" width="150" prop="updateTime" />
-          <el-table-column label="同步状态" align="center" width="150" prop="sendStatus" />
-          <el-table-column label="启用" align="center" width="150" prop="status" />
+          <el-table-column show-overflow-tooltip type="selection" width="55" />
+          <el-table-column show-overflow-tooltip label="仓库属性" align="center" prop="warehouseProperty"/>
+          <el-table-column show-overflow-tooltip label="仓库档案名称" align="center" width="200" prop="warehouseCode"/>
+          <el-table-column show-overflow-tooltip label="收货仓库编码" align="center" prop="code" />
+          <el-table-column show-overflow-tooltip label="收货仓库名称" align="center" width="150" prop="name"/>
+          <el-table-column show-overflow-tooltip label="详细地址" align="center" width="150" prop="address"/>
+          <el-table-column show-overflow-tooltip label="物料分类" align="center" width="150" prop="materialClassifyName" />
+          <el-table-column show-overflow-tooltip label="联系人" align="center" width="150" prop="contactsName" />
+          <el-table-column show-overflow-tooltip label="联系人电话" align="center" prop="contactsPhone" />
+          <el-table-column show-overflow-tooltip label="NC档案ID" align="center" width="150" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="备注" align="center" width="120" prop="remark" />
+          <el-table-column show-overflow-tooltip label="创建人" align="center" width="150" prop="createByName" />
+          <el-table-column show-overflow-tooltip label="创建时间" align="center" width="150" prop="createTime" />
+          <el-table-column show-overflow-tooltip label="修改人" align="center" width="150" prop="updateByName" />
+          <el-table-column show-overflow-tooltip label="修改时间" align="center" width="150" prop="updateTime" />
+          <el-table-column show-overflow-tooltip label="同步状态" align="center" width="150" prop="sendStatus" />
+          <el-table-column show-overflow-tooltip label="启用" align="center" width="150" prop="status" />
           <el-table-column
           fixed="right"
           label="操作"

+ 1 - 1
src/views/purchase/purchase-content/index.vue

@@ -191,7 +191,7 @@ export default {
         if (code === 200) {
           this.total = total;
           this.tableData = rows;
-          this.$notify.success({ title: msg });
+          
         } else {
           this.$notify.warning({ title: msg });
         }

+ 364 - 91
src/views/purchase/purchase-order/add/column.js

@@ -11,21 +11,30 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type", // 字典名
+    isShow:true,
+  },
+  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input",  isShow:true,},
+  {
+    key: "code",
+    title: "订单编号",
+    inputType: "Input",
+    readonly: true,
+    disabled: true,
+    isShow:true,
   },
-  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input", },
-  { key: "code", title: "订单编号", inputType: "Input", },
   {
     key: "billDate",
     title: "订单日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
-    width: 200,
+    width: 200, isShow:true,
   },
   {
     key: "supplierName",
@@ -39,6 +48,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "paymentAgreementName",
@@ -51,7 +61,7 @@ export const Columns = [
       paymentAgreementName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "finalTypeName",
@@ -64,6 +74,7 @@ export const Columns = [
       finalTypeName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "currencyName",
@@ -76,7 +87,7 @@ export const Columns = [
       currencyName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "buyerName",
@@ -90,6 +101,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "puDeptName",
@@ -103,6 +115,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "customerName",
@@ -117,35 +130,40 @@ export const Columns = [
       customerName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "qty",
     title: "总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
+    isShow:true,
   },
   {
     key: "originalQty",
     title: "原始总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
+    isShow:true,
   },
-  { key: "money", title: "价税合计", inputType: "Input", },
-  { key: "originalMoney", title: "原始总金额", inputType: "Input", },
-  { key: "notaxMoney", title: "无税金额", inputType: "Input", },
+  { key: "money", title: "价税合计", inputType: "Input", isShow:true, },
+  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true,},
+  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true,},
   {
     key: "status",
     title: "单据状态",
     inputType: "Select",
-    referName: "sys_status", // 字典名
+    referName: "documents_status", // 字典名
+    disabled: true,
+    isShow:true,
   },
-  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", },
-  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox", },
-  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox", },
-  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox", },
+  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
+  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
   {
     key: "warehouseName",
-    title: "WMS入库仓库", // 收货仓库
+    title: "WMS入库仓库", 
     inputType: "PopoverSelect",
     require: true,
     valueKey: "id",
@@ -154,7 +172,10 @@ export const Columns = [
       warehouse: 'id',
       warehouseName: 'name'
     },
-    queryParams: () => ({}),
+    queryParams: (params) => ({
+      pkOrg: params.puOrg,
+    }),
+    isShow:true,
   },
   {
     key: "goodsAllocationName",
@@ -167,18 +188,56 @@ export const Columns = [
       goodsAllocation: 'id',
       goodsAllocationName: 'name'
     },
+     isShow:true,
     queryParams: (params) => ({
-      pkOrg: params.puOrg,
+      stordocId: params.warehouse,
     }),
     width: 200,
   },
-  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox", },
-  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", },
-  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input", },
-  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input", },
-  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input", },
-  { key: "address", title: "收货地址", inputType: "Input", },
-  { key: "contacts", title: "收货联系人", inputType: "Input", },
+  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
+  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", isShow:true,},
+  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
+  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input",isShow:true, },
+  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input",isShow:true, },
+  { 
+    key: "goodsWarehouseName",
+    title: "收货仓库",
+    inputType: "Input",
+    isShow:true,
+    disabled:true,
+  },
+  { 
+    key: "address",
+    title: "收货地址",
+    inputType: "PopoverSelect",
+    valueKey: "address",
+    referName: "ADDRESS_PARAM",
+    isShow:true,
+    dataMapping: {
+      // address: 'address',
+      // addressName: '',
+      goodsWarehouse:'id',
+      goodsWarehouseName:'name',
+      contacts:'contactsName',
+      contactsPhone:'contactsPhone'
+    },
+    queryParams: () => ({}),
+    width: 180
+  },
+  { 
+    key: "contacts", 
+    title: "收货联系人", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
+  { 
+    key: "contactsPhone", 
+    title: "收货联系人电话", 
+    inputType: "Input",
+    isShow:true, 
+    disabled:true,
+  },
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -190,6 +249,7 @@ export const Columns = [
       customerDept: 'id',
       customerDeptName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
@@ -204,37 +264,60 @@ export const Columns = [
       supplierContacts: 'id',
       supplierContactsName: 'name'
     },
-    queryParams: () => ({}),
+     isShow:true,
+    queryParams: (params) => ({
+      supplierId:params.supplier
+    }),
     width: 200,
   },
-  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox", },
-  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox", },
+  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox",isShow:true, },
+  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox",isShow:true, },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
-  // { key: "agentName", title: "代理人名称", },
-  { key: "isClose", title: "最终关闭", inputType: "Checkbox", },
+  {
+    key: "agentName",
+    title: "代理人",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      agent: 'id',
+      agentName: 'name'
+    },
+     isShow:true,
+    queryParams: () => ({}),
+    width: 200,
+  },
+  { key: "isClose", title: "最终关闭", inputType: "Checkbox", isShow:true, },
   {
     key: "closeTime",
     title: "最终关闭日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:true,
   },
-  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", },
-  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", },
-  { key: "invoiceMoney", title: "发票金额", inputType: "Input", },
+  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", isShow:true,},
+  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", isShow:true,},
+  { key: "invoiceMoney", title: "发票金额", inputType: "Input",isShow:true, },
   {
     key: "supplierPersonalName",
     title: "供应商业务员",
     inputType: "PopoverSelect",
     valueKey: "id",
-    referName: "SUPPLIERCONTACTS_PARAM",
+    // referName: "SUPPLIERCONTACTS_PARAM",
+    referName: "PSNLICENSE_PARAM",
     dataMapping: {
       supplierPersonal: 'id',
       supplierPersonalName: 'name'
     },
-    queryParams: () => ({}),
+     isShow:true,
+    queryParams: (params) => ({
+      // 组织、供应商id
+      pkOrg: params.puOrg,
+      supplierId:params.supplier
+    }),
     require: true,
   },
-  { key: "isDeliver", title: "是否发货", inputType: "Checkbox", },
+  { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
   {
     key: "retReasonName",
     title: "退换原因",
@@ -246,6 +329,7 @@ export const Columns = [
       retReason: 'id',
       retReasonName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -259,9 +343,10 @@ export const Columns = [
       processType: 'id',
       processTypeName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
-  { key: "isEnd", title: "整单关闭标识", inputType: "Input", },
+  { key: "isEnd", title: "整单关闭标识", inputType: "Input", isShow:true, },
   {
     key: "projectNowName",
     title: "在建工程项目",
@@ -273,6 +358,7 @@ export const Columns = [
       projectNow: 'id',
       projectNowName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -286,28 +372,39 @@ export const Columns = [
       operatingItems: 'id',
       operatingItemsName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
-  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", },
-  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", },
-  { key: "marketingCode", title: "销售订单号", inputType: "Input", },
-  { key: "isArrival", title: "到货超期", inputType: "Checkbox", },
-  { key: "createByName", title: "创建人名称", inputType: "Input", },
-  { key: "updateByName", title: "更新人名称", inputType: "Input", },
-  { key: "flowId", title: "OA流程ID", inputType: "Input", },
-  { key: "approver", title: "审批人", inputType: "Input", },
+  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", isShow:true, },
+  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
+  { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
+  { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
+  { key: "createByName", title: "创建人名称", inputType: "Input", isShow:false, },
+  { key: "updateByName", title: "更新人名称", inputType: "Input", isShow:false, },
+  { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
+  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
   {
     key: "approverFinishTime",
     title: "审批时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
   },
   {
     key: "approveTime",
     title: "提交时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
+  },
+  {
+    key: "sysFileRecordList",
+    title: "附件",
+    inputType: "Upload",
+    // fileType: ["pdf",""],
+    span: 24,
+    isShow:true,
   },
 
 ];
@@ -319,8 +416,8 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      { key: "rowNo", title: "行号", inputType: "Input", },
-      { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+      { key: "rowNo", title: "行号", inputType: "Input", disabled:true},
+      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
       // {key: "material",title: "物料",inputType: "Input",   },
       {
         key: "materialName",
@@ -333,6 +430,20 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
+          materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicineValue',
+          manufacturer:'manufacturerIdName',
+          unit:'unitIdName',
+          // tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'oneClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass',
         },
         queryParams: () => ({}),
       },
@@ -341,67 +452,171 @@ export const TabColumns = [
         title: "物料编码",
         inputType: "Input",
         width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { //classifyIdName   classifyId
+        key: "materialClassify",
+        title: "物料分类", 
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true, 
+      },
+      { // manufacturersMaterialCode  manufacturersMaterialName
+        key: "materialManufacturersCode",
+         title: "厂家物料编码", 
+         inputType: "Input",
+          width: 180,
+          disabled:true,
+        readonly:true,
+         },
+      { //specification
+        key: "specification",
+        title: "规格", 
+        inputType: "Input",
+        width: 180 ,
+        disabled:true,
+        readonly:true,
+        },
+      { //model
+        key: "model",
+        title: "型号", 
+        inputType: "Input",
+        disabled:true,
+        readonly:true,
+      },
+      { //isMedicine  isMedicineValue
+        key: "isMedcine",
+        title: "医药物料", 
+        inputType: "Checkbox", 
+        width: 180,
+        disabled:true,
+        readonly:true,
+        },
+      { // manufacturerId  manufacturerIdName
+        key: "manufacturer",
+        title: "生产厂家代理人",
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { 
+        key: "isDrug",
+         title: "物料药品属性", 
+         inputType: "Checkbox", 
+         disabled:true,
+      },
+      { //unitId  unitIdName
+        key: "unit", 
+        title: "单位", 
+        inputType: "Input",
+        disabled:true,
+        readonly:true,
+       },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
       },
-      { key: "materialClassify", title: "物料分类", inputType: "Input", width: 180 },
-      { key: "materialManufacturersCode", title: "厂家物料编码", inputType: "Input", width: 180 },
-      { key: "specification", title: "规格", inputType: "Input", width: 180 },
-      { key: "model", title: "型号", inputType: "Input", },
-      { key: "isMedcine", title: "医药物料", inputType: "Input", width: 180 },
-      { key: "manufacturer", title: "生产厂家代理人", inputType: "Input", width: 180 },
-      { key: "isDrug", title: "物料药品属性", inputType: "Input", width: 180 },
-      { key: "unit", title: "单位", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
       { key: "taxPrice", title: "含税单价", inputType: "Input", },
       { key: "money", title: "价税合计", inputType: "Input", },
-      { key: "tax", title: "税率", inputType: "Input", },
+      { //materialRate  materialRateName
+        key: "tax", 
+        title: "税率",
+        inputType: "Input",
+      },
       { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input", },
       { key: "arrivalQty", title: "已到货数量", inputType: "Input", },
       { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
       { key: "notaxMoney", title: "无税金额", inputType: "Input", },
-      { key: "priceSource", title: "价格目录ID", inputType: "Input", },
-      { key: "isStorage", title: "入库关闭", inputType: "Input", },
-      { key: "isInvoice", title: "开票关闭", inputType: "Input", },
-      { key: "isArrival", title: "到货关闭", inputType: "Input", },
-      { key: "isPayment", title: "付款关闭", inputType: "Input", },
-      { key: "isGift", title: "赠品", inputType: "Input", width: 180 },
+      // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
+      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", },
+      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", },
+      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", },
+      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", },
+      { key: "isGift", title: "赠品", inputType: "Checkbox", },
       {
-        key: "warehouseName",
-        title: "收货仓库", //WMS入库仓库
+        key: "goodsWarehouseName",
+        title: "收货仓库", 
+        inputType: "Input",
+        width: 200,
+        disabled:true,
+      },
+      // { key: "place", title: "收货地点", inputType: "Input", width: 180 },
+      { 
+        key: "address",
+        title: "收货地址",
+        inputType: "PopoverSelect",
+        valueKey: "address",
+        referName: "ADDRESS_PARAM",
+        width: 180,
+        dataMapping:{
+          // address: 'address',
+          // addressName: '',
+          goodsWarehouse:'id',
+          goodsWarehouseName:'name',
+          contacts:'contactsName',
+          contactsPhone:'contactsPhone'
+        }
+      },
+      { 
+        key: "customerName",
+        title: "收货客户", 
         inputType: "PopoverSelect",
         valueKey: "id",
-        referName: "WAREHOUSE_PARAM",
-        dataMapping: {
-          warehouse: 'id',
-          warehouseName: 'name'
+        referName: "CUSTOMER_PARAM",
+        width: 180,
+        dataMapping:{
+          customer:'id',
+          customerName:'name',
         },
-        queryParams: () => ({}),
-        width: 200,
       },
-      { key: "place", title: "收货地点", inputType: "Input", width: 180 },
-      { key: "address", title: "收货地址", inputType: "Input", width: 180 },
       { key: "productBatch", title: "产品批号", inputType: "Input", width: 180 },
       { key: "manufactureDate", title: "生产日期", inputType: "Input", width: 180 },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", inputType: "Input", width: 180 },
-      { key: "approvalNumber", title: "批准文号", inputType: "Input", width: 180 },
-      { key: "registration", title: "注册证号", inputType: "Input", width: 180 },
+      { 
+        key: "efficacyLoseDate", 
+        title: "有效期至/失效日期", 
+        inputType: "Input",
+         width: 180
+         },
+      { 
+        key: "approvalNumber",
+         title: "批准文号",
+          inputType: "Input", 
+          width: 180
+         },
+      { 
+        key: "registration",
+         title: "注册证号", 
+         inputType: "Input", 
+         width: 180 
+        },
 
-      {
+      { //storageCondition storageConditionName
         key: "storageCondition",
         title: "存储条件",
         inputType: "Select",
         referName: "sys_storage_condition", // 字典名
-        width: 180
+        width: 180,
+        disabled:true,
+        readonly:true,
       },
-      {
+      { // transportationCondition  transportationConditionName
         key: "carriageCondition",
         title: "运输条件",
         inputType: "Select",
         referName: "sys_conditions_carriage", // 字典名
-        width: 180
+        width: 180,
+        disabled:true,
+        readonly:true,
       },
 
-      { key: "isBatchLock", title: "批号锁定标识", inputType: "Input", },
-      { key: "isReplenishment", title: "补单标识", inputType: "Input", },
+      { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
+      { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
       { key: "isUrgency", title: "紧急标识", inputType: "Input", },
       { key: "originalQty", title: "原始数量", inputType: "Input", },
       { key: "originalMoney", title: "原始金额", inputType: "Input", },
@@ -425,19 +640,51 @@ export const TabColumns = [
       { key: "isDistributionPrice", title: "配送价", inputType: "Input", },
       { key: "createByName", title: "创建人名称", inputType: "Input", },
       { key: "updateByName", title: "更新人名称", inputType: "Input", },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", inputType: "Input", width: 180 },
-      { key: "price", title: "无税单价", inputType: "Input", }
+      { //threeClass
+        key: "materialClassifyOneName", 
+        title: "物料一级分类名称", 
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true, 
+      },
+      { //twoClass
+        key: "materialClassifyTwoName",
+        title: "物料二级分类名称", 
+        inputType: "Input",
+        width: 180,
+        disabled:true,
+        readonly:true, 
+      },
+      { //threeClass
+        key: "materialClassifyThreeName", 
+        title: "物料三级分类名称", 
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { //fourClass
+        key: "materialClassifyFourName", 
+        title: "物料四级分类名称",
+        inputType: "Input", 
+        width: 180,
+        disabled:true,
+        readonly:true,
+      },
+      { 
+        key: "price",
+        title: "无税单价",
+        inputType: "Input",
+      }
     ]
   },
   {
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
-      { key: "rowno", title: "行号", inputType: "Input", },
+      // { key: "orderId", title: "采购订单ID", inputType: "Input", width: 180 },
+      { key: "rowno", title: "行号", inputType: "Input", disabled:true},
       {
         key: "materialName",
         title: "物料",
@@ -448,12 +695,38 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
+          materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicineValue',
+          manufacturer:'manufacturerIdName',
+          unit:'unitIdName',
+          // tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'oneClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass',
         },
         queryParams: () => ({}),
         width: 180
       },
-      { key: "specification", title: "规格", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
+      { 
+        key: "specification",
+        title: "规格", 
+        inputType: "Input", 
+        disabled:true,
+        readonly:true, 
+      },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
+      },
       { key: "stroageQty", title: "累计到货主数量", inputType: "Input", width: 120 },
       { key: "stockQty", title: "累计入库主数量", inputType: "Input", width: 120 },
       { key: "invoiceQty", title: "累计开票主数量", inputType: "Input", width: 120 },

+ 370 - 186
src/views/purchase/purchase-order/add/index.vue

@@ -9,18 +9,22 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 
-const SelectColumns = NewColumns.filter((column) => column.inputType === "Select");
+const SelectColumns = NewColumns.filter(
+  (column) => column.inputType === "Select"
+);
 NewTabColumns.forEach((column) => {
   SelectColumns.push(
     ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
   );
 });
-console.log(SelectColumns, 'SelectColumns');
 
 export default {
   name: "AddPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
-  components: {},
+  components: {
+    FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
+    popDialog: () => import("@/components/PopDialog/index.vue"),
+  },
 
   data() {
     return {
@@ -43,41 +47,49 @@ export default {
   watch: {
     "params.puOrderItemList": {
       handler(nVal, oVal) {
-        console.log(nVal, 'nVal', oVal, 'oVal');
-        this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
+        this.visible &&
+          this.handleSynchronousMaterial(
+            "puOrderItemList",
+            "puOrderExecuteList"
+          );
       },
       deep: true,
     },
     "params.puOrderExecuteList": {
       handler(nVal, oVal) {
-        this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
+        this.visible &&
+          this.handleSynchronousMaterial(
+            "puOrderExecuteList",
+            "puOrderItemList"
+          );
       },
       deep: true,
     },
-    "params": {
+    params: {
       handler(nVal, oVal) {
-
-
         // 组织变化
-        if (nVal.puOrg != oVal.puOrg) {
-          console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
+        if (this.visible && nVal.puOrg != oVal.puOrg) {
+          console.log(nVal.puOrg, "nVal.puOrg", oVal.puOrg, "oVal.puOrg");
           for (const key in this.params) {
             if (Array.isArray(this.params[key])) {
               this.params[key] = [];
+            } else if (
+              key != "puOrg" &&
+              key != "puOrgName" &&
+              key != "buyer" &&
+              key != "buyerName" &&
+              key != "puDept" &&
+              key != "puDeptName" &&
+              key != "status"
+            ) {
+              this.params[key] = "";
+            } else {
             }
-            else if (key != 'puOrg' && key != 'puOrgName'
-              && key != 'buyer' && key != 'buyerName'
-              && key != 'puDept' && key != 'puDeptName'
-              && key != 'status') {
-              this.params[key] = '';
-            }
-            else { }
           }
         }
-
       },
       deep: true,
-    }
+    },
   },
   methods: {
     beforeOpen() {
@@ -88,11 +100,43 @@ export default {
       this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
-      this.params.status = '0';
-
+      this.params.billDate = new Date().Format('yyyy-MM-dd');
     },
     setVisible(prop) {
       this.visible = prop;
+
+      if(!this.visible){
+        this.$refs['orderAddForm'].clearValidate();
+      }
+    },
+    // 复制赋值
+    async setCopyParams(id) {
+      console.log(id, "iid-----------------------");
+      try {
+        const { code, msg, data } = await orderApi.details(id);
+
+        if (code === 200) {
+          this.params = {
+            ...data,
+            id: "",
+            code: "",
+            status: "0",
+            source: "3",
+          };
+
+          for (const key in this.params) {
+            if (Array.isArray(this.params[key])) {
+              this.params[key].forEach((v) => {
+                v.id = "";
+              });
+            }
+          }
+        }
+      } catch (err) {
+        //
+      } finally {
+        // this.loading = false;
+      }
     },
     // 增行
     addTableRow(prop) {
@@ -110,7 +154,7 @@ export default {
             (rowData["rowNo"] = this.params[key].length + 1);
 
           // 是否完成询价,新增明细行需默认明细为false
-          rowData['whetherCompleteInquiry'] = false;
+          rowData["whetherCompleteInquiry"] = false;
 
           this.params[key].push(rowData);
         }
@@ -134,43 +178,45 @@ export default {
     handleSynchronousMaterial(key1, key2) {
       let _this = this;
       // this.params[key1]-- -> this.params[key2]
-      this.params[key1] && this.params[key1].forEach((item, index) => {
-
-        for (const key in item) {
-
-          if (key in _this.params[key2][index]) {
-
-            if (key == 'material' || key == 'materialName' || key == 'materialCode') {
-              _this.params[key2][index].material = item.material;
-              _this.params[key2][index].materialName = item.materialName;
-              _this.params[key2][index].materialCode = item.materialCode;
-            } else {
-
-              _this.params[key2][index][key] = item[key];
+      this.params[key1] &&
+        this.params[key1].forEach((item, index) => {
+          for (const key in item) {
+            if (key in _this.params[key2][index]) {
+              if (
+                key == "material" ||
+                key == "materialName" ||
+                key == "materialCode"
+              ) {
+                _this.params[key2][index].material = item.material;
+                _this.params[key2][index].materialName = item.materialName;
+                _this.params[key2][index].materialCode = item.materialCode;
+              } else {
+                _this.params[key2][index][key] = item[key];
+              }
             }
           }
-        }
-
-      });
+        });
     },
     // 取消
     handleCancel() {
       this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
+      this.params = {
+        ...initParams(this.columns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      };
     },
     // 保存
     async handleSava() {
       // orderAddForm
       console.log(this.params, "params");
+
       // this.$refs['orderAddForm'].validate(async (valid) => {
       //   if (valid) {
       try {
         const { code, msg } = await orderApi.create(this.params);
         if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
-        } else {
-          this.$notify.warning({ title: msg });
+          this.handleCancel();
         }
       } catch (err) {
         //
@@ -185,55 +231,56 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
-      // this.$refs["orderAddForm"].validate(async (valid) => {
-      //   if (valid) {
-      try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await orderApi.create({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
+      this.$refs["orderAddForm"].validate(async (valid) => {
+        if (valid) {
+          try {
+            const createById = this.params.buyer;
+            const createByName = this.params.buyerName;
+            const updateById = this.$store.state.user.id;
+            const updateByName = this.$store.state.user.name;
+            const { code, msg } = await orderApi.create({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.setVisible(false);
+            }
+          } catch (err) {
+            this.$notify.error({ title: "error", message: err });
+          } finally {
+            // this.setVisible(false);
+          }
         } else {
-          this.$notify.warning({ title: msg });
+          console.log("error submit!!");
+          return false;
         }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        // this.setVisible(false);
-      }
-      //   } else {
-      //     console.log("error submit!!");
-      //     return false;
-      //   }
-      // });
+      });
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
-      console.log(val, 'val');
-      console.log(source, 'source');
-      console.log(type, 'type');
-
-      // 触发物料参照
-      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+    handleReferChange(val, type, source) {
+      console.log(val, "val");
+      console.log(source, "source");
+      console.log(type, "type");
 
+      // 触发物料参照询价
+      if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
         this.handleGetPrice();
       }
+
+      if(type == "MATERIAL_PARAM"){
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+        // return source;
+      }
     },
 
-    // 子表input
+    // 子表inputNumber
     handleInputChange(row, type) {
-      console.log(type, 'type');
+      console.log(type, "type");
       // 物料数量变化----询价
-      if (type == 'qty' && row.material) {
+      if (type == "qty" && row.material) {
         this.handleGetPrice();
       }
     },
@@ -241,161 +288,296 @@ export default {
     async handleGetPrice() {
       try {
         // let { puOrg, priceType, customer, assignSupplier, material, } = data;
-        let { code, data } = await orderApi.getPrice({ ...this.params })
+        let { code, data } = await orderApi.getPrice({ ...this.params });
         if (code == 200) {
           this.params = data;
         }
       } catch (error) {
-
       } finally {
+      }
+    },
 
+    // 下拉框选择改变
+    handleChangeSelect(val,typeName){
+      if(val === 'billType'){
+       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
       }
     },
 
   },
   created() {
-    console.log("ADD CREATED", this.params)
+    console.log("ADD CREATED", this.params);
   },
-  mounted() { },
-  destroyed() { },
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form size="mini" label-position="right" ref="orderAddForm" label-width="140px" :model="params" :rules="rules">
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }" style="margin: 10px">
-        <div slot="header" style="
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      size="mini"
+      label-position="right"
+      ref="orderAddForm"
+      label-width="140px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
-            <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
-            <el-button size="mini" type="info" @click="handleSubmit">
+            <el-button size="mini" type="danger" @click="handleSava"
+              >保存</el-button
+            >
+            <!-- <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
-            </el-button>
+            </el-button> -->
           </div>
         </div>
-        <el-row style="display:flex; flex-wrap: wrap;">
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-
-              <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]"
-                :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
-                :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
-              </dr-popover-select>
-
-              <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+        <el-row style="display: flex; flex-wrap: wrap">
+          <el-col
+            v-for="(column, index) in columns"
+            :key="index"
+            :span="column.span || 6"
+          >
+            <el-form-item
+              :prop="column.key"
+              :label="column.title"
+              v-if="column.isShow"
+            >
+              <el-input
+                v-if="column.inputType === 'Input'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
               </el-input>
-
-              <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              <dr-popover-select
+                v-if="column.inputType === 'PopoverSelect'"
+                v-model="params[column.key]"
+                :value-key="column.valueKey"
+                :source.sync="params"
+                :title="column.title"
+                :type="column.referName"
+                :multiple="column.multiple"
+                :placeholder="column.placeholder"
+                :data-mapping="column.dataMapping"
+                :query-params="column.queryParams"
+              ></dr-popover-select>
+
+              <el-input
+                v-if="column.inputType === 'Textarea'"
+                v-model="params[column.key]"
+                type="textarea"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+
+              <el-input-number
+                v-if="column.inputType === 'InputNumber'"
+                v-model="params[column.key]"
+                :controls-position="column.controlsPosition"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
               </el-input-number>
-              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
-                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
-                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                v-if="column.inputType === 'Select'"
+                v-model="params[column.key]"
+                :disabled="column.disabled"
+                :clearable="column.clearable"
+                :placeholder="column.placeholder"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in dict.type[column.referName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable
-                collapse-tags :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select
+                v-if="column.inputType === 'TagSelect'"
+                v-model="params[column.key]"
+                multiple
+                clearable
+                collapse-tags
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
                 <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                  <el-icon
+                    class="el-icon-view"
+                    style="cursor: pointer"
+                    @click.stop="$message.info(234)"
+                  >
+                  </el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N">
-              </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
-                drag action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
+              <el-date-picker
+                v-if="column.inputType === 'DatePicker'"
+                v-model="params[column.key]"
+                :type="column.type"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions"
+                style="width: 100%"
+              ></el-date-picker>
+              <el-checkbox
+                v-if="column.inputType === 'Checkbox'"
+                v-model="params[column.key]"
+                true-label="Y"
+                false-label="N"
+              ></el-checkbox>
+              <file-upload-center
+                v-if="column.inputType === 'Upload'"
+                v-model="params[column.key]"
+                :file-type="column.fileType"
+              ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
       </el-card>
 
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
+      <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-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
             <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width || 80">
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width || 80"
+              >
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%" @change="handleInputChange(scope.row, cColumn.key)">
-                  </el-input>
+                  <el-input
+                    v-if="cColumn.inputType === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input>
 
                   <!--  -->
-                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
-                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)"
-                    @change="handleReferChange" size="mini">
+                  <dr-popover-select
+                    v-if="cColumn.inputType === 'PopoverSelect'"
+                    v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row"
+                    :title="cColumn.title"
+                    :value-key="cColumn.valueKey"
+                    :type="cColumn.referName"
+                    :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams"
+                    @change="handleReferChange"
+                    size="mini"
+                  >
                   </dr-popover-select>
 
-                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
-                  </el-input-number>
-
-                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
-                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
-                    style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
-                      :value="item.value">
-                    </el-option>
+                  <el-input-number
+                    v-if="cColumn.inputType === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.controlsPosition"
+                    :placeholder="cColumn.placeholder"
+                    @change="handleInputChange(scope.row, cColumn.key)"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input-number>
+
+                  <el-select
+                    v-if="cColumn.inputType === 'Select'"
+                    v-model="scope.row[cColumn.key]"
+                    size="mini"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in dict.type[cColumn.referName]"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    ></el-option>
                   </el-select>
 
-
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N">
-                  </el-checkbox>
-
+                  <el-checkbox
+                    v-if="cColumn.inputType === 'Checkbox'"
+                    v-model="scope.row[cColumn.key]"
+                    true-label="Y"
+                    false-label="N"
+                  ></el-checkbox>
                 </template>
               </el-table-column>
 
               <el-table-column fixed="right" label="操作" width="80">
                 <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
                     删行
                   </el-button>
                 </template>
@@ -404,7 +586,9 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button size="mini" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
         </el-row>
       </el-card>
     </el-form>

+ 295 - 52
src/views/purchase/purchase-order/column.js

@@ -1,62 +1,110 @@
+import {
+  initPage,
+  initParams,
+  initColumns,
+  initDicts,
+} from "@/utils/init";
+
 export const TableColumns = [
   // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  { key: "puOrgName", title: "采购组织", inputType: "Input" },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type",
   },
-  { key: "code", title: "订单编号", search: true, type: "Input" },
+  { key: "code", title: "订单编号",  inputType: "Input" },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    width:80,
+    referName: "documents_status", // 字典名
+  },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },
-  { key: "supplierName", title: "供应商名称", search: true, type: "Input" },
-  { key: "paymentAgreement", title: "付款协议" },
+  { key: "supplierName", title: "供应商", inputType: "Input" },
+  { key: "paymentAgreementName", title: "付款协议" },
+  // { key: "paymentAgreement", title: "付款协议" },
   // { key: "currency", title: "币种" },
-  { key: "currencyName", title: "币种名称" },
-  // { key: "buyer", title: "采购员" },
+  { key: "currencyName", title: "币种" },
+  // { key: "buyer", title: "采购员" },ut
   { key: "buyerName", title: "采购员" },
   // { key: "puDept", title: "采购部门" },
-  { key: "puDeptName", title: "采购部门名称" },
+  { key: "puDeptName", title: "采购部门" },
   // { key: "customer", title: "收货客户" },
-  { key: "customerName", title: "收货客户名称" },
+  { key: "customerName", title: "收货客户" },
   { key: "isDeliver", title: "是否发货" },
-  { key: "isArrival", title: "到货超期" },
-  { key: "isBack", title: "退货" },
+  {
+    key: "isArrival",
+    title: "到货超期",
+    inputType: 'Checkbox',
+    width:80,
+  },
+  {
+    key: "isBack",
+    title: "退货",
+    inputType: 'Checkbox',
+    width:80,
+  },
   // { key: "freezeCause", title: "冻结原因" },
   { key: "qty", title: "总数量" },
   { key: "money", title: "总数量" },
-  { key: "isMarketing", title: "已协同生成销售订单" },
-  { key: "isMarketingSource", title: "由销售订单协同生成" },
+  {
+    key: "isMarketing",
+    title: "已协同生成销售订单",
+    inputType: 'Checkbox',
+  },
+  {
+    key: "isMarketingSource",
+    title: "由销售订单协同生成",
+    inputType: 'Checkbox',
+  },
   // { key: "personal", title: "人员" },
-  { key: "personalName", title: "人员名称" },
+  { key: "personalName", title: "人员" },
   // { key: "isSendSrm", title: "是否同步SRM" },
-  { key: "isInvoice", title: "发票标识" },
+  {
+    key: "isInvoice",
+    title: "发票标识",
+    inputType: 'Checkbox',
+    width:80,
+  },
   { key: "rebateMoney", title: "订单使用返利金额" },
   { key: "deductionMoney", title: "订单抵扣余款金额" },
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
   // { key: "goodsAllocation", title: "货位" },
-  { key: "goodsAllocationName", title: "货位名称" },
+  { key: "goodsAllocationName", title: "货位" },
   // { key: "customerDept", title: "客户部门" },
-  { key: "customerDeptName", title: "客户部门名称" },
+  { key: "customerDeptName", title: "客户部门" },
   // { key: "supplierContacts", title: "供应商业务联系人" },
-  { key: "supplierContactsName", title: "供应商业务联系人名称" },
-  { key: "isUrgency", title: "紧急程度" },
+  { key: "supplierContactsName", title: "供应商业务联系人" },
+  {
+    key: "isUrgency",
+    title: "紧急程度",
+    inputType: 'Checkbox',
+    width:80,
+  },
   // { key: "agent", title: "代理人" }, // 建议删除
-  { key: "agentName", title: "代理人名称" },
-  { key: "isClose", title: "最终关闭" },
+  { key: "agentName", title: "代理人" },
+  {
+    key: "isClose",
+    title: "最终关闭",
+    inputType: 'Checkbox',
+    width:80,
+  },
   { key: "applyPaymentMoney", title: "累计付款申请金额" },
   { key: "paymentMoney", title: "累计付款金额" },
   { key: "invoiceMoney", title: "发票金额" },
   // { key: "supplierPersonal", title: "供应商业务员" },
-  { key: "supplierPersonalName", title: "供应商业务员名称" },
+  { key: "supplierPersonalName", title: "供应商业务员" },
   { key: "marketingCode", title: "销售订单号" },
   // { key: "tenantId", title: "租户号" },
   // { key: "revision", title: "乐观锁" },
-  { key: "createByName", title: "创建人名称" },
-  { key: "updateByName", title: "更新人名称" },
+  { key: "createByName", title: "创建人" },
+  { key: "updateByName", title: "更新人" },
   // { key: "delFlag", title: "删除标记" },
   { key: "flowId", title: "OA流程ID" },
   { key: "approver", title: "审批人" },
@@ -65,22 +113,22 @@ export const TableColumns = [
   { key: "createTime", title: "制单日期/创建时间" },
   { key: "remark", title: "备注" },
   { key: "updateTime", title: "最后修改时间" },
-  {
-    key: "status",
-    title: "单据状态",
-    inputType: "Select",
-    referName: "sys_status", // 字典名
-  },
+
   { key: "oaDemandNo", title: "OA需求单号" },
   { key: "address", title: "收货地址" },
   { key: "contacts", title: "收获联系人" },
-  { key: "isSendWms", title: "已同步WMS" },
-  { key: "retReason", title: "退换原因" },
+  {
+    key: "isSendWms",
+    title: "已同步WMS",
+    inputType: 'Checkbox',
+    width:120,
+  },
+  { key: "retReasonName", title: "退换原因" },
   { key: "closeTime", title: "最终关闭日期" },
-  { key: "processType", title: "处理方式" },
+  { key: "processTypeName", title: "处理方式" },
   { key: "isEnd", title: "整单关闭标识" },
-  { key: "projectNow", title: "在建工程项目" },
-  { key: "operatingItems", title: "经营性项目" },
+  { key: "projectNowName", title: "在建工程项目" },
+  { key: "operatingItemsName", title: "经营性项目" },
   { key: "isArrivalReson", title: "到货超期原因" },
   { key: "midOrderNo", title: "中台采购订单号" }
 ];
@@ -91,7 +139,7 @@ export const TabColumns = [
     key: 'puOrderItemList',
     tableColumns: [
       { key: "rowNo", title: "行号" },
-      { key: "orderId", title: "采购订单ID" },
+      // { key: "orderId", title: "采购订单ID" },
       { key: "material", title: "物料" },
       { key: "materialName", title: "物料名称", width: 180 },
       { key: "materialCode", title: "物料编码", width: 180 },
@@ -99,7 +147,13 @@ export const TabColumns = [
       { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
       { key: "specification", title: "规格", width: 180 },
       { key: "model", title: "型号", width: 180 },
-      { key: "isMedcine", title: "医药物料", width: 180 },
+      {
+        key: "isMedcine",
+        title: "医药物料",
+        width: 180,
+        inputType: 'Checkbox',
+        width:80,
+      },
       { key: "manufacturer", title: "生产厂家代理人", width: 180 },
       { key: "isDrug", title: "物料药品属性", width: 180 },
       { key: "unit", title: "单位", width: 180 },
@@ -112,11 +166,36 @@ export const TabColumns = [
       { key: "unarrivedQty", title: "未到货数量" },
       { key: "notaxMoney", title: "无税金额" },
       { key: "priceSource", title: "价格目录ID" },
-      { key: "isStorage", title: "入库关闭" },
-      { key: "isInvoice", title: "开票关闭" },
-      { key: "isArrival", title: "到货关闭" },
-      { key: "isPayment", title: "付款关闭" },
-      { key: "isGift", title: "赠品" },
+      {
+        key: "isStorage",
+        title: "入库关闭",
+        inputType: 'Checkbox',
+        width:80,
+      },
+      {
+        key: "isInvoice",
+        title: "开票关闭",
+        inputType: 'Checkbox',
+        width:80,
+      },
+      {
+        key: "isArrival",
+        title: "到货关闭",
+        inputType: 'Checkbox',
+        width:80,
+      },
+      {
+        key: "isPayment",
+        title: "付款关闭",
+        inputType: 'Checkbox',
+        width:80,
+      },
+      {
+        key: "isGift",
+        title: "赠品",
+        inputType: 'Checkbox',
+        width:80,
+      },
       { key: "warehouse", title: "收货仓库", width: 180 },
       { key: "place", title: "收货地点", width: 180 },
       { key: "address", title: "收货地址", width: 180 },
@@ -137,8 +216,18 @@ export const TabColumns = [
         inputType: "Select",
         referName: "sys_conditions_carriage", // 字典名
       },
-      { key: "isBatchLock", title: "批号锁定标识" },
-      { key: "isReplenishment", title: "补单标识" },
+      {
+        key: "isBatchLock",
+        title: "批号锁定标识",
+        inputType: 'Checkbox',
+        width:80,
+      },
+      {
+        key: "isReplenishment",
+        title: "补单标识",
+        inputType: 'Checkbox',
+        width:80,
+      },
       { key: "isUrgency", title: "紧急标识" },
       { key: "originalQty", title: "原始数量" },
       { key: "originalMoney", title: "原始金额" },
@@ -158,20 +247,25 @@ export const TabColumns = [
         inputType: "Select",
         referName: "sys_price_type", // 字典名
       },
-      { key: "isDistributionPrice", title: "配送价" },
+      { 
+        key: "isDistributionPrice", 
+        title: "配送价",
+        inputType: 'Checkbox',
+        width:80,
+       },
       // { key: "tenantId", title: "租户号" },
       // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人名称" },
-      { key: "updateByName", title: "更新人名称" },
+      { key: "createByName", title: "创建人" },
+      { key: "updateByName", title: "更新人" },
       // { key: "delFlag", title: "删除标记" },
       // { key: "materialClassifyOne", title: "物料一级分类" },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", width: 180 },
+      { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
       // { key: "materialClassifyTwo", title: "物料二级分类" },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", width: 180 },
+      { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
       // { key: "materialClassifyThree", title: "物料三级分类" },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", width: 180 },
+      { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
       // { key: "materialClassifyFour", title: "物料四级分类" },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", width: 180 },
+      { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
       { key: "price", title: "无税单价" }
     ]
   },
@@ -180,7 +274,7 @@ export const TabColumns = [
     key: 'puOrderExecuteList',
     tableColumns: [
       // { key: "id", title: "主键" },
-      { key: "orderId", title: "采购订单ID", width: 180 },
+      // { key: "orderId", title: "采购订单ID", width: 180 },
       { key: "rowno", title: "行号" },
       { key: "material", title: "物料", width: 180 },
       { key: "materialName", title: "物料名称", width: 180 },
@@ -201,4 +295,153 @@ export const TabColumns = [
   },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+// export const SearchColumns = TableColumns.filter((element) => element.search);
+export const SearchColumns = [
+  {
+    key: "source",
+    title: "订单来源",  
+    inputType: "Select",
+    referName: "order_source", // 字典名
+    clearable:true,
+  },
+  {
+    key: "code",
+    title: "订单编号",  
+    inputType: "Input",
+    clearable:true,
+  },
+  {
+    key: "date",
+    title: "订单日期",  
+    type: "daterange",
+    inputType: "DatePicker",
+    unlinkPanels: true,
+    rangeSeparator: "至",
+    valueFormat: "yyyy-MM-dd",
+    endPlaceholder: "结束日期",
+    startPlaceholder: "开始日期",
+    clearable:true,
+  },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    referName: "documents_status", // 字典名
+    clearable:true,
+  },
+  { 
+    key: "supplierName", 
+    title: "供应商", 
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      // supplier: "id",
+      supplierName: "name",
+    },
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "puOrgIds",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    multiple:true,
+    valueKey: "id",
+    referName: "ORG_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "materialCode",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    valueKey: "code",
+    referName: "MATERIAL_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "materialName",
+    title: "物料名称",
+    inputType: "PopoverSelect",
+    valueKey: "name",
+    referName: "MATERIAL_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  { 
+    key: "deliveryStatus",
+    title: "erp发送状态", 
+    inputType: "Select",
+    referName: "order_delivery_status", // 字典名
+    clearable:true,
+  },
+  { 
+    key: "contractNo",
+    title: "合同号", 
+    inputType: "Input",
+    clearable:true,
+  },
+  {
+    key: "projectNowName",
+    title: "在建工程项目",
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "name",
+    referName: "PROJECT_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "buyers",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    multiple:true,
+    valueKey: "code",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "billTypes",
+    title: "订单类型",
+    inputType: "Select",
+    referName: "sys_order_type", // 字典名
+    multiple:true,
+    tags:true,
+    clearable:true,
+  },
+  { 
+    key: "demandCode",
+    title: "采购需求单号", 
+    inputType: "Input",
+    clearable:true,
+  },
+  { 
+    key: "isDrug",
+    title: "物料药品属性", 
+    inputType: "SelectCheck",
+    clearable:true,
+  },
+];
+
+const NewColumns = initColumns(TableColumns);
+const NewSearchColumns = initColumns(SearchColumns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+// 
+export const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
+
+NewTabColumns.forEach(column => {
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+});
+
+SelectColumns.push(...NewSearchColumns.filter(column => column.inputType === 'Select'))

+ 241 - 0
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -0,0 +1,241 @@
+<template>
+  <div class="upload-file">
+    <el-upload multiple :action="uploadFileUrl" :disabled="disabled" :before-upload="handleBeforeUpload"
+      :file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
+      :on-success="handleUploadSuccess" :show-file-list="false" class="upload-file-uploader" ref="fileUpload">
+      <!-- 上传按钮 -->
+      <el-button size="mini" type="primary" :disabled="disabled">选取文件</el-button>
+      <!-- 上传提示 -->
+      <div class="el-upload__tip" slot="tip" v-if="showTip">
+        请上传
+        <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>
+
+    <!-- 文件列表 -->
+    <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
+
+      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList">
+        <el-link
+          :href="`${baseUrl}?id=${file.fileFastId}`"
+          :underline="false"
+          target="_blank"
+        >
+          <span class="el-icon-document"> {{ file.fileName }} </span>
+        </el-link>
+        <div class="ele-upload-list__item-content-action">
+          <el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
+        </div>
+      </li>
+    </transition-group>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/utils/auth";
+
+export default {
+  name: "FileUploadCenter",
+  props: {
+    // 值
+    value: [String, Object, Array],
+    // 数量限制
+    limit: {
+      type: Number,
+      default: 5,
+    },
+    // 大小限制(MB)
+    fileSize: {
+      type: Number,
+      default: 5,
+    },
+    // 文件类型, 例如['png', 'jpg', 'jpeg']
+    fileType: {
+      type: Array,
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg", "png"],
+    },
+    // 是否显示提示
+    isShowTip: {
+      type: Boolean,
+      default: true,
+    },
+    // 是否禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+    }
+  },
+  data() {
+    return {
+      number: 0,
+      uploadList: [],
+      // baseUrl: '/sy-derom',
+      // uploadFileUrl: "/sy-derom/document-center/fastdfs/upload", // 上传文件服务器地址
+      baseUrl: "https://sy.derom.com/document-center/fastdfs/download",
+      uploadFileUrl:
+        process.env.NODE_ENV == "development"
+          ? "/drp-file/document-center/fastdfs/upload"
+          : "/document-center/fastdfs/upload",
+      headers: {
+        Authorization: "Bearer " + getToken(),
+      },
+      fileList: [],
+    };
+  },
+  watch: {
+    value: {
+      handler(val) {
+        this.fileList = val ? val : [];
+
+        return this.fileList;
+        // if (val) {
+        //   let temp = 1;
+        //   // 首先将值转为数组
+        //   const list = Array.isArray(val) ? val : this.value.split(",");
+        //   console.log("list", list);
+        //   // 然后将数组转为对象数组
+        //   this.fileList = list.map((item) => {
+        //     if (typeof item === "string") {
+        //       item = { name: item, url: item };
+        //     }
+        //     item.uid = item.uid || new Date().getTime() + temp++;
+        //     return item;
+        //   });
+        // } else {
+        //   this.fileList = [];
+        //   return [];
+        // }
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    // 是否显示提示
+    showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize);
+    },
+  },
+  methods: {
+    // 上传前校检格式和大小
+    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;
+    },
+    // 文件个数超出
+    handleExceed() {
+      this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
+    },
+    // 上传失败
+    handleUploadError(err) {
+      this.$modal.msgError("上传文件失败,请重试");
+      this.$modal.closeLoading();
+    },
+    // 上传成功回调
+    handleUploadSuccess(res, file) {
+      if (res.code == 200) {
+        console.log(res, 'res--------------');
+        this.uploadList.push({
+          fileName: res.filename,
+          fileUrl: `/${res.group}/${res.filepath}`,
+          fileFastId: res.id,
+        });
+        this.uploadedSuccessfully();
+      } else {
+        this.number--;
+        this.$modal.closeLoading();
+        this.$modal.msgError(res.msg);
+        this.$refs.fileUpload.handleRemove(file);
+        this.uploadedSuccessfully();
+      }
+    },
+    // 删除文件
+    handleDelete(index) {
+      this.fileList.splice(index, 1);
+      // this.$emit("input", this.listToString(this.fileList));
+      this.$emit("input", this.fileList);
+    },
+    // 上传结束处理
+    uploadedSuccessfully() {
+      if (this.number > 0 && this.uploadList.length === this.number) {
+        this.fileList = this.fileList.concat(this.uploadList);
+        console.log(this.fileList, 'this.fileList***************');
+        this.uploadList = [];
+        this.number = 0;
+        // this.$emit("input", this.listToString(this.fileList));
+        this.$emit("input", this.fileList);
+        this.$modal.closeLoading();
+      }
+    },
+    // 获取文件名称
+    // getFileName(name) {
+    //   if (name.lastIndexOf("/") > -1) {
+    //     return name.slice(name.lastIndexOf("/") + 1);
+    //   } else {
+    //     return "";
+    //   }
+    // },
+    // 对象转成指定字符串分隔
+    // listToString(list, separator) {
+    //   let strs = "";
+    //   separator = separator || ",";
+    //   for (let i in list) {
+    //     strs += list[i].url + separator;
+    //   }
+    //   return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    // },
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.upload-file-uploader {
+  margin-bottom: 5px;
+}
+
+.upload-file-list .el-upload-list__item {
+  border: 1px solid #e4e7ed;
+  line-height: 2;
+  margin-bottom: 10px;
+  position: relative;
+}
+
+.upload-file-list .ele-upload-list__item-content {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: inherit;
+}
+
+.ele-upload-list__item-content-action .el-link {
+  margin-right: 10px;
+}
+</style>

+ 278 - 115
src/views/purchase/purchase-order/edit/index.vue

@@ -1,46 +1,36 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
+// import { Columns, TabColumns } from "../add/column";
+import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-// 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
-
 export default {
   name: "EditPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
   components: {
-
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
   },
   data() {
     return {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: editColumns,
+      rules: initRules(editColumns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(editColumns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: editTabColumns,
       tabName: "puOrderItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = editTabColumns.filter((element) =>
         newProp === "1" ? element.key !== "puOrderItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
@@ -51,14 +41,16 @@ export default {
     },
     'params.puOrderItemList': {
       handler(nVal, oVal) {
-        this.params.source == 3 && this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
+        this.params.source == 3 &&
+         this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
       },
       deep: true,
       immediate: true
     },
     'params.puOrderExecuteList': {
       handler(nVal, oVal) {
-        this.params.source == 3 && this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
+        this.params.source == 3 && 
+        this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
       },
       deep: true,
       immediate: true
@@ -68,6 +60,10 @@ export default {
     setVisible(prop) {
       this.visible = prop;
 
+      if(!this.visible){
+        this.$refs['orderEditForm'].clearValidate();
+      }
+
     },
     // 同步子表物料
     handleSynchronousMaterial(key1, key2) {
@@ -78,6 +74,13 @@ export default {
         this.params[key2][index].materialCode = item.materialCode;
       })
     },
+    // 判断属性是否禁用
+    handleIsForbidden(status) {
+      console.log(status);
+      let {  updateColumns,updateTabColumns } = forbidden(status != '2');
+      this.columns = updateColumns;
+      this.tabColumns = updateTabColumns;
+    },
     // 查询详细
     async fetchItem(prop) {
       try {
@@ -85,10 +88,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          console.log(this.params, 'this.params----------');
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
+          this.handleIsForbidden(this.params.status);
         }
       } catch (err) {
         //
@@ -104,13 +104,21 @@ export default {
         if (Array.isArray(this.params[key])) {
 
           const arr = this.tabColumns.find(
+
             (element) => element.key === key
+
           ).tableColumns;
 
+
           let rowData = initParams(arr, "key", "value");
 
-          'rowno' in rowData && (rowData['rowno'] = this.params[key].length + 1);
-          'rowNo' in rowData && (rowData['rowNo'] = this.params[key].length + 1);
+          "rowno" in rowData &&
+            (rowData["rowno"] = this.params[key].length + 1);
+          "rowNo" in rowData &&
+            (rowData["rowNo"] = this.params[key].length + 1);
+
+          // 是否完成询价,新增明细行需默认明细为false
+          rowData['whetherCompleteInquiry'] = false;
 
           this.params[key].push(rowData);
         }
@@ -134,7 +142,11 @@ export default {
     // 取消
     handleCancel() {
       this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
+      this.params = {
+        ...initParams(this.columns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      }
     },
     // 保存
     async handleSava() {
@@ -147,10 +159,7 @@ export default {
           : orderApi.edit(this.params)
         )
         if (code === 200) {
-          this.setVisible(false);
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
+          this.handleCancel();
         }
       } catch (err) {
         //
@@ -166,25 +175,84 @@ export default {
     },
     beforeOpen() {
     },
-    handleReferChange(val, source) { },
+    // 子表参照改变之后
+    handleReferChange(val,  type,source) {
+      console.log(val, 'val');
+      console.log(source, 'source');
+      console.log(type, 'type');
+
+      // 触发物料参照
+      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+
+        this.handleGetPrice();
+      }
+
+      if(type == "MATERIAL_PARAM"){
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+        // return source;
+      }
+    },
+    // 子表inputNumber
+    handleInputChange(row, type) {
+      console.log(type, 'type');
+      // 物料数量变化----询价
+      if (type == 'qty' && row.material) {
+        this.handleGetPrice();
+      }
+    },
+    // 询价 getPrice
+    async handleGetPrice() {
+      try {
+        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+        let { code, data } = await orderApi.getPrice({ ...this.params })
+        if (code == 200) {
+          this.params = data;
+        }
+      } catch (error) {
+
+      } finally {
+
+      }
+    },
     // 判断修订还是编辑
     handleIsRevise(status) {
       return status == '2';
     },
+     // 下拉框选择改变
+     handleChangeSelect(val,typeName){
+      if(val === 'billType'){
+       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
+      }
+    },
   },
   created() {
     console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
+
+
   },
   mounted() { },
   destroyed() { },
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" ref="orderEditForm" label-position="right" label-width="140px"
-      :model="params" :rules="rules">
+  <el-drawer 
+    direction="btt" 
+    size="100%" 
+    :with-header="false" 
+    :visible.sync="visible" 
+    @open="beforeOpen"
+    @close="$emit('close')"
+    >
+    <el-form 
+      v-loading="loading" 
+      :size="size" 
+      ref="orderEditForm" 
+      label-position="right" 
+      label-width="140px"
+      :model="params" 
+      :rules="rules"
+      >
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -201,57 +269,106 @@ export default {
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
-        <el-row  style="display:flex; flex-wrap: wrap;">
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]" size="mini"
-                :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
-                :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
-              </dr-popover-select>
-              <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-              </el-input>
-              <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input-number>
-              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
-                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
-                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
+        <el-row style="display:flex; flex-wrap: wrap;">
+          <el-col 
+            v-for="(column, index) in columns" 
+            :key="index" 
+            :span="column.span || 6"
+            >
+            <el-form-item :prop="column.key" :label="column.title" v-if="column.isShow">
+
+              <el-input v-if="column.inputType === 'Input'" 
+                v-model="params[column.key]" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                ></el-input>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" 
+                v-model="params[column.key]" 
+                size="mini"
+                :value-key="column.valueKey" 
+                :source.sync="params" 
+                :title="column.title" 
+                :type="column.referName"
+                :multiple="column.multiple" 
+                :placeholder="column.placeholder" 
+                :data-mapping="column.dataMapping"
+                :disabled="column.disabled" 
+                :query-params="column.queryParams"
+                ></dr-popover-select>
+              <el-input v-if="column.inputType === 'Textarea'" 
+                v-model="params[column.key]" 
+                type="textarea"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                ></el-input>
+              <el-input-number v-if="column.inputType === 'InputNumber'" 
+                v-model="params[column.key]"
+                :max="handleIsRevise(params.status) ? params[column.key] : Infinity"
+                :controls-position="column.controlsPosition" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                ></el-input-number>
+              <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%"
+                @change="handleChangeSelect(column.key,column.referName)"
+                >
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select v-if="column.inputType === 'TagSelect'" 
+                v-model="params[column.key]" 
+                multiple 
+                clearable
+                collapse-tags 
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                >
                 <template #prefix>
                   <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
+                <el-option 
+                  v-for="item in options" 
+                  :key="item.value" 
+                  :label="item.label" 
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
-                true-label="Y" false-label="N">
-              </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <!-- <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div> -->
-              </el-upload>
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]" 
+                :type="column.type"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions" 
+                style="width: 100%"
+                ></el-date-picker>
+              <el-checkbox v-if="column.inputType === 'Checkbox'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                true-label="Y"
+                false-label="N"
+                > </el-checkbox>
+              <file-upload-center v-if="column.inputType === 'Upload'" 
+                v-model="params[column.key]"
+                :file-type="column.fileType" 
+                :disabled="handleIsRevise(params.status)"
+                ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
@@ -263,56 +380,101 @@ export default {
         position: 'relative',
       }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane 
+            v-for="(column, index) in tabColumns" 
+            :key="index" 
+            :label="column.title" 
+            :name="column.key"
+            >
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
+              <el-table-column 
+                v-for="(cColumn, cIndex) in column.tableColumns" 
+                :key="cIndex" 
+                :prop="cColumn.key"
+                :label="cColumn.title" 
+                :width="cColumn.width"
+                >
                 <template slot-scope="scope">
 
                   <span v-if="!cColumn.inputType">
                     {{ scope.row[cColumn.key] }}
                   </span>
 
-                  <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%">
-                  </el-input>
-
-                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
-                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)" size="mini"
-                    @change="handleReferChange">
-                  </dr-popover-select>
-
-                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
-                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
-                    style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
-                      :value="item.value">
-                    </el-option>
+                  <el-input v-if="cColumn.inputType === 'Input'" 
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" 
+                    :clearable="cColumn.clearable" 
+                    :disabled="cColumn.disabled"
+                    :size="size" 
+                    style="width: 100%"
+                    ></el-input>
+
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" 
+                    v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" 
+                    :title="cColumn.title" 
+                    :value-key="cColumn.valueKey"
+                    :disabled="cColumn.disabled" 
+                    :type="cColumn.referName" 
+                    :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" 
+                    :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams" 
+                    size="mini" 
+                    @change="handleReferChange"
+                  ></dr-popover-select>
+
+                  <el-select v-if="cColumn.inputType === 'Select'" 
+                    v-model="scope.row[cColumn.key]" size="mini"
+                    :disabled="cColumn.disabled" 
+                    :clearable="cColumn.clearable" 
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  >
+                    <el-option 
+                      v-for="item in dict.type[cColumn.referName]" 
+                      :key="item.value" 
+                      :label="item.label"
+                      :value="item.value"
+                    ></el-option>
                   </el-select>
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N">
-                  </el-checkbox>
-                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
-                  </el-input-number>
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" 
+                    v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" 
+                    true-label="Y" 
+                    false-label="N"
+                  ></el-checkbox>
+                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.controlsPosition"
+                    :max="handleIsRevise(params.status) ? scope.row[cColumn.key] : Infinity"
+                    @change="handleInputChange(scope.row, cColumn.key)" 
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" 
+                    :disabled="cColumn.disabled" 
+                    :size="size" 
+                    style="width: 100%"
+                  ></el-input-number>
                 </template>
               </el-table-column>
+
+
+              <!-- 修订:不可删除、增行
+              编辑:自制:可删可增 -->
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
+                  <el-button 
+                    v-if="params.source == '3' && !handleIsRevise(params.status)" 
+                    @click.native.prevent="delTableRow(params[tabName], scope.$index)" 
+                    type="text" 
+                    size="small"
+                    > 删行
                   </el-button>
                 </template>
               </el-table-column>
@@ -320,7 +482,8 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button v-if="params.source == '3' && !handleIsRevise(params.status)" :size="size"
+            @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 71 - 0
src/views/purchase/purchase-order/edit/initColumn.js

@@ -0,0 +1,71 @@
+import { Columns, TabColumns } from "../add/column";
+import { initColumns, initParams } from "@/utils/init";
+import deepCopy from "@gby/deep-copy";
+// import {deepCopy} from "../dist/deep-copy.es"
+
+
+export const editColumns = initColumns(Columns);
+
+export const editTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+
+export const SelectColumns = editColumns.filter(column => column.inputType === 'Select')
+
+editTabColumns.forEach(column => {
+
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+
+});
+
+
+// 禁用项
+export const forbidden = (isEdit) => {
+
+  let updateColumns = deepCopy(editColumns);
+  let updateTabColumns = deepCopy(editTabColumns);
+
+  console.log(isEdit, 'isEdit');
+  
+  if(!isEdit){  
+
+    console.log('修订');
+    // 修订
+    updateColumns.forEach(item => {
+
+      if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
+        item.key == 'supplierContactsName' || item.key == 'agentName' || item.key == 'isInvoice' ||
+        item.key == 'rebateMoney') {
+        item.disabled = false;
+        item.readonly = false;
+      } else {
+        item.disabled = true;
+        item.readonly = true;
+      }
+    })
+
+    updateTabColumns.forEach(item => {
+
+      item.tableColumns.forEach(t => {
+
+        if (t.key == 'unit' || t.key == 'qty' ||
+          t.key == 'place' || t.key == 'arrivalDatePlan' || t.key == 'storageCondition' ||
+          t.key == 'carriageCondition' || t.key == 'customerName' || t.key == 'isBatchLock' ||
+          t.key == 'isReplenishment' || t.key == 'originalQty' || t.key == 'originalMoney'
+        ) {
+
+          t.disabled = false;
+          t.readonly = false;
+        } else {
+          t.disabled = true;
+          t.readonly = true;
+        }
+      })
+    })
+
+  }
+
+  return { updateColumns, updateTabColumns }
+
+}

+ 316 - 94
src/views/purchase/purchase-order/index.vue

@@ -1,27 +1,14 @@
 <!-- 采购订单修订—— 列表 -->
 <script>
-import { TableColumns, SearchColumns, TabColumns } from "./column";
+import { TableColumns, SearchColumns, TabColumns, SelectColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
-  initLayout,
-  initPageSizes,
   initParams,
   initColumns,
   initDicts,
 } from "@/utils/init";
 
-const NewColumns = initColumns(TableColumns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
-// 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
-console.log(SelectColumns, 'SelectColumns------------');
 
 export default {
   name: "PuchaseOrder",
@@ -36,8 +23,7 @@ export default {
     return {
       loading: false,
       isSimpleSearch: true,
-      pageSizes: initPageSizes(),
-      layout: initLayout(),
+      pageSizes: [10, 20, 50, 100],
       page: initPage(),
       searchColumns: SearchColumns,
       params: initParams(SearchColumns),
@@ -55,7 +41,6 @@ export default {
   },
   computed: {
     showSearchColumns() {
-      console.log(this.searchColumns, 'this.searchColumns');
       return this.isSimpleSearch
         ? this.searchColumns.slice(0, 4)
         : this.searchColumns;
@@ -74,38 +59,39 @@ export default {
         if (code === 200) {
           this.page.total = total;
           this.tableData = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
       } finally {
+        
         this.loading = false;
+
+        for (const key in this.tabTableDatas) {
+
+          this.tabTableDatas[key] = [];
+
+        }
       }
     },
     handleSearchChange() {
       this.isSimpleSearch = !this.isSimpleSearch;
-      this.$notify.info({
-        title: this.isSimpleSearch ? "Simple Search" : "All Search",
-      });
-    },
-    // 页大小变
-    handleSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // 当前页变
-    handleCurrentChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      // this.$notify.info({
+      //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
+      // });
     },
+
     // 刷新操作
     handleRefreshList() {
       this.fetchList(this.params, this.page);
     },
     // 查询操作
     handleQueryList() {
+      console.log(this.params,'this.params---------------------');
+      let {date} = this.params;
+      if(date){
+        this.params.startDate = date[0];
+        this.params.endDate = date[1];
+      }
       this.fetchList(this.params, this.page);
     },
     // 重置操作
@@ -117,9 +103,23 @@ export default {
     },
     handleTabClick() { },
     // 新增
-    handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.addDrawerFef;
+    handleOpenAddDrawer(copyVal) {
+      const { setVisible, setCopyParams } = this.$refs.addDrawerFef;
       setVisible(true);
+
+      copyVal.id && copyVal.id != '' && setCopyParams(copyVal.id);
+    },
+    // 复制
+    handleCopy() {
+
+      // let rowDetails = {
+      //   ... this.checkedList[0],
+      //   id: '',
+      //   code: '',
+      //   status: '0',
+      //   source: '3',
+      // };
+      this.handleOpenAddDrawer(this.checkedList[0]);
     },
     // 查看
     async handleOpenSeeDrawer(row) {
@@ -137,7 +137,6 @@ export default {
     },
     // 获取子表信息
     async handleDetailsData(row) {
-      console.log(row, '获取详情信息');
       try {
         const { code, msg, data } = await orderApi.details(row.id);
         if (code === 200) {
@@ -145,9 +144,6 @@ export default {
           for (const key in this.tabTableDatas) {
             this.tabTableDatas[key] = data[key];
           }
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -156,18 +152,34 @@ export default {
       }
     },
     // 删除操作
-    async handleDeleteList(row) {
+     handleDeleteList(row) {
       try {
         this.loading = true;
-        const { id } = row;
-        console.log(id, 'id');
-        const { code, msg } = await orderApi.remove(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
+
+        this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then( async() => {
+
+          const { id } = row;
+
+          const { code } = await orderApi.remove(id);
+          
+          if (code === 200) {
+
+            this.fetchList(this.params, this.page);
+
+          }
+
+        }).catch(() => {
+
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          });          
+        });
+        
       } catch (err) {
         //
       } finally {
@@ -176,22 +188,34 @@ export default {
     },
     // 提交
     async handleSubmit(row) {
+      try {
+
+        let { code } = await orderApi.submit({ puOrderId: row.id });
+
+        if (code == 200) {
+
+          this.fetchList(this.params, this.page);
+
+        }
+
+      } catch (error) {
 
+      } finally {
+      }
     },
     // 判断“退回”按钮
     judgeIsAllSendBack() {
-
       if (this.checkedList.length == 1) {
 
         // 非手工、状态非审批通过  
-        if (this.checkedList[0].source != 3 && this.checkedList[0].status != 2) {
+        if (this.checkedList[0].source != 3 && (this.checkedList[0].status == 0 || this.checkedList[0].status == 3)) {
 
           return false
         }
       }
       return true;
     },
-    //  退回
+    //  整单退回
     handleAllSendBack() {
       let data = {
         id: this.checkedList[0].id,
@@ -201,7 +225,7 @@ export default {
       console.log(data);
       try {
         this.loading = true;
-        // let { code, msg } = orderApi.documentsReturn(data);
+        let { code, msg } = orderApi.documentsReturn(data);
 
       } catch (error) {
 
@@ -209,28 +233,166 @@ export default {
         this.loading = false;
       }
     },
+    // 判断是否满足整单关闭
+    judgeIsAllClose() {
+
+      if (this.checkedList.length == 1) {
+
+        if (this.checkedList[0].status == 0) {
+          // 未审批状态下整单关闭
+
+          return false
+        }
+      }
+      return true;
+
+    },
+    // 整单关闭
+    async handleAllClose() {
+      // 未审批状态下整单关闭
+      try {
+
+        this.loading = true;
+
+        let puOrderIds = this.checkedList.map(order => {
+
+          return order.id;
+
+        })
+
+        let { code } = await orderApi.close({ puOrderIds });
+
+        if (code === 200) {
+
+          this.fetchList(this.params, this.page);
+
+        }
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 付款协议
+    async handlePaymentRequest(){
+      // name:工号
+      try {
+        let {name} = this.$store.state.user;
+
+        await orderApi.payRequest(name).then(res=>{
+
+          if(res){
+
+            let url = `uclient://start/http://172.16.100.2:8081?ssoKey=${res}&uiloader=nc.uap.lfw.applet.PortalUILoader&nodeId=40040407`
+
+            window.location.href = url;
+          }
+        });
+
+      } catch (error) {
+        
+      }
+      
+    },
     handleSelect(selection, row) {
+
       this.checkedList = selection;
+
       console.log(this.checkedList, 'this.checkedList');
-    },
 
+    },
   },
 };
 </script>
 
 <template>
-  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
+  <el-card 
+    v-loading="loading" 
+    style="width: calc(100% - 24px); height: 100%; margin: 10px" 
+    :body-style="{ padding: 0 }"
+  >
     <SeeDrawer ref="seeDrawerFef"></SeeDrawer>
     <AddDrawer ref="addDrawerFef" @close="handleRefreshList"></AddDrawer>
     <EditDrawer ref="editDrawerFef" @close="handleRefreshList"></EditDrawer>
 
-    <el-form size="mini" label-position="right" label-width="100px" :model="params" style="padding: 20px 0 0 0">
-      <el-row :gutter="24" style="display:flex; flex-wrap: wrap;">
+    <el-form 
+      size="mini" 
+      label-position="right" 
+      label-width="100px" 
+      :model="params" 
+      style="padding: 20px 0 0 0"
+    >
+      <el-row :gutter="24" >
         <el-col :span="20">
-          <el-row :gutter="20">
-            <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+          <el-row :gutter="20" style="display:flex; flex-wrap: wrap;">
+            <el-col 
+              v-for="column in showSearchColumns" 
+              :key="column.title" 
+              :xl="6" :lg="6" :md="8" :sm="12" :xs="24"
+            >
               <el-form-item :prop="column.key" :label="column.title">
-                <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
+
+                <el-input v-if="column.inputType === 'Input'" 
+                  v-model="params[column.key]" 
+                  :placeholder="column.placeholder"
+                ></el-input>
+                <dr-popover-select v-if="column.inputType === 'PopoverSelect'"
+                  v-model="params[column.key]"
+                  :source.sync="params"
+                  :title="column.title"
+                  :type="column.referName"
+                  :multiple="column.multiple"
+                  :readonly="column.readonly"
+                  :value-key="column.valueKey"
+                  :placeholder="column.placeholder"
+                  :data-mapping="column.dataMapping"
+                  :query-params="column.queryParams(params)"
+                ></dr-popover-select>
+                <!-- @keyup.enter.native="useQuery(params, page)" -->
+
+                <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                :multiple="column.multiple"
+                :collapse-tags="column.tags"
+                style="width: 100%"
+                >
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                  ></el-option>
+              </el-select>
+              <!-- 只有是否 -->
+              <el-select v-if="column.inputType === 'SelectCheck'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%"
+                >
+                <el-option key="N" label="否" value="N"></el-option>
+                <el-option key="Y" label="是" value="Y"></el-option>
+              </el-select>
+
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]"
+                size="mini"
+                type="daterange"
+                :value-format="column.valueFormat"
+                :unlink-panels="column.unlinkPanels"
+                :picker-options="column.pickerOptions"
+                :range-separator="column.rangeSeparator"
+                :end-placeholder="column.endPlaceholder"
+                :start-placeholder="column.startPlaceholder"
+                :clearable="column.clearable"
+                style="width: 100%"
+              >
+              </el-date-picker>
               </el-form-item>
             </el-col>
           </el-row>
@@ -252,36 +414,65 @@ export default {
     <el-row :gutter="24" style="padding: 0 20px">
       <!-- <el-col :span="6">123</el-col> -->
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
-        <el-button-group style="margin-left: 10px">
-          <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
-            v-hasPermi="['material:order:add']">新增</el-button>
-          <el-button size="mini">复制</el-button>
 
-        </el-button-group>
+        <!-- <el-button-group style="margin-left: 10px"> -->
+        <el-button size="mini" type="primary" plain @click="handleOpenAddDrawer"
+          v-hasPermi="['material:order:add']">新增</el-button>
+        <!-- </el-button-group> -->
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
-            :disabled="judgeIsAllSendBack()">整单退回</el-button>
+          <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+        </el-button-group>
+
+        <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
+          <el-button size="mini" @click="handleAllSendBack" :disabled="judgeIsAllSendBack()">整单退回</el-button>
+          <el-button size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini">采购退货</el-button>
-          <el-button size="mini">整单关闭</el-button>
-          <el-button size="mini">附件管理</el-button>
-          <el-button size="mini">单据追溯</el-button>
+          <!-- <el-button size="mini">采购退货</el-button> -->
+          <el-button size="mini" @click="handlePaymentRequest">付款申请</el-button>
+
+          <!-- <el-button size="mini">附件管理</el-button>
+          <el-button size="mini">单据追溯</el-button> -->
         </el-button-group>
       </el-col>
     </el-row>
 
-    <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
-      highlight-current-row style="width: 100%; margin: 20px 0 0 0" @select="handleSelect" height="450">
+    <el-table 
+      @row-dblclick="handleOpenSeeDrawer" 
+      @row-click="handleDetailsData" 
+      :data="tableData" 
+      size="mini"
+      highlight-current-row
+      @select="handleSelect"
+      height="450"
+      style="width: 100%; margin: 20px 0 0 0"
+    >
       <el-table-column type="selection" width="45"></el-table-column>
       <el-table-column type="index" width="50" label="序号"></el-table-column>
-      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
-        :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+      <el-table-column 
+        v-for="(column, index) in tableColumns" 
+        :key="index" 
+        :prop="column.key" 
+        :label="column.title"
+        :width="column.width || 180" 
+        :show-overflow-tooltip="column.showOverflowTooltip || true"
+      >
+
         <template slot-scope="scope">
-          <dict-tag v-if="column.referName" size="small" :value="scope.row[column.key]"
-            :options="dict.type[column.referName]" />
+          <dict-tag v-if="column.inputType === 'Select'" 
+            size="small" 
+            :value="scope.row[column.key]"
+            :options="dict.type[column.referName]"
+           />
+
+          <el-checkbox v-else-if="column.inputType === 'Checkbox'"
+            v-model="scope.row[column.key]" 
+            disabled 
+            true-label="Y"
+            false-label="N"
+          > </el-checkbox>
           <span v-else>{{ scope.row[column.key] }}</span>
         </template>
       </el-table-column>
@@ -291,33 +482,64 @@ export default {
           <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)"
             v-hasPermi="['material:order:edit']">
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
-          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
-          <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)"
-            v-hasPermi="['material:order:remove']">删除</el-button>
-          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
-            @click.stop="handleSubmit(scope.row)">提交</el-button>
+          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中-->
+          <el-button 
+            v-if="(scope.row.status == '0' || scope.row.status == '3') && scope.row.source == '3'" 
+            type="text" 
+            size="small" 
+            @click.stop="handleDeleteList(scope.row)"
+            v-hasPermi="['material:order:remove']"
+          >删除</el-button>
+          <el-button 
+            v-if="scope.row.status == '0' || scope.row.status == '3'" 
+            type="text" 
+            size="mini"
+            v-hasPermi="['material:order:toOa']" 
+            @click.stop="handleSubmit(scope.row)"
+          >提交</el-button>
         </template>
       </el-table-column>
 
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
-      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page :layout="layout"
-      style="text-align: right;margin-top: 10px;">
-    </el-pagination>
+
+    <pagination
+      v-show="page.total>0"
+      :total="page.total"
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="fetchList(params, page)"
+    />
 
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
-      <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+      <el-tab-pane 
+        v-for="(column, index) in tabColumns" 
+        :key="index" 
+        :label="column.title" 
+        :name="column.key"
+      >
         <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row
           :height="tabTableDatas[column.key].length ? 300 : 100">
-
           <el-table-column type="index" width="50" label="序号"></el-table-column>
-
-          <el-table-column v-for="(cColumn, cIndex)  in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-            :label="cColumn.title" :width="cColumn.width || 180"
-            :show-overflow-tooltip="cColumn.showOverflowTooltip || true">
+          <el-table-column 
+            v-for="(cColumn, cIndex)  in column.tableColumns" 
+            :key="cIndex" 
+            :prop="cColumn.key"
+            :label="cColumn.title" 
+            :width="cColumn.width || 180"
+            :show-overflow-tooltip="cColumn.showOverflowTooltip || true"
+          >
             <template slot-scope="scope">
-              <dict-tag v-if="cColumn.referName" size="small" :value="scope.row[cColumn.key]"
-                :options="dict.type[cColumn.referName]" />
+              <dict-tag v-if="cColumn.referName" 
+                size="small" 
+                :value="scope.row[cColumn.key]"
+                :options="dict.type[cColumn.referName]"
+               />
+              <el-checkbox v-else-if="cColumn.inputType === 'Checkbox'" 
+                v-model="scope.row[cColumn.key]"
+                disabled
+                true-label="Y" 
+                false-label="N"
+              ></el-checkbox>
               <span v-else>{{ scope.row[cColumn.key] }}</span>
             </template>
           </el-table-column>

+ 220 - 71
src/views/purchase/purchase-order/see/index.vue

@@ -24,6 +24,9 @@ NewTabColumns.forEach(column => {
 export default {
   name: "SeePurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
+  components: {
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+  },
   data() {
     return {
       visible: false,
@@ -53,9 +56,6 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -68,6 +68,47 @@ export default {
       this.setVisible(false);
       this.params = initParams(Columns);
     },
+    handleRefresh(){
+      let {id} = this.params;
+      this.fetchItem(id);
+    },
+    // 发送NC
+    async handleSendNC(){
+      console.log('发送NC');
+
+      try {
+        let {code} = await orderApi.toNc({ puOrderId:this.params.id});
+
+        if(code == 200){
+          this.handleRefresh();
+        }
+      } catch (error) {
+        
+      }finally{
+
+      }
+    },
+    // 判断是否能发送NC
+    judgeIsToNC(){
+
+      let {source,status,deliveryStatus} = this.params;
+
+      // 自制 & 状态为:自由态、驳回
+      // if(source === '3' &&(status === '0' || status === '3')){
+      if(status === '2'){
+
+        // 发送NC之后展示 SUCCESS("0","成功"),SEND_IN("1","发送中"),FAILURE("2","失败");
+        //    未发送                发送过但未成功
+        if(!deliveryStatus || (deliveryStatus && deliveryStatus !== '0')){
+
+          return true;
+        }
+
+        return false;
+      }
+
+      return false;
+    },
     beforeOpen() { },
   },
   created() { },
@@ -76,7 +117,10 @@ export default {
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+  <el-drawer 
+    direction="btt" 
+    size="100%" 
+    :with-header="false" :visible.sync="visible" @open="beforeOpen"
     @close="$emit('close')">
     <el-form size="mini" label-position="right" label-width="140px" :model="params" :rules="rules">
       <el-card :body-style="{
@@ -91,6 +135,26 @@ export default {
           ">
           <h3>查看</h3>
           <div style="text-align: right">
+            <el-button size="mini" @click="handleRefresh">刷新</el-button>
+            <template v-if="judgeIsToNC()">
+              <el-tooltip
+                class="box-item"
+                effect="dark"
+                :key="params.deliveryStatus"
+                :content="params.deliveryMsg"
+                placement="bottom-end"
+              >
+                <el-button 
+                  :key="params.deliveryStatus"
+                  :disabled="params.deliveryStatus === '1' "
+                  size="mini" 
+                  type="primary"
+                  @click="handleSendNC"
+                >{{  params.deliveryStatus === '1' ? '发送中' :
+                    (params.deliveryStatus === '2'? '重新发送NC' : '发送NC')
+                }}</el-button>
+              </el-tooltip>
+            </template>
             <el-button size="mini" @click="handleCancel">取 消</el-button>
           </div>
         </div>
@@ -98,55 +162,101 @@ export default {
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
 
-              <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" readonly style="width: 100%">
-              </el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]" disabled
-                :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
-                :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
-              </dr-popover-select>
-
-              <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" readonly style="width: 100%">
-              </el-input>
-
-              <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" disabled style="width: 100%">
-              </el-input-number>
-              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" disabled size="mini"
-                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
-                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
-                  :value="item.value">
+              <el-input v-if="column.inputType === 'Input'" 
+                v-model="params[column.key]" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                readonly 
+                style="width: 100%"
+              ></el-input>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" 
+                v-model="params[column.key]" 
+                disabled
+                :value-key="column.valueKey" 
+                :source.sync="params" 
+                :title="column.title" 
+                :type="column.referName"
+                :multiple="column.multiple" 
+                :placeholder="column.placeholder" 
+                :data-mapping="column.dataMapping"
+                :query-params="column.queryParams"
+              ></dr-popover-select>
+
+              <el-input v-if="column.inputType === 'Textarea'" 
+                v-model="params[column.key]" 
+                type="textarea"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                readonly 
+                style="width: 100%"
+              ></el-input>
+
+              <el-input-number v-if="column.inputType === 'InputNumber'" 
+                v-model="params[column.key]"
+                :controls-position="column.controlsPosition" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                disabled 
+                style="width: 100%"
+              ></el-input-number>
+              <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                disabled 
+                size="mini"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%">
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable
-                collapse-tags :placeholder="column.placeholder" :clearable="column.clearable" disabled
+              <el-select v-if="column.inputType === 'TagSelect'" 
+                v-model="params[column.key]" 
+                multiple 
+                clearable
+                collapse-tags 
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                disabled
                 style="width: 100%">
                 <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                  <el-icon class="el-icon-view" 
+                    style="cursor: pointer" 
+                    @click.stop="$message.info(234)">
+                  </el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                <el-option 
+                  v-for="item in options" 
+                  :key="item.value" 
+                  :label="item.label" 
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" readonly
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" disabled true-label="Y"
-                false-label="N">
-              </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" disabled drag
-                action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]" 
+                :type="column.type"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                readonly
+                :picker-options="column.pickerOptions" 
+                style="width: 100%"
+              ></el-date-picker>
+              <el-checkbox v-if="column.inputType === 'Checkbox'" 
+                v-model="params[column.key]" 
+                disabled 
+                true-label="Y"
+                false-label="N"
+              ></el-checkbox>
+              <file-upload-center v-if="column.inputType === 'Upload'" 
+                v-model="params[column.key]"
+                :file-type="column.fileType" 
+                :disabled="true"
+              ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
@@ -158,40 +268,79 @@ export default {
         position: 'relative',
       }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane 
+            v-for="(column, index) in tabColumns" 
+            :key="index" 
+            :label="column.title" 
+            :name="column.key"
+          >
             <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width || 80">
+              <el-table-column 
+                v-for="(cColumn, cIndex) in column.tableColumns" 
+                :key="cIndex" 
+                :prop="cColumn.key"
+                :label="cColumn.title" 
+                :width="cColumn.width || 80"
+              >
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" readonly size="mini"
-                    style="width: 100%"></el-input>
+                  <el-input v-if="cColumn.inputType === 'Input'" 
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" 
+                    :clearable="cColumn.clearable" 
+                    readonly 
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input>
 
                   <!--  -->
-                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
-                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey" disabled
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)" size="mini">
-                  </dr-popover-select>
-
-                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" disabled size="mini" style="width: 100%">
-                  </el-input-number>
-
-                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" disabled size="mini"
-                    :clearable="cColumn.clearable" :placeholder="cColumn.placeholder" style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
-                      :value="item.value">
-                    </el-option>
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'"
+                    v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" 
+                    :title="cColumn.title" 
+                    :value-key="cColumn.valueKey" 
+                    disabled
+                    :type="cColumn.referName" 
+                    :multiple="cColumn.multiple" 
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping" 
+                    :query-params="cColumn.queryParams" 
+                    size="mini"
+                  ></dr-popover-select>
+
+                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.controlsPosition" 
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" 
+                    disabled 
+                    size="mini" 
+                    style="width: 100%"
+                  ></el-input-number>
+
+                  <el-select v-if="cColumn.inputType === 'Select'" 
+                    v-model="scope.row[cColumn.key]" 
+                    disabled 
+                    size="mini"
+                    :clearable="cColumn.clearable" 
+                    :placeholder="cColumn.placeholder" 
+                    style="width: 100%">
+                    <el-option 
+                      v-for="item in dict.type[cColumn.referName]" 
+                      :key="item.value" 
+                      :label="item.label"
+                      :value="item.value"
+                    ></el-option>
                   </el-select>
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" disabled
-                    true-label="Y" false-label="N">
-                  </el-checkbox>
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" 
+                    v-model="scope.row[cColumn.key]" 
+                    disabled
+                    true-label="Y" 
+                    false-label="N"
+                  ></el-checkbox>
 
                 </template>
               </el-table-column>

+ 42 - 0
src/views/purchase/task/close/index.vue

@@ -0,0 +1,42 @@
+<script>
+import { SHUTDOWN } from "@/api/business/purchase/task";
+export default {
+  name: "DeleteDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop) {
+      this.$confirm("是否关闭数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(async () => {
+          try {
+            this.loading = true;
+            const { demandItemId } = prop;
+            const { code } = await SHUTDOWN(demandItemId);
+            if (code === 200) {
+              this.$emit("success");
+            }
+          } catch (err) {
+            // catch
+          } finally {
+            // finally
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 61 - 65
src/views/purchase/task/column.js

@@ -67,65 +67,6 @@ export const TableColumns = [
   // { key: "delFlag", title: "删除标记" },
 ];
 
-const pickerOptions = {
-  shortcuts: [
-    {
-      text: "昨天",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-    {
-      text: "最近三天",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-    {
-      text: "最近一周",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-    {
-      text: "最近一个月",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-    {
-      text: "最近三个月",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-    {
-      text: "最近半年",
-      onClick(picker) {
-        const end = new Date();
-        const start = new Date();
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
-        picker.$emit("pick", [start, end]);
-      },
-    },
-  ],
-};
-
 export const SearchColumns = [
   {
     key: "classIds",
@@ -136,7 +77,6 @@ export const SearchColumns = [
     referName: "MATERIALCLASSIFY_PARAM",
     readonly: true,
     dataMapping: {},
-    queryParams: () => ({}),
   },
   {
     key: "materialCodes",
@@ -147,10 +87,9 @@ export const SearchColumns = [
     referName: "MATERIAL_PARAM",
     readonly: true,
     dataMapping: {},
-    queryParams: () => ({}),
   },
   { key: "materialDesc", title: "物料描述", inputType: "Input" },
-  { key: "source", title: "需求来源", inputType: "Input" },
+  { key: "code", title: "单据号", inputType: "Input" },
   {
     key: "puOrgIds",
     title: "采购组织",
@@ -160,7 +99,6 @@ export const SearchColumns = [
     referName: "ORG_PARAM",
     readonly: true,
     dataMapping: {},
-    queryParams: () => ({}),
   },
   {
     key: "status",
@@ -186,11 +124,10 @@ export const SearchColumns = [
     title: "采购员",
     inputType: "PopoverSelect",
     multiple: true,
-    valueKey: "id",
+    valueKey: "code",
     referName: "CONTACTS_PARAM",
     readonly: true,
     dataMapping: {},
-    queryParams: () => ({}),
   },
   {
     key: "documentsCodes",
@@ -199,3 +136,62 @@ export const SearchColumns = [
     placeholder: "请输入来源单据号,多个用,分隔",
   },
 ];
+
+const pickerOptions = {
+  shortcuts: [
+    {
+      text: "昨天",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近三天",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近一周",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近一个月",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近三个月",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+    {
+      text: "最近半年",
+      onClick(picker) {
+        const end = new Date();
+        const start = new Date();
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
+        picker.$emit("pick", [start, end]);
+      },
+    },
+  ],
+};

+ 2 - 2
src/views/purchase/task/documents-return/index.vue

@@ -37,8 +37,8 @@ export default {
         });
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
-          this.$notify.success({ title: msg });
+          this.$emit("success");
+          
         } else {
           this.$notify.warning({ title: msg });
         }

+ 35 - 0
src/views/purchase/task/export/index.vue

@@ -0,0 +1,35 @@
+<script>
+export default {
+  name: "ExportDialog",
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    //
+    open(prop, page) {
+      this.$confirm("是否确认导出所有数据项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info",
+      })
+        .then(() => {
+          const { pageNum, pageSize } = page;
+          this.download(
+            "pu/order/generate/export",
+            { ...prop, pageNum, pageSize },
+            `task_${new Date().getTime()}.xlsx`
+          );
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template></template>

+ 6 - 5
src/views/purchase/task/first-direct/index.vue

@@ -30,10 +30,10 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await FIRSTDIRECT(prop);
+        const { code,data } = await FIRSTDIRECT(prop);
         if (code === 200) {
           this.data = data;
-          this.$notify.success({ title: msg });
+          
         } else {
           this.hide();
           this.$notify.warning({ title: msg });
@@ -58,8 +58,8 @@ export default {
         const { code, msg } = await ADD(params);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
-          this.$notify.success({ title: msg });
+          this.$emit("success");
+          
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -77,7 +77,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog :visible.sync="visible" title="首次协议直采">
+  <el-dialog :visible.sync="visible" width="75%" title="首次协议直采">
     <div
       v-for="(item, index) in data"
       :key="index"
@@ -101,6 +101,7 @@ export default {
       </el-descriptions>
       <el-table
         v-loading="loading"
+        :size="size"
         :data="item.orderPriceVos"
         style="width: 100%"
       >

+ 113 - 148
src/views/purchase/task/index.vue

@@ -1,22 +1,18 @@
 el-col
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { LIST, SHUTDOWN } from "@/api/business/purchase/task";
-import {
-  initPage,
-  initDicts,
-  initLayout,
-  initParams,
-  initPageSizes,
-} from "@/utils/init";
+import { LIST } from "@/api/business/purchase/task";
+import { initPage, initDicts, initParams } from "@/utils/init";
 export default {
   name: "PuchaseTask",
   dicts: [...initDicts(TableColumns), ...initDicts(SearchColumns)],
   components: {
-    SeeDialog: () => import("./see/index.vue"),
-    FirstDirectDialog: () => import("./first-direct/index.vue"),
-    DocReturnDialog: () => import("./documents-return/index.vue"),
-    ModifyBuyerDialog: () => import("./modify-buyer/index.vue"),
+    SeeModel: () => import("./see/index.vue"),
+    CloseModel: () => import("./close/index.vue"),
+    ExportModel: () => import("./export/index.vue"),
+    ShiftModel: () => import("./modify-buyer/index.vue"),
+    DirectModel: () => import("./first-direct/index.vue"),
+    ReturnModel: () => import("./documents-return/index.vue"),
   },
   data() {
     return {
@@ -27,15 +23,13 @@ export default {
       tableData: [],
       selectData: [],
       tableColumns: TableColumns,
-      page: initPage(),
-      layout: initLayout(),
-      pageSizes: initPageSizes(),
+      page: { pageNum: 1, pageSize: 10, total: 0 },
     };
   },
   computed: {},
   watch: {},
   created() {
-    this.queryList(this.params, this.page);
+    this.useQuery(this.params, this.page);
   },
   methods: {
     //
@@ -43,98 +37,82 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await LIST(
+        const { code, rows, total } = await LIST(
           { ...prop },
-          { pageNum, pageSize, isAsc: "desc", orderByColumn: "createTime" }
+          { pageNum, pageSize }
         );
         if (code === 200) {
           this.tableData = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
-    // 查询操作
-    queryList(prop, page) {
-      const { date } = prop;
+    // 查 
+    useQuery(prop, page) {
+      const { date, documentsCodes } = prop;
       prop.endDate = date[1];
       prop.startDate = date[0];
-      this.fetchList({ ...prop, date: undefined }, page);
+      prop.documentsCodes = documentsCodes
+        ? documentsCodes.split(",")
+        : undefined;
+      this.fetchList(
+        {
+          ...prop,
+          isAsc: "desc",
+          date: undefined,
+          orderByColumn: "createTime",
+        },
+        page
+      );
     },
-    // 重置操作
-    resetList() {
+    // 重 
+    useReset() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.queryList(this.params, this.page);
-    },
-    // 页大小变
-    sizeChange(prop) {
-      this.page.pageSize = prop;
-      this.queryList(this.params, this.page);
+      this.useQuery(this.params, this.page);
     },
-    // 当前页变
-    currentChange(prop) {
-      this.page.pageNum = prop;
-      this.queryList(this.params, this.page);
-    },
-    // 选择行
-    selectionChange(prop) {
+    // 选 择
+    useSelect(prop) {
       this.selectData = prop;
     },
-    // 行关闭
-    async shutDown(prop) {
-      try {
-        this.loading = true;
-        const { demandItemId } = prop;
-        const { code, msg } = await SHUTDOWN(demandItemId);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          await this.queryList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
+    // 行 关
+    async useClose(prop) {
+      const { open } = this.$refs.CloseModel;
+      await open(prop);
     },
-    // 退回需求
-    async openDocumentsReturnDialog(prop) {
-      const { open } = this.$refs.DocReturnDialog;
+    // 退 回
+    async useReturn(prop) {
+      const { open } = this.$refs.ReturnModel;
       await open(prop);
     },
-    // 转派
-    async openModifyBuyerDialog(prop) {
+    // 转 派
+    async useShift(prop) {
       const { id } = prop;
-      const { open } = this.$refs.ModifyBuyerDialog;
+      const { open } = this.$refs.ShiftModel;
       await open(id);
     },
-    // 打开查看drawer
-    async openSeeDialog(prop) {
+    // 明 细
+    async useSee(prop) {
       const { id } = prop;
-      const { open } = this.$refs.SeeDialog;
+      const { open } = this.$refs.SeeModel;
       await open(id);
     },
-    // 打开首次直采drawer
-    async openFristDirectDialog(prop) {
-      const { open } = this.$refs.FirstDirectDialog;
+    // 直 
+    async useDirect(prop) {
+      const { open } = this.$refs.DirectModel;
       await open(prop);
     },
-    // 导出
+    // 导 
     async useExport(prop, page) {
-      const { pageNum, pageSize } = page;
-      this.download(
-        "pu/order/generate/export",
-        { ...prop, pageNum, pageSize },
-        `KONG_${new Date().getTime()}.xlsx`
-      );
+      const { open } = this.$refs.ExportModel;
+      await open(prop, page);
     },
   },
 };
@@ -143,22 +121,20 @@ export default {
 <template>
   <el-card
     v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
+    style="
+      width: calc(100% - 20px);
+      height: 100%;
+      margin: 10px;
+      padding: 0 20px 20px 0;
+    "
     :body-style="{ padding: 0 }"
   >
-    <see-dialog ref="SeeDialog"></see-dialog>
-    <first-direct-dialog
-      ref="FirstDirectDialog"
-      @submit-success="resetList"
-    ></first-direct-dialog>
-    <doc-return-dialog
-      ref="DocReturnDialog"
-      @submit-success="resetList"
-    ></doc-return-dialog>
-    <modify-buyer-dialog
-      ref="ModifyBuyerDialog"
-      @submit-success="resetList"
-    ></modify-buyer-dialog>
+    <see-model ref="SeeModel"></see-model>
+    <export-model ref="ExportModel"></export-model>
+    <close-model ref="CloseModel" @success="useReset"></close-model>
+    <shift-model ref="ShiftModel" @success="useReset"></shift-model>
+    <direct-model ref="DirectModel" @success="useReset"></direct-model>
+    <return-model ref="ReturnModel" @success="useReset"></return-model>
     <el-backtop target=".el-scrollbar__wrap"></el-backtop>
     <el-form
       :size="size"
@@ -166,6 +142,7 @@ export default {
       label-width="auto"
       label-position="right"
       style="padding: 20px 20px 0"
+      @submit.native.prevent
     >
       <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
         <el-col
@@ -181,6 +158,8 @@ export default {
               :clearable="column.clearable"
               :placeholder="column.placeholder"
               style="width: 100%"
+              @change="useQuery(params, page)"
+              @keyup.enter.native="useQuery(params, page)"
             ></el-input>
             <el-select
               v-if="column.inputType === 'Select'"
@@ -189,6 +168,8 @@ export default {
               :clearable="column.clearable"
               :placeholder="column.placeholder"
               style="width: 100%"
+              @change="useQuery(params, page)"
+              @keyup.enter.native="useQuery(params, page)"
             >
               <el-option
                 v-for="item in dict.type[column.referName]"
@@ -210,6 +191,8 @@ export default {
               :end-placeholder="column.endPlaceholder"
               :start-placeholder="column.startPlaceholder"
               style="width: 100%"
+              @change="useQuery(params, page)"
+              @keyup.enter.native="useQuery(params, page)"
             >
             </el-date-picker>
             <dr-popover-select
@@ -224,7 +207,8 @@ export default {
               :value-key="column.valueKey"
               :placeholder="column.placeholder"
               :data-mapping="column.dataMapping"
-              :query-params="column.queryParams(params)"
+              @change="useQuery(params, page)"
+              @keyup.enter.native="useQuery(params, page)"
             >
             </dr-popover-select>
             <dr-popover-tree-select
@@ -238,70 +222,56 @@ export default {
               :value-key="column.valueKey"
               :placeholder="column.placeholder"
               :data-mapping="column.dataMapping"
-              :query-params="column.queryParams(params)"
+              :query-params="column.queryParams"
             >
             </dr-popover-tree-select>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
-          <el-form-item label-width="0">
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-search"
-              @click="queryList(params, page)"
-            ></el-button>
-            <el-button
-              circle
-              :size="size"
-              icon="el-icon-refresh"
-              @click="resetList"
-            ></el-button>
-          </el-form-item>
-        </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="24">
-        <el-button :size="size" @click="useExport(params, page)">
-          导 出
-        </el-button>
-        <el-button
-          :size="size"
-          :disabled="selectData.length !== 1"
-          @click="openModifyBuyerDialog(selectData[0])"
-        >
-          转 派
-        </el-button>
-        <el-button
-          :size="size"
-          :disabled="!selectData.length"
-          @click="openDocumentsReturnDialog(selectData)"
-        >
-          退回需求
-        </el-button>
-        <!-- <el-button
+    <el-row style="padding: 0 20px">
+      <el-button :size="size" @click="useQuery(params, page)">
+        查 询
+      </el-button>
+      <el-button :size="size" @click="useReset"> 重 置 </el-button>
+      <!-- <el-button :size="size" @click="useExport(params, page)">
+        导 出
+      </el-button> -->
+      <el-button
+        :size="size"
+        :disabled="selectData.length !== 1"
+        @click="useShift(selectData[0])"
+      >
+        转 派
+      </el-button>
+      <el-button
+        :size="size"
+        :disabled="!selectData.length"
+        @click="useReturn(selectData)"
+      >
+        退回需求
+      </el-button>
+      <!-- <el-button
           :size="size"
           :disabled="selectData.length !== 1"
-          @click="shutDown(selectData[0])"
+          @click="useClose(selectData[0])"
         >
           行关闭
         </el-button> -->
-        <el-button
-          :size="size"
-          :disabled="!selectData.length"
-          @click="openFristDirectDialog(selectData)"
-        >
-          协议直采
-        </el-button>
-      </el-col>
+      <el-button
+        :size="size"
+        :disabled="!selectData.length"
+        @click="useDirect(selectData)"
+      >
+        协议直采
+      </el-button>
     </el-row>
     <el-table
       :data="tableData"
       size="mini"
       style="width: 100%; margin: 20px 0 0 0"
-      @row-dblclick="openSeeDialog"
-      @selection-change="selectionChange"
+      @row-dblclick="useSee"
+      @selection-change="useSelect"
     >
       <el-table-column fixed width="55" align="center" type="selection">
       </el-table-column>
@@ -324,16 +294,11 @@ export default {
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChange"
-      @current-change="currentChange"
+    <pagination
       :total="page.total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      layout="total, prev, pager, next, sizes, jumper"
-      style="margin: 10px 20px"
-    >
-    </el-pagination>
+      :page.sync="page.pageNum"
+      :limit.sync="page.pageSize"
+      @pagination="useQuery(params, page)"
+    />
   </el-card>
 </template>

+ 2 - 2
src/views/purchase/task/modify-buyer/index.vue

@@ -40,8 +40,8 @@ export default {
         ]);
         if (code === 200) {
           this.hide();
-          this.$emit("submit-success");
-          this.$notify.success({ title: msg });
+          this.$emit("success");
+          
         } else {
           this.$notify.warning({ title: msg });
         }

+ 2 - 2
src/views/purchase/task/see/index.vue

@@ -32,10 +32,10 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await ITEM(prop);
+        const { code,data } = await ITEM(prop);
         if (code === 200) {
           this.params = data;
-          this.$notify.success({ title: msg });
+          
         } else {
           this.$notify.warning({ title: msg });
         }

+ 233 - 130
src/views/purchase/transferOrder/add.vue

@@ -87,7 +87,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
                 <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -158,7 +158,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventory, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -186,11 +186,12 @@
             </el-form-item>
         </el-col>
         <el-col :span="1.5">
-            <el-form-item label="是否已同步WMS">
-              <el-select clearable size="small" v-model="basicForm.isSendWms" :disabled="sonDisable" style="width: 200px">
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-            </el-form-item>
+          <el-form-item label="单据状态">
+            <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
+              <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
         </el-col>
         <el-col :span="1.5">
             <el-form-item label="备注">
@@ -203,13 +204,20 @@
               />
             </el-form-item>
         </el-col>
-        <el-col :span="1.5">
-            <el-form-item label="单据状态">
-              <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
-                <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
+      </el-row>
+
+      <el-row>
+        <el-col :span="20">
+          <el-form-item label="同步NC结果">
+              <el-input
+                v-model="basicForm.isSendWms"
+                type="textarea"
+                :rows="3"
+                size="small"
+                disabled
+                clearable
+              />
+          </el-form-item>
         </el-col>
       </el-row>
 
@@ -223,45 +231,71 @@
           fit
           max-height="480"
           >
-          <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="物料编码" align="center" prop="material" width="230px">
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.material">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.material" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="物料名称" align="center" prop="materialName" width="200px"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="200px"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="200px"/>
-          <el-table-column label="规格" align="center" prop="specification"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
-          <el-table-column label="产地" align="center" prop="originPlaceName"/>
-          <el-table-column label="型号" align="center" prop="model"/>
-          <el-table-column label="单位" align="center" prop="unitName"/>
-          <!-- <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
-          <el-table-column label="数量" align="center" prop="qty" width="150px">
+          <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="200px"/>
+          <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="200px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="200px"/>
+          <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
+          <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlaceName"/>
+          <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
+          <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
+          <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
+          <el-table-column show-overflow-tooltip label="数量" align="center" prop="qty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="主单位" align="center" prop="mainUnitName"/>
-          <el-table-column label="换算率" align="center" prop="equation"/>
-          <el-table-column label="主数量" align="center" prop="mainQty" width="150px">
+          <el-table-column show-overflow-tooltip label="主单位" align="center" prop="mainUnitName"/>
+          <el-table-column show-overflow-tooltip label="换算率" align="center" prop="equation"/>
+          <el-table-column show-overflow-tooltip label="主数量" align="center" prop="mainQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input :readonly="sonDisable" size="small" v-model="scope.row.mainQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="税率" align="center" prop="rate"/>
-          <!-- <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/> -->
-          <el-table-column label="批次号" align="center" prop="patchNo" width="150px"/>
-          <el-table-column label="产品批号" align="center" prop="producBatch" width="230px">
+          <el-table-column show-overflow-tooltip label="税率" align="center" prop="rate"/>
+          <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="调入部门" align="center" prop="storageDeptName" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.storageDeptName" @focus="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)"">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="批次号" align="center" prop="patchNo" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="producBatch" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.producBatch">
@@ -270,7 +304,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="230px">
+          <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-date-picker
@@ -283,27 +317,41 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="200px"/>
-          <el-table-column label="注册证号" align="center" prop="registration" width="200px"/>
-          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-          <el-table-column label="剂型" align="center" prop="drug"/>
-          <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail" width="200px"/>
-          <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="200px"/>
-          <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
-          <el-table-column label="pi码" align="center" prop="pi">
+          <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨日期" align="center" prop="allotDate" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-date-picker
+                  v-model="scope.row.allotDate"
+                  :readonly="sonDisable"
+                  type="date"
+                  size="small"
+                  :picker-options="pickerOptionsEnd"
+                  value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="200px"/>
+          <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="200px"/>
+          <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug"/>
+          <el-table-column show-overflow-tooltip label="调入调出结算规则明细" align="center" prop="ruleDetail" width="200px"/>
+          <el-table-column show-overflow-tooltip label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="200px"/>
+          <el-table-column show-overflow-tooltip label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
+          <el-table-column show-overflow-tooltip label="pi码" align="center" prop="pi">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input :readonly="sonDisable" size="small" v-model="scope.row.pi"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
-          <!-- <el-table-column label="备注" align="center" prop="code"/> -->
-          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-          <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
+          <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           <el-table-column
             fixed="right"
             label="操作"
@@ -322,35 +370,35 @@
           fit
           max-height="480"
           >
-          <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
-          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
-          <!-- <el-table-column label="收货利润中心" align="center" prop="code"/>
-          <el-table-column label="发货利润中心" align="center" prop="code"/> -->
-          <el-table-column label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
-          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-          <el-table-column label="收货客户" align="center" prop="customerName" width="150px"/>
-          <el-table-column label="收货地址" align="center" prop="addressaddress" width="150px"/>
-          <el-table-column label="收货地区" align="center" prop="area" width="150px"/>
-          <el-table-column label="收货地点" align="center" prop="place" width="150px"/>
-          <el-table-column label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
-          <el-table-column label="计划到货日期" align="center" prop="strageDate" width="150px"/>
-          <el-table-column label="运输方式" align="center" prop="transportation" width="150px"/>
-          <el-table-column label="备注" align="center" prop="remark" width="150px"/>
-          <el-table-column label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+          <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
+          <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
+          <el-table-column show-overflow-tooltip label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+          <el-table-column show-overflow-tooltip label="收货客户" align="center" prop="customerName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="addressaddress" width="150px"/>
+          <el-table-column show-overflow-tooltip label="收货地区" align="center" prop="area" width="150px"/>
+          <el-table-column show-overflow-tooltip label="收货地点" align="center" prop="place" width="150px"/>
+          <el-table-column show-overflow-tooltip label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="计划到货日期" align="center" prop="strageDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="运输方式" align="center" prop="transportation" 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="customerLogistic" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
 
@@ -360,31 +408,31 @@
           fit
           max-height="480"
           >
-          <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-          <!-- <el-table-column label="税率" align="center" prop="code"/> -->
-          <!-- <el-table-column label="无税单价" align="center" prop="code"/> -->
-          <!-- <el-table-column label="含税单价" align="center" prop="code"/> -->
-          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-          <!-- <el-table-column label="询价无税价" align="center" prop="code"/> -->
-          <!-- <el-table-column label="询价含税价" align="center" prop="code"/> -->
-          <!-- <el-table-column label="税额" align="center" prop="code"/> -->
-          <!-- <el-table-column label="加价率" align="center" prop="code"/> -->
-          <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
-          <!-- <el-table-column label="价税合计" align="center" prop="code"/> -->
-          <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+          <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
+          <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
+          <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
 
@@ -394,30 +442,30 @@
           fit
           max-height="480"
           >
-          <el-table-column label="行号" align="center" prop="rowno"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-          <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-          <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-          <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-          <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-          <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-          <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-          <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-          <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-          <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-          <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-          <!-- <el-table-column label="已调出主数量" align="center" prop="code"/>
-          <el-table-column label="已调入主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="调拨在途主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="已发货主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="途损主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="累计退货主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="调出与调入已结算主数量" align="center" prop="code"/> -->
-          <!-- <el-table-column label="调出与调入已结算金额" align="center" prop="code"/> -->
-          <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-          <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+          <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+          <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+          <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+          <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+          <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+          <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
+          <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
+          <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
+          <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
           </el-table>
         </el-tab-pane>
       </el-tabs>
@@ -581,6 +629,7 @@ export default {
         deliveryCode: '',
         storageCode: '',
         storageInventoryOrg: '',
+        storageInventory: '',
         storageInventoryOrgName: '',
         businessPersonal: '',
         businessPersonalName: '',
@@ -614,6 +663,8 @@ export default {
         type: '',
         isPage: true,
         title: '',
+        // 仓库编码
+        stordocId: ''
       },
       referConditionMx: {
         orgCode: '',
@@ -640,6 +691,17 @@ export default {
       receiveInfo: [],
       priceList: [],
       resultList: [],
+      pickerOptionsEnd: {
+        disabledDate: (time) => {
+          let beginDateVal = this.basicForm.billDate;
+          if (beginDateVal) {
+            return (
+              time.getTime() <
+              new Date(beginDateVal).getTime()
+            );
+          }
+        }
+      }
     }
   },
   created() {
@@ -695,7 +757,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -770,10 +832,17 @@ export default {
         mainQty: null,
         rate: '0.00',
         storageWarehouseName: null,
+        deliveryAllocationName: null,
+        deliveryAllocation: null,
+        storageDept: null,
+        storageDeptName: null,
+        storageAllocationName: null,
+        storageAllocation: null,
         patchNo: null,
         producBatch: null,
         manufactureDate: null,
         periodEndDate: null,
+        allotDate: null,
         ratifyCode: null,
         registration: null,
         productCode: null,
@@ -793,10 +862,13 @@ export default {
       console.log('删除行:', index)
       this.materialInfo.splice(index, 1)
     },
-    chooseRefer(type, isPage, title) {
+    chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      this.referCondition.pkOrg = pkOrg
+      this.referCondition.isDirectStore = isDirectStore
+      this.referCondition.gubFlag = gubFlag
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
@@ -808,6 +880,7 @@ export default {
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
         this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventory = selection[0].code
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
         // 选择调入库存组织时判断调拨方式
@@ -842,6 +915,18 @@ export default {
         this.basicForm.deliveryWarehouse = selection[0].id
         this.basicForm.deliveryWarehouseName = selection[0].name
       }
+      if (this.referCondition.title == '调出货位') {
+        this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name
+        this.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '调入货位') {
+        this.materialInfo[this.tableIndex].storageAllocationName = selection[0].name
+        this.materialInfo[this.tableIndex].storageAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '调入部门') {
+        this.materialInfo[this.tableIndex].storageDeptName = selection[0].name
+        this.materialInfo[this.tableIndex].storageDept = selection[0].id
+      }
     },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type
@@ -888,6 +973,24 @@ export default {
     selectBatch(selection) {
       console.log('选中的批次号', selection)
     },
+    // 明细行选择货位
+    chooseMxHW(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    // 明细行选择调入部门
+    chooseMxBM(index, type, isPage, title, pkOrg) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.pkOrg = pkOrg
+      this.$refs.refer.init(this.referCondition)
+    },
   }
 }
 </script>

+ 159 - 143
src/views/purchase/transferOrder/index.vue

@@ -13,7 +13,7 @@
           <el-col :span="1.5">
             <el-form-item label="单据日期">
               <el-date-picker
-               style="width: 240px"
+               style="width: 200px"
                size="small"
                clearable
                value-format="yyyy-MM-dd"
@@ -38,6 +38,16 @@
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
+            <el-form-item label="单据号">
+              <el-input
+                v-model.trim="queryParams.code"
+                size="small"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
             <el-form-item label="" label-width="20px">
               <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
               <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
@@ -90,35 +100,39 @@
           ref="multipleTable"
           @row-click="select"
         >
-          <el-table-column label="调出库存" align="center" prop="deliveryInventoryOrgName" width="150px"/>
-          <el-table-column label="订单类型" align="center" prop="billType" width="150px"/>
-          <el-table-column label="单据号" align="center" prop="code" width="150px"/>
-          <el-table-column label="单据日期" align="center" prop="billDate" width="150px"/>
-          <el-table-column label="调拨方式" align="center" prop="allotType" width="150px"/>
-          <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-          <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-          <el-table-column label="调拨入库组织" align="center" prop="storageInventoryOrgName" width="150px"/>
-          <el-table-column label="调出业务员" align="center" prop="businessPersonalName" width="150px"/>
-          <el-table-column label="调出部门" align="center" prop="deliveryDeptName" width="150px"/>
-          <el-table-column label="币种" align="center" prop="currencyName"/>
-          <el-table-column label="折本汇率" align="center" prop="rate"/>
-          <el-table-column label="在途归属" align="center" prop="onRouteAffilliation" width="150px"/>
-          <el-table-column label="总数量" align="center" prop="qty"/>
-          <el-table-column label="结算路径" align="center" prop="accountPath" width="150px"/>
-          <el-table-column label="客户" align="center" prop="customerName" width="150px"/>
-          <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="180px"/>
-          <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
-          <el-table-column label="物流项目组" align="center" prop="materialProject" width="150px"/>
-          <el-table-column label="利润中心" align="center" prop="liacenterName" width="150px"/>
-          <el-table-column label="已同步WMS" align="center" prop="isSendWms" width="150px"/>
-          <el-table-column label="备注" align="center" prop="remark" width="150px"/>
-          <el-table-column label="单据状态" align="center" prop="status" width="150px"/>
-          <el-table-column label="制单人" align="center" prop="createByName" width="150px"/>
-          <el-table-column label="制单日期" align="center" prop="createTime" width="150px"/>
-          <!-- <el-table-column label="审批人" align="center" prop="code" width="150px"/> -->
-          <!-- <el-table-column label="审批日期" align="center" prop="code" width="150px"/> -->
-          <el-table-column label="最后修改人" align="center" prop="updateByName" width="150px"/>
-          <el-table-column label="最后修改时间" align="center" prop="updateTime" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调出库存" align="center" prop="deliveryInventoryOrgName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="订单类型" align="center" prop="billType" width="150px"/>
+          <el-table-column show-overflow-tooltip label="单据号" align="center" prop="code" width="180px"/>
+          <el-table-column show-overflow-tooltip label="单据日期" align="center" prop="billDate" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨方式" align="center" prop="allotType" width="150px">
+            <template slot-scope="scope">
+              <span>{{ scope.row.allotType == '2' ? '财务组织间调拨' : '财务组织内库存组织内调拨' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调拨入库组织" align="center" prop="storageInventoryOrgName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调出业务员" align="center" prop="businessPersonalName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调出部门" align="center" prop="deliveryDeptName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="币种" align="center" prop="currencyName"/>
+          <el-table-column show-overflow-tooltip label="折本汇率" align="center" prop="rate"/>
+          <el-table-column show-overflow-tooltip label="在途归属" align="center" prop="onRouteAffilliation" width="150px"/>
+          <el-table-column show-overflow-tooltip label="总数量" align="center" prop="qty"/>
+          <el-table-column show-overflow-tooltip label="结算路径" align="center" prop="accountPath" width="150px"/>
+          <el-table-column show-overflow-tooltip label="客户" align="center" prop="customerName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName" width="180px"/>
+          <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="物流项目组" align="center" prop="materialProject" width="150px"/>
+          <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="status" width="150px"/>
+          <el-table-column show-overflow-tooltip label="制单人" align="center" prop="createByName" width="150px"/>
+          <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"/> -->
+          <el-table-column show-overflow-tooltip label="最后修改人" align="center" prop="updateByName" width="150px"/>
+          <el-table-column show-overflow-tooltip label="最后修改时间" align="center" prop="updateTime" width="150px"/>
           <el-table-column
           fixed="right"
           label="操作"
@@ -149,41 +163,41 @@
             fit
             max-height="380"
             >
-            <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="物料编码" align="center" prop="material" width="150px"/>
-            <el-table-column label="物料名称" align="center" prop="materialName" width="150px"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-            <el-table-column label="规格" align="center" prop="specification"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-            <el-table-column label="型号" align="center" prop="model" width="150px"/>
-            <el-table-column label="单位" align="center" prop="unitName" width="150px"/>
-            <!-- <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
-            <el-table-column label="数量" align="center" prop="qty" width="150px"/>
-            <el-table-column label="主单位" align="center" prop="mainUnit" width="150px"/>
-            <el-table-column label="换算率" align="center" prop="equation" width="150px"/>
-            <el-table-column label="主数量" align="center" prop="mainQty" width="150px"/>
-            <el-table-column label="税率" align="center" prop="rate" width="150px"/>
-            <!-- <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/> -->
-            <el-table-column label="批次号" align="center" prop="patchNo" width="150px"/>
-            <el-table-column label="产品批号" align="center" prop="producBatch" width="150px"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-            <el-table-column label="调入调出结算规则明细" align="center" prop="ruleDetail" width="150px"/>
-            <el-table-column label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="150px"/>
-            <el-table-column label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
-            <el-table-column label="pi码" align="center" prop="pi" width="150px"/>
-            <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
-            <!-- <el-table-column label="备注" align="center" prop="code"/> -->
-            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-            <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+            <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="150px"/>
+            <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
+            <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column show-overflow-tooltip label="型号" align="center" prop="model" width="150px"/>
+            <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
+            <el-table-column show-overflow-tooltip label="数量" align="center" prop="qty" width="150px"/>
+            <el-table-column show-overflow-tooltip label="主单位" align="center" prop="mainUnit" width="150px"/>
+            <el-table-column show-overflow-tooltip label="换算率" align="center" prop="equation" width="150px"/>
+            <el-table-column show-overflow-tooltip label="主数量" align="center" prop="mainQty" width="150px"/>
+            <el-table-column show-overflow-tooltip label="税率" align="center" prop="rate" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName"/> -->
+            <el-table-column show-overflow-tooltip label="批次号" align="center" prop="patchNo" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="producBatch" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调入调出结算规则明细" align="center" prop="ruleDetail" width="150px"/>
+            <el-table-column show-overflow-tooltip label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
+            <el-table-column show-overflow-tooltip label="pi码" align="center" prop="pi" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
+            <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -193,35 +207,35 @@
             fit
             max-height="380"
             >
-            <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-            <el-table-column label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
-            <el-table-column label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
-            <!-- <el-table-column label="收货利润中心" align="center" prop="code"/>
-            <el-table-column label="发货利润中心" align="center" prop="code"/> -->
-            <el-table-column label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
-            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-            <el-table-column label="收货客户" align="center" prop="customerName" width="150px"/>
-            <el-table-column label="收货地址" align="center" prop="addressaddress" width="150px"/>
-            <el-table-column label="收货地区" align="center" prop="area" width="150px"/>
-            <el-table-column label="收货地点" align="center" prop="place" width="150px"/>
-            <el-table-column label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
-            <el-table-column label="计划到货日期" align="center" prop="strageDate" width="150px"/>
-            <el-table-column label="运输方式" align="center" prop="transportation" width="150px"/>
-            <el-table-column label="备注" align="center" prop="remark" width="150px"/>
-            <el-table-column label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+            <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
+            <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
+            <el-table-column show-overflow-tooltip label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+            <el-table-column show-overflow-tooltip label="收货客户" align="center" prop="customerName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="addressaddress" width="150px"/>
+            <el-table-column show-overflow-tooltip label="收货地区" align="center" prop="area" width="150px"/>
+            <el-table-column show-overflow-tooltip label="收货地点" align="center" prop="place" width="150px"/>
+            <el-table-column show-overflow-tooltip label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="计划到货日期" align="center" prop="strageDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="运输方式" align="center" prop="transportation" 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="customerLogistic" width="150px"/>
+            <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -231,31 +245,31 @@
             fit
             max-height="380"
             >
-            <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-            <!-- <el-table-column label="税率" align="center" prop="code"/> -->
-            <!-- <el-table-column label="无税单价" align="center" prop="code"/> -->
-            <!-- <el-table-column label="含税单价" align="center" prop="code"/> -->
-            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-            <!-- <el-table-column label="询价无税价" align="center" prop="code"/> -->
-            <!-- <el-table-column label="询价含税价" align="center" prop="code"/> -->
-            <!-- <el-table-column label="税额" align="center" prop="code"/> -->
-            <!-- <el-table-column label="加价率" align="center" prop="code"/> -->
-            <!-- <el-table-column label="无税金额" align="center" prop="code"/> -->
-            <!-- <el-table-column label="价税合计" align="center" prop="code"/> -->
-            <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+            <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
+            <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
+            <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
 
@@ -265,30 +279,30 @@
             fit
             max-height="380"
             >
-            <el-table-column label="行号" align="center" prop="rowno"/>
-            <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
-            <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
-            <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
-            <el-table-column label="产地" align="center" prop="originPlace" width="150px"/>
-            <el-table-column label="类别" align="center" prop="classify" width="150px"/>
-            <el-table-column label="产品批号" align="center" prop="productBatch" width="150px"/>
-            <el-table-column label="生产日期" align="center" prop="manufactureDate" width="150px"/>
-            <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
-            <el-table-column label="批准文号" align="center" prop="ratifyCode" width="150px"/>
-            <el-table-column label="注册证号" align="center" prop="registration" width="150px"/>
-            <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
-            <el-table-column label="通用名" align="center" prop="commonCode" width="150px"/>
-            <el-table-column label="剂型" align="center" prop="drug" width="150px"/>
-            <!-- <el-table-column label="已调出主数量" align="center" prop="code"/>
-            <el-table-column label="已调入主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="调拨在途主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="已发货主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="途损主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="累计退货主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="调出与调入已结算主数量" align="center" prop="code"/> -->
-            <!-- <el-table-column label="调出与调入已结算金额" align="center" prop="code"/> -->
-            <el-table-column label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
-            <el-table-column label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
+            <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
+            <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
+            <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
+            <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
+            <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+            <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
+            <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
+            <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
+            <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
+            <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
+            <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
+            <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
+            <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
             </el-table>
           </el-tab-pane>
         </el-tabs>
@@ -325,6 +339,7 @@ export default {
         billDate: '',
         billType: '',
         storageInventoryOrg: '',
+        code: '',
         pageNum: 1,
         pageSize: 5
       },
@@ -364,6 +379,7 @@ export default {
         billDate: '',
         billType: '',
         storageInventoryOrg: '',
+        code: '',
         pageNum: 1,
         pageSize: 5
       }

+ 15 - 8
vue.config.js

@@ -43,18 +43,25 @@ module.exports = {
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
-        // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
+        // target: `http://172.16.13.47:8000/drp-admin`, //这是一个美女的本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        // target: `http://172.16.13.21:8000/drp-admin`, // 雪豹的本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",
         },
       },
-      "/drp-admin/mock34": {
-        target: `http://172.16.100.123:3030/mock/34`,
+      "/drp-file": {
+        target: `https://test-sy.derom.com`,
         changeOrigin: true,
-        pathRewrite: { [`^/drp-admin/mock34`]: "" },
+        pathRewrite: { [`^/drp-file`]: "" },
+      },
+      "/sy-derom": {
+        // target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        target: `https://sy.derom.com`,
+        changeOrigin: true,
+        pathRewrite: { [`^/sy-derom`]: "" },
       },
     },
     disableHostCheck: true,
@@ -137,10 +144,10 @@ module.exports = {
         },
       });
       config.optimization.runtimeChunk("single"),
-      {
-        from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
-        to: "./", //到根目录下
-      };
+        {
+          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+          to: "./", //到根目录下
+        };
     });
   },
 };