Prechádzať zdrojové kódy

Merge branch 'dev' into 'master'

Dev

See merge request new-business/drp-web!59
黄梓星 2 rokov pred
rodič
commit
e9ad1e5a0b
100 zmenil súbory, kde vykonal 4704 pridanie a 4139 odobranie
  1. 1 0
      package.json
  2. 1 1
      src/api/business/purchase/apply.js
  3. 22 9
      src/api/business/purchase/contract.js
  4. 12 2
      src/api/business/purchase/purchase-order.js
  5. 28 7
      src/api/business/purchase/task.js
  6. 1 0
      src/api/business/spd/bo/statement.js
  7. 5 1
      src/api/marketing/dealer-authorization.js
  8. 8 0
      src/api/purchase/basic.js
  9. 8 0
      src/api/purchase/transferOrder.js
  10. 1 1
      src/assets/styles/variables.scss
  11. 4 2
      src/components/DictTag/index.vue
  12. 40 19
      src/components/FileUpload/index.vue
  13. 3 1
      src/components/PopDialog/index.vue
  14. 171 0
      src/components/Refers/batchRefer.vue
  15. 2 2
      src/components/Refers/refers.vue
  16. 1 2
      src/components/Refers/treeRefer.vue
  17. 0 186
      src/components/input-dialog/components/index.vue
  18. 0 12
      src/components/input-dialog/components/init-column.js
  19. 0 62
      src/components/input-dialog/index.js
  20. 0 97
      src/components/input-dialog/index.vue
  21. 0 0
      src/components/popover-select/api/index.js
  22. 0 0
      src/components/popover-select/components/ALLOCATION_PARAM.js
  23. 0 0
      src/components/popover-select/components/BALATYPE_PARAM.js
  24. 15 0
      src/components/popover-select/components/CONTACTS_PARAM.js
  25. 0 0
      src/components/popover-select/components/CURRENCY_PARAM.js
  26. 0 0
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  27. 0 0
      src/components/popover-select/components/CUSTOMER_PARAM.js
  28. 0 0
      src/components/popover-select/components/DEPT_PARAM.js
  29. 0 0
      src/components/popover-select/components/MATERIAL_PARAM.js
  30. 0 0
      src/components/popover-select/components/OPERATING_PARAM.js
  31. 0 0
      src/components/popover-select/components/ORG_PARAM.js
  32. 0 0
      src/components/popover-select/components/PAYAGREEMENT_PARAM.js
  33. 0 0
      src/components/popover-select/components/PROCESSTYPE_PARAM.js
  34. 0 0
      src/components/popover-select/components/PROJECT_PARAM.js
  35. 21 0
      src/components/popover-select/components/PSNLICENSE_PARAM.js
  36. 0 0
      src/components/popover-select/components/RETREASON_PARAM.js
  37. 0 0
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  38. 0 0
      src/components/popover-select/components/SUPPLIER_PARAM.js
  39. 22 0
      src/components/popover-select/components/TAX_RATE_PARAM.js
  40. 22 0
      src/components/popover-select/components/UNIT_PARAM.js
  41. 0 0
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  42. 349 0
      src/components/popover-select/index.vue
  43. 18 0
      src/components/popover-tree-select/api/index.js
  44. 22 0
      src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js
  45. 178 0
      src/components/popover-tree-select/components/index.vue
  46. 213 0
      src/components/popover-tree-select/index.vue
  47. 59 34
      src/layout/components/Sidebar/SidebarItem.vue
  48. 61 45
      src/layout/components/Sidebar/index.vue
  49. 63 50
      src/main.js
  50. 17 32
      src/utils/init/index.js
  51. 33 0
      src/utils/init/setting.js
  52. 5 4
      src/utils/request.js
  53. 122 203
      src/views/business/spd/bo/basic/details.vue
  54. 3 2
      src/views/business/spd/bo/basic/index.vue
  55. 13 5
      src/views/business/spd/bo/basic/process.vue
  56. 8 1
      src/views/business/spd/bo/behavior/behaviorList.vue
  57. 9 2
      src/views/business/spd/bo/contact/contactList.vue
  58. 8 1
      src/views/business/spd/bo/education/educationList.vue
  59. 8 1
      src/views/business/spd/bo/pojpsn/pojpsnList.vue
  60. 9 2
      src/views/business/spd/bo/relationship/relationshipList.vue
  61. 134 9
      src/views/business/spd/bo/statement/index.vue
  62. 19 9
      src/views/business/spd/bo/statement/proportion/index.vue
  63. 9 0
      src/views/business/spd/bo/task/taskList.vue
  64. 18 13
      src/views/marketing/dealer-authorization/authprivAdd.vue
  65. 15 26
      src/views/marketing/dealer-authorization/authprivSee.vue
  66. 92 50
      src/views/marketing/dealer-authorization/index.vue
  67. 9 9
      src/views/marketing/utils/date.js
  68. 23 12
      src/views/monitor/job/log.vue
  69. 1 1
      src/views/purchase/DemandSummary/add.vue
  70. 81 44
      src/views/purchase/DemandSummary/index.vue
  71. 8 60
      src/views/purchase/MaterialClassDivision/add.vue
  72. 133 44
      src/views/purchase/MaterialClassDivision/index.vue
  73. 67 126
      src/views/purchase/PurchaseDemandList/add.vue
  74. 20 46
      src/views/purchase/PurchaseDemandList/index.vue
  75. 70 202
      src/views/purchase/apply/add/index.vue
  76. 23 17
      src/views/purchase/apply/column.js
  77. 72 204
      src/views/purchase/apply/edit/index.vue
  78. 52 35
      src/views/purchase/apply/index.vue
  79. 2 2
      src/views/purchase/apply/see/index.vue
  80. 70 202
      src/views/purchase/catalogue/add/index.vue
  81. 71 203
      src/views/purchase/catalogue/edit/index.vue
  82. 2 2
      src/views/purchase/catalogue/index.vue
  83. 2 2
      src/views/purchase/catalogue/see/index.vue
  84. 0 514
      src/views/purchase/contract/add/column.js
  85. 213 263
      src/views/purchase/contract/add/index.vue
  86. 478 62
      src/views/purchase/contract/column.js
  87. 197 252
      src/views/purchase/contract/edit/index.vue
  88. 53 67
      src/views/purchase/contract/index.vue
  89. 105 256
      src/views/purchase/contract/see/index.vue
  90. 39 11
      src/views/purchase/deliveryAddress/add.vue
  91. 108 44
      src/views/purchase/deliveryAddress/index.vue
  92. 1 1
      src/views/purchase/purchase-content/index.vue
  93. 1 1
      src/views/purchase/purchase-content/see-purchase-task.vue
  94. 239 228
      src/views/purchase/purchase-order/add/column.js
  95. 168 56
      src/views/purchase/purchase-order/add/index.vue
  96. 170 170
      src/views/purchase/purchase-order/column.js
  97. 91 49
      src/views/purchase/purchase-order/edit/index.vue
  98. 90 22
      src/views/purchase/purchase-order/index.vue
  99. 1 1
      src/views/purchase/purchase-order/see/index.vue
  100. 171 38
      src/views/purchase/task/column.js

+ 1 - 0
package.json

@@ -7,6 +7,7 @@
   "scripts": {
     "dev": "vue-cli-service serve",
     "dev:highNode": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
+    "build:highNode": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
     "build:prod": "vue-cli-service build",
     "build:stage": "vue-cli-service build --mode staging",
     "preview": "node build/index.js --preview",

+ 1 - 1
src/api/business/purchase/apply.js

@@ -1,6 +1,6 @@
 import request from "@/utils/request";
 
-export function list(params) {
+export function LIST(params) {
   return request({
     url: "/pu/priceApply/list",
     method: "GET",

+ 22 - 9
src/api/business/purchase/contract.js

@@ -1,6 +1,6 @@
 import request from "@/utils/request";
 
-export function list(params) {
+export function LIST(params) {
   return request({
     url: "/pu/contract/list",
     method: "GET",
@@ -8,7 +8,7 @@ export function list(params) {
   });
 }
 
-export function add(data) {
+export function ADD(data) {
   return request({
     url: "/pu/contract/add",
     method: "POST",
@@ -16,36 +16,36 @@ export function add(data) {
   });
 }
 
-export function edit(data) {
+export function EDIT(data) {
   return request({
     url: "/pu/contract/edit",
-    method: "POST",
+    method: "PUT",
     data: data,
   });
 }
 
-export function remove(data) {
+export function REMOVE(data) {
   return request({
     url: `/pu/contract/${data}`,
-    method: "delete",
+    method: "DELETE",
   });
 }
 
-export function item(data) {
+export function ITEM(data) {
   return request({
     url: `/pu/contract/${data}`,
     method: "GET",
   });
 }
 
-export function generateCode() {
+export function CODE() {
   return request({
     url: "/pu/contract/generateNo",
     method: "GET",
   });
 }
 
-export function itemTableList(params, name) {
+export function TABLELIST(params, name) {
   let url = "";
   if (name === "contractItemList") url = "/pu/contract/item/list";
   if (name === "contractClauseList") url = "/pu/contract/clause/list";
@@ -58,3 +58,16 @@ export function itemTableList(params, name) {
     params: params,
   });
 }
+
+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}`,
+    method: "DELETE",
+  });
+}

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

@@ -1,9 +1,9 @@
 import request from "@/utils/request";
 
 // 采购订单修订列表
-const list = (data) => {
+const list = (data, page) => {
   return request({
-    url: `/pu/order/list`,
+    url: `/pu/order/list?pageSize=${page.pageSize}&pageNum=${page.pageNum}`,
     method: "post",
     data,
   });
@@ -71,6 +71,15 @@ const getPrice = (data) => {
   });
 }
 
+// 采购订单退回
+const documentsReturn = (data) => {
+  return request({
+    url: `/pu/order/documentsReturn`,
+    method: "put",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -80,5 +89,6 @@ export default {
   revision,
   remove,
   getPrice,
+  documentsReturn,
 
 }

+ 28 - 7
src/api/business/purchase/task.js

@@ -1,23 +1,21 @@
 import request from "@/utils/request";
 
-// 查询任务列表
-export function LIST(data) {
+export function LIST(data, params) {
   return request({
     url: "/pu/order/generate/list",
     method: "POST",
     data: data,
+    params: params,
   });
 }
 
-// 查询任务列表
-export function item(data) {
+export function ITEM(data) {
   return request({
     url: `/pu/order/generate/${data}`,
     method: "GET",
   });
 }
 
-// 查询任务列表
 export function FIRSTDIRECT(data) {
   return request({
     url: "/pu/order/generate/manualAgreement",
@@ -26,7 +24,6 @@ export function FIRSTDIRECT(data) {
   });
 }
 
-// 查询任务列表
 export function ADD(data) {
   return request({
     url: "/pu/order/create",
@@ -35,7 +32,6 @@ export function ADD(data) {
   });
 }
 
-// 查询任务列表
 export function SHUTDOWN(data) {
   return request({
     url: `/pu/demand/item/summary/shutDown/${data}`,
@@ -43,3 +39,28 @@ export function SHUTDOWN(data) {
     data: data,
   });
 }
+
+export function DOCUMENTSRETURN(data) {
+  return request({
+    url: "/pu/order/generate/documentsReturn",
+    method: "PUT",
+    data: data,
+  });
+}
+
+export function MODEIFYBUYER(data) {
+  return request({
+    url: "/pu/order/generate/modifyBuyer",
+    method: "PUT",
+    data: data,
+  });
+}
+
+export function EXPORT(data, params) {
+  return request({
+    url: "/pu/order/generate/export",
+    method: "POST",
+    data: data,
+    params: params,
+  });
+}

+ 1 - 0
src/api/business/spd/bo/statement.js

@@ -11,6 +11,7 @@ export function listBasic(query) {
 
 // 查询商机百分比列表
 export function listProportion(query) {
+  console.log('query',query);
   return request({
     url: '/mk/bo/statement/listCollect',
     method: 'get',

+ 5 - 1
src/api/marketing/dealer-authorization.js

@@ -23,7 +23,7 @@ const insert = (data) => {
 
 // 经销商授权信息列表
 const remove = (params) => {
-// ?id=${params.id}
+  // ?id=${params.id}
   return request({
     url: `/dealer/delete`,
     method: 'get',
@@ -55,6 +55,10 @@ const download = (data) => {
     url: `/dealer/download`,
     method: 'post',
     data,
+    responseType: "blob",
+    headers: {
+      'Content-Type': 'application/json; application/octet-stream'
+    },
   })
 }
 

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

@@ -45,4 +45,12 @@ export function getRefer(data) {
     method: 'post',
     data: data
   })
+}
+// 查询批次号参照
+export function getBatchRefer(data) {
+  return request({
+    url: `/pu/allot/queryPatchCode?pageSize=${data.pageSize}&pageNum=${data.pageNo}`,
+    method: 'post',
+    data: data
+  })
 }

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

@@ -24,6 +24,14 @@ export function editOrder(data) {
     data: data
   })
 }
+// 调拨订单提交
+export function submitOrder(data) {
+  return request({
+    url: `/pu/allot/submit`,
+    method: 'post',
+    data: data
+  })
+}
 // 调拨订单详情
 // 调拨订单详情
 export function getOrderDetail(id) {

+ 1 - 1
src/assets/styles/variables.scss

@@ -36,7 +36,7 @@ $base-sub-menu-background:#000c17;
 $base-sub-menu-hover:#001528;
 */
 
-$base-sidebar-width: 200px;
+$base-sidebar-width: 270px;
 
 // the :export directive is the magic sauce for webpack
 // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

+ 4 - 2
src/components/DictTag/index.vue

@@ -14,6 +14,7 @@
           :disable-transitions="true"
           :key="item.value"
           :index="index"
+          :size="size"
           :type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
           :class="item.raw.cssClass"
         >
@@ -33,10 +34,11 @@ export default {
       default: null,
     },
     value: [Number, String, Array],
+    size: String,
   },
   computed: {
     values() {
-      if (this.value !== null && typeof this.value !== 'undefined') {
+      if (this.value !== null && typeof this.value !== "undefined") {
         return Array.isArray(this.value) ? this.value : [String(this.value)];
       } else {
         return [];
@@ -49,4 +51,4 @@ export default {
 .el-tag + .el-tag {
   margin-left: 10px;
 }
-</style>
+</style>

+ 40 - 19
src/components/FileUpload/index.vue

@@ -19,20 +19,38 @@
       <!-- 上传提示 -->
       <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>
+        <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.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
-        <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+    <transition-group
+      class="upload-file-list el-upload-list el-upload-list--text"
+      name="el-fade-in-linear"
+      tag="ul"
+    >
+      <li
+        :key="file.url"
+        class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList"
+      >
+        <el-link
+          :href="`${baseUrl}${file.url}`"
+          :underline="false"
+          target="_blank"
+        >
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" type="danger"
+            >删除</el-link
+          >
         </div>
       </li>
     </transition-group>
@@ -65,15 +83,15 @@ export default {
     // 是否显示提示
     isShowTip: {
       type: Boolean,
-      default: true
-    }
+      default: true,
+    },
   },
   data() {
     return {
       number: 0,
       uploadList: [],
       baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
+      uploadFileUrl: process.env.VUE_APP_BASE_API + "/pu/contract/upload", // 上传文件服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
@@ -86,9 +104,10 @@ export default {
         if (val) {
           let temp = 1;
           // 首先将值转为数组
-          const list = Array.isArray(val) ? val : this.value.split(',');
+          const list = Array.isArray(val) ? val : this.value.split(",");
+          console.log("list", list);
           // 然后将数组转为对象数组
-          this.fileList = list.map(item => {
+          this.fileList = list.map((item) => {
             if (typeof item === "string") {
               item = { name: item, url: item };
             }
@@ -101,8 +120,8 @@ export default {
         }
       },
       deep: true,
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   computed: {
     // 是否显示提示
@@ -115,11 +134,13 @@ export default {
     handleBeforeUpload(file) {
       // 校检文件类型
       if (this.fileType) {
-        const fileName = file.name.split('.');
+        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("/")}格式文件!`);
+          this.$modal.msgError(
+            `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
+          );
           return false;
         }
       }
@@ -142,7 +163,7 @@ export default {
     // 上传失败
     handleUploadError(err) {
       this.$modal.msgError("上传文件失败,请重试");
-      this.$modal.closeLoading()
+      this.$modal.closeLoading();
     },
     // 上传成功回调
     handleUploadSuccess(res, file) {
@@ -187,9 +208,9 @@ export default {
       for (let i in list) {
         strs += list[i].url + separator;
       }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
-    }
-  }
+      return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    },
+  },
 };
 </script>
 

+ 3 - 1
src/components/PopDialog/index.vue

@@ -56,6 +56,7 @@ export default {
       searchForm: {
         code: '',
         name: '',
+        isSync: '',
         pageNo: 1,
         pageSize: 10,
       },
@@ -82,8 +83,9 @@ export default {
     }
   },
   methods: {
-    init() {
+    init(val) {
       this.visible = true;
+      this.searchForm.isSync = val
       this.$nextTick(() => {
         this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
         this.resetSearch();

+ 171 - 0
src/components/Refers/batchRefer.vue

@@ -0,0 +1,171 @@
+<template>
+  <div>
+    <el-dialog :title="reciveForm.title" width="1000px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+      class="userDialog" :visible.sync="visible">
+      <el-container style="height: 500px">
+        <el-container>
+          <el-header style="text-align: left; font-size: 12px; height: 30px">
+            <el-form size="small" :inline="true" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()"
+              @submit.native.prevent>
+              <el-form-item prop="param" label="名称/编号">
+                <el-input size="small" v-model="searchForm.search" placeholder="输入名称/编号查询" clearable></el-input>
+              </el-form-item>
+              <el-form-item>
+                <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+                <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+              </el-form-item>
+            </el-form>
+          </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>
+            </el-table>
+            <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
+              :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
+              :total="total" layout="total, sizes, prev, pager, next, jumper">
+            </el-pagination>
+          </el-main>
+        </el-container>
+      </el-container>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
+        <el-button size="small" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getBatchRefer } from '@/api/purchase/basic'
+export default {
+  data() {
+    return {
+      searchForm: {
+        search: '',
+        pageNo: 1,
+        pageSize: 10,
+      },
+      reciveForm: {},
+      dataListAllSelections: [], // 所有选中的数据包含跨页数据
+      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
+      dataList: [],
+      total: 0,
+      orders: [],
+      loading: false,
+      visible: false,
+    };
+  },
+  props: {
+    selectData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    // 是否启用单选
+    single: {
+      type: Boolean,
+      default: false
+    }
+  },
+  methods: {
+    init(val) {
+      this.visible = true;
+      console.log("🚀 ~ file: refers.vue:79 ~ init ~ init(val):", val)
+      this.reciveForm = val
+      this.searchForm.search = ''
+      this.$nextTick(() => {
+        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
+        this.resetSearch();
+      });
+    },
+    // 获取数据列表
+    refreshList() {
+      this.loading = true;
+      let params = { ...this.searchForm, ...this.reciveForm }
+      getBatchRefer(params).then(res => {
+        console.log('res', res)
+        this.dataList = res.rows;
+        this.total = res.total
+        this.loading = false;
+        this.$nextTick(() => {
+          this.setSelectRow();
+        });
+      });
+    },
+    // 每页数
+    sizeChangeHandle(val) {
+      this.searchForm.pageSize = val;
+      this.refreshList();
+    },
+    // 当前页
+    currentChangeHandle(val) {
+      this.searchForm.pageNo = val;
+      this.refreshList();
+    },
+    // 排序
+    resetSearch() {
+      this.searchForm.pageNo = 1
+      this.searchForm.search = ''
+      this.refreshList();
+    },
+    // 表格选中数据
+    rowSelect(row, column, event) {
+      this.$refs.contractTable.clearSelection();
+      this.$refs.contractTable.toggleRowSelection(row);
+      this.dataListAllSelections = this.single ? [row] : selection
+    },
+    // 选中数据
+    handleSelectionChange(selection, row) {
+      if (this.single && selection.length > 1) {
+        this.$refs.contractTable.clearSelection();
+        this.$refs.contractTable.toggleRowSelection(row);
+      }
+      this.dataListAllSelections = this.single ? [row] : selection
+    },
+    // 设置选中的方法
+    setSelectRow() {
+      this.$refs.contractTable.clearSelection();
+      if (!this.dataListAllSelections || this.dataListAllSelections.length <= 0) {
+        return;
+      }
+      for (let i = 0; i < this.dataList.length; i++) {
+        if (this.dataListAllSelections.some(item => item[this.idKey] == this.dataList[i][this.idKey])) {
+          // 设置选中,记住table组件需要使用ref="table"
+          this.$refs.contractTable.toggleRowSelection(this.dataList[i], true);
+        }
+      }
+    },
+    doSubmit() {
+      this.visible = false;
+      console.log('选择的数据?', this.dataListAllSelections)
+      this.$emit("doSubmit", this.dataListAllSelections);
+    },
+  },
+};
+</script>
+<style lang="scss">
+.userDialog {
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+
+  .el-main {
+    padding: 20px 20px 5px 20px;
+
+    .el-pagination {
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 2 - 2
src/components/Refers/refers.vue

@@ -112,8 +112,8 @@ export default {
     },
     // 排序
     resetSearch() {
-      this.$refs['searchForm'].resetFields();
-      this.searchForm.pageNo = 1;
+      this.searchForm.pageNo = 1
+      this.searchForm.search = ''
       this.refreshList();
     },
     // 表格选中数据

+ 1 - 2
src/components/Refers/treeRefer.vue

@@ -59,6 +59,7 @@ export default {
   methods: {
     init(val) {
       this.visible = true;
+      this.filterText = ''
       this.reciveForm = val
       this.$nextTick(() => {
         this.refreshList();
@@ -81,8 +82,6 @@ export default {
       this.choosePoint = data;
     },
     filterNode(value, data) {
-      console.log("value", value);
-      console.log("data", data);
       if (!value) return true;
       return data.name.indexOf(value) !== -1;
     },

+ 0 - 186
src/components/input-dialog/components/index.vue

@@ -1,186 +0,0 @@
-<script>
-import { refer } from "../api/index";
-import { initParams } from "@/utils/init";
-import InitColumnHooks from "./init-column";
-
-export default {
-  name: "InputDialog",
-  props: ["type", "title", "queryParams"],
-  components: {},
-  data() {
-    const { type } = this.$props;
-    const { TableColumns, SearchColumns } = InitColumnHooks(type);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      showKey: "name",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      layout: "total, prev, pager, next, sizes, jumper",
-      pageSizes: [25, 50, 100],
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      params: { search: "" },
-      searchColumns: SearchColumns,
-      // table
-      data: [],
-      tableColumns: TableColumns,
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { type, queryParams } = this.$props;
-        const { code, msg, rows, total } = await refer(
-          {
-            type: type,
-            isPage: true,
-            ...prop,
-            ...queryParams,
-          },
-          
-          { 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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-      }
-    },
-    // setting up to fetch table data
-    queryList() {
-      this.fetchList(this.params, this.page);
-    },
-    // reset to fetch table data
-    resetList() {
-      this.page.pageNum = 1;
-      this.params = initParams(this.searchColumns);
-      this.fetchList(this.params, this.page);
-    },
-    // size change to fetch table data
-    pageSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // number change to fetch table data
-    pageNumberChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
-    },
-    // click select row data
-    clickSelectCurrentData(row) {
-      this.currentData = row;
-    },
-    // double click select row data and confirm
-    dblclickSelectCurrentData(row) {
-      this.confirm(row);
-    },
-    //
-    confirm(prop) {
-      if (prop) {
-        this.$emit("confirm", prop);
-      }
-      this.setVisible(false);
-    },
-  },
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-dialog
-    :title="title"
-    :visible.sync="visible"
-    :width="width"
-    append-to-body
-    @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-table
-      v-loading="loading"
-      :data="data"
-      :size="size"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="clickSelectCurrentData"
-      @row-dblclick="dblclickSelectCurrentData"
-    >
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width"
-        show-overflow-tooltip
-      >
-      </el-table-column>
-    </el-table>
-    <div
-      style="display: flex; justify-content: space-between; align-items: center"
-    >
-      <p>
-        <span style="font-size: 12px">已选择 :</span>
-        <el-tag v-if="currentData" :size="size">{{
-          currentData[showKey]
-        }}</el-tag>
-        <span v-else>无</span>
-      </p>
-      <el-pagination
-        :layout="layout"
-        :total="page.total"
-        :page-sizes="pageSizes"
-        :page-size="page.pageSize"
-        :current-page="page.pageNum"
-        :small="size === 'mini'"
-        background
-        @size-change="pageSizeChange"
-        @current-change="pageNumberChange"
-      >
-      </el-pagination>
-    </div>
-    <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(currentData)"
-        >确 定</el-button
-      >
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 12
src/components/input-dialog/components/init-column.js

@@ -1,12 +0,0 @@
-export default function InitColumnsHooks(prop) {
-  //
-  const TableColumns = require(`./${prop}`).default.filter(
-    (element) => element.key
-  );
-  //
-  const SearchColumns = require(`./${prop}`).default.filter(
-    (element) => element.search
-  );
-  //
-  return { TableColumns, SearchColumns };
-}

+ 0 - 62
src/components/input-dialog/index.js

@@ -1,62 +0,0 @@
-const arr2obj = (data, keyName, valueName) =>
-  Object.fromEntries(data.map((item) => [item[keyName], item[valueName]]));
-
-export const initColumns = (
-  arr,
-  prop = { disabled: false, readonly: false, clearable: false }
-) => {
-  return arr.map((element) => {
-    element.config = element.config || {};
-    if (element.type === "Input") {
-    }
-    if (element.type === "InputDialog") {
-      prop.readonly = true;
-    }
-    if (element.type === "InputNumber") {
-      element.config = { controlsPosition: "right", ...element.config };
-    }
-    if (element.type === "Select") {
-    }
-    if (element.type === "DatePicker") {
-      element.config = { type: "date", ...element.config };
-    }
-    if (element.type === "Upload") {
-      element.value = [];
-    }
-    return { ...element, ...prop };
-  });
-};
-
-// 初始化参数
-export const initParams = (prop, key = "key", value = "value") =>
-  arr2obj(prop, key, value);
-// 初始化字典
-export const initDicts = (prop) =>
-  prop
-    .filter((column) => column.type === "Select")
-    .map((column) => column.config.optionsName);
-// 初始化校验
-export const initRules = (prop) => {
-  const rules = {};
-  prop
-    .filter((column) => column.require)
-    .forEach((column) => {
-      const message = `${column.title}不能为空`;
-      rules[column.key] = [
-        { required: true, message: message, trigger: "change" },
-      ];
-    });
-  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 = () => page;

+ 0 - 97
src/components/input-dialog/index.vue

@@ -1,97 +0,0 @@
-<script>
-export default {
-  name: "DrInputDialog",
-  props: {
-    // 参照类型 ,对应后端
-    type: {
-      type: String,
-      require: true,
-    },
-    // Input显示数据
-    value: {
-      type: String,
-      require: true,
-    },
-    // 需映射源数据
-    source: {
-      type: Object,
-      require: true,
-    },
-    // 参照内外映射
-    dataMapping: {
-      type: Object,
-      require: true,
-    },
-    // 参照弹窗标题
-    title: {
-      type: String,
-      default: "TITLE",
-    },
-    // 默认查询参数
-    queryParams: {
-      type: Object,
-      default: () => ({}),
-    },
-    //
-    size: String,
-    //
-    readonly: Boolean,
-    //
-    disabled: Boolean,
-    //
-    clearable: Boolean,
-    //
-    placeholder: String,
-  },
-  components: {
-    InputDialog: () => import("./components/index.vue"),
-  },
-  data() {
-    return {};
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // 处理默认传参
-    handleMakeQueryParams() {
-      const newQueryParams = {}
-      const { source, queryParams } = this.$props;
-      for (let key in queryParams) {
-        newQueryParams[key] = queryParams[key] === key ? source[queryParams[key]] : queryParams[key]
-      }
-      return newQueryParams
-    },
-    // 打开弹窗
-    handleAsyncOpenDialog() {
-      this.$nextTick(() => {
-        const { setVisible } = this.$refs.InputDialogFef;
-        setVisible(true);
-      });
-    },
-    // 更新映射数据
-    handleUpdateSource(prop) {
-      const { source, dataMapping } = this.$props;
-      for (let key in dataMapping) {
-        source[key] = prop[dataMapping[key]];
-      }
-      this.$emit("update:source", source);
-    },
-  },
-  created() {
-    this.handleMakeQueryParams()
-  },
-  mounted() { },
-  destroyed() { },
-};
-</script>
-<template>
-  <el-input v-model="value" :size="size" :readonly="readonly" :disabled="disabled" :clearable="clearable"
-    :placeholder="placeholder" style="width: 100%; cursor: pointer" @click.native.stop="handleAsyncOpenDialog">
-    <template #suffix>
-      <el-icon class="el-icon-milk-tea"></el-icon>
-      <input-dialog ref="InputDialogFef" :type="type" :title="title" :queryParams="handleMakeQueryParams()"
-        @confirm="handleUpdateSource"></input-dialog>
-    </template>
-  </el-input>
-</template>
-<style scoped></style>

+ 0 - 0
src/components/input-dialog/api/index.js → src/components/popover-select/api/index.js


+ 0 - 0
src/components/input-dialog/components/ALLOCATION_PARAM.js → src/components/popover-select/components/ALLOCATION_PARAM.js


+ 0 - 0
src/components/input-dialog/components/BALATYPE_PARAM.js → src/components/popover-select/components/BALATYPE_PARAM.js


+ 15 - 0
src/components/popover-select/components/CONTACTS_PARAM.js

@@ -0,0 +1,15 @@
+// 客户部门
+export default [
+  {
+    key: "code",
+    title: "人员编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "人员名称",
+    type: "Input",
+    search: true,
+  },
+];

+ 0 - 0
src/components/input-dialog/components/CURRENCY_PARAM.js → src/components/popover-select/components/CURRENCY_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CUSTOMERDEPT_PARAM.js → src/components/popover-select/components/CUSTOMERDEPT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/CUSTOMER_PARAM.js → src/components/popover-select/components/CUSTOMER_PARAM.js


+ 0 - 0
src/components/input-dialog/components/DEPT_PARAM.js → src/components/popover-select/components/DEPT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/MATERIAL_PARAM.js → src/components/popover-select/components/MATERIAL_PARAM.js


+ 0 - 0
src/components/input-dialog/components/OPERATING_PARAM.js → src/components/popover-select/components/OPERATING_PARAM.js


+ 0 - 0
src/components/input-dialog/components/ORG_PARAM.js → src/components/popover-select/components/ORG_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PAYAGREEMENT_PARAM.js → src/components/popover-select/components/PAYAGREEMENT_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PROCESSTYPE_PARAM.js → src/components/popover-select/components/PROCESSTYPE_PARAM.js


+ 0 - 0
src/components/input-dialog/components/PROJECT_PARAM.js → src/components/popover-select/components/PROJECT_PARAM.js


+ 21 - 0
src/components/popover-select/components/PSNLICENSE_PARAM.js

@@ -0,0 +1,21 @@
+// 处理方式
+export default [
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
+  {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "处理方式",
+    type: "Input",
+    search: true,
+  },
+];

+ 0 - 0
src/components/input-dialog/components/RETREASON_PARAM.js → src/components/popover-select/components/RETREASON_PARAM.js


+ 0 - 0
src/components/input-dialog/components/SUPPLIERCONTACTS_PARAM.js → src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js


+ 0 - 0
src/components/input-dialog/components/SUPPLIER_PARAM.js → src/components/popover-select/components/SUPPLIER_PARAM.js


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

@@ -0,0 +1,22 @@
+// 货位
+export default [
+  // 树
+  {
+    key: "id",
+    title: "ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "货位",
+    type: "Input",
+    search: true,
+  },
+];

+ 22 - 0
src/components/popover-select/components/UNIT_PARAM.js

@@ -0,0 +1,22 @@
+// 货位
+export default [
+  // 树
+  {
+    key: "id",
+    title: "ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "货位",
+    type: "Input",
+    search: true,
+  },
+];

+ 0 - 0
src/components/input-dialog/components/WAREHOUSE_PARAM.js → src/components/popover-select/components/WAREHOUSE_PARAM.js


+ 349 - 0
src/components/popover-select/index.vue

@@ -0,0 +1,349 @@
+<script>
+import { refer } from "./api/index";
+export default {
+  name: "PopoverSelect",
+  props: {
+    // 参照类型 ,对应后端
+    type: {
+      type: String,
+      require: true,
+    },
+    // v-model
+    value: {
+      type: [Array, String],
+      require: true,
+    },
+    // 参照弹窗标题
+    title: {
+      type: String,
+      dafault: () => {
+        return "TITEL";
+      },
+    },
+    // 作为 value 唯一标识的键名,绑定值
+    valueKey: {
+      type: String,
+      dafault: () => {
+        return "code";
+      },
+    },
+    // 默认查询参数
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    // 组件大小
+    size: {
+      type: String,
+      dafault: () => {
+        return "mini";
+      },
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      dafault: () => {
+        return "";
+      },
+    },
+    // 是否可读
+    readonly: {
+      type: Boolean,
+      dafault: () => {
+        return false;
+      },
+    },
+    // 是否禁止
+    disabled: {
+      type: Boolean,
+      dafault: () => {
+        return false;
+      },
+    },
+    // 是否清除
+    clearable: {
+      type: Boolean,
+      dafault: () => {
+        return false;
+      },
+    },
+    // 是否多选
+    multiple: {
+      type: Boolean,
+      dafault: () => {
+        return false;
+      },
+    },
+    // 需映射源数据
+    source: Object,
+    // 参照内外映射
+    dataMapping: Object,
+  },
+  components: {},
+  data() {
+    return {
+      width: "50%",
+      page: { pageNum: 1, pageSize: 25, total: 0 },
+      layout: "total, prev, pager, next, sizes, jumper",
+      pageSizes: [25, 50, 100],
+      visible: false,
+      loading: false,
+      model: {
+        search: "",
+        isPage: true,
+      },
+      data: [],
+      selectData: [],
+    };
+  },
+  computed: {
+    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) {
+        if (!newProp) this.selectData = [];
+      },
+      immediate: true,
+    },
+  },
+  methods: {
+    // open dialog
+    async open() {
+      this.visible = true;
+      await this.resetList();
+    },
+    // hide dialog
+    async hide() {
+      this.visible = false;
+    },
+    // fetch list
+    async fetchList(prop, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, 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) {
+        //
+      } finally {
+        this.loading = false;
+      }
+    },
+    // reset list
+    async resetList() {
+      const { type, queryParams } = this.$props;
+      this.model = { type, ...this.model, ...queryParams };
+      const { page, model } = this;
+      await this.fetchList(model, page);
+    },
+    // query list
+    async queryList() {
+      const { page, model } = this;
+      await this.fetchList(model, 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) {
+      const { multiple } = this.$props;
+      await this.hide();
+      await this.update(multiple ? prop : prop[0]);
+    },
+    // delete tag
+    deleteTag(prop) {
+      this.selectData.splice(prop, 1);
+      this.update(this.selectData);
+    },
+    // update
+    update(prop) {
+      const { source, multiple, valueKey, dataMapping } = 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, source);
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <div>
+    <el-input
+      v-model="innerValue"
+      :size="size"
+      :disabled="disabled"
+      :readonly="readonly"
+      :clearable="clearable"
+      :placeholder="placeholder"
+    >
+      <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="model"
+        @submit.native.prevent
+      >
+        <el-form-item prop="search">
+          <el-input
+            v-model="model.search"
+            @change="queryList"
+            @keydown.enter="queryList"
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button icon="el-icon-refresh" @click="resetList"></el-button>
+        </el-form-item>
+        <el-table
+          ref="multipleTable"
+          :data="data"
+          :size="size"
+          height="45vh"
+          highlight-current-row
+          style="width: 100%; margin-bottom: 20px"
+          @row-click="rowClick"
+          @row-dblclick="rowDblclick"
+          @selection-change="selectionChange"
+        >
+          <el-table-column width="55" type="selection" align="center">
+          </el-table-column>
+          <el-table-column
+            v-for="(column, index) in TableColumnTemp"
+            :key="index"
+            :prop="column.key"
+            :label="column.title"
+            :width="column.width"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          :layout="layout"
+          :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>
+      </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>
+      </div>
+    </el-dialog>
+    <div
+      style="
+        position: absolute;
+        left: 10px;
+        top: 50%;
+        transform: translateY(-50%);
+        padding-right: 30px;
+        overflow: hidden;
+      "
+    >
+      <div v-if="multiple && selectData.length">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
+          <el-tag slot="reference" :size="size" style="margin-right: 10px">
+            + {{ selectData.length }}
+          </el-tag>
+          <el-tag
+            v-for="(tag, index) in selectData"
+            :size="size"
+            hit
+            closable
+            :style="{
+              display: 'flex',
+              justifyContent: 'space-between',
+              alignItems: 'center',
+              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
+            }"
+            @close="deleteTag(index)"
+          >
+            {{ tag.name }}
+          </el-tag>
+        </el-popover>
+      </div>
+    </div>
+  </div>
+</template>
+<style scoped></style>

+ 18 - 0
src/components/popover-tree-select/api/index.js

@@ -0,0 +1,18 @@
+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) {
+  return request({
+    url: "/refer/query",
+    method: "POST",
+    data: data,
+    params: params,
+  });
+}

+ 22 - 0
src/components/popover-tree-select/components/MATERIALCLASSIFY_PARAM.js

@@ -0,0 +1,22 @@
+// 客户部门 tree
+export default [
+  {
+    key: "id",
+    title: "客户部门ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "客户部门编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "客户部门名称",
+    type: "Input",
+    search: true,
+  },
+];
+

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

@@ -0,0 +1,178 @@
+<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>

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

@@ -0,0 +1,213 @@
+<script>
+export default {
+  name: "PopoverTreeSelect",
+  props: {
+    // 参照类型 ,对应后端
+    type: {
+      type: String,
+      require: true,
+    },
+    // v-model
+    value: {
+      type: [Array, String],
+      require: true,
+    },
+    // 参照弹窗标题
+    title: {
+      type: String,
+      default: "TITLE",
+    },
+    // 作为 value 唯一标识的键名,绑定值
+    valueKey: {
+      type: String,
+      default: "name",
+    },
+    // 作为 value 唯一标识的键名,显示值
+    showKey: {
+      type: String,
+    },
+    // 默认查询参数
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    // 组件大小
+    size: {
+      type: String,
+      default: "mini",
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      default: "",
+    },
+    // 是否可读
+    readonly: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否禁止
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否清除
+    clearable: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    // 需映射源数据
+    source: Object,
+    // 参照内外映射
+    dataMapping: Object,
+  },
+  components: {
+    TableDialog: () => import("./components/index.vue"),
+  },
+  data() {
+    return {
+      // popover宽度
+      width: "",
+      // 选中data
+      data: [],
+    };
+  },
+  computed: {
+    showValue() {
+      const { showKey, valueKey } = this.$props;
+      return this.data.length === 1 ? this.data[0][showKey || valueKey] : "";
+    },
+  },
+  watch: {
+    "$props.value": {
+      handler: function (newProp, oldProp) {
+        if (!newProp) {
+          this.data = [];
+        }
+      },
+      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]];
+        }
+        this.$emit("update:source", source);
+      }
+      //
+      this.$emit("change", prop, source);
+    },
+  },
+  created() {
+    this.$nextTick(() => {
+      const { clientWidth } = this.$refs.PopoverTreeSelect;
+      this.width = clientWidth;
+    });
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <div ref="PopoverTreeSelect" style="position: relative">
+    <el-input
+      v-model="showValue"
+      :size="size"
+      :disabled="disabled"
+      :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-input>
+    <div
+      style="
+        position: absolute;
+        left: 10px;
+        top: 50%;
+        transform: translateY(-50%);
+        padding-right: 30px;
+        overflow: hidden;
+      "
+    >
+      <div v-if="multiple && data.length">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
+          <el-tag slot="reference" :size="size" style="margin-right: 10px">
+            + {{ data.length }}
+          </el-tag>
+          <el-tag
+            v-for="(item, index) in data"
+            :size="size"
+            hit
+            closable
+            :style="{
+              display: 'flex',
+              justifyContent: 'space-between',
+              alignItems: 'center',
+              margin: data.length - 1 === index ? '0' : '0 0 5px 0',
+            }"
+            @close="handleDelete(index)"
+          >
+            {{ item.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>

+ 59 - 34
src/layout/components/Sidebar/SidebarItem.vue

@@ -1,22 +1,47 @@
 <template>
   <div v-if="!item.hidden">
-    <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
-      <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
-        <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
-          <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
+    <template
+      v-if="
+        hasOneShowingChild(item.children, item) &&
+        (!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
+        !item.alwaysShow
+      "
+    >
+      <app-link
+        v-if="onlyOneChild.meta"
+        :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"
+      >
+        <el-menu-item
+          :index="resolvePath(onlyOneChild.path)"
+          :class="{ 'submenu-title-noDropdown': !isNest }"
+        >
+          <item
+            :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"
+            :title="onlyOneChild.meta.title"
+          />
         </el-menu-item>
       </app-link>
     </template>
 
-    <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
+    <el-submenu
+      v-else
+      ref="subMenu"
+      :index="resolvePath(item.path)"
+      popper-append-to-body
+    >
       <template slot="title">
-        <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
+        <item
+          v-if="item.meta"
+          :icon="item.meta && item.meta.icon"
+          :title="item.meta.title"
+        />
       </template>
       <sidebar-item
         v-for="child in item.children"
         :key="child.path"
         :is-nest="true"
         :item="child"
+        :title="child.meta.title"
         :base-path="resolvePath(child.path)"
         class="nest-menu"
       />
@@ -25,76 +50,76 @@
 </template>
 
 <script>
-import path from 'path'
-import { isExternal } from '@/utils/validate'
-import Item from './Item'
-import AppLink from './Link'
-import FixiOSBug from './FixiOSBug'
+import path from "path";
+import { isExternal } from "@/utils/validate";
+import Item from "./Item";
+import AppLink from "./Link";
+import FixiOSBug from "./FixiOSBug";
 
 export default {
-  name: 'SidebarItem',
+  name: "SidebarItem",
   components: { Item, AppLink },
   mixins: [FixiOSBug],
   props: {
     // route object
     item: {
       type: Object,
-      required: true
+      required: true,
     },
     isNest: {
       type: Boolean,
-      default: false
+      default: false,
     },
     basePath: {
       type: String,
-      default: ''
-    }
+      default: "",
+    },
   },
   data() {
-    this.onlyOneChild = null
-    return {}
+    this.onlyOneChild = null;
+    return {};
   },
   methods: {
     hasOneShowingChild(children = [], parent) {
       if (!children) {
         children = [];
       }
-      const showingChildren = children.filter(item => {
+      const showingChildren = children.filter((item) => {
         if (item.hidden) {
-          return false
+          return false;
         } else {
           // Temp set(will be used if only has one showing child)
-          this.onlyOneChild = item
-          return true
+          this.onlyOneChild = item;
+          return true;
         }
-      })
+      });
 
       // When there is only one child router, the child router is displayed by default
       if (showingChildren.length === 1) {
-        return true
+        return true;
       }
 
       // Show parent if there are no child router to display
       if (showingChildren.length === 0) {
-        this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
-        return true
+        this.onlyOneChild = { ...parent, path: "", noShowingChildren: true };
+        return true;
       }
 
-      return false
+      return false;
     },
     resolvePath(routePath, routeQuery) {
       if (isExternal(routePath)) {
-        return routePath
+        return routePath;
       }
       if (isExternal(this.basePath)) {
-        return this.basePath
+        return this.basePath;
       }
       if (routeQuery) {
         let query = JSON.parse(routeQuery);
-        return { path: path.resolve(this.basePath, routePath), query: query }
+        return { path: path.resolve(this.basePath, routePath), query: query };
       }
-      return path.resolve(this.basePath, routePath)
-    }
-  }
-}
+      return path.resolve(this.basePath, routePath);
+    },
+  },
+};
 </script>

+ 61 - 45
src/layout/components/Sidebar/index.vue

@@ -1,26 +1,42 @@
 <template>
-    <div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
-        <logo v-if="showLogo" :collapse="isCollapse" />
-        <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
-            <el-menu
-                :default-active="activeMenu"
-                :collapse="isCollapse"
-                :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
-                :text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
-                :unique-opened="true"
-                :active-text-color="settings.theme"
-                :collapse-transition="false"
-                mode="vertical"
-            >
-                <sidebar-item
-                    v-for="(route, index) in sidebarRouters"
-                    :key="route.path  + index"
-                    :item="route"
-                    :base-path="route.path"
-                />
-            </el-menu>
-        </el-scrollbar>
-    </div>
+  <div
+    :class="{ 'has-logo': showLogo }"
+    :style="{
+      backgroundColor:
+        settings.sideTheme === 'theme-dark'
+          ? variables.menuBackground
+          : variables.menuLightBackground,
+    }"
+  >
+    <logo v-if="showLogo" :collapse="isCollapse" />
+    <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
+      <el-menu
+        :default-active="activeMenu"
+        :collapse="isCollapse"
+        :background-color="
+          settings.sideTheme === 'theme-dark'
+            ? variables.menuBackground
+            : variables.menuLightBackground
+        "
+        :text-color="
+          settings.sideTheme === 'theme-dark'
+            ? variables.menuColor
+            : variables.menuLightColor
+        "
+        :unique-opened="true"
+        :active-text-color="settings.theme"
+        :collapse-transition="false"
+        mode="vertical"
+      >
+        <sidebar-item
+          v-for="(route, index) in sidebarRouters"
+          :key="route.path + index"
+          :item="route"
+          :base-path="route.path"
+        />
+      </el-menu>
+    </el-scrollbar>
+  </div>
 </template>
 
 <script>
@@ -30,28 +46,28 @@ import SidebarItem from "./SidebarItem";
 import variables from "@/assets/styles/variables.scss";
 
 export default {
-    components: { SidebarItem, Logo },
-    computed: {
-        ...mapState(["settings"]),
-        ...mapGetters(["sidebarRouters", "sidebar"]),
-        activeMenu() {
-            const route = this.$route;
-            const { meta, path } = route;
-            // if set path, the sidebar will highlight the path you set
-            if (meta.activeMenu) {
-                return meta.activeMenu;
-            }
-            return path;
-        },
-        showLogo() {
-            return this.$store.state.settings.sidebarLogo;
-        },
-        variables() {
-            return variables;
-        },
-        isCollapse() {
-            return !this.sidebar.opened;
-        }
-    }
+  components: { SidebarItem, Logo },
+  computed: {
+    ...mapState(["settings"]),
+    ...mapGetters(["sidebarRouters", "sidebar"]),
+    activeMenu() {
+      const route = this.$route;
+      const { meta, path } = route;
+      // if set path, the sidebar will highlight the path you set
+      if (meta.activeMenu) {
+        return meta.activeMenu;
+      }
+      return path;
+    },
+    showLogo() {
+      return this.$store.state.settings.sidebarLogo;
+    },
+    variables() {
+      return variables;
+    },
+    isCollapse() {
+      return !this.sidebar.opened;
+    },
+  },
 };
 </script>

+ 63 - 50
src/main.js

@@ -1,70 +1,83 @@
-import Vue from 'vue'
+import Vue from "vue";
 
-import Cookies from 'js-cookie'
+import Cookies from "js-cookie";
 
-import Element from 'element-ui'
-import './assets/styles/element-variables.scss'
+import Element from "element-ui";
+import "./assets/styles/element-variables.scss";
 
-import '@/assets/styles/index.scss' // global css
-import '@/assets/styles/ruoyi.scss' // ruoyi css
-import App from './App'
-import store from './store'
-import router from './router'
-import directive from './directive' // directive
-import plugins from './plugins' // plugins
-import { download } from '@/utils/request'
+import "@/assets/styles/index.scss"; // global css
+import "@/assets/styles/ruoyi.scss"; // ruoyi css
+import App from "./App";
+import store from "./store";
+import router from "./router";
+import directive from "./directive"; // directive
+import plugins from "./plugins"; // plugins
+import { download } from "@/utils/request";
 
 // 时间格式化方法挂载
-import '@/views/marketing/utils/date';
+import "@/views/marketing/utils/date";
 
-import './assets/icons' // icon
-import './permission' // permission control
+import "./assets/icons"; // icon
+import "./permission"; // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+import {
+  parseTime,
+  resetForm,
+  addDateRange,
+  selectDictLabel,
+  selectDictLabels,
+  handleTree,
+} from "@/utils/ruoyi";
 // 分页组件
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
-import RightToolbar from "@/components/RightToolbar"
+import RightToolbar from "@/components/RightToolbar";
 // 富文本组件
-import Editor from "@/components/Editor"
+import Editor from "@/components/Editor";
 // 文件上传组件
-import FileUpload from "@/components/FileUpload"
+import FileUpload from "@/components/FileUpload";
 // 图片上传组件
-import ImageUpload from "@/components/ImageUpload"
+import ImageUpload from "@/components/ImageUpload";
 // 图片预览组件
-import ImagePreview from "@/components/ImagePreview"
+import ImagePreview from "@/components/ImagePreview";
 // 字典标签组件
-import DictTag from '@/components/DictTag'
+import DictTag from "@/components/DictTag";
 // 头部标签组件
-import VueMeta from 'vue-meta'
+import VueMeta from "vue-meta";
 // 字典数据组件
-import DictData from '@/components/DictData'
+import DictData from "@/components/DictData";
+//
+import PopoverSelect from "@/components/popover-select/index.vue";
+//
+import PopoverTreeSelect from "@/components/popover-tree-select/index.vue";
 
 // 全局方法挂载
-Vue.prototype.getDicts = getDicts
-Vue.prototype.getConfigKey = getConfigKey
-Vue.prototype.parseTime = parseTime
-Vue.prototype.resetForm = resetForm
-Vue.prototype.addDateRange = addDateRange
-Vue.prototype.selectDictLabel = selectDictLabel
-Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.download = download
-Vue.prototype.handleTree = handleTree
+Vue.prototype.getDicts = getDicts;
+Vue.prototype.getConfigKey = getConfigKey;
+Vue.prototype.parseTime = parseTime;
+Vue.prototype.resetForm = resetForm;
+Vue.prototype.addDateRange = addDateRange;
+Vue.prototype.selectDictLabel = selectDictLabel;
+Vue.prototype.selectDictLabels = selectDictLabels;
+Vue.prototype.download = download;
+Vue.prototype.handleTree = handleTree;
 
 // 全局组件挂载
-Vue.component('DictTag', DictTag)
-Vue.component('Pagination', Pagination)
-Vue.component('RightToolbar', RightToolbar)
-Vue.component('Editor', Editor)
-Vue.component('FileUpload', FileUpload)
-Vue.component('ImageUpload', ImageUpload)
-Vue.component('ImagePreview', ImagePreview)
+Vue.component("DictTag", DictTag);
+Vue.component("Pagination", Pagination);
+Vue.component("RightToolbar", RightToolbar);
+Vue.component("Editor", Editor);
+Vue.component("FileUpload", FileUpload);
+Vue.component("ImageUpload", ImageUpload);
+Vue.component("ImagePreview", ImagePreview);
+Vue.component("DrPopoverSelect", PopoverSelect);
+Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
 
-Vue.use(directive)
-Vue.use(plugins)
-Vue.use(VueMeta)
-DictData.install()
+Vue.use(directive);
+Vue.use(plugins);
+Vue.use(VueMeta);
+DictData.install();
 
 /**
  * If you don't want to use mock-server
@@ -76,14 +89,14 @@ DictData.install()
  */
 
 Vue.use(Element, {
-  size: Cookies.get('size') || 'medium' // set element-ui default size
-})
+  size: Cookies.get("size") || "medium", // set element-ui default size
+});
 
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
 
 new Vue({
-  el: '#app',
+  el: "#app",
   router,
   store,
-  render: h => h(App)
-})
+  render: (h) => h(App),
+});

+ 17 - 32
src/utils/init/index.js

@@ -1,39 +1,24 @@
-import { arr2obj } from "../data-transform";
-
-export const initColumns = (
-  arr,
-  prop = { disabled: false, readonly: false, clearable: false }
-) => {
-  return arr.map((element) => {
-    element.config = element.config || {};
-    if (element.type === "Input") {
-    }
-    if (element.type === "InputDialog") {
-      prop.readonly = true;
-    }
-    if (element.type === "InputNumber") {
-      element.config = { controlsPosition: "right", ...element.config };
-    }
-    if (element.type === "Select") {
-    }
-    if (element.type === "DatePicker") {
-      element.config = { type: "date", ...element.config };
-    }
-    if (element.type === "Upload") {
-      element.value = [];
-    }
-    return { ...element, ...prop };
-  });
+import Setting from "./setting";
+
+// 初始化模板
+export const initColumns = (arr) => {
+  return arr.map((element) => ({
+    ...element,
+    ...Setting(element.type),
+  }));
 };
-
 // 初始化参数
 export const initParams = (prop, key = "key", value = "value") =>
-  arr2obj(prop, key, value);
+  Object.fromEntries(prop.map((item) => [item[key], item[value]]));
 // 初始化字典
 export const initDicts = (prop) =>
-  prop
-    .filter((column) => column.type === "Select")
-    .map((column) => column.config.optionsName);
+  Array.from(
+    new Set(
+      prop
+        .filter((column) => column.inputType === "Select")
+        .map((column) => column.referName)
+    )
+  );
 // 初始化校验
 export const initRules = (prop) => {
   const rules = {};
@@ -58,4 +43,4 @@ export const initPageSizes = () => pageSizes;
 
 export const initLayout = () => layout;
 
-export const initPage = () => page;
+export const initPage = () => ({ pageNum: 1, pageSize: 25, total: 0 });

+ 33 - 0
src/utils/init/setting.js

@@ -0,0 +1,33 @@
+const Input = {};
+
+const Select = {};
+
+const PopoverSelect = {
+  readonly: true,
+  dataMapping: {},
+  queryParams: () => ({}),
+};
+
+const InputNumber = {
+  controlsPosition: "right",
+};
+
+const DatePicker = {
+  type: "date",
+};
+
+const Upload = {
+  value: [],
+};
+
+export default (prop) => {
+  return {
+    Input: Input,
+    Select: Select,
+    PopoverSelect: PopoverSelect,
+    PopoverMultipleSelect: PopoverSelect,
+    InputNumber: InputNumber,
+    DatePicker: DatePicker,
+    Upload: Upload,
+  }[prop];
+};

+ 5 - 4
src/utils/request.js

@@ -6,7 +6,6 @@ import errorCode from "@/utils/errorCode";
 import { tansParams, blobValidate } from "@/utils/ruoyi";
 import cache from "@/plugins/cache";
 import { saveAs } from "file-saver";
-import judgeFileFormat from "@/views/material/tools/attachment-file";
 
 let downloadLoadingInstance;
 // 是否显示重新登录
@@ -121,10 +120,12 @@ service.interceptors.response.use(
       }
       return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
     } else if (code === 500) {
-      Message({ message: msg, type: "error" });
+      Notification.error({ title: "error", message: msg });
+      // Message({ message: msg, type: "error" });
       return Promise.reject(new Error(msg));
     } else if (code === 601) {
-      Message({ message: msg, type: "warning" });
+      Notification.warning({ title: "error", message: msg });
+      // Message({ message: msg, type: "warning" });
       return Promise.reject("error");
     } else if (code !== 200) {
       Notification.error({ title: msg });
@@ -153,7 +154,7 @@ export function download(url, params, filename, config) {
   downloadLoadingInstance = Loading.service({
     text: "正在下载数据,请稍候",
     spinner: "el-icon-loading",
-    background: "rgba(0, 0, 0, 0.7)",
+    background: "rgba(255, 255, 255, 0.7)",
   });
   return service
     .post(url, params, {

+ 122 - 203
src/views/business/spd/bo/basic/details.vue

@@ -5,74 +5,42 @@
     <el-row type="flex" class="row-bg" justify="space-around">
       <el-col :span="4">
         <div class="grid-content bg-purple">
-          <el-button
-            type="info"
-            plain
-            icon="el-icon-back"
-            size="small"
-            @click="handleBack"
-            >返回</el-button
-          >
+          <el-button type="info" plain icon="el-icon-back" size="small" @click="handleBack">返回</el-button>
         </div>
       </el-col>
       <el-col :span="16">
         <div class="grid-content bg-purple-light">
           <el-descriptions :colon="false" :size="medium">
             <el-descriptions-item>
-                <dev style="width: 200px; height: 60px; font-size: 18px" v-show="!showCustomer">{{form.basic.boName.split('-')[0] + '-' + form.basic.boName.split('-')[1].substring(0,2) + '******' + form.basic.boName.split('-')[1].substring(form.basic.boName.split('-')[1].length - 2,form.basic.boName.split('-')[1].length) + '-' + form.basic.boName.split('-')[2]}}</dev>
-                <dev style="width: 200px; height: 60px; font-size: 18px" v-show="showCustomer">{{form.basic.boName}}</dev>
-                <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
+              <dev style="width: 200px; height: 60px; font-size: 18px" v-show="!showCustomer">
+                {{ form.basic.boName.split('-')[0] + '-' + form.basic.boName.split('-')[1].substring(0, 2) + '******' +
+                  form.basic.boName.split('-')[1].substring(form.basic.boName.split('-')[1].length -
+                    2, form.basic.boName.split('-')[1].length) + '-' + form.basic.boName.split('-')[2] }}</dev>
+              <dev style="width: 200px; height: 60px; font-size: 18px" v-show="showCustomer">{{ form.basic.boName }}</dev>
+              <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton" />
             </el-descriptions-item>
             <el-descriptions-item label="商机状态:" style="margin-left:27px">
               <div v-for="dict in dict.type.mk_bo_state" v-if="form.basic.boState == dict.value">
-                <div>{{dict.label}}</div>
+                <div>{{ dict.label }}</div>
               </div>
             </el-descriptions-item>
             <el-descriptions-item label="赢丢单状态:">
               <div v-for="dict in dict.type.mk_bo_winstate" v-if="form.basic.winningState == dict.value">
-                {{dict.label}}
+                {{ dict.label }}
               </div>
             </el-descriptions-item>
           </el-descriptions>
         </div>
       </el-col>
       <el-col :span="6">
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-delete-solid"
-          size="small"
-          @click="handleWinningState('1','关闭')"
-          v-if="(showClose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boClose"
-          >关闭</el-button
-        >
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-close"
-          size="small"
-          @click="handleWinningState('2','丢单')"
-          v-if="(showLose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boLose"
-          >丢单</el-button
-        >
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-check"
-          size="small"
-          @click="handleWinningState('3','赢单')"
-          v-if="(showWin && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boWin"
-          >赢单</el-button
-        >
-        <el-button
-          type="info"
-          plain
-          icon="el-icon-user"
-          size="small"
-          @click="allocation()"
-          v-if="this.boAuthority.post == 0 && this.form.basic.winningState == 0"
-          >分配</el-button
-        >
+        <el-button type="info" plain icon="el-icon-delete-solid" size="small" @click="handleWinningState('1', '关闭')"
+          v-if="(showClose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boClose">关闭</el-button>
+        <el-button type="info" plain icon="el-icon-close" size="small" @click="handleWinningState('2', '丢单')"
+          v-if="(showLose && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boLose">丢单</el-button>
+        <el-button type="info" plain icon="el-icon-check" size="small" @click="handleWinningState('3', '赢单')"
+          v-if="(showWin && this.form.basic.winningState == 0) && this.boAuthority.boAuthority.boWin">赢单</el-button>
+        <el-button type="info" plain icon="el-icon-user" size="small" @click="allocation()"
+          v-if="this.boAuthority.post == 0 && this.form.basic.winningState == 0">分配</el-button>
       </el-col>
     </el-row>
     <!-- 主多页签 -->
@@ -82,7 +50,8 @@
         <el-divider content-position="left" style="font-size: 30px">
           <dev style="width: 50px; height: 40px; font-size: 18px">项目流程</dev>
         </el-divider>
-        <Process :key="timer" :form="form.basic" :boAuthority="boAuthority" :boStage="boStage" :dict="dict" @reload="reload"/>
+        <Process :key="timer" :form="form.basic" :boAuthority="boAuthority" :boStage="boStage" :dict="dict"
+          @reload="reload" />
         <!-- 基本信息 -->
         <el-divider content-position="left">
           <dev style="width: 50px; height: 40px; font-size: 18px">基本信息</dev>
@@ -90,36 +59,37 @@
         <el-descriptions>
           <el-descriptions-item label="商机来源">
             <div v-for="dict in dict.type.mk_bo_source" v-if="form.basic.boSource == dict.value">
-              {{dict.label}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item label="商机类型">
             <div v-for="dict in dict.type.mk_bo_type" v-if="form.basic.boType == dict.value">
-              {{dict.label}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item label="客户">
             <dev v-show="!showCustomer">
-              {{form.basic.customerName.substring(0,2) + '******' + form.basic.customerName.substring(form.basic.customerName.length - 2,form.basic.customerName.length)}}
+              {{ form.basic.customerName.substring(0, 2) + '******' +
+                form.basic.customerName.substring(form.basic.customerName.length - 2, form.basic.customerName.length) }}
             </dev>
             <dev v-show="showCustomer">
-              {{form.basic.customerName}}
+              {{ form.basic.customerName }}
             </dev>
-            <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
+            <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton" />
           </el-descriptions-item>
           <el-descriptions-item :label="totalRevenue">
             <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.basic.totalHosRevenue == dict.value">
-              {{dict.label}}
+              {{ dict.label }}
             </div>
           </el-descriptions-item>
           <el-descriptions-item :label="estimate">
-            {{form.basic.hosDiscreetValue}}
+            {{ form.basic.hosDiscreetValue }}
           </el-descriptions-item>
           <el-descriptions-item label="赢单率">
-            {{form.basic.winningRate}}
+            {{ form.basic.winningRate }}
           </el-descriptions-item>
           <el-descriptions-item label="商机内容">
-            {{form.basic.boContent}}
+            {{ form.basic.boContent }}
           </el-descriptions-item>
         </el-descriptions>
         <!-- 其它信息 -->
@@ -128,58 +98,43 @@
         </el-divider>
         <el-descriptions>
           <el-descriptions-item label="销售组织">
-            {{form.basic.marketingOrganizingName}}
+            {{ form.basic.marketingOrganizingName }}
           </el-descriptions-item>
           <el-descriptions-item label="销售区域">
-            {{form.basic.marketingAreaName}}
+            {{ form.basic.marketingAreaName }}
           </el-descriptions-item>
           <el-descriptions-item label="部门">
-            {{form.basic.deptName}}
+            {{ form.basic.deptName }}
           </el-descriptions-item>
           <el-descriptions-item label="商机负责人">
-            {{form.basic.principalName}}
+            {{ form.basic.principalName }}
           </el-descriptions-item>
           <el-descriptions-item label="创建人">
-            {{form.basic.creatorName}}
+            {{ form.basic.creatorName }}
           </el-descriptions-item>
           <el-descriptions-item label="创建时间">
-            {{form.basic.createTime}}
+            {{ form.basic.createTime }}
           </el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 商机任务页签 -->
       <el-tab-pane label="商机任务" name="second">
-        <TaskList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'second'"
-        />
+        <TaskList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'second'" />
       </el-tab-pane>
       <!-- 联系人页签 -->
       <el-tab-pane label="商机联系人" name="third">
-        <ContactList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'third'"
-        />
+        <ContactList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'third'" />
       </el-tab-pane>
       <!-- 附件页签 -->
       <el-tab-pane label="附件信息" name="fourth">
-        <AccessoryList
-          :source="'BoDetails'"
-          :bo="this.form.basic"
-          :boAuthority="this.boAuthority"
-          v-if="masterTabs == 'fourth'"
-        />
+        <AccessoryList :source="'BoDetails'" :bo="this.form.basic" :boAuthority="this.boAuthority"
+          v-if="masterTabs == 'fourth'" />
       </el-tab-pane>
       <!-- 模板文件页签 -->
       <el-tab-pane label="模板文件下载" name="five">
-        <FileTemplate
-          :botype="form.basic.boType"
-          v-if="masterTabs == 'five'"
-        />
+        <FileTemplate :botype="form.basic.boType" v-if="masterTabs == 'five'" />
       </el-tab-pane>
     </el-tabs>
 
@@ -188,64 +143,46 @@
       <el-form ref="wsform" :model="winningStateData" :rules="winningStateDataRules" label-width="140px">
         <!-- 赢单 -->
         <el-form-item label="赢单日期" prop="winningStateDate" v-if="this.winningStateData.winningState == '3'">
-          <el-date-picker clearable
-            v-model="winningStateData.winningStateDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择赢单日期"
-            style="width:220px"
-            >
+          <el-date-picker clearable v-model="winningStateData.winningStateDate" type="date" value-format="yyyy-MM-dd"
+            placeholder="请选择赢单日期" style="width:220px">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="赢单金额(万元)" prop="winningStateMoney" v-if="this.winningStateData.winningState == '3'">
-          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="赢单金额"/>
+          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="赢单金额" />
         </el-form-item>
-        <el-form-item label="赢单原因" prop="winningStateCause"  v-if="this.winningStateData.winningState == '3'">
+        <el-form-item label="赢单原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '3'">
           <el-select v-model="winningStateData.winningStateCause" placeholder="请输入">
-            <el-option
-              v-for="dict in dict.type.mk_bo_wincause"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.label"
-            ></el-option>
+            <el-option v-for="dict in dict.type.mk_bo_wincause" :key="dict.value" :label="dict.label"
+              :value="dict.label"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="赢单备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '3'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入赢单备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入赢单备注" />
         </el-form-item>
         <!-- 丢单 -->
         <el-form-item label="丢单日期" prop="winningStateDate" v-if="this.winningStateData.winningState == '2'">
-          <el-date-picker clearable
-            v-model="winningStateData.winningStateDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="丢单日期"
-            style="width:220px"
-            >
+          <el-date-picker clearable v-model="winningStateData.winningStateDate" type="date" value-format="yyyy-MM-dd"
+            placeholder="丢单日期" style="width:220px">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="丢单金额(万元)" prop="winningStateMoney" v-if="this.winningStateData.winningState == '2'">
-          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="丢单金额"/>
+          <el-input type="number" v-model="winningStateData.winningStateMoney" style="width:220px" placeholder="丢单金额" />
         </el-form-item>
-        <el-form-item label="丢单原因" prop="winningStateCause"  v-if="this.winningStateData.winningState == '2'">
+        <el-form-item label="丢单原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '2'">
           <el-select v-model="winningStateData.winningStateCause" placeholder="请输入">
-            <el-option
-              v-for="dict in dict.type.mk_bo_losecause"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.label"
-            ></el-option>
+            <el-option v-for="dict in dict.type.mk_bo_losecause" :key="dict.value" :label="dict.label"
+              :value="dict.label"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="丢单备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '2'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入丢单备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="请输入丢单备注" />
         </el-form-item>
         <!-- 关闭 -->
         <el-form-item label="关闭原因" prop="winningStateCause" v-if="this.winningStateData.winningState == '1'">
-          <el-input v-model="winningStateData.winningStateCause" style="width:220px" placeholder="关闭原因"/>
+          <el-input v-model="winningStateData.winningStateCause" style="width:220px" placeholder="关闭原因" />
         </el-form-item>
         <el-form-item label="关闭备注" prop="winningStateRemark" v-if="this.winningStateData.winningState == '1'">
-          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="关闭备注"/>
+          <el-input v-model="winningStateData.winningStateRemark" style="width:220px" placeholder="关闭备注" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -255,38 +192,21 @@
     </el-dialog>
 
     <!-- 分配商机负责人对话框 -->
-    <el-dialog
-      title="分配商机负责人"
-      :visible.sync="allocationPopover"
-      width="500px"
-      append-to-body
-    >
+    <el-dialog title="分配商机负责人" :visible.sync="allocationPopover" width="500px" append-to-body>
       <el-form ref="afform" :model="allocationForm" :rules="allocationFormRules" label-width="140px">
         <el-form-item label="新负责人" prop="allocationStaff">
-          <dr-input-dialog
-            v-model="allocationForm.allocationStaffName"
-            title="员工"
-            type="CONTACTS_PARAM"
-            :dataMapping="{
-              allocationStaff: 'id',
-              allocationStaffName: 'name',
-            }"
-            :source.sync="allocationForm"
-          ></dr-input-dialog>
+          <dr-popover-select v-model="allocationForm.allocationStaffName" title="员工" type="CONTACTS_PARAM" :dataMapping="{
+            allocationStaff: 'id',
+            allocationStaffName: 'name',
+          }" :source.sync="allocationForm"></dr-popover-select>
         </el-form-item>
         <el-form-item label="是否将您作为参与人" prop="isParticipant">
-          <el-radio v-model="allocationForm.isParticipant" :label='true'
-            >是</el-radio
-          >
-          <el-radio v-model="allocationForm.isParticipant" :label='false'
-            >否</el-radio
-          >
+          <el-radio v-model="allocationForm.isParticipant" :label='true'>是</el-radio>
+          <el-radio v-model="allocationForm.isParticipant" :label='false'>否</el-radio>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitAllocationForm"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitAllocationForm">确 定</el-button>
         <el-button @click="cancelAllocation">取 消</el-button>
       </div>
     </el-dialog>
@@ -306,14 +226,13 @@ import ContactList from "../contact/contactList.vue";
 import AccessoryList from "../basic/accessoryList.vue";
 import FileTemplate from "../filetemplate/botabs.vue";
 import Process from '../basic/process.vue';
-import DrInputDialog from "@/components/input-dialog/index.vue";
 
 
 export default {
   //名称
   name: "BoDetails",
   //注册引入的组件
-  components: { TaskList, ContactList,AccessoryList,FileTemplate, Process,DrInputDialog,},
+  components: { TaskList, ContactList, AccessoryList, FileTemplate, Process,},
   //平台枚举
   dicts: [
     "mk_bo_type",
@@ -336,7 +255,7 @@ export default {
       //赢单状态
       winningState: null,
       //赢单状态数据
-      winningStateData:{},
+      winningStateData: {},
       //赢单状态表单校验
       // 赢单表单校验
       winningStateDataRules: {
@@ -358,15 +277,15 @@ export default {
         accessory: [],
       },
       //权限数据
-      boAuthority:{},
+      boAuthority: {},
       //流程节点数据
-      boStage:[],
+      boStage: [],
       //关单按钮是否显示
-      showClose:false,
+      showClose: false,
       //赢单按钮是否显示
-      showWin:false,
+      showWin: false,
       //丢单按钮是否显示
-      showLose:false,
+      showLose: false,
       //重新加载子组件参数
       timer: "",
       //是否显示客户
@@ -387,16 +306,16 @@ export default {
       //分配弹窗
       allocationPopover: false,
       //营收总额
-      totalRevenue:"***营收总额",
+      totalRevenue: "***营收总额",
       //预估额
-      estimate:"***预估额(万元)",
+      estimate: "***预估额(万元)",
     };
   },
   watch: {
     'form.basic.boType': {
       handler(newVal, oldVal) {
-        console.log('newVal',newVal);
-        switch(newVal) {
+        console.log('newVal', newVal);
+        switch (newVal) {
           case '0':
             this.totalRevenue = "医院营收总额";
             this.estimate = "医院耗材预估值(万元)"
@@ -415,14 +334,14 @@ export default {
             break;
           case '4':
             this.totalRevenue = "医院营收总额";
-            this.estimate = "医院耗材预估值(万元)"
+            this.estimate = "军队医院设备预估额(万元)"
             break;
           case '5':
             this.totalRevenue = "项目总额";
             this.estimate = "工程预估额(万元)"
             break;
           default:
-              break;
+            break;
         }
       },
       immediate: true,
@@ -455,7 +374,7 @@ export default {
       }
     },
     //赢单状态按钮
-    handleWinningState(winningState,title){
+    handleWinningState(winningState, title) {
       this.resetWinningStateData();
       this.winningStateOpen = true;
       this.winningStateTitle = title;
@@ -463,7 +382,7 @@ export default {
       this.winningStateData.boId = this.form.basic.id;
       this.winningStateData.winningStateDate = new Date();
     },
-    resetWinningStateData(){
+    resetWinningStateData() {
       this.winningStateData = {
         boId: null,
         winningState: null,
@@ -497,11 +416,11 @@ export default {
       // this.allocationForm.boId = parseInt(this.form.basic.id);
       // this.allocationForm.allocationStaff = parseInt(this.allocationForm.allocationStaff);
       this.allocationForm.boId = this.form.basic.id;
-      console.log('this.allocationForm',this.allocationForm);
+      console.log('this.allocationForm', this.allocationForm);
       this.$refs["afform"].validate(valid => {
         if (valid) {
           allocationParticipant(this.allocationForm).then(response => {
-            console.log('response',response);
+            console.log('response', response);
             this.$modal.msgSuccess("分配成功");
             this.allocationPopover = false;
             this.reload();
@@ -514,7 +433,7 @@ export default {
       this.allocationPopover = false;
     },
     //重新加载数据
-    reload(){
+    reload() {
       //加载基础数据
       getBasic(this.$route.params.id).then((response) => {
         this.form.basic = response.data;
@@ -530,27 +449,27 @@ export default {
           var curNode = 0;
           var signContract = 999;
           for (var i = 0; i < this.boStage.length; i++) {
-            if(this.boStage[i].code == this.form.basic.boStage){
+            if (this.boStage[i].code == this.form.basic.boStage) {
               curNode = i;
             }
-            if(this.boStage[i].name.toString().includes('审核')){
+            if (this.boStage[i].name.toString().includes('审核')) {
               auditNode = i;
             }
-            if(this.boStage[i].name.toString().includes('合同')){
+            if (this.boStage[i].name.toString().includes('合同')) {
               signContract = i;
             }
           }
-          this.showClose=false;
-          this.showLose=false;
-          this.showWin=false;
-          if(curNode < auditNode){
-            this.showClose=true;
+          this.showClose = false;
+          this.showLose = false;
+          this.showWin = false;
+          if (curNode < auditNode) {
+            this.showClose = true;
           }
-          if(curNode > auditNode){
-            this.showLose=true;
+          if (curNode > auditNode) {
+            this.showLose = true;
           }
-          if(curNode >= signContract){
-            this.showWin=true;
+          if (curNode >= signContract) {
+            this.showWin = true;
           }
           //确定数据加载完成,子组件可以开始展示
           this.timer = new Date().getTime();
@@ -558,7 +477,7 @@ export default {
       });
     },
     //是否显示客户
-    customerButton(){
+    customerButton() {
       this.showCustomer = !this.showCustomer;
     },
   },
@@ -574,33 +493,33 @@ export default {
       //加载流程节点数据
       getBoNodeListByType(this.form.basic.boType).then(response => {
         this.boStage = response.rows;
-        console.log('this.boStage',this.boStage);
+        console.log('this.boStage', this.boStage);
         //赢丢单按钮显示逻辑
         var auditNode = 999;
         var curNode = 0;
         var signContract = 999;
         for (var i = 0; i < this.boStage.length; i++) {
-          if(this.boStage[i].code == this.form.basic.boStage){
+          if (this.boStage[i].code == this.form.basic.boStage) {
             curNode = i;
           }
-          if(this.boStage[i].name.toString().includes('审核')){
+          if (this.boStage[i].name.toString().includes('审核')) {
             auditNode = i;
           }
-          if(this.boStage[i].name.toString().includes('合同')){
+          if (this.boStage[i].name.toString().includes('合同')) {
             signContract = i;
           }
         }
-        this.showClose=false;
-        this.showLose=false;
-        this.showWin=false;
-        if(curNode < auditNode){
-          this.showClose=true;
+        this.showClose = false;
+        this.showLose = false;
+        this.showWin = false;
+        if (curNode < auditNode) {
+          this.showClose = true;
         }
-        if(curNode > auditNode){
-          this.showLose=true;
+        if (curNode > auditNode) {
+          this.showLose = true;
         }
-        if(curNode >= signContract){
-          this.showWin=true;
+        if (curNode >= signContract) {
+          this.showWin = true;
         }
         //确定数据加载完成,子组件可以开始展示
         this.timer = new Date().getTime();
@@ -612,35 +531,35 @@ export default {
 
 
 <style scoped>
-.md-content >>> .el-form-item {
+.md-content>>>.el-form-item {
   margin-bottom: 10px;
 }
 
-.md-content >>> .el-tabs--border-card > .el-tabs__content {
+.md-content>>>.el-tabs--border-card>.el-tabs__content {
   padding-bottom: 8px;
 }
 
-.md-content .md-auditInfo >>> .el-form-item {
+.md-content .md-auditInfo>>>.el-form-item {
   margin-bottom: 0px;
 }
 
-.md-main >>> .el-form-item,
-.md-vice >>> .el-form-item {
+.md-main>>>.el-form-item,
+.md-vice>>>.el-form-item {
   width: 100%;
   box-sizing: border-box;
 }
 
-.md-main >>> .el-form-item__label,
-.md-vice >>> .el-form-item__label {
+.md-main>>>.el-form-item__label,
+.md-vice>>>.el-form-item__label {
   width: 40%;
 }
 
-.md-main >>> .el-form-item__content,
-.md-md-vice >>> .el-form-item__content {
+.md-main>>>.el-form-item__content,
+.md-md-vice>>>.el-form-item__content {
   width: 60%;
 }
 
-.md-content >>> .el-form-item__label {
+.md-content>>>.el-form-item__label {
   font-weight: normal;
   /* text-align: left;
   width: 28%; */
@@ -656,11 +575,11 @@ export default {
   /* Firefox */
 }
 
-.md-main >>> .material-table {
+.md-main>>>.material-table {
   height: 100%;
 }
 
-.md-vice >>> .material-table {
+.md-vice>>>.material-table {
   height: 140px;
   overflow-y: auto;
   overflow-x: auto;

+ 3 - 2
src/views/business/spd/bo/basic/index.vue

@@ -631,7 +631,7 @@ export default {
             break;
           case '4':
             this.totalRevenue = "医院营收总额";
-            this.estimate = "医院耗材预估值(万元)"
+            this.estimate = "军队医院设备预估额(万元)"
             break;
           case '5':
             this.totalRevenue = "项目总额";
@@ -801,8 +801,9 @@ export default {
               this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
-        this.submitButtonEditStatus = false;
       });
     },
     /** 删除按钮操作 */

+ 13 - 5
src/views/business/spd/bo/basic/process.vue

@@ -308,7 +308,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="医院耗材集采预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -389,8 +389,10 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="医院决策人" prop="hospitalDecisionMaker" >
-                <el-input v-model="form.consumablesBoFlow.hospitalDecisionMaker" />
+                <el-input v-model="form.consumablesBoFlow.hospitalDecisionMaker" v-show="decisionMakerDisplay"/>
+                <el-input :placeholder="form.consumablesBoFlow.hospitalDecisionMaker ? form.consumablesBoFlow.hospitalDecisionMaker[0] + new Array(form.consumablesBoFlow.hospitalDecisionMaker.length).join('*') : ''" v-show="!decisionMakerDisplay"/>
               </el-form-item>
+              <el-button size="mini" type="text" icon="el-icon-view" :disabled="false" @click="decisionMakerDisplay = !decisionMakerDisplay" v-show="!isUpdate"/>
             </el-col>
             <el-col :span="8">
               <el-form-item label="医院决策时间" prop="hospitalDecisionTime" >
@@ -614,8 +616,11 @@
           <el-row>
             <el-col :span="8">
               <el-form-item label="医院决策人" prop="hospitalDecisionMaker" >
-                <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" />
+                <!-- <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" /> -->
+                <el-input v-model="form.medicalBoFlow.hospitalDecisionMaker" v-show="decisionMakerDisplay"/>
+                <el-input :placeholder="form.medicalBoFlow.hospitalDecisionMaker ? form.medicalBoFlow.hospitalDecisionMaker[0] + new Array(form.medicalBoFlow.hospitalDecisionMaker.length).join('*') : ''" v-show="!decisionMakerDisplay"/>
               </el-form-item>
+              <el-button size="mini" type="text" icon="el-icon-view" :disabled="false" @click="decisionMakerDisplay = !decisionMakerDisplay" v-show="!isUpdate"/>
             </el-col>
             <el-col :span="8">
               <el-form-item label="医院决策时间" prop="hospitalDecisionTime" >
@@ -748,7 +753,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="医院设备预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -978,7 +983,7 @@
               <div>{{dict.label}}</div>
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+          <el-descriptions-item label="军队医院设备预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
         </el-descriptions>
       </el-tab-pane>
       <!-- 项目立项 -->
@@ -1537,6 +1542,8 @@ export default {
       isUpdate:false,
       //跟进记录参数
       behaviorParame:{},
+      //医院决策人是否显示
+      decisionMakerDisplay:false,
     };
   },
   created() {
@@ -1608,6 +1615,7 @@ export default {
     //修改按钮
     modifyButton() {
       this.isUpdate = true;
+      this.decisionMakerDisplay = true;
     },
     //取消按钮
     cancelButton() {

+ 8 - 1
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -292,7 +292,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -394,6 +394,8 @@ export default {
       },
       //当前操作状态
       operatingState: '',
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -559,6 +561,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           let formData = new FormData();
@@ -575,14 +578,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addBehavior(formData).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 9 - 2
src/views/business/spd/bo/contact/contactList.vue

@@ -35,7 +35,7 @@
           <dict-tag :options="dict.type.mk_bo_power" :value="scope.row.power"/>
         </template>
       </el-table-column>
-      <el-table-column label="业务爱好" align="center" prop="hobby" />
+      <el-table-column label="兴趣爱好" align="center" prop="hobby" />
       <el-table-column label="家庭地址" align="center" prop="address" />
       <el-table-column label="状态" align="center" prop="state" >
         <template slot-scope="scope">
@@ -332,7 +332,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'">确 定</el-button>
+        <el-button type="primary" @click="submitForm" v-if="this.operatingState != 'Browse'" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -444,6 +444,8 @@ export default {
       operatingState: '',
       //
       activeName: 'first',
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -577,6 +579,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -584,14 +587,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addContact(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 8 - 1
src/views/business/spd/bo/education/educationList.vue

@@ -122,7 +122,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -203,6 +203,8 @@ export default {
           );
         }
       },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -283,6 +285,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -290,14 +293,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addEducation(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 8 - 1
src/views/business/spd/bo/pojpsn/pojpsnList.vue

@@ -152,7 +152,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -231,6 +231,8 @@ export default {
       },
       //职责列表
       mk_bo_pojpsn_job:[],
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -323,6 +325,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
@@ -330,14 +333,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addPojpsn(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 9 - 2
src/views/business/spd/bo/relationship/relationshipList.vue

@@ -113,7 +113,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="submitButtonEditStatus">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
@@ -183,7 +183,9 @@ export default {
             trigger: "blur"
           }
         ],
-      }
+      },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -266,6 +268,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
@@ -273,14 +276,18 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addRelationship(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 134 - 9
src/views/business/spd/bo/statement/index.vue

@@ -23,11 +23,17 @@
         />
       </el-form-item>
       <el-form-item label="商机来源" prop="boSource">
-        <el-input
+        <el-select
           v-model="queryParams.boSource"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_source"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -36,7 +42,7 @@
     </el-form>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="SPD商机" name="0">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -94,7 +100,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="耗材集采商机" name="1">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -160,7 +166,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="医疗耗材商机" name="2">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -242,7 +248,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="医疗设备商机" name="3">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -308,7 +314,7 @@
         </el-table>
       </el-tab-pane>
       <el-tab-pane label="军队医疗设备商机" name="4">
-        <el-table :data="boList" >
+        <el-table :data="boList" v-loading="loading">
           <el-table-column label="客户" align="center" prop="customerName" />
           <el-table-column label="部门" align="center" prop="deptName" />
           <el-table-column label="负责人" align="center" prop="principalName" />
@@ -373,6 +379,72 @@
           </el-table-column>
         </el-table>
       </el-tab-pane>
+      <el-tab-pane label="工程商机" name="5">
+        <el-table :data="boList" v-loading="loading">
+          <el-table-column label="客户" align="center" prop="customerName" />
+          <el-table-column label="部门" align="center" prop="deptName" />
+          <el-table-column label="负责人" align="center" prop="principalName" />
+          <el-table-column label="商机名称" align="center" prop="boName" />
+          <el-table-column label="商机编码" align="center" prop="boCode" />
+          <el-table-column label="创建日期" align="center" prop="createTime" />
+          <el-table-column label="需求信息收集" align="center" prop="b500">
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b500">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b500}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="商机审核" align="center" prop="b501" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b501">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b501}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="项目立项" align="center" prop="b502" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b502">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b502}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="考察" align="center" prop="b503" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b503">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b503}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="解决方案" align="center" prop="b504" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b504">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b504}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="投标与签合同" align="center" prop="b505" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b505">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b505}}
+              </dev>
+            </template>
+          </el-table-column>
+          <el-table-column label="完成" align="center" prop="b599" >
+            <template slot-scope="scope">
+              <dev v-if="scope.row.b599">
+                <el-button size="medium" type="text" icon="el-icon-s-flag" />
+                {{scope.row.b599}}
+              </dev>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
     </el-tabs>
 
     <pagination
@@ -390,6 +462,10 @@
 import { listBasic } from "@/api/business/spd/bo/statement";
 
 export default {
+  dicts: [
+    "mk_bo_type",
+    "mk_bo_source",
+  ],
   data() {
     return {
       // 遮罩层
@@ -412,6 +488,7 @@ export default {
       activeName: '0',
       //分页参数
       total:0,
+      loading: true,
     };
   },
   created() {
@@ -429,6 +506,7 @@ export default {
       this.handleClick(e);
     },
     handleClick(e) {
+      this.loading = true;
       console.log('e',e);
       this.queryParams.boType = e.name;
       switch (e.name) {
@@ -438,7 +516,7 @@ export default {
             console.log('this.boList',this.boList);
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
-              console.log('nodes',nodes);
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '0-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b000 = nodesfilter[0].day;
@@ -473,6 +551,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '1-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b100 = nodesfilter[0].day;
@@ -511,6 +590,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '2-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b200 = nodesfilter[0].day;
@@ -539,6 +619,10 @@ export default {
               if(nodesfilter.length > 0){
                 this.boList[i].b207 = nodesfilter[0].day;
               }
+              nodesfilter = nodes.filter(n => n.code == '2-08');
+              if(nodesfilter.length > 0){
+                this.boList[i].b208 = nodesfilter[0].day;
+              }
               nodesfilter = nodes.filter(n => n.code == '2-99');
               if(nodesfilter.length > 0){
                 this.boList[i].b299 = nodesfilter[0].day;
@@ -553,6 +637,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '3-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b300 = nodesfilter[0].day;
@@ -591,6 +676,7 @@ export default {
             this.boList = response.rows;
             for(var i = 0;i < this.boList.length;i++){
               var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
               var nodesfilter = nodes.filter(n => n.code == '4-00');
               if(nodesfilter.length > 0){
                 this.boList[i].b400 = nodesfilter[0].day;
@@ -624,6 +710,45 @@ export default {
             this.loading = false;
           });
           break;
+        case "5":
+          listBasic(this.queryParams).then(response => {
+            this.boList = response.rows;
+            for(var i = 0;i < this.boList.length;i++){
+              var nodes = this.boList[i].boNodeFlowList;
+              if(!nodes){continue;}
+              var nodesfilter = nodes.filter(n => n.code == '5-00');
+              if(nodesfilter.length > 0){
+                this.boList[i].b500 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-01');
+              if(nodesfilter.length > 0){
+                this.boList[i].b501 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-02');
+              if(nodesfilter.length > 0){
+                this.boList[i].b502 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-03');
+              if(nodesfilter.length > 0){
+                this.boList[i].b503 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-04');
+              if(nodesfilter.length > 0){
+                this.boList[i].b504 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-05');
+              if(nodesfilter.length > 0){
+                this.boList[i].b505 = nodesfilter[0].day;
+              }
+              nodesfilter = nodes.filter(n => n.code == '5-99');
+              if(nodesfilter.length > 0){
+                this.boList[i].b599 = nodesfilter[0].day;
+              }
+            }
+            this.total = response.total;
+            this.loading = false;
+          });
+          break;
         default:
           break;
       }

+ 19 - 9
src/views/business/spd/bo/statement/proportion/index.vue

@@ -1,18 +1,18 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="商机日期" prop="code">
+      <el-form-item label="商机日期" prop="yearMonth">
         <el-date-picker
           type="month"
           v-model="queryParams.yearMonth"
           placeholder="选择月份"
+          @change="yearMonthChange"
           >
         </el-date-picker>
       </el-form-item>
       <el-form-item label="商机类型" prop="boType">
         <el-select
           v-model="queryParams.boType"
-          @change="boTypeChange"
           clearable
         >
           <el-option
@@ -105,7 +105,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        yearMonth: null,
+        yearMonth: new Date().Format(),
         boType: null,
         boSource: null,
         deptName: null,
@@ -127,10 +127,10 @@ export default {
       listProportion(this.queryParams).then(response => {
         this.list = response.rows;
         for(let item of this.list) {
-          if(item.passAuditRate){item.passAuditRate = (item.passAuditRate * 100) + '%';}
-          if(item.approveInitiateProjectRate){item.approveInitiateProjectRate = (item.approveInitiateProjectRate * 100) + '%';}
-          if(item.hangingRate){item.hangingRate = (item.hangingRate * 100) + '%';}
-          if(item.contractSigningRate){item.contractSigningRate = (item.contractSigningRate * 100) + '%';}
+          if(item.passAuditRate){item.passAuditRate = this.accMul(item.passAuditRate,100) + '%';}
+          if(item.approveInitiateProjectRate){item.approveInitiateProjectRate = this.accMul(item.approveInitiateProjectRate,100) + '%';}
+          if(item.hangingRate){item.hangingRate = this.accMul(item.hangingRate , 100) + '%';}
+          if(item.contractSigningRate){item.contractSigningRate = this.accMul(item.contractSigningRate , 100) + '%';}
         }
         this.total = response.total;
         this.loading = false;
@@ -160,13 +160,13 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      console.log('this.queryParams',this.queryParams);
       this.queryParams.pageNum = 1;
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.yearMonth = new Date().Format();
       this.handleQuery();
     },
     // 多选框选中数据
@@ -226,7 +226,17 @@ export default {
       this.download('pu/job/export', {
         ...this.queryParams
       }, `job_${new Date().getTime()}.xlsx`)
-    }
+    },
+    accMul(arg1,arg2){
+      var m=0,s1=arg1.toString(),s2=arg2.toString();
+      try{m+=s1.split(".")[1].length}catch(e){}
+      try{m+=s2.split(".")[1].length}catch(e){}
+      return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
+    },
+    //选月份后
+    yearMonthChange(value) {
+      this.queryParams.yearMonth = value.Format();
+    },
   }
 };
 </script>

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

@@ -402,6 +402,7 @@
           type="primary"
           @click="submitForm"
           v-if="this.operatingState != 'Browse'"
+          :disabled="submitButtonEditStatus"
           >确 定</el-button
         >
         <el-button @click="cancel">取 消</el-button>
@@ -564,6 +565,8 @@ export default {
           );
         }
       },
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
     };
   },
   created() {
@@ -683,21 +686,27 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate((valid) => {
+        console.log('valid',valid);
         if (valid) {
           if (this.form.id != null) {
             updateTask(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addTask(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
+        }else{
+          this.submitButtonEditStatus = false;
         }
       });
     },

+ 18 - 13
src/views/marketing/dealer-authorization/authprivAdd.vue

@@ -68,11 +68,13 @@ export default {
 
         this.isAdd = false;
 
-        let objData = { ...data };
+        this.formData = {
 
-        objData['time'] = [objData.startTime, objData.endTime];
+          ...data,
 
-        this.formData = objData;
+          time: [data.startTime, data.endTime]
+
+        };
 
         setTimeout(() => {
           this.loading = false;
@@ -98,27 +100,28 @@ export default {
     // 确定
     handleConfirm(formName) {
 
-      console.log(this.formData, 'this.formData');
-
       this.$refs[formName].validate(async (valid) => {
 
         if (valid) {
           // 校验通过
           let isTime = this.formData.time && this.formData.time != '' && this.formData.time.length;
 
-          const { name, id, } = this.$store.state.user;
+          // name:工号   nickName:名字
+          const { name, nickName } = this.$store.state.user;
 
           let params = {
             ...this.formData,
             startTime: isTime ? this.formData.time[0] : '',
             endTime: isTime ? this.formData.time[1] : '',
-            updatePerson: name,
-            updateTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+            updatePerson: nickName,
+            updateBy: name,
+            updateTime: new Date().Format(),
             ...(
               this.isAdd ? {
                 status: '0',
-                createPerson: name,
-                createTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+                createPerson: nickName,
+                createBy: name,
+                createTime: new Date().Format(),
               } : {}
             )
 
@@ -128,9 +131,11 @@ export default {
 
           try {
             this.loading = true;
-            let { code, msg } = await (this.isAdd ?
-              dealerApi.insert(params) :
-              dealerApi.update(params))
+            let { code, msg } = await (
+              this.isAdd ?
+                dealerApi.insert(params) :
+                dealerApi.update(params)
+            )
 
             if (code === 200) {
               this.handleCancel();

+ 15 - 26
src/views/marketing/dealer-authorization/authprivSee.vue

@@ -3,14 +3,17 @@
   <el-dialog title="查看" :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false">
     <el-form :model="formData" label-position="left" label-width="120px">
       <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key">
-        <el-input v-if="column.type == 'Input'" readonly v-model="formData[column.key]" autocomplete="off"></el-input>
+        <el-input v-if="column.type == 'Input'" readonly v-model="formData[column.key]" autocomplete="off">
+        </el-input>
 
         <el-date-picker v-if="column.type == 'DateRange'" readonly v-model="formData[column.key]" type="daterange"
           format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
-          end-placeholder="结束日期"></el-date-picker>
+          end-placeholder="结束日期">
+        </el-date-picker>
 
         <el-date-picker v-if="column.type == 'Date'" readonly v-model="formData[column.key]" type="date"
-          format="yyyy-MM-dd " value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
+          format="yyyy-MM-dd " value-format="yyyy-MM-dd" placeholder="选择日期">
+        </el-date-picker>
 
       </el-form-item>
     </el-form>
@@ -21,31 +24,17 @@
 </template>
 
 <script>
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
 export default {
 
   name: 'authprivSee',
   data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-
-    const formColumns = [
-      { title: '经销商名称', key: 'dealerName', type: 'Input' },
-      { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
-      { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
-      { title: '授权期限', key: 'time', type: 'DateRange' },
-      { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
-    ];
-
-    const initFormColumns = () => formColumns;
-    const initFormData = () => arr2Obj(initFormColumns(), "key", "value")
 
     return {
       visible: false,
-      formData: { ...initFormData() },
-      formColumns: initFormColumns(),
+      formData: { ...initParams(FormColumns) },
+      formColumns: FormColumns,
 
     }
   },
@@ -60,13 +49,13 @@ export default {
 
       if (data.id) {
 
-        let objData = { ...data };
+        this.formData = {
 
-        objData['time'] = [objData.startTime, objData.endTime];
+          ...data,
 
-        // delete data.startTime
-        // delete data.endTime
-        this.formData = objData;
+          time: [data.startTime, data.endTime]
+
+        };
 
       }
 

+ 92 - 50
src/views/marketing/dealer-authorization/index.vue

@@ -41,7 +41,7 @@
         <el-button size="mini" type="primary" @click="handleOpenAddDialog"
           v-hasPermi="['pu:authorization:add']">新增</el-button>
         <!-- <el-button size="mini" @click="handleSubmit">提交</el-button> -->
-        <el-button size="mini" @click="handleDownload">下载授权书</el-button>
+        <!-- <el-button size="mini" @click="handleDownload">下载授权书</el-button> -->
       </el-col>
     </el-row>
 
@@ -59,6 +59,7 @@
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button type="text" size="mini" @click="handleOpenAddDialog(scope.row)"
+            v-if="scope.row.status == '0' || scope.row.status == '3'"
             v-hasPermi="['pu:authorization:edit']">编辑</el-button>
           <el-button type="text" size="mini" @click="handleDelDialog(scope.row)"
             v-if="scope.row.status == '0' || scope.row.status == '3'"
@@ -66,6 +67,8 @@
           <!-- <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button> -->
           <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'"
             @click="handleSubmit(scope.row)">提交</el-button>
+          <el-button type="text" size="mini" v-if="scope.row.status == '2'"
+            @click="handleDownload(scope.row)">下载授权书</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -92,15 +95,14 @@ export default {
   },
 
   data() {
-    const initTableColumns = () => TableColumns;
-    const initSearchColumns = () => SearchColumns;
+
     return {
       loading: false,
-      searchColumns: initSearchColumns(),
+      searchColumns: SearchColumns,
       searchParams: {
-        ...initParams(initSearchColumns()),
+        ...initParams(SearchColumns),
       },
-      tableColumns: initTableColumns(),
+      tableColumns: TableColumns,
       tableData: [],
       checkedList: [],
       page: {
@@ -129,26 +131,25 @@ export default {
       delete params['time']
       console.log(params, 'params--------');
 
-      await dealerApi.list(params).then(res => {
-        console.log(res, '获取列表');
-        let { code, rows, total } = res;
-        this.loading = false;
+      try {
+        let { code, rows, total } = await dealerApi.list(params);
         if (code == 200) {
           this.tableData = rows;
           this.page.total = total;
         }
-      }).catch(error => {
+      } catch (error) {
+        console.log(error);
+      } finally {
         this.loading = false;
-      })
+      }
+
     },
     // 重置
     handelResetSearch() {
 
       console.log('重置');
-
-      for (const key in this.searchParams) {
-
-        this.searchParams[key] = '';
+      this.searchParams = {
+        ...initParams(SearchColumns),
       }
     },
     // 判断状态
@@ -194,7 +195,6 @@ export default {
     },
     // 新增、编辑授权信息
     handleOpenAddDialog(rows) {
-      console.log(rows, '授权信息');
       const { setVisible, setFormData } = this.$refs.addDialogRef;
       setFormData(rows);
       setVisible(true);
@@ -202,18 +202,59 @@ export default {
     },
     // 查看
     handleOpenSeeDialog(rows) {
-      console.log(rows, '编辑、查看');
       const { setVisible, setFormData } = this.$refs.seeDialogRef;
       setFormData(rows);
       setVisible(true);
     },
     // 删除
-    async handleDelDialog(rows) {
-      console.log(rows, '删除');
+    handleDelDialog(rows) {
       let { id } = rows;
+
+      this.$confirm('此操作将删除该条数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          this.loading = true;
+          let { code, msg } = await dealerApi.remove({ id });
+          if (code == 200) {
+            this.handleRefresh();
+          }
+        } catch (error) {
+          console.log(error);
+        } finally {
+          this.loading = false;
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+
+    },
+    // 提交OA
+    async handleSubmit(row) {
       try {
+        // name:工号   nickName:名字
+        const { name, nickName } = this.$store.state.user;
+
+        const { id, authorizedProductsCode,dealerName,authorizedProductsName,authorizedAreaName   } = row;
+
+        let data = {
+          authorizedProductsCode,
+          id,
+          createPerson: nickName,
+          createBy: name,
+          date: new Date().Format(),
+          dealerName,
+          authorizedProductsName,
+          authorizedAreaName
+        }
+
         this.loading = true;
-        let { code, msg } = await dealerApi.remove({ id });
+        let { code, msg } = await dealerApi.submitOA(data);
         if (code == 200) {
           this.handleRefresh();
         }
@@ -221,47 +262,48 @@ export default {
         console.log(error);
       } finally {
         this.loading = false;
-      }
-    },
-    // 提交
-    handleSubmit(row) {
 
-      console.log(row, '提交');
-      let params = {
-        id: '',
-        status: ''
       }
-      // try {
-      //   this.loading = true;
-      //   let { code, msg } = await dealerApi.submitOA();
-      //   if (code == 200) {
-      //     this.handleRefresh();
-      //   }
-      // } catch (error) {
-      //   console.log(error);
-      // } finally {
-      //   this.loading = false;
-
-      // }
 
 
 
     },
     // 下载
-    handleDownload() {
-      console.log('下载');
-      // try {
-      //   let { code, msg } = await dealerApi.download();
-      //   if (code == 200) {
-      //   }
-      // } catch (error) {
-      //   console.log(error);
-      // } finally {}
+    async handleDownload(row) {
+      console.log('下载', row);
+      try {
+        const { id, authorizedProductsCode, dealerName, authorizedAreaName, authorizedProductsName } = row;
+
+        const data = {
+          dealerName,
+          authorizedAreaName,
+          authorizedProductsName,
+          id,
+          authorizedProductsCode,
+        }
+
+        // await this.download('/dealer/download', data, `授权书${new Date().getTime()}.doc`);
+        let file = await dealerApi.download(data)
+        let blob = new Blob([file], {
+          type: `application/msword` //word文档为msword,pdf文档为pdf,msexcel 为excel
+        });
+        let objectUrl = URL.createObjectURL(blob);
+        let link = document.createElement("a");
+        let fname = `授权书.doc`; //下载文件的名字+后缀名
+        link.href = objectUrl;
+        link.setAttribute("download", fname);
+        document.body.appendChild(link);
+        link.click();
+
+      } catch (error) {
+        console.log(error);
+      } finally { }
     },
 
   },
   created() {
     this.handelSearch();
+    console.log(this.$store.state.user, 'this.$store.state.user');
   }
 
 }

+ 9 - 9
src/views/marketing/utils/date.js

@@ -5,18 +5,18 @@
 // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 
 // (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18 
 
-Date.prototype.Format = function (fmt) {
+Date.prototype.Format = function (fmt = 'yyyy-MM-dd HH:mm:ss') {
   var o = {
-      "M+": this.getMonth() + 1, //月份 
-      "d+": this.getDate(), //日 
-      "H+": this.getHours(), //小时 
-      "m+": this.getMinutes(), //分 
-      "s+": this.getSeconds(), //秒 
-      "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
-      "S": this.getMilliseconds() //毫秒 
+    "M+": this.getMonth() + 1, //月份 
+    "d+": this.getDate(), //日 
+    "H+": this.getHours(), //小时 
+    "m+": this.getMinutes(), //分 
+    "s+": this.getSeconds(), //秒 
+    "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+    "S": this.getMilliseconds() //毫秒 
   };
   if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
   for (var k in o)
-  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
   return fmt;
 }

+ 23 - 12
src/views/monitor/job/log.vue

@@ -145,13 +145,6 @@
         align="center"
         prop="nickName"
       />
- <el-table-column
-        label="任务员工编号"
-        width="80"
-        align="center"
-        prop="enpno"
-      />
-
       <el-table-column
         label="任务大类"
         width="80"
@@ -396,17 +389,35 @@ export default {
             const { executionTime, createTime, duration } = item;
 
             const durations=`${duration}h`;
+            let tqaaaa  = null;
 
-            const tqaaaa = (
+
+            if(executionTime != null){
+              tqaaaa = (
+                parseInt (
+                  new Date(executionTime).getTime() - new Date(createTime).getTime()
+                ) /
+                1000 /
+                60 /
+                60
+              ).toFixed(2);
+            }
+            
+
+            /** 用于计算超时时长 */
+             const calculateTime = (
               parseInt (
-                new Date(executionTime).getTime() - new Date(createTime).getTime()
+                new Date(executionTime == null ? Date(): executionTime).getTime() - new Date(createTime).getTime()
               ) /
               1000 /
               60 /
               60
-            ).toFixed(2)+'h';
-            const tqbbbb =
-              tqaaaa - duration > 0 ? `超时${tqaaaa - duration}h` : `未超时`;
+            ).toFixed(2);
+
+            /** 计算超时时长 */
+            const timestemp = (calculateTime - duration).toFixed(2)  ;
+
+            const tqbbbb = timestemp > 0 ? `超时 ${timestemp}h` : `未超时`;
 
             return {
               ...item,

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

@@ -1,7 +1,7 @@
 <template>
   <div id="checkDemandSummary">
     <el-card>
-      <span>采购需求汇总详情</span>
+      <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="small" @click="editLine">编辑</el-button>
         <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>

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

@@ -1,7 +1,7 @@
 <template>
   <div id="demandSummary">
     <div v-if="isList">
-      <el-form class="search_area" label-width="120px">
+      <el-form class="search_area" label-width="100px">
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="行状态">
@@ -32,16 +32,6 @@
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="生产厂家">
-              <el-input
-              v-model="queryParams.manufacturer"
-              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="search">搜索</el-button>
               <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
@@ -53,6 +43,16 @@
         <div v-show="expanded">
           <el-row :gutter="10">
             <el-col :span="1.5">
+              <el-form-item label="生产厂家">
+                <el-input
+                v-model="queryParams.manufacturer"
+                size="small"
+                clearable
+                style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="预测分类">
                 <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
                   <el-option
@@ -70,20 +70,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="业务部门">
-                <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
-                  <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="审核人">
-                <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
-                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
           </el-row>
 
           <el-row :gutter="10">
@@ -99,6 +85,20 @@
               </el-form-item>
             </el-col> -->
             <el-col :span="1.5">
+              <el-form-item label="业务部门">
+                <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
+                  <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="审核人">
+                <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="采购需求单号">
                 <el-input
                 v-model="queryParams.code"
@@ -109,6 +109,9 @@
                 />
               </el-form-item>
             </el-col>
+          </el-row>
+
+          <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="注册人">
                 <el-input
@@ -129,9 +132,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-          </el-row>
-
-          <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="单据来源">
                 <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
@@ -141,6 +141,9 @@
                 </el-select>
               </el-form-item>
             </el-col>
+          </el-row>
+
+          <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="需求客户">
                 <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
@@ -162,6 +165,18 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <!-- <el-col :span="1.5">
+              <el-form-item label="转请购时间">
+                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
+                  <el-option
+                    v-for="item in options"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
@@ -192,18 +207,6 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <!-- <el-col :span="1.5">
-              <el-form-item label="转请购时间">
-                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
@@ -267,6 +270,7 @@
           :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"/>
@@ -309,7 +313,6 @@
           <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="status"/>
           <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
@@ -326,7 +329,7 @@
           </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"/>
+          <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"/>
@@ -393,6 +396,40 @@ export default {
   },
   data() {
     return {
+      hangStatus(row) {
+        switch (row.status) {
+          case '0':
+            return '需补货'
+          case '1':
+            return '待采购确认'
+          case '2':
+            return '采购已确认'
+          case '3':
+            return '采购已审核'
+          case '4':
+            return '行关闭'
+          case '5':
+            return '总供应可满足'
+        }
+      },
+      formatterBusinessType(row) {
+        switch (row.businessType) {
+          case 'ZQBH':
+            return '周期备货'
+          case 'FXXQ':
+            return '分销需求'
+          case 'TSXQ':
+            return '特殊采购需求'
+          case 'BDXQ':
+            return '补单需求'
+          case 'JJXQ':
+            return '紧急需求单'
+          case 'XPXQ':
+            return '新品需求'
+          case 'HZBM':
+            return '合作部门需求'
+        }
+      },
       isUpdate: false,
       expanded: false,
       // 页面配置
@@ -434,9 +471,9 @@ export default {
       lastAllocationOptions: [],
       orgOptions: [],
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       referCondition: {
         type: '',

+ 8 - 60
src/views/purchase/MaterialClassDivision/add.vue

@@ -160,7 +160,7 @@
          <el-col :span="1.5">
             <el-form-item label="订单部门">
               <el-input
-                v-model="basicForm.orderDept"
+                v-model="basicForm.orderDeptName"
                 size="small"
                 disabled
                 style="width: 200px"
@@ -192,7 +192,7 @@
           <el-col :span="1.5">
             <el-form-item label="采购部门">
               <el-input
-                v-model="basicForm.puDept"
+                v-model="basicForm.puDeptName"
                 size="small"
                 disabled
                 style="width: 200px"
@@ -251,11 +251,6 @@
 
     <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
 
-    <staff2
-      ref="staff2"
-      @doSubmit="acceptStaff2"
-      :single="true"
-    />
   </div>
 </template>
 
@@ -271,16 +266,13 @@ import popDialog from '@/components/PopDialog/index.vue'
 import Refers from '@/components/Refers/refers.vue'
 // 用于回显参照框数据
 import { getRefer } from '@/api/purchase/basic.js'
-import staff2 from '@/components/PopDialog/staff.vue'
-// 所属组织,订单员用于回显
-import { getOrgs, getStaff} from '@/api/requisition/basic'
+
 export default {
   name: 'addDivision',
   components: {
     fourClass,
     popDialog,
     Refers,
-    staff2
   },
   props: ['pageStu','row', 'disable'],
   model: {
@@ -315,7 +307,9 @@ export default {
         remark: ''
       },
       options: [{
-        value: 0, label: '仓库1'
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
       }],
       referCondition: {
         type: '',
@@ -369,9 +363,6 @@ export default {
           if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
           if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
           if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
-          // this.getOrgDetails(res.data.org)
-          // this.getStaffDetails(res.data.orderPersonal)
-          // this.getStaffDetails2(res.data.buyer)
         }
       })
     },
@@ -399,7 +390,6 @@ export default {
     },
     selectionsToInput (selections) {
       console.log('父组件拿到的:', selections)
-      this.selectData = selections
       this.basicForm.material = selections[0].id
       this.basicForm.materialCode = selections[0].code
       this.basicForm.materialName = selections[0].name
@@ -433,9 +423,9 @@ export default {
         this.basicForm.buyerName = selection[0].name
       }
     },
-    // 回显参照框
+    // 回显参照框 加title解决判断重复提交问题
     reBackRefer(type, id, title) {
-      getRefer({ type: type, id: id }).then(res => {
+      getRefer({ type: type, id: id, title: title }).then(res => {
         if (type == 'ORG_PARAM') {
           this.organizationsOptions = res.rows
         }
@@ -447,48 +437,6 @@ export default {
         }
       })
     },
-    // 选择订单员
-    // acceptStaff (selections) {
-    //   this.staffOptions = selections
-    //   this.basicForm.orderPersonal = selections[0].code
-    //   this.basicForm.orderPersonalName = selections[0].name
-    //   this.getStaffDetails(selections[0].id)
-    // },
-    // // 订单员显示列表
-    // chooseStaff () {
-    //   this.$refs.staffs.blur()
-    //   this.$refs.staff.init()
-    // },
-    // // 订单员回显
-    // getStaffDetails(id) {
-    //   getStaff({id:id}).then(res => {
-    //     console.log('订单员', res)
-    //     if (res.code === 200 ) {
-    //       this.staffOptions = res.data.tableBody
-    //     }
-    //   })
-    // },
-    // 选择采购员
-    acceptStaff2 (selections) {
-      this.staff2Options = selections
-      this.basicForm.buyer = selections[0].code
-      this.basicForm.buyerName = selections[0].name
-      this.getStaffDetails2(selections[0].id)
-    },
-    // 采购员显示列表
-    chooseStaff2 () {
-      this.$refs.staffs2.blur()
-      this.$refs.staff2.init()
-    },
-    // 采购员回显
-    getStaffDetails2(id) {
-      getStaff({id:id}).then(res => {
-        console.log('采购员', res)
-        if (res.code === 200 ) {
-          this.staff2Options = res.data.tableBody
-        }
-      })
-    },
   }
 }
 </script>

+ 133 - 44
src/views/purchase/MaterialClassDivision/index.vue

@@ -45,8 +45,8 @@
           </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>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <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>
             </el-form-item>
           </el-col>
         </el-row>
@@ -76,14 +76,9 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类编码">
-              <el-select v-model="queryParams.materialClassifyFour" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input size="small" style="width: 200px" readonly v-model="queryParams.materialClassifyFour">
+                <el-button slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -101,49 +96,56 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-select v-model="queryParams.material" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input style="width: 200px" size="small" readonly v-model="queryParams.material">
+                  <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料名称">
-              <el-select v-model="queryParams.materialName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="订单员">
-              <el-select v-model="queryParams.orderPersonal" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.orderPersonal"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
+                >
+                  <el-option
+                    v-for="item in staffOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <el-select v-model="queryParams.buyer" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                  ref="staffs2"
+                  size="small"
+                  style="width: 200px"
+                  v-model="queryParams.buyer"
+                  clearable
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
+                >
+                  <el-option
+                    v-for="item in staff2Options"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.code"
+                  />
               </el-select>
             </el-form-item>
           </el-col>
@@ -197,12 +199,11 @@
               导出<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
+              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
               <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
 
-          <el-button type="primary" size="small">同步分配</el-button>
           <el-button type="primary" size="small">删除</el-button>
         </div>
         <el-table 
@@ -257,6 +258,20 @@
     </div>
 
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+  
+    <fourClass
+      ref="fourClass"
+      @doSubmit="acceptFourClass"
+      :single="true"
+    />
+
+    <popDialog
+      ref="contractSelect"
+      @doSubmit="selectionsToInput"
+      :single="true"
+    />
+
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
   </div>
 </template>
 
@@ -264,11 +279,19 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getDivisionList, delDivision} from '@/api/purchase/basic.js'
+// 物料分类
+import fourClass from '@/components/PopDialog/fourClass.vue'
+// 物料编码
+import popDialog from '@/components/PopDialog/index.vue'
+import Refers from '@/components/Refers/refers.vue'
 export default {
   name: 'MaterialClassDivision',
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    fourClass,
+    popDialog,
+    Refers
   },
   data() {
     return {
@@ -296,8 +319,17 @@ export default {
         pageSize: 5
       },
       options: [{
-        value: 0, label: '仓库1'
+        value: 'Y', label: '是',
+      }, {
+        value: 'N', label: '否'
       }],
+      staffOptions: [],
+      staff2Options: [],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -316,6 +348,30 @@ export default {
         }
       })
     },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        materialClassifyOne: '',
+        materialClassifyOneName: '',
+        materialClassifyTwo: '',
+        materialClassifyTwoName: '',
+        materialClassifyThree: '',
+        materialClassifyThreeName: '',
+        materialClassifyFour: '',
+        materialClassifyFourName: '',
+        material: '',
+        materialName: '',
+        orderPersonal: '',
+        buyer: '',
+        manufacturer: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     handleSelectionChange() {},
     handleCommand(command) {
       alert(command)
@@ -360,6 +416,39 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
+    },
+    // 物料分类显示列表
+    chooseFourClass() {
+      this.$refs.fourClass.init()
+    },
+    // 选择物料分类
+    acceptFourClass(selections) {
+      console.log('收到的四级分类', selections)
+      this.queryParams.materialClassifyFour = selections.code
+    },
+    // 显示物料编码列表
+    test01() {
+      this.$refs.contractSelect.init()
+    },
+    selectionsToInput(selections) {
+      this.queryParams.material = selections[0].code
+    },
+    // 选择默认采购组织
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.queryParams.orderPersonal = selection[0].code
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.queryParams.buyer = selection[0].code
+      }
     }
   }
 }

+ 67 - 126
src/views/purchase/PurchaseDemandList/add.vue

@@ -63,7 +63,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-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
             </el-form-item>
           </el-col>
@@ -85,7 +85,7 @@
             <el-form-item label="需求日期">
               <el-date-picker
                 v-model="basicForm.demandDate"
-                disabled
+                :disabled="sonDisable"
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -104,22 +104,6 @@
             </el-form-item>
          </el-col>
 
-          <el-col :span="1.5">
-            <el-form-item label="供应仓库">
-              <el-select size="small" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
-                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-         </el-col>
-
-         <el-col :span="1.5">
-            <el-form-item label="供应货位">
-              <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="sonDisable" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
-                <el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-
          <el-col :span="1.5">
             <el-form-item label="业务类型">
               <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
@@ -151,20 +135,9 @@
          </el-col> -->
 
           <el-col :span="1.5">
-            <el-form-item label="是否月销量计算">
-              <el-input
-                v-model="basicForm.isMonthleyCalculate"
-                size="small"
-                disabled
-                style="width: 200px"
-              />
-            </el-form-item>
-         </el-col>
-
-          <el-col :span="1.5">
             <el-form-item label="备注">
               <el-input
-                v-model="basicForm.remark"
+                v-model.trim="basicForm.remark"
                 size="small"
                 :disabled="sonDisable"
                 clearable
@@ -191,24 +164,11 @@
         >
           <el-table-column type="selection"/>
           <el-table-column label="序号" type="index" align="center"/>
-          <el-table-column label="行状态" align="center" prop="status" />
+          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus"/>
           <el-table-column label="行号" align="center" prop="rowNo" />
-          <el-table-column label="业务部门名称" align="center" width="180px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.businessDeptName"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column label="业务部门" align="center" width="180px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.businessDept">
-                <!-- <el-button :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'DEPT_PARAM', true, '选择部门')"></el-button> -->
-                </el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <!-- <el-table-column label="业务部门名称" align="center" width="180px"/> -->
+          <!-- <el-table-column label="业务部门" align="center" width="180px"/> -->
+          <el-table-column label="需求客户" align="center"  prop="customerName"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -367,15 +327,6 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="末级供应仓库" align="center"  prop="lastWarehouseName" width="200px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.lastWarehouseName">
-                  <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="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -385,25 +336,18 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="末级供应货位" align="center"  prop="lastAllocationName" width="200px">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.lastAllocationName">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择末级供应货位')"></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="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input readonly size="small" v-model="scope.row.deliveryAllocationName">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位')"></el-button>
+                  <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">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -420,13 +364,7 @@
           </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">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.lastStockQty"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
+          <!-- <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"/>
@@ -453,10 +391,10 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierCode" width="200px">
+          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -471,13 +409,6 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="需求客户" align="center"  prop="customer">
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input v-model="scope.row.customer"/>
-              </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="updateTime" width="200px"></el-table-column>
           <el-table-column label="调拨单号" align="center"  prop="allotCode"></el-table-column>
@@ -526,7 +457,7 @@
         <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == '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="sonPageStu == 'check'">提交</el-button>
+        <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button size="small" plain @click="back">返回</el-button>
@@ -584,9 +515,7 @@ export default {
         demandPersonal: '',
         demandDept: '',
         demandDate: '',
-        source: '1',
-        warehouse: '',
-        goodsAllocation: '',
+        source: '4',
         billType: '',
         isSpeical: '',
         isProcess: '',
@@ -595,30 +524,27 @@ export default {
         puDemandItemList: []
       },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
       basicRules: {},
       tableList: [],
       referCondition: {
-        type: 'ORG_PARAM',
+        type: '',
         isPage: true,
-        title: '选择组织',
-        pkOrg: '',
+        title: '',
       },
       referConditionMx: {
-        type: 'DEPT_PARAM',
+        type: '',
         isPage: true,
-        title: '选择部门'
+        title: '',
       },
       tableIndex: null,
       orgOptions: [],
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
-      houseOptions: [],
-      goodsOptions: []
     }
   },
   created() {
@@ -630,6 +556,22 @@ export default {
     }
   },
   methods: {
+    hangStatus(row) {
+      switch (row.status) {
+        case '0':
+          return '需补货'
+        case '1':
+          return '待采购确认'
+        case '2':
+          return '采购已确认'
+        case '3':
+          return '采购已审核'
+        case '4':
+          return '行关闭'
+        case '5':
+          return '总供应可满足'
+      }
+    },
     copy() {
       this.$modal.msgSuccess("复制成功");
       this.sonPageStu = 'add'
@@ -690,6 +632,8 @@ export default {
         status: null,
         businessDept: null,
         businessDeptName: null,
+        customer: this.basicForm.customer,
+        customerName: this.basicForm.customerName,
         materialCategory: null,
         buyer: null,
         buyerName: null,
@@ -753,7 +697,7 @@ export default {
         availableQty: null,
         statusAllot: 'N',
         additionalSupplier: null,
-        additionalSupplierCode: null,
+        additionalSupplierName: null,
         periodUnit: null,
         demandCustomer: null,
         demandCustomerName: null,
@@ -784,6 +728,8 @@ export default {
         delFlag: null,
         // 新增字段
         model: null,
+        storageCondition: null,
+        transportationCondition: null,
       }
       this.basicForm.puDemandItemList.push(newLine)
     },
@@ -818,10 +764,8 @@ export default {
               if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
               if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
-              if(this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
-              if(this.basicForm.goodsAllocation) { this.reBackRefer('ALLOCATION_PARAM', this.basicForm.goodsAllocation) }
+              // 详情时将收货仓库id赋值给stordocId
             }
-            console.log('111')
           })
         }
       })
@@ -850,20 +794,12 @@ export default {
         if (type == 'DEPT_PARAM') {
           this.deptOptions = res.rows
         }
-        if (type == 'WAREHOUSE_PARAM') {
-          this.houseOptions = res.rows
-        }
-        if (type == 'ALLOCATION_PARAM') {
-          this.goodsOptions = res.rows
-        }
       })
     },
     chooseOrg(type, isPage, title) {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
-      // 选择货位时要传入组织id
-      this.referCondition.pkOrg = this.basicForm.org
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
@@ -886,34 +822,21 @@ export default {
         this.deptOptions = selection
         this.basicForm.demandDept = selection[0].id
       }
-      if(this.referCondition.type == 'WAREHOUSE_PARAM') {
-        this.houseOptions = selection
-        this.basicForm.warehouse = selection[0].id
-      }
-      if(this.referCondition.type == 'ALLOCATION_PARAM') {
-        this.goodsOptions = selection
-        this.basicForm.goodsAllocation = selection[0].id
-      }
       // if(this.referConditionMx.type == 'DEPT_PARAM') {
       //   this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].code
       //   this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].name
       // }
-      if(this.referConditionMx.title == '选择末级供应仓库') {
-        this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = selection[0].name
-      }
       if(this.referConditionMx.title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
         this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
       }
-      if(this.referConditionMx.title == '选择末级供应货位') {
-        this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = selection[0].name
-      }
       if(this.referConditionMx.title == '选择收货货位') {
-        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].code
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierCode = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
@@ -927,7 +850,8 @@ export default {
     chooseMaterial(index) {
       console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
       this.tableIndex = index
-      this.$refs.materialRefer.init()
+      // 传0只展示同步NC了的物料
+      this.$refs.materialRefer.init(0)
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
@@ -963,6 +887,9 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
       this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
       this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
+      // 物料存储条件和运输条件
+      this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
+      this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
     },
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {
@@ -971,6 +898,20 @@ export default {
       this.referConditionMx.isPage = isPage
       this.referConditionMx.title = title
       this.$refs.refer.init(this.referConditionMx)
+    },
+    // 明细行选择业务部门参照带出业务部门数据
+    choosehuoWei(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referConditionMx.type = type
+      this.referConditionMx.isPage = isPage
+      this.referConditionMx.title = title
+      // 选择收货货位前先选择收货仓库
+      if(stordocId) {
+        this.referConditionMx.stordocId = stordocId
+        this.$refs.refer.init(this.referConditionMx)
+      } else {
+        this.$modal.msgWarning("请先选择收货仓库");
+      }
     }
   }
 }

+ 20 - 46
src/views/purchase/PurchaseDemandList/index.vue

@@ -1,34 +1,28 @@
 <template>
   <div id="PurchaseDemandList">
     <div v-if="isList">
-      <el-form class="search_area" label-width="120px">
+      <el-form class="search_area" label-width="100px">
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="单据编码">
               <el-input
-                v-model="queryParams.code"
+                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="供应仓库">
-              <el-select size="small" v-model="queryParams.warehouse" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
-                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-select clearable size="small" v-model="queryParams.customer" @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>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
                 <el-option
                   v-for="item in options"
                   :key="item.value"
@@ -50,40 +44,33 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="需求人员">
-              <el-select size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+              <el-select clearable size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
                 <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="供应货位">
-              <el-select size="small" v-model="queryParams.goodsAllocation" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
-                <el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="单据来源">
-              <el-select v-model="queryParams.source" size="small" style="width: 200px">
+              <el-select clearable v-model="queryParams.source" size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
-        </el-row>
-
-        <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="queryParams.billType" size="small" style="width: 200px">
+              <el-select clearable v-model="queryParams.billType" 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>
             </el-form-item>
           </el-col>
+        </el-row>
+
+        <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select clearable v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -98,6 +85,7 @@
               <el-date-picker
                 v-model="queryParams.demandDate"
                 type="date"
+                clearable
                 value-format="yyyy-MM-dd"
                 size="small"
                 style="width: 200px"
@@ -108,7 +96,7 @@
           <el-col :span="1.5">
             <el-form-item label="备注">
             <el-input
-              v-model="queryParams.remark"
+              v-model.trim="queryParams.remark"
               size="small"
               clearable
               style="width: 200px"
@@ -196,7 +184,7 @@
     </div>
 
     <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
+    <el-dialog title="数据导入" :visible.sync="upload.open" width="400px">
       <el-upload
       ref="upload"
       :limit="1"
@@ -214,9 +202,9 @@
         将文件拖到此处,或
         <em>点击上传</em>
       </div>
-      <div class="el-upload__tip" slot="tip">
+      <!-- <div class="el-upload__tip" slot="tip">
         <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
-      </div>
+      </div> -->
       <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -253,7 +241,7 @@ export default {
         // 是否显示弹出层(导入)
         open: false,
         // 弹出层标题(导入)
-        title: "",
+        title: "数据导入",
         // 是否禁用上传
         isUploading: false,
         // 是否更新已经存在的用户数据
@@ -271,11 +259,9 @@ export default {
       page: '',
       queryParams: {
         code: '',
-        warehouse: '',
         customer: '',
         isProcess: '',
         demandPersonal: '',
-        goodsAllocation: '',
         source: '',
         billType: '',
         demandDept: '',
@@ -290,14 +276,12 @@ export default {
         title: ''
       },
       options: [{
-        value: '0', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '2', label: '否'
+        value: 'N', label: '否'
       }],
-      houseOptions: [],
       customerOptions: [],
       personOptions: [],
-      goodsOptions: [],
       deptOptions: [],
       tableList: [],
       total: 0,
@@ -359,11 +343,9 @@ export default {
     resetList() {
       this.queryParams = {
         code: '',
-        warehouse: '',
         customer: '',
         isProcess: '',
         demandPersonal: '',
-        goodsAllocation: '',
         source: '',
         billType: '',
         demandDept: '',
@@ -538,10 +520,6 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
-        this.houseOptions = selection
-        this.queryParams.warehouse = selection[0].id
-      }
       if (this.referCondition.type == 'CUSTOMER_PARAM') {
         this.customerOptions = selection
         this.queryParams.customer = selection[0].id
@@ -550,10 +528,6 @@ export default {
         this.personOptions = selection
         this.queryParams.demandPersonal = selection[0].id
       }
-      if (this.referCondition.type == 'ALLOCATION_PARAM') {
-        this.goodsOptions = selection
-        this.queryParams.goodsAllocation = selection[0].id
-      }
       if (this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
         this.queryParams.demandDept = selection[0].id

+ 70 - 202
src/views/purchase/apply/add/index.vue

@@ -13,7 +13,7 @@ export default {
   name: "AddDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -64,7 +64,7 @@ export default {
         this.loading = true;
         this.params.code = await generateCode();
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -109,7 +109,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
@@ -118,161 +118,70 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  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
-      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="
+  <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
-            >
+            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
             <el-button :size="size" type="info" @click="handleSubmit">
               新 增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <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-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <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-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]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </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%"
-              >
+              <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>
+                  <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.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 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
-              >
+              <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>
@@ -285,83 +194,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-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 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.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-input-dialog
-                    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-input-dialog>
-                  <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>
+                    {{ 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 @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -370,9 +240,7 @@ 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 :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 23 - 17
src/views/purchase/apply/column.js

@@ -6,27 +6,11 @@ export const TableColumns = [
   {
     key: "supplierName",
     title: "供应商名称",
-    search: true,
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
   },
   { key: "puOrg", title: "采购组织" },
   {
     key: "puOrgName",
     title: "采购组织名称",
-    search: true,
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
-    },
   },
   { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
@@ -47,4 +31,26 @@ export const TableColumns = [
   { key: "delFlag", title: "删除标记" },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+export const SearchColumns = [
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    valueKey: "code",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+  },
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+  },
+];

+ 72 - 204
src/views/purchase/apply/edit/index.vue

@@ -17,7 +17,7 @@ export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -68,7 +68,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -85,7 +85,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -131,168 +131,77 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
     },
-    beforeOpen(){},
+    beforeOpen() { },
   },
   created() {
     console.log("ADD CREATED");
   },
-  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
-      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="
+  <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
-            >
+            <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-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-input-dialog
-                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-input-dialog>
-              <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-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%"
-              >
+              <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>
+                  <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.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 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
-              >
+              <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>
@@ -305,83 +214,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-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 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.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-input-dialog
-                    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-input-dialog>
-                  <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>
+                    {{ 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 @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -390,9 +260,7 @@ 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 :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 52 - 35
src/views/purchase/apply/index.vue

@@ -1,13 +1,13 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { list, remove } from "@/api/business/purchase/apply";
+import { LIST, remove } from "@/api/business/purchase/apply";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
   components: {
-    AddDrawer: () => import("./add/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    EditDrawer: () => import("./edit/index.vue"),
+    // AddDrawer: () => import("./add/index.vue"),
+    // SeeDrawer: () => import("./see/index.vue"),
+    // EditDrawer: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -24,18 +24,18 @@ export default {
   },
   computed: {},
   created() {
-    this.handleQueryList();
+    this.handleQueryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
-          ...params,
+          ...prop,
         });
         if (code === 200) {
           this.tableData = rows;
@@ -45,7 +45,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -55,10 +55,10 @@ export default {
       this.fetchList(this.params, this.page);
     },
     // 重置操作
-    handleResetList() {
+    handleResetList(prop, page) {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(prop, page);
     },
     // 删除操作
     async handleDeleteList(prop) {
@@ -68,12 +68,12 @@ export default {
         const { code, msg } = await remove(id);
         if (code === 200) {
           this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
+          this.handleQueryList(this.params, this.page);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -81,12 +81,12 @@ export default {
     // 页大小变
     handleSizeChange(prop) {
       this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 当前页变
     handleCurrentChange(prop) {
       this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      this.handleQueryList(this.params, this.page);
     },
     // 打开新增drawer
     handleOpenAddDrawer() {
@@ -118,40 +118,57 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
-    <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
-    <el-form :size="size" label-position="top" :model="params">
-      <el-row :gutter="24" style="padding: 0 20px">
+    <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
+    <!-- <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer> -->
+    <!-- <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer> -->
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="75px"
+      label-position="right"
+    >
+      <el-row :gutter="24" style="padding: 20px 20px">
         <el-col
           v-for="column in searchColumns"
           :key="column.title"
           :xl="4"
-          :lg="4"
+          :lg="6"
           :md="8"
           :sm="12"
           :xs="24"
         >
-          <el-form-item :prop="column.key" :label="column.title">
-            <el-input
+          <el-form-item
+            v-if="column.inputType === 'PopoverSelect'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <dr-popover-select
               v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :value-key="column.valueKey"
               :placeholder="column.placeholder"
-            ></el-input>
+            >
+            </dr-popover-select>
           </el-form-item>
         </el-col>
-        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </el-col>
+        <el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-search"
+            @click="handleQueryList(params, page)"
+          ></el-button>
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-refresh"
+            @click="handleResetList(params, page)"
+          ></el-button>
+        </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="24">
-        <el-button :size="size" icon="el-icon-search" @click="handleQueryList"
-          >搜索</el-button
-        >
-        <el-button :size="size" icon="el-icon-refresh" @click="handleResetList"
-          >重置</el-button
-        >
-      </el-col>
-    </el-row>
     <el-table
       @row-dblclick="handleOpenSeeDrawer"
       :data="tableData"

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

@@ -63,7 +63,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -80,7 +80,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 70 - 202
src/views/purchase/catalogue/add/index.vue

@@ -13,7 +13,7 @@ export default {
   name: "AddDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -64,7 +64,7 @@ export default {
         this.loading = true;
         this.params.code = await generateCode();
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -109,7 +109,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
@@ -118,161 +118,70 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  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
-      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="
+  <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
-            >
+            <el-button :size="size" type="danger" @click="handleSava">保 存</el-button>
             <el-button :size="size" type="info" @click="handleSubmit">
               新 增
             </el-button>
           </div>
         </div>
         <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
-          >
+          <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-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <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-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]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping" :source.sync="params">
+              </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%"
-              >
+              <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>
+                  <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.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 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
-              >
+              <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>
@@ -285,83 +194,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-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 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.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-input-dialog
-                    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-input-dialog>
-                  <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>
+                    {{ 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 @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -370,9 +240,7 @@ 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 :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 71 - 203
src/views/purchase/catalogue/edit/index.vue

@@ -17,7 +17,7 @@ export default {
   name: "EditDrawer",
   dicts: initDicts(NewColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+   
   },
   data() {
     return {
@@ -68,7 +68,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -85,7 +85,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -131,7 +131,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
@@ -140,158 +140,67 @@ export default {
   created() {
     console.log("ADD CREATED");
   },
-  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
-      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="
+  <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
-            >
+            <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-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-input-dialog
-                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-input-dialog>
-              <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-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%"
-              >
+              <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>
+                  <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.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 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
-              >
+              <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>
@@ -304,83 +213,44 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-          position: 'relative',
-        }"
-        style="margin: 10px"
-      >
+      <el-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 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.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-input-dialog
-                    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-input-dialog>
-                  <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>
+                    {{ 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 @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
                     删行
                   </el-button>
                 </template>
@@ -389,9 +259,7 @@ 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 :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

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

@@ -45,7 +45,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -73,7 +73,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

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

@@ -63,7 +63,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -80,7 +80,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 0 - 514
src/views/purchase/contract/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" },
-    ],
-  },
-];

+ 213 - 263
src/views/purchase/contract/add/index.vue

@@ -1,29 +1,28 @@
 <script>
-import { Columns, TabColumns } from "./column";
-import { add, generateCode } 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),
-}));
+import { Columns, TabColumns } from "../column";
+import { ADD, CODE } from "@/api/business/purchase/contract";
+import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
-  name: "AddDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  name: "AddDialog",
+  dicts: Array.from(
+    new Set([
+      ...initDicts(Columns),
+      ...initDicts(TabColumns.map((item) => item.tableColumns))
+        .flat()
+        .filter((cItem) => cItem.inputType === "Select"),
+    ])
+  ),
+  components: {},
   data() {
     return {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
+      rules: initRules(Columns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
@@ -31,270 +30,202 @@ export default {
         contractApplyOrgList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = TabColumns.filter((element) =>
         newProp === "1" ? element.key !== "contractItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
     },
   },
   methods: {
-    beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
-        this.$store.state.user;
-      this.params.puOrg = orgId;
-      this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
-      this.params.puDept = deptId;
-      this.params.puDeptName = deptName;
+    open() {
+      const {
+        deptId: puDept,
+        deptName: puDeptName,
+        id: buyer,
+        name: buyerName,
+        orgId: puOrg,
+        orgName: puOrgName,
+      } = this.$store.state.user;
+      this.params.puOrg = puOrg;
+      this.params.puOrgName = puOrgName;
+      this.params.buyer = buyer;
+      this.params.buyerName = buyerName;
+      this.params.puDept = puDept;
+      this.params.puDeptName = puDeptName;
       this.fetchCode();
+      this.visible = true;
     },
-    setVisible(prop) {
-      this.visible = prop;
+    hide() {
+      this.visible = false;
+      this.params = initParams(this.columns);
+      this.tabName = this.tabColumns[0].key;
     },
     async fetchCode() {
       try {
         this.loading = true;
-        this.params.code = await generateCode();
+        const code = await CODE();
+        this.params.code = code;
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    addTableRow(prop) {
+    addRow(prop) {
       const arr = this.tabColumns.find(
         (element) => element.key === this.tabName
       ).tableColumns;
-      console.log("arr", arr);
-      prop.push(initParams(arr, "key", "value"));
+      prop.push(initParams(arr));
     },
-    delTableRow(prop, index) {
+    deleteRow(prop, index) {
       prop.splice(index, 1);
     },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
+    cancel() {
+      this.hide();
     },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
+    sava() {
+      this.visible = 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 add({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
+    submit(prop) {
+      this.$refs[prop].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 ADD({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.cancel();
+              this.$emit("submit-success");
+              this.$notify.success({ title: msg });
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            //
+          } finally {
+            // this.hide();
+          }
         } 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);
-      }
+      });
     },
   },
-  created() {
-    console.log("ADD CREATED");
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
+  <el-dialog :visible.sync="visible" title="新增" fullscreen @close="hide">
     <el-form
+      ref="ruleForm"
       v-loading="loading"
       :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
       :rules="rules"
+      :model="params"
+      label-width="auto"
+      label-position="right"
     >
-      <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;
-          "
+      <el-row>
+        <el-col
+          v-for="(column, index) in columns"
+          :key="index"
+          :span="column.span || 8"
         >
-          <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
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-if="column.inputType === 'Input'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :disabled="column.disabled"
+              :readonly="column.readonly"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
             >
-            <el-button :size="size" type="info" @click="handleSubmit">
-              新 增
-            </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-input-dialog
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :title="column.title"
-                :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping"
-                :source.sync="params"
-              >
-              </dr-input-dialog>
-              <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
+            </dr-popover-select>
+            <el-input
+              v-if="column.inputType === 'Textarea'"
+              v-model="params[column.key]"
+              type="textarea"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <el-input-number
+              v-if="column.inputType === 'InputNumber'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :controls-position="column.controlsPosition"
+              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"
               >
-                <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-option>
+            </el-select>
+            <el-date-picker
+              v-if="column.inputType === 'DatePicker'"
+              v-model="params[column.key]"
+              :type="column.type"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :picker-options="column.pickerOptions"
+              style="width: 100%"
+            >
+            </el-date-picker>
+            <file-upload
+              v-if="column.inputType === 'Upload'"
+              v-model="params[column.key]"
+              :file-type="column.fileType"
+            ></file-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label-width="0">
+        <el-tabs v-model="tabName" tab-position="left" style="width: 100%">
           <el-tab-pane
             v-for="(column, index) in tabColumns"
             :key="index"
@@ -315,49 +246,68 @@ export default {
                 :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-if="cColumn.inputType === 'Input'"
                     v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
                     :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
+                  <dr-popover-select
+                    v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
+                    :size="size"
                     :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
                     :source.sync="scope.row"
-                    :size="size"
+                    :type="cColumn.referName"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping"
                   >
-                  </dr-input-dialog>
+                  </dr-popover-select>
                   <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
+                    v-else-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"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
                     style="width: 100%"
                   ></el-input-number>
+                  <el-select
+                    v-else-if="cColumn.inputType === 'Select'"
+                    v-model="scope.row[cColumn.key]"
+                    :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>
+                  <span v-else> {{ scope.row[cColumn.key] }}</span>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
+                <template slot="header" slot-scope="scope">
+                  <el-button :size="size" @click="addRow(params[tabName])">
+                    增 行
+                  </el-button>
+                </template>
                 <template slot-scope="scope">
                   <el-button
                     @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
+                      deleteRow(params[tabName], scope.$index)
                     "
                     type="text"
                     size="small"
@@ -369,12 +319,12 @@ export default {
             </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-item>
+      <el-form-item label-width="0" style="text-align: right">
+        <el-button :size="size" @click="cancel">取 消</el-button>
+        <el-button :size="size" @click="sava">保 存</el-button>
+        <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
+      </el-form-item>
     </el-form>
-  </el-drawer>
+  </el-dialog>
 </template>

+ 478 - 62
src/views/purchase/contract/column.js

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

+ 197 - 252
src/views/purchase/contract/edit/index.vue

@@ -1,83 +1,83 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
+import { Columns, TabColumns } from "../column";
 import {
-  edit,
-  item,
-  itemTableList,
+  EDIT,
+  ITEM,
+  TABLELIST,
+  TABLEROMOVE,
 } 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),
-}));
+import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
-  name: "EditDrawer",
-  dicts: initDicts(NewColumns),
-  components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  name: "EditDialog",
+  dicts: Array.from(
+    new Set([
+      ...initDicts(Columns),
+      ...initDicts(TabColumns.map((item) => item.tableColumns))
+        .flat()
+        .filter((cItem) => cItem.inputType === "Select"),
+    ])
+  ),
   data() {
     return {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
+      rules: initRules(Columns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
-        contractAgreementList: [],
         contractApplyOrgList: [],
+        contractAgreementList: [],
       },
-
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       tabName: "contractItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = TabColumns.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;
+    open(prop) {
+      this.visible = true;
+      this.fetchItem(prop);
+    },
+    hide() {
+      this.visible = false;
+      this.params = initParams(Columns);
+      this.tabName = this.tabColumns[0].key;
     },
-    // 查询详细
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await item(prop);
+        const { code, msg, 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) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    // 查询详情关联TABLE
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
+        const { code, msg, rows } = await TABLELIST({ contractId: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
           this.$notify.success({ title: msg });
@@ -85,39 +85,40 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    // 新增行
-    addTableRow(prop) {
+    addRow(prop) {
       const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
+        (element) => element.key === prop
       ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
-    },
-    // 删除行
-    delTableRow(prop, index) {
-      prop.splice(index, 1);
+      this.params[prop].push(initParams(arr));
     },
-    // 取消
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
-    },
-    // 保存
-    handleSava() {
-      this.setVisible(false);
+    async deleteRow(prop, { row: { id }, $index }) {
+      try {
+        this.loading = true;
+        const { code, msg } = await TABLEROMOVE(id, prop);
+        if (code === 200) {
+          this.params[prop].splice($index, 1);
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        //
+      } finally {
+        this.loading = false;
+      }
     },
-    // 保存并新增
-    async handleSubmit() {
+    async submit() {
       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({
+        const { code, msg } = await EDIT({
           createById,
           createByName,
           updateById,
@@ -125,195 +126,123 @@ export default {
           ...this.params,
         });
         if (code === 200) {
+          this.hide();
+          this.$emit("submit-success");
           this.$notify.success({ title: msg });
-          this.setVisible(false);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
     },
   },
-  created() {
-    console.log("ADD CREATED");
-  },
+  created() {},
   mounted() {},
   destroyed() {},
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-    @close="$emit('close')"
-  >
+  <el-dialog :visible.sync="visible" title="编辑" fullscreen @close="hide">
     <el-form
+      ref="ruleForm"
       v-loading="loading"
       :size="size"
-      label-position="right"
-      label-width="135px"
-      :model="params"
       :rules="rules"
+      :model="params"
+      label-width="auto"
+      label-position="right"
     >
-      <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;
-          "
+      <el-row>
+        <el-col
+          v-for="(column, index) in columns"
+          :key="index"
+          :span="column.span || 8"
         >
-          <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
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-if="column.inputType === 'Input'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :disabled="column.disabled"
+              :readonly="column.readonly"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
             >
-          </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-input-dialog
-                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-input-dialog>
-              <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
+            </dr-popover-select>
+            <el-input
+              v-if="column.inputType === 'Textarea'"
+              v-model="params[column.key]"
+              type="textarea"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            ></el-input>
+            <el-input-number
+              v-if="column.inputType === 'InputNumber'"
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :controls-position="column.controlsPosition"
+              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"
               >
-                <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-option>
+            </el-select>
+            <el-date-picker
+              v-if="column.inputType === 'DatePicker'"
+              v-model="params[column.key]"
+              :type="column.type"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              :picker-options="column.pickerOptions"
+              style="width: 100%"
+            >
+            </el-date-picker>
+            <file-upload
+              v-if="column.inputType === 'Upload'"
+              v-model="params[column.key]"
+              :file-type="column.fileType"
+            ></file-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-form-item label-width="0">
+        <el-tabs
+          v-model="tabName"
+          tab-position="left"
+          style="width: 100%"
+          @tab-click="fetchTable(params.code, tabName)"
+        >
           <el-tab-pane
             v-for="(column, index) in tabColumns"
             :key="index"
@@ -334,50 +263,67 @@ export default {
                 :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-if="cColumn.inputType === 'Input'"
                     v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
                     :size="size"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
-                  <dr-input-dialog
-                    v-if="cColumn.type === 'InputDialog'"
+                  <dr-popover-select
+                    v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    :readonly="cColumn.readonly"
+                    :size="size"
                     :title="cColumn.title"
-                    :type="cColumn.config.componentName"
-                    :data-mapping="cColumn.config.dataMapping"
                     :source.sync="scope.row"
-                    :size="size"
+                    :type="cColumn.referName"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping"
                   >
-                  </dr-input-dialog>
+                  </dr-popover-select>
                   <el-input-number
-                    v-if="cColumn.type === 'InputNumber'"
+                    v-else-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"
+                    :disabled="cColumn.disabled"
+                    :clearable="cColumn.clearable"
+                    :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
                     style="width: 100%"
                   ></el-input-number>
+                  <el-select
+                    v-else-if="cColumn.inputType === 'Select'"
+                    v-model="scope.row[cColumn.key]"
+                    :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>
+                  <span v-else> {{ scope.row[cColumn.key] }}</span>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">
+                <template slot="header" slot-scope="scope">
+                  <el-button :size="size" @click="addRow(tabName)">
+                    增 行
+                  </el-button>
+                </template>
                 <template slot-scope="scope">
                   <el-button
-                    @click.native.prevent="
-                      delTableRow(params[tabName], scope.$index)
-                    "
+                    @click.native.prevent="deleteRow(tabName, scope)"
                     type="text"
                     size="small"
                   >
@@ -388,12 +334,11 @@ export default {
             </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-item>
+      <el-form-item label-width="0" style="text-align: right">
+        <el-button :size="size" @click="hide">取 消</el-button>
+        <el-button :size="size" @click="submit('ruleForm')"> 更 新 </el-button>
+      </el-form-item>
     </el-form>
-  </el-drawer>
+  </el-dialog>
 </template>

+ 53 - 67
src/views/purchase/contract/index.vue

@@ -1,13 +1,13 @@
 <script>
-import { TableColumns, SearchColumns } from "./column";
-import { list, remove } from "@/api/business/purchase/catalogue";
+import { Columns as TableColumns, SearchColumns } from "./column";
+import { LIST, REMOVE } from "@/api/business/purchase/contract";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
   name: "PuchaseContract",
   components: {
-    AddDrawer: () => import("./add/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    EditDrawer: () => import("./edit/index.vue"),
+    AddDialog: () => import("./add/index.vue"),
+    SeeDialog: () => import("./see/index.vue"),
+    EditDialog: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -24,18 +24,18 @@ export default {
   },
   computed: {},
   created() {
-    this.handleQueryList();
+    this.queryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
-          ...params,
+          ...prop,
         });
         if (code === 200) {
           this.tableData = rows;
@@ -45,72 +45,65 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
     // 查询操作
-    handleQueryList() {
-      this.fetchList(this.params, this.page);
+    queryList(prop, page) {
+      this.fetchList(prop, page);
     },
     // 重置操作
-    handleResetList() {
+    resetList() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
-      this.fetchList(this.params, this.page);
-    },
-    // 刷新操作
-    handleRefreshList() {
-      this.fetchList(this.params, this.page);
+      this.queryList(this.params, this.page);
     },
     // 删除操作
-    async handleDeleteList(prop) {
+    async deleteList(prop) {
       try {
         this.loading = true;
         const { id } = prop;
-        const { code, msg } = await remove(id);
+        const { code, msg } = await REMOVE(id);
         if (code === 200) {
           this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
+          this.queryList(this.params, this.page);
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
     // 页大小变
-    handleSizeChange(prop) {
+    sizeChange(prop) {
       this.page.pageSize = prop;
-      this.fetchList(this.params, this.page);
+      this.queryList(this.params, this.page);
     },
     // 当前页变
-    handleCurrentChange(prop) {
+    currentChange(prop) {
       this.page.pageNum = prop;
-      this.fetchList(this.params, this.page);
+      this.queryList(this.params, this.page);
     },
     // 打开新增drawer
-    handleOpenAddDrawer() {
-      console.log(this.$refs.AddDrawerFef);
-      const { setVisible } = this.$refs.AddDrawerFef;
-      setVisible(true);
+    async openAddDialog() {
+      const { open } = this.$refs.AddDialog;
+      await open();
     },
     // 打开查看drawer
-    async handleOpenSeeDrawer(prop) {
+    async openSeeDialog(prop) {
       const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
-      await setVisible(true);
-      await fetchItem(id);
+      const { open } = this.$refs.SeeDialog;
+      await open(id);
     },
     // 打开编辑drawer
-    async handleOpenEditDrawer(prop) {
+    async openEditDialog(prop) {
       const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
-      await setVisible(true);
-      await fetchItem(id);
+      const { open } = this.$refs.EditDialog;
+      await open(id);
     },
   },
 };
@@ -122,20 +115,20 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
-    <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
+    <see-dialog ref="SeeDialog"></see-dialog>
+    <add-dialog ref="AddDialog" @submit-success="resetList"></add-dialog>
+    <edit-dialog ref="EditDialog" @submit-success="resetList"></edit-dialog>
     <el-form
       :size="size"
-      label-position="right"
-      label-width="85px"
       :model="params"
+      label-width="75px"
+      label-position="right"
     >
-      <el-row :gutter="24">
+      <el-row :gutter="24" style="padding: 20px 20px">
         <el-col
           v-for="column in searchColumns"
           :key="column.title"
-          :xl="6"
+          :xl="4"
           :lg="6"
           :md="8"
           :sm="12"
@@ -148,43 +141,29 @@ export default {
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+        <el-col :xl="4" :lg="6" :md="8" :sm="12" :xs="24">
           <el-button
             circle
             :size="size"
             icon="el-icon-search"
-            @click="handleQueryList"
+            @click="queryList(params, page)"
           ></el-button>
           <el-button
             circle
             :size="size"
             icon="el-icon-refresh"
-            @click="handleResetList"
+            @click="resetList"
           ></el-button>
         </el-col>
       </el-row>
     </el-form>
     <el-row :gutter="24" style="padding: 0 20px">
       <el-col :span="6">
-        <el-button
-          :size="size"
-          type="danger"
-          icon="el-icon-plus"
-          @click="handleOpenAddDrawer"
-        >
-          新增
-        </el-button>
-        <el-button
-          :size="size"
-          icon="el-icon-refresh-right"
-          @click="handleRefreshList"
-        >
-          刷新
-        </el-button>
+        <el-button :size="size" @click="openAddDialog"> 新 增 </el-button>
       </el-col>
     </el-row>
     <el-table
-      @row-dblclick="handleOpenSeeDrawer"
+      @row-dblclick="openSeeDialog"
       :data="tableData"
       :size="size"
       style="width: 100%; margin: 20px 0 0 0"
@@ -201,7 +180,14 @@ export default {
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button
-            @click.native.prevent="handleDeleteList(scope.row)"
+            @click.native.prevent="openEditDialog(scope.row)"
+            type="text"
+            size="small"
+          >
+            编 辑
+          </el-button>
+          <el-button
+            @click.native.prevent="deleteList(scope.row)"
             type="text"
             size="small"
           >
@@ -211,8 +197,8 @@ export default {
       </el-table-column>
     </el-table>
     <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
+      @size-change="sizeChange"
+      @current-change="currentChange"
       :total="page.total"
       :page-sizes="pageSizes"
       :page-size="page.pageSize"

+ 105 - 256
src/views/purchase/contract/see/index.vue

@@ -1,78 +1,70 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
-import { item, itemTableList } from "@/api/business/purchase/contract";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
-
-const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns, {
-    disabled: true,
-    readonly: true,
-  }),
-}));
+import { Columns, TabColumns } from "../column";
+import { initDicts, initParams } from "@/utils/init";
+import { ITEM, TABLELIST } from "@/api/business/purchase/contract";
 
 export default {
-  name: "SeeDrawer",
-  dicts: initDicts(NewColumns),
+  name: "SeeDialog",
+  dicts: Array.from(
+    new Set([
+      ...initDicts(Columns),
+      ...initDicts(TabColumns.map((item) => item.tableColumns))
+        .flat()
+        .filter((cItem) => cItem.inputType === "Select"),
+    ])
+  ),
   data() {
     return {
+      size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: Columns,
       params: {
-        ...initParams(NewColumns),
+        ...initParams(Columns),
         contractItemList: [],
         contractClauseList: [],
         contractExpenseList: [],
-        contractAgreementList: [],
         contractApplyOrgList: [],
+        contractAgreementList: [],
       },
-
-      tabColumns: NewTabColumns,
+      tabColumns: TabColumns,
       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);
-    },
-  },
+  watch: {},
   methods: {
-    setVisible(prop) {
-      this.visible = prop;
+    open(prop) {
+      this.visible = true;
+      this.fetchItem(prop);
+    },
+    hide() {
+      this.visible = false;
+      this.params = initParams(Columns);
+      this.tabName = this.tabColumns[0].key;
     },
-    // 查询详细
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await item(prop);
+        const { code, msg, 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) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    // 查询详情关联TABLE
     async fetchTable(prop, name) {
       try {
         this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
+        const { code, msg, rows } = await TABLELIST({ id: prop }, name);
         if (code === 200) {
           this.params[name] = rows;
           this.$notify.success({ title: msg });
@@ -80,20 +72,21 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
     },
-    // 取消操作
-    handleCancel() {
-      this.setVisible(false);
-      this.params = initParams(Columns);
-    },
     // 编辑操作
-    handleOpenEditDrawer(prop) {
-      this.setVisible(false);
-      this.$parent.$parent.handleOpenEditDrawer(prop);
+    // handleOpenEditDrawer(prop) {
+    //   this.setVisible(false);
+    //   this.$parent.$parent.handleOpenEditDrawer(prop);
+    // },
+    setFileList(prop) {
+      return prop.split(",").map((file) => ({
+        url: file,
+        name: file.split("/")[file.split("/").length - 1],
+      }));
     },
   },
   created() {},
@@ -102,216 +95,72 @@ export default {
 };
 </script>
 <template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    destroy-on-close
-  >
-    <el-form
-      v-loading="loading"
-      size="mini"
-      label-position="right"
-      label-width="135px"
-      :model="params"
-      :rules="rules"
-    >
-      <el-card
-        :body-style="{
-          padding: '20px',
-          display: 'flex',
-          'flex-wrap': 'wrap',
-        }"
-        style="margin: 10px"
+  <el-dialog :visible.sync="visible" title="明细" @close="hide">
+    <el-descriptions :column="2" border>
+      <el-descriptions-item
+        v-if="params[column.key]"
+        v-for="(column, index) in columns"
+        :key="index"
+        :label="column.title"
       >
-        <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="handleOpenEditDrawer(params)"
-              >编 辑</el-button
-            >
-            <el-button size="mini" @click="handleCancel">取 消</el-button>
-          </div>
-        </div>
-        <el-row>
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 6"
+        <dict-tag
+          v-if="column.inputType === 'Select'"
+          :size="size"
+          :value="params[column.key]"
+          :options="dict.type[column.referName]"
+        />
+        <span v-else-if="column.inputType === 'Upload'">
+          <el-button
+            v-for="file in setFileList(params[column.key])"
+            :key="file.url"
+            type="text"
+            @click.stop="
+              download(
+                '/pu/contract/download/resource',
+                { resource: file.url },
+                file.name
+              )
+            "
           >
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input
-                v-if="column.type === 'Textarea'"
-                v-model="params[column.key]"
-                type="textarea"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-              <el-input-number
-                v-else-if="column.type === 'InputNumber'"
-                v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input-number>
-              <el-select
-                v-else-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                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-date-picker
-                v-else-if="column.type === 'DatePicker'"
-                v-model="params[column.key]"
-                :type="column.config.type"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                :picker-options="column.pickerOptions"
-                style="width: 100%"
-              >
-              </el-date-picker>
-              <el-upload
-                v-else-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                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-input
-                v-else
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                :readonly="column.readonly"
-                style="width: 100%"
-              ></el-input>
-            </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"
+            {{ file.name }}
+          </el-button>
+        </span>
+        <span v-else>{{ params[column.key] }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+    <el-tabs
+      v-model="tabName"
+      tab-position="left"
+      style="width: 100%"
+      @tab-click="fetchTable(params.code, tabName)"
+    >
+      <el-tab-pane
+        v-for="(column, index) in tabColumns"
+        :key="index"
+        :name="column.key"
+        :label="column.title"
+        lazy
       >
-        <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
-                v-for="(cColumn, cIndex) in column.tableColumns"
-                :key="cIndex"
-                :prop="cColumn.key"
-                :label="cColumn.title"
-                :width="cColumn.width"
-              >
-                <template slot-scope="scope">
-                  <el-tag v-if="cColumn.key === 'index'">
-                    {{ scope.$index + 1 }}
-                  </el-tag>
-                  <el-input
-                    v-if="cColumn.type === 'Input'"
-                    v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled"
-                    size="mini"
-                    style="width: 100%"
-                  ></el-input>
-                  <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="mini"
-                    style="width: 100%"
-                  ></el-input-number>
-                  <el-input
-                    v-if="column.type === 'InputDialog'"
-                    v-model="params[column.key]"
-                    :placeholder="column.placeholder"
-                    :clearable="column.clearable"
-                    :disabled="column.disabled"
-                    :readonly="column.readonly"
-                    style="width: 100%; cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, params)"
-                  >
-                    <template #suffix>
-                      <el-icon class="el-icon-thumb"></el-icon>
-                    </template>
-                  </el-input>
-                </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="mini" @click="addTableRow(params[tabName])"
-            >增行</el-button
+        <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"
           >
-        </el-row> -->
-      </el-card>
-    </el-form>
-  </el-drawer>
+            <template slot-scope="scope">
+              <dict-tag
+                v-if="cColumn.inputType === 'Select'"
+                :size="size"
+                :value="scope.row[cColumn.key]"
+                :options="dict.type[cColumn.referName]"
+              />
+              <span v-else>{{ scope.row[cColumn.key] }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
+  </el-dialog>
 </template>

+ 39 - 11
src/views/purchase/deliveryAddress/add.vue

@@ -28,7 +28,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select size="small" v-model="basicForm.warehouseCode" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+              <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
                 <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -57,8 +57,8 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-select size="small" v-model="basicForm.contactsName" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
-                <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.id" />
+              <el-select size="small" v-model="basicForm.contacts" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+                <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.code" />
               </el-select>
             </el-form-item>
          </el-col>
@@ -105,9 +105,9 @@
 
          <el-col :span="1.5">
             <el-form-item label="同步状态">
-              <el-select v-model="basicForm.sendStatus" size="small" style="width: 200px" clearable :disabled="disable">
+              <el-select disabled v-model="basicForm.sendStatus" size="small" style="width: 200px">
                 <el-option
-                  v-for="item in options"
+                  v-for="item in options2"
                   :key="item.value"
                   :label="item.label"
                   :value="item.value">
@@ -153,6 +153,8 @@
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
 export default {
   name: 'addAddress',
   dicts: ['sys_warehouse_attribute'],
@@ -171,7 +173,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
-        warehouseCode: '',
+        warehouseName: '',
         warehouseProperty: '',
         address: '',
         contacts: '',
@@ -180,7 +182,7 @@ export default {
         materialClassify: '',
         materialClassifyName: '',
         status: '',
-        sendStatus: '',
+        sendStatus: '2',
         remark: '',
       },
       referCondition: {
@@ -189,9 +191,14 @@ export default {
         title: ''
       },
       options: [{
-        value: '1', label: '是',
+        value: 'Y', label: '启用',
+      }, {
+        value: 'N', label: '停用'
+      }],
+      options2: [{
+        value: 'Y', label: '已同步',
       }, {
-        value: '0', label: '否'
+        value: 'N', label: '未同步'
       }],
       houseOptions: [],
       contactsOptions: [],
@@ -239,6 +246,9 @@ export default {
       getAddressDetail(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
+          if (this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
+          if (this.basicForm.contacts) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.contacts) }
+          if (this.basicForm.materialClassify) { this.reBackRefer('MATERIALCLASSIFY_PARAM', this.basicForm.materialClassify) }
         }
       })
     },
@@ -251,11 +261,14 @@ export default {
     selectionsToInput(selection) {
       if (this.referCondition.type == 'WAREHOUSE_PARAM') {
         this.houseOptions = selection
-        this.basicForm.warehouseCode = selection[0].id
+        this.basicForm.warehouseName = selection[0].name
+        this.basicForm.name = selection[0].name
+        this.basicForm.warehouse = selection[0].id
       }
       if (this.referCondition.type == 'CONTACTS_PARAM') {
         this.contactsOptions = selection
-        this.basicForm.contactsName = selection[0].id
+        this.basicForm.contactsName = selection[0].name
+        this.basicForm.contacts = selection[0].code
       }
     },
     chooseTreeRefer(type, isPage, title) {
@@ -267,6 +280,21 @@ export default {
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
       this.basicForm.materialClassify = selection.id
+      this.basicForm.materialClassifyName = selection.name
+    },
+    // 回显参照框 加title解决判断重复提交问题
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id, title: title }).then(res => {
+        if (type == 'WAREHOUSE_PARAM') {
+          this.houseOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM') {
+          this.contactsOptions = res.rows
+        }
+        if (type == 'MATERIALCLASSIFY_PARAM') {
+          this.classOptions = res.rows
+        }
+      })
     },
   }
 }

+ 108 - 44
src/views/purchase/deliveryAddress/index.vue

@@ -5,25 +5,16 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="仓库属性">
-              <el-select v-model="queryParams.warehouseProperty" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select clearable v-model="queryParams.warehouseProperty" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-select v-model="queryParams.warehouseCode" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select clearable size="small" v-model="queryParams.warehouseName" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -49,8 +40,8 @@
           </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>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <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>
             </el-form-item>
           </el-col>
         </el-row>
@@ -60,13 +51,14 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-select v-model="queryParams.materialClassify" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select
+                v-model="queryParams.materialClassifyName"
+                size="small"
+                clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
+                style="width: 200px"
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -85,13 +77,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-            <el-input
-              v-model="queryParams.contactsName"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+            <el-select clearable size="small" v-model="queryParams.contactsName" clearable @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+              <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.name" />
+            </el-select>
             </el-form-item>
           </el-col>
 
@@ -100,7 +88,6 @@
             <el-input
               v-model="queryParams.contactsPhone"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -114,7 +101,6 @@
             <el-input
               v-model="queryParams.remark"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -123,19 +109,20 @@
 
           <el-col :span="1.5">
             <el-form-item label="同步状态">
-            <el-input
-              v-model="queryParams.sendStatus"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+              <el-select v-model="queryParams.sendStatus" size="small" style="width: 200px" clearable>
+                <el-option
+                  v-for="item in options2"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
 
           <el-col :span="1.5">
             <el-form-item label="启用">
-              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="queryParams.status" size="small" style="width: 200px" clearable>
                 <el-option
                   v-for="item in options"
                   :key="item.value"
@@ -229,6 +216,10 @@
       </el-card>
     </div>
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
@@ -236,11 +227,16 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getAddressList, delAddress} from '@/api/purchase/deliveryAddress.js'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 export default {
   name: 'deliveryAddress',
+  dicts: ['sys_warehouse_attribute'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers,
+    TreeRefers
   },
   data() {
     return {
@@ -254,6 +250,7 @@ export default {
         code: '',
         name: '',
         warehouse: '',
+        warehouseName: '',
         warehouseCode: '',
         warehouseProperty: '',
         address: '',
@@ -266,13 +263,26 @@ export default {
         sendStatus: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
-        value: '1', label: '是',
+        value: 'Y', label: '是',
       }, {
-        value: '0', label: '否'
+        value: 'N', label: '否'
       }],
+      options2: [{
+        value: 'Y', label: '已同步',
+      }, {
+        value: 'N', label: '未同步'
+      }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
+      houseOptions: [],
+      classOptions: [],
+      contactsOptions: [],
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -291,6 +301,31 @@ export default {
         }
       })
     },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        code: '',
+        name: '',
+        warehouse: '',
+        warehouseName: '',
+        warehouseCode: '',
+        warehouseProperty: '',
+        address: '',
+        contacts: '',
+        contactsName: '',
+        contactsPhone: '',
+        materialClassify: '',
+        materialClassifyName: '',
+        status: '',
+        sendStatus: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     handleSelectionChange() {},
     handleCommand(command) {
       alert(command)
@@ -335,7 +370,36 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
-    }
+    },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        // this.queryParams.warehouse = selection[0].id
+        this.queryParams.warehouseName = selection[0].name
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        // this.queryParams.contacts = selection[0].code
+        this.queryParams.contactsName = selection[0].name
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      // this.queryParams.materialClassify = selection.id
+      this.queryParams.materialClassifyName = selection.name
+    },
   }
 }
 </script>

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

@@ -196,7 +196,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 1 - 1
src/views/purchase/purchase-content/see-purchase-task.vue

@@ -99,7 +99,7 @@ export default {
       try {
         // do something
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 239 - 228
src/views/purchase/purchase-order/add/column.js

@@ -1,25 +1,23 @@
 export const Columns = [
   {
-    key: "puOrgName",
+    key: "puOrg",
     title: "采购组织",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    showKey:'name',
+    referName: "ORG_PARAM",
+    dataMapping: {
+      // puOrg: "id",
+      puOrgName: "name",
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
     key: "billTypeName",
     title: "订单类型",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "sys_order_type", // 字典名
-    },
+    inputType: "Select",
+    referName: "sys_order_type", // 字典名
   },
   // { key: "billTypeName", title: "订单类型名称", },
   { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
@@ -27,98 +25,95 @@ export const Columns = [
   {
     key: "billDate",
     title: "订单日期",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
+    width: 200,
   },
   {
-    key: "supplierName",
+    key: "supplier",
     title: "供应商",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      // supplier: "id",
+      supplierName: "name",
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "paymentAgreementName",
+    key: "paymentAgreement",
     title: "付款协议",
-    type: "InputDialog",
-    config: {
-      componentName: "PAYAGREEMENT_PARAM",
-      dataMapping: {
-        paymentAgreement: "code",
-        paymentAgreementName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "PAYAGREEMENT_PARAM",
+    dataMapping: {
+      paymentAgreementName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "finalTypeName",
+    key: "finalType",
     title: "结算方式",
-    type: "InputDialog",
-    config: {
-      componentName: "BALATYPE_PARAM",
-      dataMapping: {
-        finalType: "code",
-        finalTypeName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "BALATYPE_PARAM",
+    dataMapping: {
+      finalTypeName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "currencyName",
+    key: "currency",
     title: "币种",
-    type: "InputDialog",
-    config: {
-      componentName: "CURRENCY_PARAM",
-      dataMapping: {
-        currency: "code",
-        currencyName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currencyName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "buyerName",
+    key: "buyer",
     title: "采购员",
-    type: "InputDialog",
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        buyer: "userId",
-        buyerName: "userName",
-        puDept: "deptId",
-        puDeptName: "deptName",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyerName: 'name'
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "puDeptName",
+    key: "puDept",
     title: "采购部门",
-    type: "InputDialog",
-    config: {
-      componentName: "DEPT_PARAM",
-      dataMapping: {
-        puDept: "code",
-        puDeptName: "name",
-      },
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDeptName: 'name'
     },
+    queryParams: () => ({}),
     require: true,
   },
   {
-    key: "customerName",
+    key: "customer",
     title: "收货客户",
-    type: "InputDialog",
+    inputType: "PopoverSelect",
     width: 200,
-    config: {
-      componentName: "CUSTOMER_PARAM",
-      dataMapping: {
-        customer: "code",
-        customerName: "name",
-      },
+    require: true,
+    valueKey: "id",
+    referName: "CUSTOMER_PARAM",
+    dataMapping: {
+      customerName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
     key: "qty",
@@ -138,43 +133,49 @@ export const Columns = [
   {
     key: "status",
     title: "单据状态",
-    type: "Select",
-    require: true,
-    config: {
-      optionsName: "sys_status", // 字典名
-    },
-
+    inputType: "Select",
+    referName: "sys_status", // 字典名
   },
   { key: "freezeCause", title: "冻结原因", type: "Checkbox", },
   { key: "isBack", title: "退货", type: "Input", type: "Checkbox", },
   { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
   { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
   {
-    key: "warehouseName",
+    key: "warehouse",
     title: "WMS入库仓库", // 收货仓库
-    type: "InputDialog",
-    config: {
-      componentName: "WAREHOUSE_PARAM",
-      dataMapping: {
-        warehouse: "code",
-        warehouseName: "name",
-      }
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "WAREHOUSE_PARAM",
+    dataMapping: {
+      warehouseName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "goodsAllocationName",
+    key: "goodsAllocation",
     title: "货位",
-    type: "InputDialog",
-    config: {
-      componentName: "ALLOCATION_PARAM",
-      dataMapping: {
-        goodsAllocation: "code",
-        goodsAllocationName: "name",
-      },
-      queryParams: {
-        pkOrg: 'puOrg',
-      }
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "ALLOCATION_PARAM",
+    dataMapping: {
+      goodsAllocationName: 'name'
     },
+    queryParams: () => ({
+      pkOrg: 'puOrg',
+    }),
+
+    // config: {
+    //   componentName: "ALLOCATION_PARAM",
+    //   dataMapping: {
+    //     goodsAllocation: "code",
+    //     goodsAllocationName: "name",
+    //   },
+    //   queryParams: {
+    //     pkOrg: 'puOrg',
+    //   }
+    // },
     width: 200,
   },
   { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
@@ -185,29 +186,29 @@ export const Columns = [
   { key: "address", title: "收货地址", type: "Input", },
   { key: "contacts", title: "收货联系人", type: "Input", },
   {
-    key: "customerDeptName",
+    key: "customerDept",
     title: "客户部门",
-    type: "InputDialog",
+    inputType: "PopoverSelect",
     width: 200,
-    config: {
-      componentName: "CUSTOMERDEPT_PARAM",
-      dataMapping: {
-        customerDept: "code",
-        customerDeptName: "name",
-      },
+    valueKey: "id",
+    referName: "CUSTOMERDEPT_PARAM",
+    dataMapping: {
+      customerDeptName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   {
-    key: "supplierContactsName",
+    key: "supplierContacts",
     title: "供应商业务联系人",
-    type: "InputDialog",
-    config: {
-      componentName: "SUPPLIERCONTACTS_PARAM",
-      dataMapping: {
-        supplierContacts: "code",
-        supplierContactsName: "name",
-      },
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "SUPPLIERCONTACTS_PARAM",
+    dataMapping: {
+      supplierContactsName: 'name'
     },
+    queryParams: () => ({}),
     width: 200,
   },
   { key: "isUrgency", title: "紧急程度", type: "Checkbox", },
@@ -215,66 +216,78 @@ export const Columns = [
   // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
   // { key: "agentName", title: "代理人名称", },
   { key: "isClose", title: "最终关闭", type: "Checkbox", },
-  { key: "closeTime", title: "最终关闭日期", type: "Input", },
+  {
+    key: "closeTime",
+    title: "最终关闭日期",
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
+  },
   { key: "applyPaymentMoney", title: "累计付款申请金额", type: "Input", },
   { key: "paymentMoney", title: "累计付款金额", type: "Input", },
   { key: "invoiceMoney", title: "发票金额", type: "Input", },
-  // {
-  //   key: "supplierPersonal",
-  //   title: "供应商业务员",
-  //   type: "Input",
-  //   // type: "InputDialog",
-  // },
-  { key: "supplierPersonalName", title: "供应商业务员名称", type: "Input", },
+  {
+    key: "supplierPersonal",
+    title: "供应商业务员",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIERCONTACTS_PARAM",
+    dataMapping: {
+      supplierPersonalName: 'name'
+    },
+    queryParams: () => ({}),
+    require: true,
+  },
   { key: "isDeliver", title: "是否发货", type: "Checkbox", },
   {
     key: "retReason",
     title: "退换原因",
-    type: "InputDialog",
-    config: {
-      componentName: "RETREASON_PARAM",
-      dataMapping: {
-        retReason: "code",
-        // retReasonName: "name",
-      },
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "RETREASON_PARAM",
+    dataMapping: {
+      retReasonName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
-    key: "processTypeName",
+    key: "processType",
     title: "处理方式",
-    type: "InputDialog",
-    config: {
-      componentName: "PROCESSTYPE_PARAM",
-      dataMapping: {
-        processType: "code",
-        processTypeName: "name",
-      },
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "PROCESSTYPE_PARAM",
+    dataMapping: {
+      processTypeName: 'name'
     },
+    queryParams: () => ({}),
   },
   { key: "isEnd", title: "整单关闭标识", type: "Input", },
   {
     key: "projectNow",
     title: "在建工程项目",
-    type: "InputDialog",
-    config: {
-      componentName: "PROJECT_PARAM",
-      dataMapping: {
-        projectNow: "code",
-        // processTypeName: "name",
-      },
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "PROJECT_PARAM",
+    dataMapping: {
+      projectNowName: 'name'
     },
+    queryParams: () => ({}),
   },
   {
     key: "operatingItems",
     title: "经营性项目",
-    type: "InputDialog",
-    config: {
-      componentName: "OPERATING_PARAM",
-      dataMapping: {
-        operatingItems: "code",
-        // processTypeName: "name",
-      },
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "id",
+    referName: "OPERATING_PARAM",
+    dataMapping: {
+      operatingItemsName: 'name'
     },
+    queryParams: () => ({}),
+
   },
   { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
   { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
@@ -287,14 +300,16 @@ export const Columns = [
   {
     key: "approverFinishTime",
     title: "审批时间",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
   },
   {
     key: "approveTime",
     title: "提交时间",
-    type: "DatePicker",
-    config: { type: "date" },
+    inputType: "DatePicker",
+    type: "date",
+    valueFormat: "yyyy-MM-dd",
   },
 
 ];
@@ -306,31 +321,36 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      // { key: "id", title: "主键" },
       { key: "rowNo", title: "行号", type: "Input", },
-      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", width: 180 },
       // {key: "material",title: "物料",type: "Input",   },
-      { key: "materialName", title: "物料名称", type: "Input", },
+      {
+        key: "materialName",
+        title: "物料",
+        inputType: "PopoverSelect",
+        width: 180,
+        valueKey: "id",
+        referName: "MATERIAL_PARAM",
+        queryParams: () => ({}),
+        dataMapping: {
+          material: "id",
+          materialName: "name",
+          materialCode: "code",
+        },
+      },
       {
         key: "materialCode",
         title: "物料编码",
-        type: "InputDialog",
-        config: {
-          componentName: "MATERIAL_PARAM",
-          dataMapping: {
-            material: "id",
-            materialName: "name",
-            materialCode: "code",
-          },
-        },
+        type: "Input",
+        width: 180,
       },
-      { key: "materialClassify", title: "物料分类", type: "Input", },
-      { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
-      { key: "specification", title: "规格", type: "Input", },
+      { key: "materialClassify", title: "物料分类", type: "Input", width: 180 },
+      { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", width: 180 },
+      { key: "specification", title: "规格", type: "Input", width: 180 },
       { key: "model", title: "型号", type: "Input", },
-      { key: "isMedcine", title: "医药物料", type: "Input", },
-      { key: "manufacturer", title: "生产厂家代理人", type: "Input", },
-      { key: "isDrug", title: "物料药品属性", type: "Input", },
+      { key: "isMedcine", title: "医药物料", type: "Input", width: 180 },
+      { key: "manufacturer", title: "生产厂家代理人", type: "Input", width: 180 },
+      { key: "isDrug", title: "物料药品属性", type: "Input", width: 180 },
       { key: "unit", title: "单位", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
       { key: "taxPrice", title: "含税单价", type: "Input", },
@@ -345,43 +365,41 @@ export const TabColumns = [
       { key: "isInvoice", title: "开票关闭", type: "Input", },
       { key: "isArrival", title: "到货关闭", type: "Input", },
       { key: "isPayment", title: "付款关闭", type: "Input", },
-      { key: "isGift", title: "赠品", type: "Input", },
+      { key: "isGift", title: "赠品", type: "Input", width: 180 },
       {
-        key: "warehouseName",
+        key: "warehouse",
         title: "收货仓库", //WMS入库仓库
-        type: "InputDialog",
-        config: {
-          componentName: "WAREHOUSE_PARAM",
-          dataMapping: {
-            warehouse: "code",
-            warehouseName: "name",
-          }
+        inputType: "PopoverSelect",
+        valueKey: "id",
+        referName: "WAREHOUSE_PARAM",
+        dataMapping: {
+          warehouseName: 'name'
         },
+        queryParams: () => ({}),
         width: 200,
       },
-      { key: "place", title: "收货地点", type: "Input", },
-      { key: "address", title: "收货地址", type: "Input", },
-      { key: "productBatch", title: "产品批号", type: "Input", },
-      { key: "manufactureDate", title: "生产日期", type: "Input", },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", },
-      { key: "approvalNumber", title: "批准文号", type: "Input", },
-      { key: "registration", title: "注册证号", type: "Input", },
+      { key: "place", title: "收货地点", type: "Input", width: 180 },
+      { key: "address", title: "收货地址", type: "Input", width: 180 },
+      { key: "productBatch", title: "产品批号", type: "Input", width: 180 },
+      { key: "manufactureDate", title: "生产日期", type: "Input", width: 180 },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期", type: "Input", width: 180 },
+      { key: "approvalNumber", title: "批准文号", type: "Input", width: 180 },
+      { key: "registration", title: "注册证号", type: "Input", width: 180 },
 
       {
         key: "storageCondition",
         title: "存储条件",
-        type: "Select",
-        config: {
-          optionsName: "sys_storage_condition",
-        },
+        inputType: "Select",
+        referName: "sys_storage_condition", // 字典名
+        width: 180
       },
       {
         key: "carriageCondition",
         title: "运输条件",
-        type: "Select",
-        config: {
-          optionsName: "sys_conditions_carriage",
-        },
+        inputType: "Select",
+        referName: "sys_conditions_carriage", // 字典名
+
+        width: 180
       },
 
       { key: "isBatchLock", title: "批号锁定标识", type: "Input", },
@@ -389,35 +407,29 @@ export const TabColumns = [
       { key: "isUrgency", title: "紧急标识", type: "Input", },
       { key: "originalQty", title: "原始数量", type: "Input", },
       { key: "originalMoney", title: "原始金额", type: "Input", },
-      { key: "directProductBatch", title: "直运产品批号", type: "Input", },
-      { key: "discountRule", title: "折扣规则编码", type: "Input", },
+      { key: "directProductBatch", title: "直运产品批号", type: "Input", width: 180 },
+      { key: "discountRule", title: "折扣规则编码", type: "Input", width: 180 },
       { key: "reservedQty", title: "预留数量", type: "Input", },
       { key: "reservedPeriod", title: "预留周期", type: "Input", },
       { key: "taxDeductClassify", title: "扣税类别", type: "Input", },
       { key: "exchangeRate", title: "折本汇率", type: "Input", },
-      { key: "source", title: "上游单据号", type: "Input", },
-      { key: "sourceId", title: "上游单据ID", type: "Input", },
-      { key: "demandCode", title: "采购需求单号", type: "Input", },
-      { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", },
+      { key: "source", title: "上游单据号", type: "Input", width: 180 },
+      { key: "sourceId", title: "上游单据ID", type: "Input", width: 180 },
+      { key: "demandCode", title: "采购需求单号", type: "Input", width: 180 },
+      { key: "arrivalDatePlan", title: "计划到货日期", type: "Input", width: 180 },
       {
         key: "priceType",
         title: "价格类型",
-        type: "Select",
-        config: {
-          optionsName: "sys_price_type",
-        },
+        inputType: "Select",
+        referName: "sys_price_type", // 字典名
       },
       { key: "isDistributionPrice", title: "配送价", type: "Input", },
       { key: "createByName", title: "创建人名称", type: "Input", },
       { key: "updateByName", title: "更新人名称", type: "Input", },
-      // { key: "materialClassifyOne", title: "物料一级分类",type: "Input", },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", },
-      // { key: "materialClassifyTwo", title: "物料二级分类",type: "Input", },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", },
-      // { key: "materialClassifyThree", title: "物料三级分类",type: "Input", },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
-      // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
+      { key: "materialClassifyOneName", title: "物料一级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyTwoName", title: "物料二级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", width: 180 },
+      { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", width: 180 },
       { key: "price", title: "无税单价", type: "Input", }
     ]
   },
@@ -425,33 +437,32 @@ export const TabColumns = [
     title: '执行结果',
     key: 'puOrderExecuteList',
     tableColumns: [
-      // { key: "id", title: "主键",type: "Input", },
-      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", width: 180 },
       { key: "rowno", title: "行号", type: "Input", },
       {
         key: "materialName",
         title: "物料",
-        type: "InputDialog",
+        inputType: "PopoverSelect",
         config: {
           componentName: "MATERIAL_PARAM",
           dataMapping: {
             material: "id",
             materialName: "name",
-            // materialCode: "code",
+            materialCode: "code",
           },
         },
+        width: 180
       },
-      // { key: "materialName", title: "物料名称", type: "Input", },
       { key: "specification", title: "规格", type: "Input", },
       { key: "qty", title: "数量", type: "Input", },
-      { key: "stroageQty", title: "累计到货主数量", type: "Input", },
-      { key: "stockQty", title: "累计入库主数量", type: "Input", },
-      { key: "invoiceQty", title: "累计开票主数量", type: "Input", },
-      { key: "rollbackQty", title: "累计退货主数量", type: "Checkbox", },
-      { key: "backStockQty", title: "累计退库主数量", type: "Input", },
-      { key: "floatQty", title: "未到货数量", type: "Input", },
-      { key: "createByName", title: "创建人名称", type: "Input", },
-      { key: "updateByName", title: "更新人名称", type: "Input", },
+      { key: "stroageQty", title: "累计到货主数量", type: "Input", width: 120 },
+      { key: "stockQty", title: "累计入库主数量", type: "Input", width: 120 },
+      { key: "invoiceQty", title: "累计开票主数量", type: "Input", width: 120 },
+      { key: "rollbackQty", title: "累计退货主数量", type: "Input", width: 120 },
+      { key: "backStockQty", title: "累计退库主数量", type: "Input", width: 120 },
+      { key: "floatQty", title: "未到货数量", type: "Input", width: 120 },
+      { key: "createByName", title: "创建人名称", type: "Input", width: 120 },
+      { key: "updateByName", title: "更新人名称", type: "Input", width: 120 },
     ]
   },
 ];

+ 168 - 56
src/views/purchase/purchase-order/add/index.vue

@@ -9,18 +9,18 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 
-const SelectColumns = NewColumns.filter(column => column.type === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === '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: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
-  },
+  components: {},
 
   data() {
     return {
@@ -40,31 +40,96 @@ export default {
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    "params.puOrderItemList": {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
+      },
+      deep: true,
+    },
+    "params.puOrderExecuteList": {
+      handler(nVal, oVal) {
+        this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
+      },
+      deep: true,
+    },
+    "params.puOrgName": {
+      handler(nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        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') {
+            this.params[key] = '';
+          }
+          else { }
+        }
+      },
+      deep: true,
+    }
+  },
   methods: {
     beforeOpen() {
-      const { deptName, deptId, name, id, orgName, orgId } =
-        this.$store.state.user;
+      const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
       this.params.puOrg = orgId;
       this.params.puOrgName = orgName;
-      this.params.buyer = id;
-      this.params.buyerName = name;
+      this.params.buyer = name;
+      this.params.buyerName = nickName;
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
+
     },
     setVisible(prop) {
       this.visible = prop;
     },
     // 增行
     addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
+      for (const key in this.params) {
+        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);
+
+          // 是否完成询价,新增明细行需默认明细为false
+          rowData['whetherCompleteInquiry'] = false;
+          console.log(rowData, 'rowData*******************');
+
+          this.params[key].push(rowData);
+        }
+      }
+
+      // const arr = this.tabColumns.find(
+      //   (element) => element.key === this.tabName
+      // ).tableColumns;
+      // prop.push(initParams(arr, "key", "value"));
     },
     // 删行
     delTableRow(prop, index) {
-      prop.splice(index, 1);
+      for (const key in this.params) {
+        if (Array.isArray(this.params[key])) {
+          this.params[key].splice(index, 1);
+        }
+      }
+      // prop.splice(index, 1);
+    },
+    // 同步子表物料
+    handleSynchronousMaterial(key1, key2) {
+      // this.params[key1]-- -> this.params[key2]
+      this.params[key1] && this.params[key1].forEach((item, index) => {
+        this.params[key2][index].material = item.material;
+        this.params[key2][index].materialName = item.materialName;
+        this.params[key2][index].materialCode = item.materialCode;
+      });
     },
     // 取消
     handleCancel() {
@@ -73,8 +138,10 @@ export default {
     },
     // 保存
     async handleSava() {
-      // this.setVisible(false);
-      console.log(this.params, 'params');
+      // 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) {
@@ -84,16 +151,20 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.setVisible(false);
       }
-
-
-
+      // } else {
+      //   console.log('error submit!!');
+      //   return false;
+      // }
+      // });
     },
     // 保存并新增
     async handleSubmit() {
+      // this.$refs["orderAddForm"].validate(async (valid) => {
+      //   if (valid) {
       try {
         const createById = this.params.buyer;
         const createByName = this.params.buyerName;
@@ -117,10 +188,41 @@ export default {
       } finally {
         // this.setVisible(false);
       }
+      //   } else {
+      //     console.log("error submit!!");
+      //     return false;
+      //   }
+      // });
+    },
+    handleReferChange(val, source) {
+      console.log(val, 'val');
+      console.log(source, 'source');
+      let parmas = {
+        ...this.params
+      }
+      console.log(parmas, 'parmas---------------');
+      this.handleGetPrice(parmas);
     },
+    // 询价 getPrice
+    async handleGetPrice(data) {
+      try {
+        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+        await orderApi.getPrice(data).then(res => {
+          console.log(res, 'res------------------');
+        })
+        if (code == 200) {
+
+        }
+      } catch (error) {
+
+      } finally {
+
+      }
+    },
+
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("ADD CREATED", this.params)
   },
   mounted() { },
   destroyed() { },
@@ -129,7 +231,7 @@ export default {
 <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" label-width="135px" :model="params" :rules="rules">
+    <el-form size="mini" label-position="right" ref="orderAddForm" label-width="135px" :model="params" :rules="rules">
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -152,22 +254,28 @@ export default {
         <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-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping" :query-params="column.config.queryParams" :source.sync="params">
-              </dr-input-dialog>
+                :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" :show-key="column.showKey" :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.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
+                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"
+              </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>
@@ -180,11 +288,11 @@ export default {
                 <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"
+              <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-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
                 false-label="N"></el-checkbox>
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
                 action="https://jsonplaceholder.typicode.com/posts/" multiple>
@@ -200,6 +308,7 @@ export default {
           </el-col>
         </el-row>
       </el-card>
+
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -210,7 +319,7 @@ export default {
           <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">
+                :label="cColumn.title" :width="cColumn.width || 80">
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
@@ -218,34 +327,37 @@ export default {
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     size="mini" style="width: 100%"></el-input>
-                  <dr-input-dialog 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="mini">
-                  </dr-input-dialog>
+
+                  <!--  -->
+                  <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"
+                    :show-key="cColumn.showKey" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" @change="handleReferChange">
+                  </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="mini" style="width: 100%">
                   </el-input-number>
-                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
-                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+
+                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
                     style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                    <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-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
-                  <!-- <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                    :readonly="column.readonly" style="width: 100%; cursor: pointer">
-                    <template #suffix>
-                      <el-icon class="el-icon-thumb"></el-icon>
-                    </template>
-                  </el-input> -->
+
+
+                  <el-checkbox v-if="cColumn.type === '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="120">
+
+              <el-table-column fixed="right" label="操作" width="80">
                 <template slot-scope="scope">
                   <el-button @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)

+ 170 - 170
src/views/purchase/purchase-order/column.js

@@ -1,179 +1,179 @@
 export const TableColumns = [
-   // { key: "id", title: "主键" },
-      // { key: "puOrg", title: "采购组织" },
-      { key: "puOrgName", title: "采购组织名称",search: true, type: "Input"  },
-      { key: "billType", title: "订单类型" },
-      { key: "code", title: "订单编号",search: true, type: "Input"  },
-      { key: "billDate", title: "订单日期" },
-      // { key: "supplier", title: "供应商" },
-      { key: "supplierName", title: "供应商名称",search: true, type: "Input" },
-      { key: "paymentAgreement", title: "付款协议" },
-      // { key: "currency", title: "币种" },
-      { key: "currencyName", title: "币种名称" },
-      // { key: "buyer", title: "采购员" },
-      { key: "buyerName", title: "采购员" },
-      // { key: "puDept", title: "采购部门" },
-      { key: "puDeptName", title: "采购部门名称" },
-      // { key: "customer", title: "收货客户" },
-      { key: "customerName", title: "收货客户名称" },
-      { key: "isDeliver", title: "是否发货" },
-      { key: "isArrival", title: "到货超期" },
-      { key: "isBack", title: "退货" },
-      // { key: "freezeCause", title: "冻结原因" },
-      { key: "qty", title: "总数量" },
-      { key: "money", title: "总数量" },
-      { key: "isMarketing", title: "已协同生成销售订单" },
-      { key: "isMarketingSource", title: "由销售订单协同生成" },
-      // { key: "personal", title: "人员" },
-      { key: "personalName", title: "人员名称" },
-      // { key: "isSendSrm", title: "是否同步SRM" },
-      { key: "isInvoice", title: "发票标识" },
-      { key: "rebateMoney", title: "订单使用返利金额" },
-      { key: "deductionMoney", title: "订单抵扣余款金额" },
-      // { key: "warehouse", title: "WMS入库仓库" },
-      { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
-      // { key: "goodsAllocation", title: "货位" },
-      { key: "goodsAllocationName", title: "货位名称" },
-      // { key: "customerDept", title: "客户部门" },
-      { key: "customerDeptName", title: "客户部门名称" },
-      // { key: "supplierContacts", title: "供应商业务联系人" },
-      { key: "supplierContactsName", title: "供应商业务联系人名称" },
-      { key: "isUrgency", title: "紧急程度" },
-      // { key: "agent", title: "代理人" }, // 建议删除
-      { key: "agentName", title: "代理人名称" },
-      { key: "isClose", title: "最终关闭" },
-      { key: "applyPaymentMoney", title: "累计付款申请金额" },
-      { key: "paymentMoney", title: "累计付款金额" },
-      { key: "invoiceMoney", title: "发票金额" },
-      // { key: "supplierPersonal", title: "供应商业务员" },
-      { key: "supplierPersonalName", title: "供应商业务员名称" },
-      { key: "marketingCode", title: "销售订单号" },
+  // { key: "id", title: "主键" },
+  // { key: "puOrg", title: "采购组织" },
+  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  { key: "billTypeName", title: "订单类型" },
+  { key: "code", title: "订单编号", search: true, type: "Input" },
+  { key: "billDate", title: "订单日期" },
+  // { key: "supplier", title: "供应商" },
+  { key: "supplierName", title: "供应商名称", search: true, type: "Input" },
+  { key: "paymentAgreement", title: "付款协议" },
+  // { key: "currency", title: "币种" },
+  { key: "currencyName", title: "币种名称" },
+  // { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员" },
+  // { key: "puDept", title: "采购部门" },
+  { key: "puDeptName", title: "采购部门名称" },
+  // { key: "customer", title: "收货客户" },
+  { key: "customerName", title: "收货客户名称" },
+  { key: "isDeliver", title: "是否发货" },
+  { key: "isArrival", title: "到货超期" },
+  { key: "isBack", title: "退货" },
+  // { key: "freezeCause", title: "冻结原因" },
+  { key: "qty", title: "总数量" },
+  { key: "money", title: "总数量" },
+  { key: "isMarketing", title: "已协同生成销售订单" },
+  { key: "isMarketingSource", title: "由销售订单协同生成" },
+  // { key: "personal", title: "人员" },
+  { key: "personalName", title: "人员名称" },
+  // { key: "isSendSrm", title: "是否同步SRM" },
+  { key: "isInvoice", title: "发票标识" },
+  { key: "rebateMoney", title: "订单使用返利金额" },
+  { key: "deductionMoney", title: "订单抵扣余款金额" },
+  // { key: "warehouse", title: "WMS入库仓库" },
+  { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
+  // { key: "goodsAllocation", title: "货位" },
+  { key: "goodsAllocationName", title: "货位名称" },
+  // { key: "customerDept", title: "客户部门" },
+  { key: "customerDeptName", title: "客户部门名称" },
+  // { key: "supplierContacts", title: "供应商业务联系人" },
+  { key: "supplierContactsName", title: "供应商业务联系人名称" },
+  { key: "isUrgency", title: "紧急程度" },
+  // { key: "agent", title: "代理人" }, // 建议删除
+  { key: "agentName", title: "代理人名称" },
+  { key: "isClose", title: "最终关闭" },
+  { key: "applyPaymentMoney", title: "累计付款申请金额" },
+  { key: "paymentMoney", title: "累计付款金额" },
+  { key: "invoiceMoney", title: "发票金额" },
+  // { key: "supplierPersonal", title: "供应商业务员" },
+  { key: "supplierPersonalName", title: "供应商业务员名称" },
+  { key: "marketingCode", title: "销售订单号" },
+  // { key: "tenantId", title: "租户号" },
+  // { key: "revision", title: "乐观锁" },
+  { key: "createByName", title: "创建人名称" },
+  { key: "updateByName", title: "更新人名称" },
+  // { key: "delFlag", title: "删除标记" },
+  { key: "flowId", title: "OA流程ID" },
+  { key: "approver", title: "审批人" },
+  { key: "approverFinishTime", title: "审批时间" },
+  { key: "approveTime", title: "提交时间" },
+  { key: "createTime", title: "制单日期/创建时间" },
+  { key: "remark", title: "备注" },
+  { key: "updateTime", title: "最后修改时间" },
+  { key: "status", title: "单据状态" },
+  { key: "oaDemandNo", title: "OA需求单号" },
+  { key: "address", title: "收货地址" },
+  { key: "contacts", title: "收获联系人" },
+  { key: "isSendWms", title: "已同步WMS" },
+  { key: "retReason", title: "退换原因" },
+  { key: "closeTime", title: "最终关闭日期" },
+  { key: "processType", title: "处理方式" },
+  { key: "isEnd", title: "整单关闭标识" },
+  { key: "projectNow", title: "在建工程项目" },
+  { key: "operatingItems", title: "经营性项目" },
+  { key: "isArrivalReson", title: "到货超期原因" },
+  { key: "midOrderNo", title: "中台采购订单号" }
+];
+
+export const TabColumns = [
+  {
+    title: '物料信息',
+    key: 'puOrderItemList',
+    tableColumns: [
+      { key: "rowNo", title: "行号" },
+      { key: "orderId", title: "采购订单ID" },
+      { key: "material", title: "物料" },
+      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "materialCode", title: "物料编码", width: 180 },
+      { key: "materialClassify", title: "物料分类", width: 180 },
+      { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
+      { key: "specification", title: "规格", width: 180 },
+      { key: "model", title: "型号", width: 180 },
+      { key: "isMedcine", title: "医药物料", width: 180 },
+      { key: "manufacturer", title: "生产厂家代理人", width: 180 },
+      { key: "isDrug", title: "物料药品属性", width: 180 },
+      { key: "unit", title: "单位", width: 180 },
+      { key: "qty", title: "数量" },
+      { key: "taxPrice", title: "含税单价" },
+      { key: "money", title: "价税合计" },
+      { key: "tax", title: "税率" },
+      { key: "taxDeductMoneya", title: "折扣金额" },
+      { key: "arrivalQty", title: "已到货数量" },
+      { 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: "warehouse", title: "收货仓库", width: 180 },
+      { key: "place", title: "收货地点", width: 180 },
+      { key: "address", title: "收货地址", width: 180 },
+      { key: "productBatch", title: "产品批号", width: 180 },
+      { key: "manufactureDate", title: "生产日期", width: 180 },
+      { key: "efficacyLoseDate", title: "有效期至/失效日期", width: 180 },
+      { key: "approvalNumber", title: "批准文号", width: 180 },
+      { key: "registration", title: "注册证号", width: 180 },
+      { key: "storageCondition", title: "存储条件" },
+      { key: "carriageCondition", title: "运输条件" },
+      { key: "isBatchLock", title: "批号锁定标识" },
+      { key: "isReplenishment", title: "补单标识" },
+      { key: "isUrgency", title: "紧急标识" },
+      { key: "originalQty", title: "原始数量" },
+      { key: "originalMoney", title: "原始金额" },
+      { key: "directProductBatch", title: "直运产品批号", width: 180 },
+      { key: "discountRule", title: "折扣规则编码", width: 180 },
+      { key: "reservedQty", title: "预留数量" },
+      { key: "reservedPeriod", title: "预留周期", width: 180 },
+      { key: "taxDeductClassify", title: "扣税类别" },
+      { key: "exchangeRate", title: "折本汇率" },
+      { key: "source", title: "上游单据号", width: 180 },
+      { key: "sourceId", title: "上游单据ID", width: 180 },
+      { key: "demandCode", title: "采购需求单号", width: 180 },
+      { key: "arrivalDatePlan", title: "计划到货日期", width: 180 },
+      { key: "priceType", title: "价格类型" },
+      { key: "isDistributionPrice", title: "配送价" },
       // { key: "tenantId", title: "租户号" },
       // { key: "revision", title: "乐观锁" },
       { key: "createByName", title: "创建人名称" },
       { key: "updateByName", title: "更新人名称" },
       // { key: "delFlag", title: "删除标记" },
-      { key: "flowId", title: "OA流程ID" },
-      { key: "approver", title: "审批人" },
-      { key: "approverFinishTime", title: "审批时间" },
-      { key: "approveTime", title: "提交时间" },
-      { key: "createTime", title: "制单日期/创建时间" },
-      { key: "remark", title: "备注" },
-      { key: "updateTime", title: "最后修改时间" },
-      { key: "status", title: "单据状态" },
-      { key: "oaDemandNo", title: "OA需求单号" },
-      { key: "address", title: "收货地址" },
-      { key: "contacts", title: "收获联系人" },
-      { key: "isSendWms", title: "已同步WMS" },
-      { key: "retReason", title: "退换原因" },
-      { key: "closeTime", title: "最终关闭日期" },
-      { key: "processType", title: "处理方式" },
-      { key: "isEnd", title: "整单关闭标识" },
-      { key: "projectNow", title: "在建工程项目" },
-      { key: "operatingItems", title: "经营性项目" },
-      { key: "isArrivalReson", title: "到货超期原因" },
-      { key: "midOrderNo", title: "中台采购订单号" }
+      // { key: "materialClassifyOne", title: "物料一级分类" },
+      { key: "materialClassifyOneName", title: "物料一级分类名称", width: 180 },
+      // { key: "materialClassifyTwo", title: "物料二级分类" },
+      { key: "materialClassifyTwoName", title: "物料二级分类名称", width: 180 },
+      // { key: "materialClassifyThree", title: "物料三级分类" },
+      { key: "materialClassifyThreeName", title: "物料三级分类名称", width: 180 },
+      // { key: "materialClassifyFour", title: "物料四级分类" },
+      { key: "materialClassifyFourName", title: "物料四级分类名称", width: 180 },
+      { key: "price", title: "无税单价" }
+    ]
+  },
+  {
+    title: '执行结果',
+    key: 'puOrderExecuteList',
+    tableColumns: [
+      // { key: "id", title: "主键" },
+      { key: "orderId", title: "采购订单ID", width: 180 },
+      { key: "rowno", title: "行号" },
+      { key: "material", title: "物料", width: 180 },
+      { key: "materialName", title: "物料名称", width: 180 },
+      { key: "specification", title: "规格" },
+      { key: "qty", title: "数量" },
+      { key: "stroageQty", title: "累计到货主数量" },
+      { key: "stockQty", title: "累计入库主数量" },
+      { key: "invoiceQty", title: "累计开票主数量" },
+      { key: "rollbackQty", title: "累计退货主数量" },
+      { key: "backStockQty", title: "累计退库主数量" },
+      { key: "floatQty", title: "未到货数量" },
+      // { key: "tenantId", title: "租户号" },
+      // { key: "revision", title: "乐观锁" },
+      { key: "createByName", title: "创建人名称", width: 180 },
+      { key: "updateByName", title: "更新人名称", width: 180 },
+      // { key: "delFlag", title: "删除标记" }
+    ]
+  },
 ];
 
-export const TabColumns = [
-   {
-     title: '物料信息',
-     key: 'puOrderItemList',
-     tableColumns: [
-       { key: "rowNo", title: "行号" },
-       { key: "orderId", title: "采购订单ID" },
-       { key: "material", title: "物料" },
-       { key: "materialName", title: "物料名称" },
-       { key: "materialCode", title: "物料编码" },
-       { key: "materialClassify", title: "物料分类" },
-       { key: "materialManufacturersCode", title: "厂家物料编码" },
-       { key: "specification", title: "规格" },
-       { key: "model", title: "型号" },
-       { key: "isMedcine", title: "医药物料" },
-       { key: "manufacturer", title: "生产厂家代理人" },
-       { key: "isDrug", title: "物料药品属性" },
-       { key: "unit", title: "单位" },
-       { key: "qty", title: "数量" },
-       { key: "taxPrice", title: "含税单价" },
-       { key: "money", title: "价税合计" },
-       { key: "tax", title: "税率" },
-       { key: "taxDeductMoneya", title: "折扣金额" },
-       { key: "arrivalQty", title: "已到货数量" },
-       { 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: "warehouse", title: "收货仓库" },
-       { key: "place", title: "收货地点" },
-       { key: "address", title: "收货地址" },
-       { key: "productBatch", title: "产品批号" },
-       { key: "manufactureDate", title: "生产日期" },
-       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
-       { key: "approvalNumber", title: "批准文号" },
-       { key: "registration", title: "注册证号" },
-       { key: "storageCondition", title: "存储条件" },
-       { key: "carriageCondition", title: "运输条件" },
-       { key: "isBatchLock", title: "批号锁定标识" },
-       { key: "isReplenishment", title: "补单标识" },
-       { key: "isUrgency", title: "紧急标识" },
-       { key: "originalQty", title: "原始数量" },
-       { key: "originalMoney", title: "原始金额" },
-       { key: "directProductBatch", title: "直运产品批号" },
-       { key: "discountRule", title: "折扣规则编码" },
-       { key: "reservedQty", title: "预留数量" },
-       { key: "reservedPeriod", title: "预留周期" },
-       { key: "taxDeductClassify", title: "扣税类别" },
-       { key: "exchangeRate", title: "折本汇率" },
-       { key: "source", title: "上游单据号" },
-       { key: "sourceId", title: "上游单据ID" },
-       { key: "demandCode", title: "采购需求单号" },
-       { key: "arrivalDatePlan", title: "计划到货日期" },
-       { key: "priceType", title: "价格类型" },
-       { key: "isDistributionPrice", title: "配送价" },
-       // { key: "tenantId", title: "租户号" },
-       // { key: "revision", title: "乐观锁" },
-       { key: "createByName", title: "创建人名称" },
-       { key: "updateByName", title: "更新人名称" },
-       // { key: "delFlag", title: "删除标记" },
-       // { key: "materialClassifyOne", title: "物料一级分类" },
-       { key: "materialClassifyOneName", title: "物料一级分类名称" },
-       // { key: "materialClassifyTwo", title: "物料二级分类" },
-       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
-       // { key: "materialClassifyThree", title: "物料三级分类" },
-       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
-       // { key: "materialClassifyFour", title: "物料四级分类" },
-       { key: "materialClassifyFourName", title: "物料四级分类名称" },
-       { key: "price", title: "无税单价" }
-     ]
-   },
-   {
-     title: '执行结果',
-     key: 'puOrderExecuteList',
-     tableColumns: [
-       // { key: "id", title: "主键" },
-       { key: "orderId", title: "采购订单ID" },
-       { key: "rowno", title: "行号" },
-       { key: "material", title: "物料" },
-       { key: "materialName", title: "物料名称" },
-       { key: "specification", title: "规格" },
-       { key: "qty", title: "数量" },
-       { key: "stroageQty", title: "累计到货主数量" },
-       { key: "stockQty", title: "累计入库主数量" },
-       { key: "invoiceQty", title: "累计开票主数量" },
-       { key: "rollbackQty", title: "累计退货主数量" },
-       { key: "backStockQty", title: "累计退库主数量" },
-       { key: "floatQty", title: "未到货数量" },
-       // { key: "tenantId", title: "租户号" },
-       // { key: "revision", title: "乐观锁" },
-       { key: "createByName", title: "创建人名称" },
-       { key: "updateByName", title: "更新人名称" },
-       // { key: "delFlag", title: "删除标记" }
-     ]
-   },
- ];
-
 export const SearchColumns = TableColumns.filter((element) => element.search);

+ 91 - 49
src/views/purchase/purchase-order/edit/index.vue

@@ -9,16 +9,16 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 // 
-const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
 NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
 });
 
 export default {
   name: "EditPurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
   components: {
-    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+
   },
   data() {
     return {
@@ -49,10 +49,34 @@ export default {
       const { id } = this.params;
       // this.fetchTable(id, newProp);
     },
+    'params.puOrderItemList': {
+      handler(nVal, oVal) {
+        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');
+      },
+      deep: true,
+      immediate: true
+    },
   },
   methods: {
     setVisible(prop) {
       this.visible = prop;
+
+    },
+    // 同步子表物料
+    handleSynchronousMaterial(key1, key2) {
+      // this.params[key1]-- -> this.params[key2]
+      this.params[key1] && this.params[key1].forEach((item, index) => {
+        this.params[key2][index].material = item.material;
+        this.params[key2][index].materialName = item.materialName;
+        this.params[key2][index].materialCode = item.materialCode;
+      })
     },
     // 查询详细
     async fetchItem(prop) {
@@ -67,38 +91,45 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: 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) {
-    //     this.$notify.error({ title: "error", message: err });
-    //   } finally {
-    //     this.loading = false;
-    //   }
-    // },
     // 新增行
     addTableRow(prop) {
-      const arr = this.tabColumns.find(
-        (element) => element.key === this.tabName
-      ).tableColumns;
-      prop.push(initParams(arr, "key", "value"));
+
+      for (const key in this.params) {
+
+        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);
+
+          this.params[key].push(rowData);
+        }
+      }
+
+      // const arr = this.tabColumns.find(
+      //   (element) => element.key === this.tabName
+      // ).tableColumns;
+      // prop.push(initParams(arr, "key", "value"));
     },
     // 删除行
     delTableRow(prop, index) {
-      prop.splice(index, 1);
+      // prop.splice(index, 1);
+      for (const key in this.params) {
+
+        if (Array.isArray(this.params[key])) {
+          this.params[key].splice(index, 1);
+        }
+      }
     },
     // 取消
     handleCancel() {
@@ -107,7 +138,8 @@ export default {
     },
     // 保存
     async handleSava() {
-
+      // this.$refs['orderEditForm'].validate(async (valid) => {
+      //   if (valid) {
       try {
         this.loading = true;
         const { code, msg } = await (this.handleIsRevise(this.params.status) ?
@@ -121,21 +153,27 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
 
+      //   } else {
+      //     console.log('error submit!!');
+      //     return false;
+      //   }
+      // });
     },
     beforeOpen() {
     },
+    handleReferChange(val, source) { },
     // 判断修订还是编辑
     handleIsRevise(status) {
       return status == '2';
     },
   },
   created() {
-    console.log("ADD CREATED");
+    console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
   },
   mounted() { },
@@ -145,7 +183,8 @@ export default {
 <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-form v-loading="loading" :size="size" ref="orderEditForm" label-position="right" label-width="135px"
+      :model="params" :rules="rules">
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -168,11 +207,11 @@ export default {
               <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-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :query-params="column.config.queryParams" :title="column.title"
-                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :source.sync="params">
-              </dr-input-dialog>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]"
+                :value-key="column.valueKey" :show-key="column.showKey" :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.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 style="width: 100%">
@@ -181,9 +220,9 @@ export default {
                 :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"
+              <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>
@@ -196,11 +235,11 @@ export default {
                 <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"
+              <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-else-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
+              <el-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
                 true-label="Y" false-label="N">
               </el-checkbox>
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
@@ -240,19 +279,22 @@ export default {
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :size="size" style="width: 100%">
                   </el-input>
-                  <dr-input-dialog 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-input-dialog>
-                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
-                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                  <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"
+                    :show-key="cColumn.showKey" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" @change="handleReferChange">
+                  </dr-popover-select>
+
+                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
                     style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                    <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-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+
+                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
                     false-label="N">
                   </el-checkbox>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"

+ 90 - 22
src/views/purchase/purchase-order/index.vue

@@ -130,6 +130,7 @@ export default {
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
+      checkedList: [],
     };
   },
   computed: {
@@ -156,12 +157,8 @@ export default {
     async fetchList(params, page) {
       try {
         this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await orderApi.list({
-          pageNum,
-          pageSize,
-          ...params,
-        });
+        // const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await orderApi.list(params, page);
         if (code === 200) {
           this.page.total = total;
           this.tableData = rows;
@@ -170,7 +167,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -241,7 +238,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         // this.loading = false;
       }
@@ -260,7 +257,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }
@@ -268,7 +265,65 @@ export default {
     // 提交
     async handleSubmit(row) {
 
-    }
+    },
+    // 判断“退回”按钮
+    judgeIsAllSendBack() {
+
+      if (this.checkedList.length == 1) {
+
+        // 非手工、状态非审批通过  
+        if (this.checkedList[0].source != 3 && this.checkedList[0].status != 2) {
+
+          return false
+        }
+      }
+      return true;
+    },
+    //  退回
+    handleAllSendBack() {
+      let data = {
+        id: this.checkedList[0].id,
+        documentIds: [],
+        baskCause: ''
+      }
+      console.log(data);
+      try {
+        this.loading = true;
+        // let { code, msg } = orderApi.documentsReturn(data);
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
+    },
+    handleSelect(selection, row) {
+      this.checkedList = selection;
+      console.log(this.checkedList, 'this.checkedList');
+    },
+    // 判断状态
+    judgeStatus(status) {
+      // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+      let statusName = '';
+      switch (status) {
+        case '0':
+          statusName = '自由态';
+          break;
+        case '1':
+          statusName = '审批中';
+          break;
+        case '2':
+          statusName = '已审核';
+          break;
+        case '3':
+          statusName = '已驳回';
+          break;
+        default:
+          break;
+      }
+
+      return statusName;
+    },
 
   },
 };
@@ -292,7 +347,8 @@ export default {
           </el-row>
         </el-col>
         <el-col :span="4" style="text-align: right; padding-right: 40px">
-          <el-button type="primary" size="mini" @click="handleQueryList">搜索</el-button>
+          <el-button type="primary" size="mini" @click="handleQueryList"
+            v-hasPermi="['material:order:query']">搜索</el-button>
           <el-button size="mini" @click="handleResetList">重置</el-button>
         </el-col>
       </el-row>
@@ -308,13 +364,15 @@ export default {
       <!-- <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">新增</el-button>
+          <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">退回</el-button>
+          <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
+            :disabled="judgeIsAllSendBack()">整单退回</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
@@ -327,18 +385,27 @@ export default {
     </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">
+      highlight-current-row style="width: 100%; margin: 20px 0 0 0" @select="handleSelect" height="450">
+      <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"
+      <el-table-column v-for="(column, index) in tableColumns" :key="index" :label="column.title"
         :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+
+        <template slot-scope="scope">
+          {{ column.key == 'status' ? judgeStatus(scope.row[column.key]) : scope.row[column.key] }}
+        </template>
+
+
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
-          <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
+          <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)">删除</el-button>
+          <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>
         </template>
@@ -346,16 +413,17 @@ export default {
 
     </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">
+      :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>
 
     <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-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
+        <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 width="100" v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-            :label="cColumn.title">
+          <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+            :label="cColumn.title" :width="cColumn.width || 100" show-overflow-tooltip>
           </el-table-column>
         </el-table>
       </el-tab-pane>

+ 1 - 1
src/views/purchase/purchase-order/see/index.vue

@@ -56,7 +56,7 @@ export default {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        this.$notify.error({ title: "error", message: err });
+        //
       } finally {
         this.loading = false;
       }

+ 171 - 38
src/views/purchase/task/column.js

@@ -1,61 +1,194 @@
 export const TableColumns = [
-  { key: "id", title: "主键" },
-  { key: "material", title: "物料", search: true, type: "Input" },
-  { key: "materialName", title: "物料名称", search: true, type: "Input" },
+  { key: "demandCode", title: "采购需求单号" },
+  { key: "materialCode", title: "物料编码" },
+  { key: "materialName", title: "物料名称" },
+  // { key: "material", title: "物料" },
+  { key: "materialDesc", title: "物料描述" },
+  { key: "manufacturerName", title: "生产厂家名称" },
+  { key: "puQty", title: "采购数量" },
+  {
+    key: "priceinputType",
+    title: "价格类型",
+    referName: "sys_price_inputType",
+  },
+  { key: "puUnitName", title: "采购单位名称" },
+  // { key: "id", title: "主键" },
   {
     key: "status",
     title: "状态",
-    search: true,
-    type: "Select",
-    config: {
-      optionsName: "purchase_task_status",
-    },
+    referName: "purchase_task_status",
   },
-  { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
-  { key: "manufacturer", title: "生产厂家" },
-  { key: "manufacturerName", title: "生产厂家名称" },
-  { key: "priceType", title: "价格类型" },
-  { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称", search: true, type: "Input" },
-  { key: "supplier", title: "建议供应商" },
+  // { key: "manufacturer", title: "生产厂家" },
+  // { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员名称" },
+  // { key: "supplier", title: "建议供应商" },
   { key: "supplierName", title: "建议供应商名称" },
-  { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
-  { key: "currency", title: "币种" },
+  // { key: "puOrg", title: "采购组织" },
+  {
+    key: "puOrgName",
+    title: "采购组织名称",
+  },
+  // { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
   { key: "billYpe", title: "交易类型" },
   { key: "source", title: "需求来源" },
-  { key: "customer", title: "收货客户" },
+  // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户名称" },
-  { key: "puUnit", title: "采购单位" },
-  { key: "puUnitName", title: "采购单位名称" },
-  { key: "puQty", title: "采购数量" },
-  { key: "demandDate", title: "需求时间", search: true, type: "Input" },
+  // { key: "puUnit", title: "采购单位" },
+
+  { key: "demandDate", title: "需求时间" },
   { key: "projectName", title: "项目名称" },
-  { key: "demandPersonal", title: "需求人" },
+  // { key: "demandPersonal", title: "需求人" },
   {
     key: "demandPersonalName",
     title: "需求人名称",
-    search: true,
-    type: "Input",
   },
-  { key: "demandOrg", title: "需求组织", search: true, type: "Input" },
+  // { key: "demandOrg", title: "需求组织" },
   { key: "demandOrgName", title: "需求组织名称" },
-  { key: "demandDept", title: "需求部门" },
-  { key: "demandDeptName", title: "需求部门名称", search: true, type: "Input" },
+  // { key: "demandDept", title: "需求部门" },
+  { key: "demandDeptName", title: "需求部门名称" },
   { key: "isBack", title: "是否退回" },
   { key: "baskCause", title: "退回原因" },
   { key: "backDate", title: "退回日期" },
-  { key: "assignSupplier", title: "指定供应商" },
+  // { key: "assignSupplier", title: "指定供应商" },
   { key: "assignSupplierName", title: "指定供应商名称" },
-  { key: "unit", title: "单位" },
+  // { key: "unit", title: "单位" },
   { key: "unitName", title: "单位名称" },
-  { key: "demandCode", title: "采购需求单号" },
-  { key: "file", title: "附件" },
-  { key: "tenantId", title: "租户号" },
-  { key: "revision", title: "乐观锁" },
-  { key: "delFlag", title: "删除标记" },
-  { key: "materialCode", title: "物料编码" },
+  // { key: "file", title: "附件" },
+  // { key: "tenantId", title: "租户号" },
+  // { key: "revision", title: "乐观锁" },
+  // { key: "delFlag", title: "删除标记" },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+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",
+    title: "物料分类",
+    inputType: "PopoverTreeSelect",
+    multiple: true,
+    valueKey: "id",
+    referName: "MATERIALCLASSIFY_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "materialCodes",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "code",
+    referName: "MATERIAL_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  { key: "materialDesc", title: "物料描述", inputType: "Input" },
+  { key: "source", title: "需求来源", inputType: "Input" },
+  {
+    key: "puOrgIds",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "id",
+    referName: "ORG_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "status",
+    title: "状态",
+    inputType: "Select",
+    referName: "purchase_task_status",
+  },
+  {
+    key: "date",
+    title: "创建时间",
+    inputType: "DatePicker",
+    type: "daterange",
+    unlinkPanels: true,
+    rangeSeparator: "至",
+    valueFormat: "yyyy-MM-dd",
+    endPlaceholder: "结束日期",
+    startPlaceholder: "开始日期",
+    pickerOptions: pickerOptions,
+    value: [],
+  },
+  {
+    key: "buyers",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    multiple: true,
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    readonly: true,
+    dataMapping: {},
+    queryParams: () => ({}),
+  },
+  {
+    key: "documentsCodes",
+    title: "需求来源",
+    inputType: "Input",
+    placeholder: "请输入来源单据号,多个用,分隔",
+  },
+];

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov