Browse Source

Merge branch 'dev'

# Conflicts:
#	src/components/input-dialog/components/index.vue
#	src/components/input-dialog/index.vue
#	src/views/business/spd/bo/basic/index.vue
#	src/views/business/spd/bo/statement/proportion/index.vue
001295 2 năm trước cách đây
mục cha
commit
3924358115
100 tập tin đã thay đổi với 10119 bổ sung5638 xóa
  1. 60 0
      src/api/business/purchase/apply.js
  2. 60 0
      src/api/business/purchase/catalogue.js
  3. 60 0
      src/api/business/purchase/contract.js
  4. 0 17
      src/api/business/purchase/purchase-contract.js
  5. 84 0
      src/api/business/purchase/purchase-order.js
  6. 0 10
      src/api/business/purchase/purchase-task.js
  7. 45 0
      src/api/business/purchase/task.js
  8. 9 0
      src/api/business/spd/bo/basic.js
  9. 34 14
      src/api/marketing/dealer-authorization.js
  10. 16 0
      src/api/purchase/DemandSummary.js
  11. 24 0
      src/api/purchase/purchaseDemand.js
  12. 0 236
      src/components/PopDialog/dose_bak.vue
  13. 3 2
      src/components/Refers/refers.vue
  14. 120 0
      src/components/Refers/treeRefer.vue
  15. 22 0
      src/components/input-dialog/components/ALLOCATION_PARAM.js
  16. 21 0
      src/components/input-dialog/components/BALATYPE_PARAM.js
  17. 22 0
      src/components/input-dialog/components/CUSTOMERDEPT_PARAM.js
  18. 21 0
      src/components/input-dialog/components/CUSTOMER_PARAM.js
  19. 21 0
      src/components/input-dialog/components/OPERATING_PARAM.js
  20. 21 0
      src/components/input-dialog/components/PROCESSTYPE_PARAM.js
  21. 21 0
      src/components/input-dialog/components/PROJECT_PARAM.js
  22. 21 0
      src/components/input-dialog/components/RETREASON_PARAM.js
  23. 21 0
      src/components/input-dialog/components/SUPPLIERCONTACTS_PARAM.js
  24. 29 0
      src/components/input-dialog/components/WAREHOUSE_PARAM.js
  25. 15 12
      src/components/input-dialog/components/index.vue
  26. 62 38
      src/components/input-dialog/index.vue
  27. 3 0
      src/main.js
  28. 0 39
      src/utils/init-something.js
  29. 61 0
      src/utils/init/index.js
  30. 142 6
      src/views/business/spd/bo/basic/details.vue
  31. 98 97
      src/views/business/spd/bo/basic/index.vue
  32. 258 1
      src/views/business/spd/bo/basic/process.vue
  33. 3 2
      src/views/business/spd/bo/behavior/behaviorList.vue
  34. 10 1
      src/views/business/spd/bo/behavior/index.vue
  35. 2 0
      src/views/business/spd/bo/contact/contactList.vue
  36. 10 1
      src/views/business/spd/bo/contact/index.vue
  37. 26 5
      src/views/business/spd/bo/education/educationList.vue
  38. 18 4
      src/views/business/spd/bo/filetemplate/index.vue
  39. 8 6
      src/views/business/spd/bo/statement/proportion/index.vue
  40. 21 2
      src/views/business/spd/bo/task/taskList.vue
  41. 0 17
      src/views/common-dialog/api/index.js
  42. 0 214
      src/views/common-dialog/currency.vue
  43. 0 198
      src/views/common-dialog/department.vue
  44. 0 20
      src/views/common-dialog/index.js
  45. 0 204
      src/views/common-dialog/organization.vue
  46. 0 203
      src/views/common-dialog/payment-plan.vue
  47. 0 198
      src/views/common-dialog/supplier.vue
  48. 0 198
      src/views/common-dialog/tax.vue
  49. 0 226
      src/views/common-dialog/user.vue
  50. 0 3
      src/views/common-dialog/utils/init-something.js
  51. 54 54
      src/views/marketing/dealer-authorization/authprivAdd.vue
  52. 56 0
      src/views/marketing/dealer-authorization/column.js
  53. 86 105
      src/views/marketing/dealer-authorization/index.vue
  54. 22 0
      src/views/marketing/utils/date.js
  55. 11 0
      src/views/marketing/utils/init.js
  56. 7 0
      src/views/monitor/job/log.vue
  57. 106 57
      src/views/purchase/DemandSummary/add.vue
  58. 327 175
      src/views/purchase/DemandSummary/index.vue
  59. 79 57
      src/views/purchase/MaterialClassDivision/add.vue
  60. 47 61
      src/views/purchase/MaterialClassDivision/index.vue
  61. 410 186
      src/views/purchase/PurchaseDemandList/add.vue
  62. 273 97
      src/views/purchase/PurchaseDemandList/index.vue
  63. 1 1
      src/views/purchase/PurchaseDemandList/reserved.vue
  64. 197 84
      src/views/purchase/apply/add/column.js
  65. 380 0
      src/views/purchase/apply/add/index.vue
  66. 50 0
      src/views/purchase/apply/column.js
  67. 400 0
      src/views/purchase/apply/edit/index.vue
  68. 194 0
      src/views/purchase/apply/index.vue
  69. 317 0
      src/views/purchase/apply/see/index.vue
  70. 514 0
      src/views/purchase/catalogue/add/column.js
  71. 380 0
      src/views/purchase/catalogue/add/index.vue
  72. 61 0
      src/views/purchase/catalogue/column.js
  73. 399 0
      src/views/purchase/catalogue/edit/index.vue
  74. 194 0
      src/views/purchase/catalogue/index.vue
  75. 317 0
      src/views/purchase/catalogue/see/index.vue
  76. 514 0
      src/views/purchase/contract/add/column.js
  77. 380 0
      src/views/purchase/contract/add/index.vue
  78. 64 0
      src/views/purchase/contract/column.js
  79. 399 0
      src/views/purchase/contract/edit/index.vue
  80. 225 0
      src/views/purchase/contract/index.vue
  81. 317 0
      src/views/purchase/contract/see/index.vue
  82. 59 23
      src/views/purchase/deliveryAddress/add.vue
  83. 2 2
      src/views/purchase/deliveryAddress/index.vue
  84. 3 3
      src/views/purchase/purchase-content/index.vue
  85. 0 314
      src/views/purchase/purchase-contract/add-purchase-contract.vue
  86. 0 386
      src/views/purchase/purchase-contract/direct-sourcing.vue
  87. 0 264
      src/views/purchase/purchase-contract/index.vue
  88. 0 404
      src/views/purchase/purchase-contract/see-purchase-contract.vue
  89. 459 0
      src/views/purchase/purchase-order/add/column.js
  90. 266 0
      src/views/purchase/purchase-order/add/index.vue
  91. 179 0
      src/views/purchase/purchase-order/column.js
  92. 282 0
      src/views/purchase/purchase-order/edit/index.vue
  93. 365 0
      src/views/purchase/purchase-order/index.vue
  94. 190 0
      src/views/purchase/purchase-order/see/index.vue
  95. 0 249
      src/views/purchase/purchase-task/add-purchase-task.vue
  96. 0 386
      src/views/purchase/purchase-task/direct-sourcing.vue
  97. 0 598
      src/views/purchase/purchase-task/index.vue
  98. 0 158
      src/views/purchase/purchase-task/see-purchase-task.vue
  99. 61 0
      src/views/purchase/task/column.js
  100. 0 0
      src/views/purchase/task/config/add.js

+ 60 - 0
src/api/business/purchase/apply.js

@@ -0,0 +1,60 @@
+import request from "@/utils/request";
+
+export function list(params) {
+  return request({
+    url: "/pu/priceApply/list",
+    method: "GET",
+    params: params,
+  });
+}
+
+export function add(data) {
+  return request({
+    url: "/pu/contract/add",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function edit(data) {
+  return request({
+    url: "/pu/contract/edit",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function remove(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "delete",
+  });
+}
+
+export function item(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "GET",
+  });
+}
+
+export function generateCode() {
+  return request({
+    url: "/pu/contract/generateNo",
+    method: "GET",
+  });
+}
+
+export function itemTableList(params, name) {
+  let url = "";
+  if (name === "contractItemList") url = "/pu/contract/item/list";
+  if (name === "contractClauseList") url = "/pu/contract/clause/list";
+  if (name === "contractExpenseList") url = "/pu/contract/expense/list";
+  if (name === "contractAgreementList") url = "/pu/contract/agreement/list";
+  if (name === "contractApplyOrgList") url = "/pu/contract/org/list";
+  return request({
+    url: url,
+    method: "GET",
+    params: params,
+  });
+}

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

@@ -0,0 +1,60 @@
+import request from "@/utils/request";
+
+export function list(params) {
+  return request({
+    url: "/pu/price/catalogue/list",
+    method: "GET",
+    params: params,
+  });
+}
+
+export function add(data) {
+  return request({
+    url: "/pu/contract/add",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function edit(data) {
+  return request({
+    url: "/pu/contract/edit",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function remove(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "delete",
+  });
+}
+
+export function item(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "GET",
+  });
+}
+
+export function generateCode() {
+  return request({
+    url: "/pu/contract/generateNo",
+    method: "GET",
+  });
+}
+
+export function itemTableList(params, name) {
+  let url = "";
+  if (name === "contractItemList") url = "/pu/contract/item/list";
+  if (name === "contractClauseList") url = "/pu/contract/clause/list";
+  if (name === "contractExpenseList") url = "/pu/contract/expense/list";
+  if (name === "contractAgreementList") url = "/pu/contract/agreement/list";
+  if (name === "contractApplyOrgList") url = "/pu/contract/org/list";
+  return request({
+    url: url,
+    method: "GET",
+    params: params,
+  });
+}

+ 60 - 0
src/api/business/purchase/contract.js

@@ -0,0 +1,60 @@
+import request from "@/utils/request";
+
+export function list(params) {
+  return request({
+    url: "/pu/contract/list",
+    method: "GET",
+    params: params,
+  });
+}
+
+export function add(data) {
+  return request({
+    url: "/pu/contract/add",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function edit(data) {
+  return request({
+    url: "/pu/contract/edit",
+    method: "POST",
+    data: data,
+  });
+}
+
+export function remove(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "delete",
+  });
+}
+
+export function item(data) {
+  return request({
+    url: `/pu/contract/${data}`,
+    method: "GET",
+  });
+}
+
+export function generateCode() {
+  return request({
+    url: "/pu/contract/generateNo",
+    method: "GET",
+  });
+}
+
+export function itemTableList(params, name) {
+  let url = "";
+  if (name === "contractItemList") url = "/pu/contract/item/list";
+  if (name === "contractClauseList") url = "/pu/contract/clause/list";
+  if (name === "contractExpenseList") url = "/pu/contract/expense/list";
+  if (name === "contractAgreementList") url = "/pu/contract/agreement/list";
+  if (name === "contractApplyOrgList") url = "/pu/contract/org/list";
+  return request({
+    url: url,
+    method: "GET",
+    params: params,
+  });
+}

+ 0 - 17
src/api/business/purchase/purchase-contract.js

@@ -1,17 +0,0 @@
-import request from "@/utils/request";
-
-export function list(params) {
-  return request({
-    url: "/pu/contract/list",
-    method: "get",
-    params: params,
-  });
-}
-
-export function add(data) {
-  return request({
-    url: "/pu/contract/add",
-    method: "post",
-    data: data,
-  });
-}

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

@@ -0,0 +1,84 @@
+import request from "@/utils/request";
+
+// 采购订单修订列表
+const list = (data) => {
+  return request({
+    url: `/pu/order/list`,
+    method: "post",
+    data,
+  });
+}
+
+// 采购订单详情
+const details = (id, params) => {
+  return request({
+    url: `/pu/order/${id}`,
+    method: "get",
+    params,
+  });
+}
+
+// 采购订单修订创建
+const create = (data) => {
+  return request({
+    url: `/pu/order`,
+    method: "post",
+    data,
+  });
+}
+
+// 采购订单提交
+const submit = (data) => {
+  return request({
+    url: `/pu/order/submit`,
+    method: "post",
+    data,
+  });
+}
+
+// 采购订单编辑
+const edit = (data) => {
+  return request({
+    url: `/pu/order`,
+    method: "put",
+    data,
+  });
+}
+
+// 采购订单修订
+const revision = (data) => {
+  return request({
+    url: `/pu/order/revision`,
+    method: "put",
+    data,
+  });
+}
+
+// 采购订单删除
+const remove = (data) => {
+  return request({
+    url: `/pu/order/${data}`,
+    method: "delete",
+  });
+}
+
+// 采购订单-询价
+const getPrice = (data) => {
+  return request({
+    url: `/pu/order/getPrice`,
+    method: "post",
+    data,
+  });
+}
+
+export default {
+  list,
+  details,
+  create,
+  submit,
+  edit,
+  revision,
+  remove,
+  getPrice,
+
+}

+ 0 - 10
src/api/business/purchase/purchase-task.js

@@ -1,10 +0,0 @@
-import request from "@/utils/request";
-
-// 查询任务列表
-export function taskList(data) {
-  return request({
-    url: "/pu/order/generate/list",
-    method: "POST",
-    data: data,
-  });
-}

+ 45 - 0
src/api/business/purchase/task.js

@@ -0,0 +1,45 @@
+import request from "@/utils/request";
+
+// 查询任务列表
+export function LIST(data) {
+  return request({
+    url: "/pu/order/generate/list",
+    method: "POST",
+    data: 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",
+    method: "POST",
+    data: data,
+  });
+}
+
+// 查询任务列表
+export function ADD(data) {
+  return request({
+    url: "/pu/order/create",
+    method: "POST",
+    data: data,
+  });
+}
+
+// 查询任务列表
+export function SHUTDOWN(data) {
+  return request({
+    url: `/pu/demand/item/summary/shutDown/${data}`,
+    method: "PUT",
+    data: data,
+  });
+}

+ 9 - 0
src/api/business/spd/bo/basic.js

@@ -103,3 +103,12 @@ export function updateWinningState(data) {
     data: data
   })
 }
+
+//分配负责人
+export function allocationParticipant(data) {
+  return request({
+    url: '/mk/bo/basic/allocationParticipant',
+    method: 'put',
+    data: data
+  })
+}

+ 34 - 14
src/api/marketing/dealer-authorization.js

@@ -4,46 +4,66 @@ import request from '@/utils/request';
 
 
 // 经销商授权信息列表
-const dealerList = (params, page) => {
-
+const list = (params) => {
   return request({
-    url: `dealer/list?pageSize=${page.pageSize}&pageNum=${page.pageNum}`,
+    url: `/dealer/list`,
     method: 'get',
     params,
   })
 }
 
 // 经销商授权信息新增接口
-const dealerInsert = (data) => {
+const insert = (data) => {
   return request({
-    url: `dealer/insert`,
+    url: `/dealer/insert`,
     method: 'post',
     data,
   })
 }
 
 // 经销商授权信息列表
-const dealerDelete = (params) => {
-
+const remove = (params) => {
+// ?id=${params.id}
   return request({
-    url: `dealer/delete?id=${params.id}`,
+    url: `/dealer/delete`,
     method: 'get',
     params,
   })
 }
 
 // 经销商授权信息新增接口
-const dealerUpdate = (data) => {
+const update = (data) => {
+  return request({
+    url: `/dealer/update`,
+    method: 'post',
+    data,
+  })
+}
+
+// 提交OA
+const submitOA = (data) => {
   return request({
-    url: `dealer/update`,
+    url: `/dealer/OA`,
     method: 'post',
     data,
   })
 }
 
+// 下载授权书
+const download = (data) => {
+  return request({
+    url: `/dealer/download`,
+    method: 'post',
+    data,
+  })
+}
+
+
 export default {
-  dealerList,
-  dealerInsert,
-  dealerDelete,
-  dealerUpdate,
+  list,
+  insert,
+  remove,
+  update,
+  submitOA,
+  download,
 }

+ 16 - 0
src/api/purchase/DemandSummary.js

@@ -45,10 +45,26 @@ export function cancelAuditSummary(id) {
     method: 'get',
   })
 }
+// 采购需求汇总编辑
+export function editSummaryList(data) {
+  return request({
+    url: `/pu/demand/summary/edit`,
+    method: 'post',
+    data: data
+  })
+}
 // 采购需求汇总明细行关闭
 export function shutDownSummary(id) {
   return request({
     url: `/pu/demand/item/summary/shutDown/${id}`,
     method: 'get',
   })
+}
+// 采购需求明细行编辑
+export function editSummaryMx(data) {
+  return request({
+    url: `/pu/demand/item/summary/detail/edit`,
+    method: 'post',
+    data: data
+  })
 }

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

@@ -24,6 +24,14 @@ export function editDemand(data) {
     data: data
   })
 }
+// 采购需求单提交
+export function submitDemand(data) {
+  return request({
+    url: `/pu/demand/submit`,
+    method: 'POST',
+    data: data
+  })
+}
 // 采购需求单基本信息详情
 export function getDemandDetail(id) {
   return request({
@@ -54,4 +62,20 @@ export function downLoadDemand(data) {
     data: data,
     responseType: 'blob'
   })
+}
+// 采购需求单导出
+export function exportDemand(data) {
+  return request({
+    url: `/pu/demand/export`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}
+// 通过物料ID查询采购员
+export function queryMan(id) {
+  return request({
+    url: `/material/division/queryBuyer?materialId=${id}`,
+    method: 'get',
+  })
 }

+ 0 - 236
src/components/PopDialog/dose_bak.vue

@@ -1,236 +0,0 @@
-<template>
-  <div>
-    <el-dialog
-      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.param"
-                  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="code"
-              >
-              </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 { getDose } from '@/api/requisition/basic'
-export default {
-  data() {
-    return {
-      searchForm: {
-        param: '',
-        pageNo: 1,
-        pageSize: 10,
-      },
-      dataListAllSelections: [], // 所有选中的数据包含跨页数据
-      idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
-      dataList: [],
-      total: 0,
-      orders: [],
-      loading: false,
-      visible: false,
-    };
-  },
-  props: {
-    selectData: {
-      type: Array,
-      default: () => {
-        return [];
-      },
-    },
-    // 是否启用单选
-    single: {
-      type: Boolean,
-      default: false
-    }
-  },
-  methods: {
-    init() {
-      this.visible = true;
-      this.$nextTick(() => {
-        this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
-        this.resetSearch();
-      });
-    },
-    // 获取数据列表
-    refreshList() {
-      this.loading = true;
-      getDose(this.searchForm).then(({ data }) => {
-        console.log('data',data)
-        this.dataList = data.tableBody;
-        this.total = data.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.$refs['searchForm'].resetFields();
-      this.searchForm.pageNo = 1;
-      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>

+ 3 - 2
src/views/purchase/PurchaseDemandList/refers.vue → src/components/Refers/refers.vue

@@ -8,7 +8,7 @@
             <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.param" placeholder="输入名称/编号查询" clearable></el-input>
+                <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>
@@ -48,7 +48,7 @@ export default {
   data() {
     return {
       searchForm: {
-        param: '',
+        search: '',
         pageNo: 1,
         pageSize: 10,
       },
@@ -80,6 +80,7 @@ export default {
       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();

+ 120 - 0
src/components/Refers/treeRefer.vue

@@ -0,0 +1,120 @@
+<template>
+  <div>
+    <el-dialog :title="reciveForm.title" width="500px" :close-on-click-modal="false" :append-to-body="true" v-dialogDrag
+      class="userDialog" :visible.sync="visible">
+      <el-container style="height: 500px">
+        <el-container>
+          <el-main>
+            <el-row :gutter="24" class="content">
+              <el-col :span="24">
+                <el-input placeholder="输入关键字进行过滤" size="small" v-model="filterText" style="margin-bottom: 16px">
+                </el-input>
+
+                <el-tree class="filter-tree" :data="threedata" :props="defaultProps" accordion node-key="id"
+                  highlight-current @node-click="clickTree" :filter-node-method="filterNode" ref="tree">
+                  <span slot-scope="{ node, data }">
+                    {{ data.code }}{{ data.name }}
+                  </span>
+                </el-tree>
+              </el-col>
+            </el-row>
+          </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 { getRefer } from '@/api/purchase/basic'
+export default {
+  data() {
+    return {
+      loading: false,
+      visible: false,
+      filterText: "",
+      threedata: [],
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+      // 判断是否为最末级节点
+      // isLast: false,
+      // 选中的节点
+      choosePoint: {},
+      // 接收的参数
+      reciveForm: {},
+    };
+  },
+  props: {},
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  methods: {
+    init(val) {
+      this.visible = true;
+      this.reciveForm = val
+      this.$nextTick(() => {
+        this.refreshList();
+      });
+    },
+    // 获取数据列表
+    refreshList(data) {
+      this.loading = true;
+      let params = this.reciveForm
+      getRefer(params).then((res) => {
+        console.log("res", res);
+        if (res.code === 200) {
+          this.threedata = res.rows
+        }
+        this.loading = false;
+      });
+    },
+    clickTree(data) {
+      console.log("树形节点信息:", data);
+      this.choosePoint = data;
+    },
+    filterNode(value, data) {
+      console.log("value", value);
+      console.log("data", data);
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    doSubmit() {
+      console.log("子组件选择的数据", this.choosePoint);
+      this.$emit("doSubmit", this.choosePoint);
+      this.visible = false;
+    },
+    loadNode(node, resolve) {
+      console.log("node, resolve", node, resolve);
+      // if (!node.data.length)
+      //   resolve(node.data.childrens.sort((a, b) => a.code - b.code));
+      // else resolve(this.threedata);
+    },
+  },
+};
+</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>

+ 22 - 0
src/components/input-dialog/components/ALLOCATION_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/BALATYPE_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,
+  },
+];

+ 22 - 0
src/components/input-dialog/components/CUSTOMERDEPT_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,
+  },
+];
+

+ 21 - 0
src/components/input-dialog/components/CUSTOMER_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/OPERATING_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/PROCESSTYPE_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/PROJECT_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/RETREASON_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,
+  },
+];

+ 21 - 0
src/components/input-dialog/components/SUPPLIERCONTACTS_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,
+  },
+];

+ 29 - 0
src/components/input-dialog/components/WAREHOUSE_PARAM.js

@@ -0,0 +1,29 @@
+// 收货仓库
+export default [
+  {
+    key: "id",
+    title: "仓库ID",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "code",
+    title: "仓库编码",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "name",
+    title: "仓库名称",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "",
+    title: "备注",
+  },
+  {
+    key: "",
+    title: "助记码",
+  },
+];

+ 15 - 12
src/components/input-dialog/components/index.vue

@@ -1,11 +1,11 @@
 <script>
 import { refer } from "../api/index";
+import { initParams } from "@/utils/init";
 import InitColumnHooks from "./init-column";
-import { initParams } from "../index";
 
 export default {
   name: "InputDialog",
-  props: ["title", "type"],
+  props: ["type", "title", "queryParams"],
   components: {},
   data() {
     const { type } = this.$props;
@@ -22,7 +22,7 @@ export default {
       visible: false,
       loading: false,
       // search
-      params: initParams(SearchColumns),
+      params: { search: "" },
       searchColumns: SearchColumns,
       // table
       data: [],
@@ -45,14 +45,16 @@ export default {
     async fetchList(prop, page) {
       try {
         this.loading = true;
-        const { type } = this.$props;
         const { pageNum, pageSize } = page;
+        const { type, queryParams } = this.$props;
         const { code, msg, rows, total } = await refer(
           {
-            ...prop,
             type: type,
             isPage: true,
+            ...prop,
+            ...queryParams,
           },
+          
           { pageNum, pageSize }
         );
         if (code === 200) {
@@ -117,13 +119,14 @@ export default {
     append-to-body
     @open="beforeOpen"
   >
-    <el-form :size="size" :inline="true" :model="params">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @change="queryList"> </el-input>
+    <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>

+ 62 - 38
src/components/input-dialog/index.vue

@@ -1,18 +1,48 @@
 <script>
 export default {
   name: "DrInputDialog",
-  props: [
-    "value",
-    "title",
-    "type",
-    "dataMapping",
-    "source",
-    "placeholder",
-    "clearable",
-    "disabled",
-    "readonly",
-    "size",
-  ],
+  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"),
   },
@@ -22,12 +52,23 @@ export default {
   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) {
@@ -37,37 +78,20 @@ export default {
     },
   },
   created() {
-    console.log("prop", this.$props);
+    this.handleMakeQueryParams()
   },
-  mounted() {},
-  destroyed() {},
+  mounted() { },
+  destroyed() { },
 };
 </script>
 <template>
-  <el-input
-    v-model="value"
-    :placeholder="placeholder"
-    :clearable="clearable"
-    :disabled="disabled"
-    :readonly="readonly"
-    :size="size"
-    style="width: 100%; cursor: pointer"
-    @click.native.stop="handleAsyncOpenDialog"
-  >
+  <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-thumb"></el-icon>
-      <input-dialog
-        ref="InputDialogFef"
-        :title="title"
-        :type="type"
-        @confirm="handleUpdateSource"
-      ></input-dialog>
+      <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>
-::v-deep.el-input .el-input__suffix {
-  display: flex;
-  align-items: center;
-}
-</style>
+<style scoped></style>

+ 3 - 0
src/main.js

@@ -14,6 +14,9 @@ import directive from './directive' // directive
 import plugins from './plugins' // plugins
 import { download } from '@/utils/request'
 
+// 时间格式化方法挂载
+import '@/views/marketing/utils/date';
+
 import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";

+ 0 - 39
src/utils/init-something.js

@@ -1,39 +0,0 @@
-import { arr2obj } from "./data-transform";
-import Components from "@/views/common-dialog";
-
-export const initParams = (arr) => arr2obj(arr, "key", "value");
-
-export const initDicts = (arr) =>
-  arr
-    .filter((column) => column.type === "Select")
-    .map((column) => column.config.optionsName);
-
-export const initRules = (arr) => {
-  const rules = {};
-  arr
-    .filter((column) => column.require)
-    .forEach((column) => {
-      const message = `${column.title}不能为空`;
-      rules[column.key] = [
-        { required: true, message: message, trigger: "change" },
-      ];
-    });
-  return rules;
-};
-
-export const initComponents = (arr) => {
-  const c = {};
-  try {
-    arr
-      .filter((element) => element.type === "InputDialog")
-      .map((element) => element.config.componentName)
-      .forEach((element) => {
-        c[element] = Components[element];
-      });
-
-    return c;
-  } catch (err) {
-    return c;
-  } finally {
-  }
-};

+ 61 - 0
src/utils/init/index.js

@@ -0,0 +1,61 @@
+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 };
+  });
+};
+
+// 初始化参数
+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;

+ 142 - 6
src/views/business/spd/bo/basic/details.vue

@@ -5,7 +5,14 @@
     <el-row type="flex" class="row-bg" justify="space-around">
       <el-col :span="4">
         <div class="grid-content bg-purple">
-          <el-button 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">
@@ -57,6 +64,15 @@
           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>
     <!-- 主多页签 -->
@@ -91,12 +107,12 @@
             </dev>
             <el-button size="mini" type="text" icon="el-icon-view" @click="customerButton"/>
           </el-descriptions-item>
-          <el-descriptions-item label="医院营收总额">
+          <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}}
             </div>
           </el-descriptions-item>
-          <el-descriptions-item label="医院耗材预估值(万元)">
+          <el-descriptions-item :label="estimate">
             {{form.basic.hosDiscreetValue}}
           </el-descriptions-item>
           <el-descriptions-item label="赢单率">
@@ -166,6 +182,7 @@
         />
       </el-tab-pane>
     </el-tabs>
+
     <!-- 赢单状态弹窗 -->
     <el-dialog :title="winningStateTitle" :visible.sync="winningStateOpen" width="500px" append-to-body>
       <el-form ref="wsform" :model="winningStateData" :rules="winningStateDataRules" label-width="140px">
@@ -236,14 +253,51 @@
         <el-button @click="cancelWinningStateData">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 分配商机负责人对话框 -->
+    <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>
+        </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-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAllocationForm"
+          >确 定</el-button
+        >
+        <el-button @click="cancelAllocation">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import {
   getBasic,
-  delAccessory,
   updateWinningState,
+  allocationParticipant,
 } from "@/api/business/spd/bo/basic";
 import { getBoNodeListByType } from "@/api/business/spd/bo/boNode";
 import { getPsnPost } from "@/api/business/spd/bo/authority";
@@ -252,13 +306,14 @@ 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},
+  components: { TaskList, ContactList,AccessoryList,FileTemplate, Process,DrInputDialog,},
   //平台枚举
   dicts: [
     "mk_bo_type",
@@ -283,7 +338,7 @@ export default {
       //赢单状态数据
       winningStateData:{},
       //赢单状态表单校验
-      // 表单校验
+      // 赢单表单校验
       winningStateDataRules: {
         winningStateCause: [
           { required: true, message: "原因不能为空", trigger: "blur" }
@@ -316,8 +371,64 @@ export default {
       timer: "",
       //是否显示客户
       showCustomer: false,
+      //分配参数
+      allocationForm: {
+        boId: null,
+        allocationStaff: null,
+        allocationStaffName: null,
+        isParticipant: true,
+      },
+      //分配表单校验
+      allocationFormRules: {
+        allocationStaff: [
+          { required: true, message: "新负责人不能为空", trigger: "blur" }
+        ],
+      },
+      //分配弹窗
+      allocationPopover: false,
+      //营收总额
+      totalRevenue:"***营收总额",
+      //预估额
+      estimate:"***预估额(万元)",
     };
   },
+  watch: {
+    'form.basic.boType': {
+      handler(newVal, oldVal) {
+        console.log('newVal',newVal);
+        switch(newVal) {
+          case '0':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '1':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材采集预估额(万元)"
+            break;
+          case '2':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '3':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院设备预估额(万元)"
+            break;
+          case '4':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '5':
+            this.totalRevenue = "项目总额";
+            this.estimate = "工程预估额(万元)"
+            break;
+          default:
+              break;
+        }
+      },
+      immediate: true,
+      deep: true // 可以深度检测到 person 对象的属性值的变化
+    }
+  },
   //方法
   methods: {
     // 返回
@@ -377,6 +488,31 @@ export default {
       this.winningStateOpen = false;
       this.resetWinningStateData();
     },
+    //打开分配弹窗
+    allocation() {
+      this.allocationPopover = true;
+    },
+    //提交分配表单
+    submitAllocationForm() {
+      // 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);
+      this.$refs["afform"].validate(valid => {
+        if (valid) {
+          allocationParticipant(this.allocationForm).then(response => {
+            console.log('response',response);
+            this.$modal.msgSuccess("分配成功");
+            this.allocationPopover = false;
+            this.reload();
+          });
+        }
+      });
+    },
+    //取消分配
+    cancelAllocation() {
+      this.allocationPopover = false;
+    },
     //重新加载数据
     reload(){
       //加载基础数据

+ 98 - 97
src/views/business/spd/bo/basic/index.vue

@@ -84,6 +84,17 @@
           ></el-option>
         </el-select>
       </el-form-item> -->
+      <el-form-item label="创建时间">
+        <el-date-picker
+          v-model="dateRange"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button
           type="primary"
@@ -142,7 +153,11 @@
       @cell-dblclick="enterDetails"
     >
       <el-table-column type="selection" align="center" />
-      <el-table-column label="编号" align="center" prop="boCode" />
+      <el-table-column
+        label="编号"
+        align="center"
+        prop="boCode"
+      />
       <el-table-column label="商机名称" align="center" prop="boName" />
       <el-table-column label="商机类型" align="center" prop="boType">
         <template slot-scope="scope">
@@ -168,7 +183,7 @@
       <el-table-column label="商机阶段" align="center" prop="boStageName" />
       <el-table-column label="客户名称" align="center" prop="customerName" />
       <el-table-column
-        label="医院耗材预估值(万元)"
+        label="预估值(万元)"
         align="center"
         prop="hosDiscreetValue"
       />
@@ -200,6 +215,7 @@
         fixed="right"
         align="center"
         class-name="small-padding fixed-width"
+        width="250"
       >
         <template slot-scope="scope">
           <el-button
@@ -223,13 +239,6 @@
             @click="handleBrowse(scope.row)"
             >查看</el-button
           >
-          <!-- <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-user"
-            @click="allocation(scope.row)"
-            >分配</el-button
-          > -->
           <el-button
             size="mini"
             type="text"
@@ -341,7 +350,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="医院营收总额" prop="totalHosRevenue">
+            <el-form-item :label="totalRevenue" prop="totalHosRevenue">
               <el-select
                 v-model="form.totalHosRevenue"
                 @change="totalHosRevenueChange"
@@ -359,7 +368,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item
-              label="医院耗材预估值(万元)"
+              :label="estimate"
               prop="hosDiscreetValue"
             >
               <el-input-number
@@ -431,55 +440,13 @@
           type="primary"
           @click="submitForm"
           v-if="this.operatingState != 'Browse'"
+          :disabled="submitButtonEditStatus"
           >确 定</el-button
         >
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
 
-    <!-- 分配商机负责人对话框 -->
-    <el-dialog
-      title="分配商机负责人"
-      :visible.sync="allocationPopover"
-      width="500px"
-      append-to-body
-    >
-      <el-form
-        :model="allocationForm"
-        label-width="150px"
-        :disabled="
-          this.form.winningState > 0 || this.operatingState == 'Browse'
-        "
-      >
-        <el-form-item label="新负责人" prop="allocationStaff">
-          <dr-input-dialog
-            v-model="allocationForm.allocationStaffName"
-            title="员工"
-            type="SUPPLIER_PARAM"
-            :dataMapping="{
-              allocationStaff: 'id',
-              allocationStaffName: 'name',
-            }"
-            :source="allocationForm"
-          ></dr-input-dialog>
-        </el-form-item>
-        <el-form-item label="是否将您作为参与人" prop="isParticipant">
-          <el-radio v-model="allocationForm.isParticipant" label="1"
-            >是</el-radio
-          >
-          <el-radio v-model="allocationForm.isParticipant" label="0"
-            >否</el-radio
-          >
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitAllocationForm"
-          >确 定</el-button
-        >
-        <el-button @click="cancelAllocation">取 消</el-button>
-      </div>
-    </el-dialog>
-
     <!-- 客户参照 -->
     <CustomerRef
       ref="customerSelect"
@@ -523,7 +490,6 @@ import OrgRef from "@/views/business/spd/bo/refer/org/index.vue";
 import DeptRef from "@/views/business/spd/bo/refer/dept/index.vue";
 import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";
 import { getBoNodeListByType } from "@/api/business/spd/bo/boNode";
-import DrInputDialog from "@/components/input-dialog/index.vue";
 
 export default {
   name: "Basic",
@@ -540,7 +506,6 @@ export default {
     OrgRef,
     DeptRef,
     StaffRef,
-    DrInputDialog,
   },
   data() {
     return {
@@ -633,15 +598,53 @@ export default {
       },
       //阶段列表
       mk_bo_stage: [],
-      //分配参数
-      allocationForm: {
-        allocationStaff: null,
-        isParticipant: "1",
-      },
-      //分配弹窗
-      allocationPopover: false,
+      // 查询日期范围
+      dateRange: [],
+      //确定按钮是否可点
+      submitButtonEditStatus:false,
+      //营收总额
+      totalRevenue:"***营收总额",
+      //预估额
+      estimate:"***预估额(万元)",
     };
   },
+  watch: {
+    'form.boType': {
+      handler(newVal, oldVal) {
+        console.log('newVal',newVal);
+        switch(newVal) {
+          case '0':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '1':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材采集预估额(万元)"
+            break;
+          case '2':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '3':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院设备预估额(万元)"
+            break;
+          case '4':
+            this.totalRevenue = "医院营收总额";
+            this.estimate = "医院耗材预估值(万元)"
+            break;
+          case '5':
+            this.totalRevenue = "项目总额";
+            this.estimate = "工程预估额(万元)"
+            break;
+          default:
+              break;
+        }
+      },
+      immediate: true,
+      deep: true // 可以深度检测到 person 对象的属性值的变化
+    }
+  },
   created() {
     this.getList();
   },
@@ -649,43 +652,41 @@ export default {
     /** 查询商机基础信息列表 */
     getList() {
       this.loading = true;
-      listBasic(this.queryParams).then((response) => {
-        this.basicList = response.rows;
-        //对商机名称进行加*
-        console.log(this.basicList);
-        for (var i = 0; i < this.basicList.length; i++) {
-          var arr = this.basicList[i].boName.split("-");
-          this.basicList[i].boName =
-            arr[0] +
-            "-" +
-            arr[1].substring(0, 2) +
-            "******" +
-            arr[1].substring(arr[1].length - 2, arr[1].length) +
-            "-" +
-            arr[2];
+      listBasic(this.addDateRange(this.queryParams, this.dateRange)).then(
+        (response) => {
+          this.basicList = response.rows;
+          //对商机名称进行加*
+          console.log(this.basicList);
+          for (var i = 0; i < this.basicList.length; i++) {
+            var arr = this.basicList[i].boName.split("-");
+            this.basicList[i].boName =
+              arr[0] +
+              "-" +
+              arr[1].substring(0, 2) +
+              "******" +
+              arr[1].substring(arr[1].length - 2, arr[1].length) +
+              "-" +
+              arr[2];
 
-          var customerName = this.basicList[i].customerName;
-          this.basicList[i].customerName =
-            customerName.substring(0, 2) +
-            "******" +
-            customerName.substring(
-              customerName.length - 2,
-              customerName.length
-            );
+            var customerName = this.basicList[i].customerName;
+            this.basicList[i].customerName =
+              customerName.substring(0, 2) +
+              "******" +
+              customerName.substring(
+                customerName.length - 2,
+                customerName.length
+              );
+          }
+          this.total = response.total;
+          this.loading = false;
         }
-        this.total = response.total;
-        this.loading = false;
-      });
+      );
     },
     // 取消按钮
     cancel() {
       this.open = false;
       this.reset();
     },
-    //取消分配
-    cancelAllocation() {
-      this.allocationPopover = false;
-    },
     // 表单重置
     reset() {
       this.form = {
@@ -728,6 +729,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -779,11 +781,9 @@ export default {
         this.title = "基础信息";
       });
     },
-    allocation(row) {
-      this.allocationPopover = true;
-    },
     /** 提交按钮 */
     submitForm() {
+      this.submitButtonEditStatus = true;
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
@@ -791,19 +791,20 @@ export default {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           } else {
             addBasic(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
+              this.submitButtonEditStatus = false;
             });
           }
         }
+        this.submitButtonEditStatus = false;
       });
     },
-    //提交分配表单
-    submitAllocationForm() {},
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;

+ 258 - 1
src/views/business/spd/bo/basic/process.vue

@@ -999,7 +999,7 @@
           <Filemanager
             @reload="reload"
             :form="form"
-            :name="'设备清单'"
+            :name="'商机审议会'"
             :fileName="form.amfBoFlow.businessCouncilAccessoryName"
             :fileUrlid="form.amfBoFlow.businessCouncilAccessoryUrlId"
             :fileCreateBy="form.amfBoFlow.businessCouncilAccessoryCreateBy"
@@ -1184,6 +1184,221 @@
           </el-row>
         </el-form>
       </el-tab-pane>
+      <!-- 军队医疗设备商机页签 -->
+      <!-- 需求信息挖掘 -->
+      <el-tab-pane label="需求信息挖掘" name="t50101" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50101">
+        <el-descriptions >
+          <el-descriptions-item label="项目总额">
+            <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
+              <div>{{dict.label}}</div>
+            </div>
+          </el-descriptions-item>
+          <el-descriptions-item label="工程预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+        </el-descriptions>
+      </el-tab-pane>
+      <!-- 商机审核 -->
+      <el-tab-pane label="商机审核" name="t50201" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50201">
+        <el-descriptions >
+          <el-descriptions-item label="项目总额">
+            <div v-for="dict in dict.type.mk_bo_total_revenue" v-if="form.totalHosRevenue == dict.value">
+              <div>{{dict.label}}</div>
+            </div>
+          </el-descriptions-item>
+          <el-descriptions-item label="工程预估额(万元)">{{form.hosDiscreetValue}}</el-descriptions-item>
+        </el-descriptions>
+      </el-tab-pane>
+      <!-- 项目立项 -->
+      <el-tab-pane label="阶段动作" name="t50301" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50301">
+        <el-form :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+          <el-form-item label="项目立项是否通过" prop="projectApproval">
+            <el-radio
+              v-model="form.boEngineeringFlow.projectApproval"
+              label="1"
+              >是</el-radio
+            >
+            <el-radio
+              v-model="form.boEngineeringFlow.projectApproval"
+              label="0"
+              >否</el-radio
+            >
+          </el-form-item>
+          <Filemanager
+            @reload="reload"
+            :form="form"
+            :name="'商机审议会'"
+            :fileName="form.boEngineeringFlow.businessCouncilAccessoryName"
+            :fileUrlid="form.boEngineeringFlow.businessCouncilAccessoryUrlId"
+            :fileCreateBy="form.boEngineeringFlow.businessCouncilAccessoryCreateBy"
+            :field="'business_council_accessory'"
+            v-if="form.boEngineeringFlow.projectApproval == 1"
+          />
+          <Filemanager
+            @reload="reload"
+            :form="form"
+            :name="'立项书'"
+            :fileName="form.boEngineeringFlow.projectProposalAccessoryName"
+            :fileUrlid="form.boEngineeringFlow.projectProposalAccessoryUrlId"
+            :fileCreateBy="form.boEngineeringFlow.projectProposalAccessoryCreateBy"
+            :field="'project_proposal_accessory'"
+            v-if="form.boEngineeringFlow.projectApproval == 1"
+          />
+          <el-form-item label="项目未通过原因:" prop="noPassCause"  v-if="form.boEngineeringFlow.projectApproval == 0">
+            <el-row>
+              <el-col
+                :span="8"
+              >
+                <el-input
+                    v-model="form.boEngineeringFlow.noPassCause"
+                  />
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+      <!-- 考察 -->
+      <el-tab-pane label="考察" name="t50401" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50401">
+        <el-form :inline="true" :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+          <el-form-item label="考察开始日期" prop="impowerStartTime" >
+            <el-date-picker
+              value-format="yyyy-MM-dd"
+              v-model="form.boEngineeringFlow.inspectStartTime">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="考察结束日期" prop="impowerEndTime" >
+            <el-date-picker
+              value-format="yyyy-MM-dd"
+              v-model="form.boEngineeringFlow.inspectEndTime">
+            </el-date-picker>
+          </el-form-item>
+          <Filemanager
+            @reload="reload"
+            :form="form"
+            :name="'考察报告'"
+            :fileName="form.boEngineeringFlow.investigationReportAccessoryName"
+            :fileUrlid="form.boEngineeringFlow.investigationReportAccessoryUrlId"
+            :fileCreateBy="form.boEngineeringFlow.investigationReportAccessoryCreateBy"
+            :field="'investigation_report_accessory'"
+          />
+        </el-form>
+      </el-tab-pane>
+      <!-- 解决方案 -->
+      <el-tab-pane label="解决方案" name="t50501" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50501">
+        <el-form :inline="true" :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+          <el-form-item label="院方决策人" prop="hospitalPolicymaker" >
+            <el-input v-model="form.boEngineeringFlow.hospitalPolicymaker" />
+          </el-form-item>
+          <el-form-item label="资源方决策人" prop="resourcePolicymaker" >
+            <el-input v-model="form.boEngineeringFlow.resourcePolicymaker" />
+          </el-form-item>
+          <Filemanager
+            @reload="reload"
+            :form="form"
+            :name="'工程解决方案'"
+            :fileName="form.boEngineeringFlow.engineeringSolutionAccessoryName"
+            :fileUrlid="form.boEngineeringFlow.engineeringSolutionAccessoryUrlId"
+            :fileCreateBy="form.boEngineeringFlow.engineeringSolutionAccessoryCreateBy"
+            :field="'engineering_solution_accessory'"
+          />
+        </el-form>
+      </el-tab-pane>
+      <!-- 投标与签合同 -->
+      <el-tab-pane label="挂网投标" name="t50601" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50601">
+        <el-form :disabled="!isUpdate" :model="form.boEngineeringFlow" >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="挂网时间" prop="researchTime">
+                <el-date-picker
+                  value-format="yyyy-MM-dd"
+                  v-model="form.boEngineeringFlow.hangingTime"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <Filemanager
+              @reload="reload"
+              :form="form"
+              :name="'投标书'"
+              :fileName="form.boEngineeringFlow.biddingDocumentsAccessoryName"
+              :fileUrlid="form.boEngineeringFlow.biddingDocumentsAccessoryUrlId"
+              :fileCreateBy="form.boEngineeringFlow.biddingDocumentsAccessoryCreateBy"
+              :field="'bidding_documents_accessory'"
+            />
+          </el-row>
+          <el-row>
+            <el-col :span="5">
+              <el-form-item label="投标是否通过" prop="biddingDocumentsPass">
+                <el-radio
+                  v-model="form.boEngineeringFlow.biddingDocumentsPass"
+                  label="1"
+                  >是</el-radio
+                >
+                <el-radio
+                  v-model="form.boEngineeringFlow.biddingDocumentsPass"
+                  label="0"
+                  >否</el-radio
+                >
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-show="this.form.boEngineeringFlow.biddingDocumentsPass == '1'">
+            <el-col :span="8">
+              <el-form-item label="我方优势" prop="ourAdvantage">
+                <el-input
+                  v-model="form.boEngineeringFlow.ourAdvantage"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-show="this.form.boEngineeringFlow.biddingDocumentsPass == '0'">
+            <el-col :span="8">
+              <el-form-item label="我方劣势" prop="ourAdvantage">
+                <el-input
+                  v-model="form.boEngineeringFlow.ourAdvantage"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-if="form.boEngineeringFlow.biddingDocumentsPass == 1">
+            <Filemanager
+              @reload="reload"
+              :form="form"
+              :name="'中标通知书'"
+              :fileName="form.boEngineeringFlow.letterAcceptanceAccessoryName"
+              :fileUrlid="form.boEngineeringFlow.letterAcceptanceAccessoryUrlId"
+              :fileCreateBy="form.boEngineeringFlow.letterAcceptanceAccessoryCreateBy"
+              :field="'letter_acceptance_accessory'"
+            />
+          </el-row>
+        </el-form>
+      </el-tab-pane>
+      <el-tab-pane label="合同签订" name="t50602" style="height: 200px; overflow-y: scroll" v-if="tabsName.t50602">
+        <el-form :disabled="!isUpdate" :model="form.boEngineeringFlow">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="合同签订时间" prop="contractSigningTime">
+                <el-date-picker
+                  value-format="yyyy-MM-dd"
+                  v-model="form.boEngineeringFlow.contractSigningTime"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <Filemanager
+              @reload="reload"
+              :form="form"
+              :name="'合同文件'"
+              :fileName="form.boEngineeringFlow.contractDocumentAccessoryName"
+              :fileUrlid="form.boEngineeringFlow.contractDocumentAccessoryUrlId"
+              :fileCreateBy="form.boEngineeringFlow.contractDocumentAccessoryCreateBy"
+              :field="'contract_document_accessory'"
+            />
+          </el-row>
+        </el-form>
+      </el-tab-pane>
 
       <!-- 公用页签 -->
       <el-tab-pane label="项目成员" name="tB" style="height: 200px; overflow-y: scroll" v-if="tabsName.B">
@@ -1307,6 +1522,14 @@ export default {
         t40701:false,
         t40702:false,
 
+        t50101:false,
+        t50201:false,
+        t50301:false,
+        t50401:false,
+        t50501:false,
+        t50601:false,
+        t50602:false,
+
         A:false,
         B:false,
       },
@@ -1621,6 +1844,32 @@ export default {
           this.tabsName.t40702 = true;
           this.tabsName.A = true;
           break;
+        case '5-01':
+          this.activeName = 't50101';
+          this.tabsName.t50101 = true;
+          break;
+        case '5-02':
+          this.activeName = 't50301';
+          this.tabsName.t50301 = true;
+          this.tabsName.B = true;
+          this.tabsName.A = true;
+          break;
+        case '5-03':
+          this.activeName = 't50401';
+          this.tabsName.t50401 = true;
+          this.tabsName.A = true;
+          break;
+        case '5-04':
+          this.activeName = 't50501';
+          this.tabsName.t50501 = true;
+          this.tabsName.A = true;
+          break;
+        case '5-05':
+          this.activeName = 't50601';
+          this.tabsName.t50601 = true;
+          this.tabsName.t50602 = true;
+          this.tabsName.A = true;
+          break;
         default:
           break;
       }
@@ -1675,6 +1924,14 @@ export default {
         t40701:false,
         t40702:false,
 
+        t50101:false,
+        t50201:false,
+        t50301:false,
+        t50401:false,
+        t50501:false,
+        t50601:false,
+        t50602:false,
+
         A:false,
         B:false,
       };

+ 3 - 2
src/views/business/spd/bo/behavior/behaviorList.vue

@@ -75,7 +75,8 @@
       <el-table-column label="销售组织" align="center" prop="salesOrgName" v-if="source == 'Behavior'"/>
       <el-table-column label="部门" align="center" prop="deptName" v-if="source == 'Behavior'"/>
 
-      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true">
+      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+      <!-- <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" v-if="this.source == 'BoDetails' ? this.bo.winningState == 0 ? true : false : true"> -->
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -396,6 +397,7 @@ export default {
     };
   },
   created() {
+    console.log('this.boAuthority',this.boAuthority);
     if(this.source == 'Behavior'){
       this.queryParams = this.bo;
     }
@@ -409,7 +411,6 @@ export default {
       this.queryParams.taskCode = this.bo.code;
       console.log("this.bo", this.bo);
     }
-    console.log("this.queryParams", this.queryParams);
     this.getList();
   },
   methods: {

+ 10 - 1
src/views/business/spd/bo/behavior/index.vue

@@ -15,7 +15,7 @@
       </el-form-item>
     </el-form>
 
-    <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" />
+    <BehaviorList :key="timer" :source = "'Behavior'" :bo="queryParams" :boAuthority="boAuthority" />
   </div>
 </template>
 
@@ -78,6 +78,15 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
+      //行动权限写死
+      boAuthority:{
+        boAuthority:{
+          behaviorAdd:true,
+          behaviorEdit:true,
+          behaviorView:true,
+          behaviorDel:true,
+        }
+      },
     };
   },
   created() {

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

@@ -449,6 +449,8 @@ export default {
   created() {
     if(this.source == 'BoDetails'){
       this.queryParams.customer = this.bo.customer;
+      let params = {"post":this.boAuthority.post};
+      this.queryParams.params = params;
     }
     if(this.source == 'Contact'){
       this.queryParams = this.bo;

+ 10 - 1
src/views/business/spd/bo/contact/index.vue

@@ -222,7 +222,7 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" />
+    <ContactList :key="timer" :source = "'Contact'" :bo="this.queryParams" :boAuthority="boAuthority" />
   </div>
 </template>
 
@@ -333,6 +333,15 @@ export default {
       },
       //重新加载子组件参数
       timer: '',
+      //列表权限写死
+      boAuthority:{
+        boAuthority:{
+          contactAdd:true,
+          contactEdit:true,
+          contactView:true,
+          contactDel:true,
+        }
+      },
     };
   },
   created() {

+ 26 - 5
src/views/business/spd/bo/education/educationList.vue

@@ -89,7 +89,9 @@
             v-model="form.enrollDate"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="请选择入学日期">
+            placeholder="请选择入学日期"
+            :picker-options="editStartOptions"
+            >
           </el-date-picker>
         </el-form-item>
         <el-form-item label="毕业日期" prop="graduationDate">
@@ -97,7 +99,9 @@
             v-model="form.graduationDate"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="请选择毕业日期">
+            placeholder="请选择毕业日期"
+            :picker-options="editStopOptions"
+            >
           </el-date-picker>
         </el-form-item>
         <el-form-item label="学校名称" prop="school">
@@ -170,10 +174,10 @@ export default {
       // 表单校验
       rules: {
         enrollDate: [
-          { required: true, message: "入学日期不能为空", trigger: "blur" }
+          { required: true, message: "入学日期不能为空", trigger: ["blur", "change"] }
         ],
         graduationDate: [
-          { required: true, message: "毕业日期不能为空", trigger: "blur" }
+          { required: true, message: "毕业日期不能为空", trigger: ["blur", "change"] }
         ],
         school: [
           { required: true, message: "学校名称不能为空", trigger: "blur" }
@@ -181,7 +185,24 @@ export default {
         education: [
           { required: true, message: "学历不能为空", trigger: "blur" }
         ],
-      }
+      },
+      editStartOptions: {
+        disabledDate: time => {
+          if (!this.form.graduationDate) {
+            return time.getTime() < new Date(1970 - 1 - 1).getTime();   //禁止选择1970年以前的日期
+          } else {
+            return time.getTime() > new Date(this.form.graduationDate);
+          }
+        }
+      },
+      editStopOptions: {
+        disabledDate: time => {
+          return (
+            time.getTime() < new Date(this.form.enrollDate) ||
+            time.getTime() < new Date(1970 - 1 - 1).getTime()    //禁止选择1970年以前的日期
+          );
+        }
+      },
     };
   },
   created() {

+ 18 - 4
src/views/business/spd/bo/filetemplate/index.vue

@@ -2,11 +2,18 @@
   <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="boType">
-        <el-input
-          v-model="queryParams.url"
+        <el-select
+          v-model="queryParams.boType"
+          @change="boTypeChange"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+        >
+          <el-option
+            v-for="dict in dict.type.mk_bo_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          ></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="模板名称" prop="name">
         <el-input
@@ -47,6 +54,8 @@
         </template>
       </el-table-column>
       <el-table-column label="模板名称" align="center" prop="name" />
+      <el-table-column label="上传者" align="center" prop="createByName" />
+      <el-table-column label="上传时间" align="center" prop="createTime" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -176,6 +185,11 @@ export default {
     this.getList();
   },
   methods: {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
     /** 查询文件模板列表 */
     getList() {
       this.loading = true;

+ 8 - 6
src/views/business/spd/bo/statement/proportion/index.vue

@@ -2,11 +2,12 @@
   <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-input
-          v-model="queryParams.code"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-date-picker
+          type="month"
+          v-model="queryParams.yearMonth"
+          placeholder="选择月份"
+          >
+        </el-date-picker>
       </el-form-item>
       <el-form-item label="商机类型" prop="boType">
         <el-select
@@ -104,6 +105,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        yearMonth: null,
         boType: null,
         boSource: null,
         deptName: null,
@@ -116,7 +118,6 @@ export default {
     };
   },
   created() {
-    this.queryParams.boType = 0;
     this.getList();
   },
   methods: {
@@ -159,6 +160,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      console.log('this.queryParams',this.queryParams);
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 21 - 2
src/views/business/spd/bo/task/taskList.vue

@@ -252,6 +252,7 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 placeholder="请选开始时间"
+                :picker-options="editStartOptions"
               >
               </el-date-picker>
             </el-form-item>
@@ -264,6 +265,7 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 placeholder="请选择截止时间"
+                :picker-options="editStopOptions"
               >
               </el-date-picker>
             </el-form-item>
@@ -532,10 +534,10 @@ export default {
           { required: true, message: "负责人不能为空", trigger: "blur" },
         ],
         startTime: [
-          { required: true, message: "开始时间不能为空", trigger: "blur" },
+          { required: true, message: "开始时间不能为空", trigger: ["blur", "change"] },
         ],
         deadlineTime: [
-          { required: true, message: "截止时间不能为空", trigger: "blur" },
+          { required: true, message: "截止时间不能为空", trigger: ["blur", "change"] },
         ],
         content: [
           { required: true, message: "任务内容不能为空", trigger: "blur" },
@@ -545,6 +547,23 @@ export default {
       timer: "",
       //当前操作状态
       operatingState: "",
+      editStartOptions: {
+        disabledDate: time => {
+          if (!this.form.deadlineTime) {
+            return time.getTime() < new Date(1970 - 1 - 1).getTime();   //禁止选择1970年以前的日期
+          } else {
+            return time.getTime() > new Date(this.form.deadlineTime);
+          }
+        }
+      },
+      editStopOptions: {
+        disabledDate: time => {
+          return (
+            time.getTime() < new Date(this.form.startTime) ||
+            time.getTime() < new Date(1970 - 1 - 1).getTime()    //禁止选择1970年以前的日期
+          );
+        }
+      },
     };
   },
   created() {

+ 0 - 17
src/views/common-dialog/api/index.js

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

+ 0 - 214
src/views/common-dialog/currency.vue

@@ -1,214 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "CurrencyInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "name",
-        title: "币种",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "code",
-        title: "币种简称",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "",
-        title: "单价精度",
-      },
-      {
-        key: "",
-        title: "单价舍入规则",
-      },
-      {
-        key: "",
-        title: "金额精度",
-      },
-      {
-        key: "",
-        title: "金额舍入规则",
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puCurrType",
-      showKey: "name",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 198
src/views/common-dialog/department.vue

@@ -1,198 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "DepartmentInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "deptId",
-        title: "组织编码",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "deptName",
-        title: "组织名称",
-        type: "Input",
-        search: true,
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puDept",
-      showKey: "deptName",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 20
src/views/common-dialog/index.js

@@ -1,20 +0,0 @@
-// 员工
-import user from "./user.vue";
-// 组织
-import organization from "./organization.vue";
-// 部门
-import department from "./department.vue";
-// 供应商
-import supplier from "./supplier.vue";
-// 税率
-import tax from "./tax.vue";
-// 币种
-import currency from "./currency.vue";
-
-export const User = user;
-export const Organization = organization;
-export const Department = department;
-export const Supplier = supplier;
-export const Tax = tax;
-export const Currency = currency;
-export default { Tax, User, Supplier, Currency, Department, Organization };

+ 0 - 204
src/views/common-dialog/organization.vue

@@ -1,204 +0,0 @@
-<script>
-import { list, refer } from "./api/index";
-import { initParams } from "@/utils/init-something";
-
-export default {
-  name: "OrganizationInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "deptId",
-        title: "组织编码",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "deptName",
-        title: "组织名称",
-        type: "Input",
-        search: true,
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puOrg",
-      showKey: "deptName",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        // const { code, msg, rows, total } = await refer({
-        //   pageNum,
-        //   pageSize,
-        //   isPage: true,
-        //   type: "ORG_PARAM",
-        // });
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 203
src/views/common-dialog/payment-plan.vue

@@ -1,203 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "PaymentPlanInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "",
-        title: "付款协议名称",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "",
-        title: "付款协议编码",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "",
-        title: "管理组织",
-      },
-      {
-        key: "",
-        title: "有效期开始时间",
-      },
-      {
-        key: "",
-        title: "有效期结束时间",
-      },
-      {
-        key: "",
-        title: "说明",
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puTaxRate",
-      showKey: "mattaxesname",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params.deptName = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 198
src/views/common-dialog/supplier.vue

@@ -1,198 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "SupplierInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "code",
-        title: "供应商编码",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "name",
-        title: "供应商名称",
-        type: "Input",
-        search: true,
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puSupplier",
-      showKey: "name",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 198
src/views/common-dialog/tax.vue

@@ -1,198 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "TaxInputDialog",
-  props: ["title", "value"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "mattaxesname",
-        title: "税目税率名称",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "mattaxescode",
-        title: "税目税率编码",
-        type: "Input",
-        search: true,
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puTaxRate",
-      showKey: "mattaxesname",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 226
src/views/common-dialog/user.vue

@@ -1,226 +0,0 @@
-<script>
-import { initParams } from "./utils/init-something";
-import { list } from "./api/index";
-
-export default {
-  name: "UserInputDialog",
-  props: ["title"],
-  components: {},
-  data() {
-    const columns = [
-      {
-        key: "userName",
-        title: "员工姓名",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "userId",
-        title: "员工编码",
-        type: "Input",
-        search: true,
-      },
-      {
-        key: "orgName",
-        title: "任职(兼职)组织",
-        type: "Input",
-        width: 200,
-      },
-      {
-        key: "deptName",
-        title: "部门",
-        type: "Input",
-        width: 200,
-      },
-      {
-        key: "",
-        title: "岗位",
-        type: "Input",
-      },
-      {
-        key: "email",
-        title: "邮箱",
-        type: "Input",
-        width: 200,
-      },
-      {
-        key: "",
-        title: "职位",
-        type: "Input",
-      },
-    ];
-    const initTableColumns = () => columns.filter((column) => column.key);
-    const initSearchColumns = () => columns.filter((column) => column.search);
-    return {
-      // global
-      size: "mini",
-      width: "50%",
-      page: { pageNum: 1, pageSize: 25, total: 0 },
-      pageSizes: [25, 50],
-      layout: "prev, pager, next, jumper",
-      api: "puPersonnel",
-      showKey: "userName",
-      // dialog
-      visible: false,
-      loading: false,
-      // search
-      searchColumns: initSearchColumns(),
-      params: initParams(initSearchColumns()),
-      // table
-      tableColumns: initTableColumns(),
-      data: [],
-      currentData: null,
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    // set dialog visible
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    // do something before dialog open
-    beforeOpen() {
-      const { value } = this.$props;
-      this.params[this.showKey] = value;
-      this.fetchList(this.params, this.page);
-    },
-    // fetch table data
-    async fetchList(prop, page) {
-      try {
-        this.loading = true;
-        const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list(this.api, {
-          ...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) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-        this.setCurrentData(
-          this.data.find(
-            (column) => column[this.showKey] === this.currentData[this.showKey]
-          )
-        );
-      }
-    },
-    // 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);
-    },
-    // select row data
-    selectCurrentData(row) {
-      this.currentData = row;
-    },
-    // set row data highlight
-    setCurrentData(row) {
-      this.$refs.singleTable.setCurrentRow(row);
-    },
-    //
-    confirm() {
-      if (this.currentData) {
-        this.$emit("confirm", this.currentData);
-      }
-      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">
-      <el-form-item
-        v-for="(column, index) in searchColumns"
-        :key="index"
-        :label="column.title"
-      >
-        <el-input v-model="params[column.key]" @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"
-      ref="singleTable"
-      height="45vh"
-      highlight-current-row
-      style="width: 100%; margin-bottom: 20px"
-      @row-click="selectCurrentData"
-    >
-      <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">确 定</el-button>
-    </div>
-  </el-dialog>
-</template>
-<style scoped></style>

+ 0 - 3
src/views/common-dialog/utils/init-something.js

@@ -1,3 +0,0 @@
-import { arr2obj } from "@/utils/data-transform";
-
-export const initParams = (arr) => arr2obj(arr, "key", "value");

+ 54 - 54
src/views/marketing/dealer-authorization/authprivAdd.vue

@@ -1,7 +1,7 @@
 <!-- 经销商授权信息 编辑新增-->
 <template>
   <el-dialog :title="isAdd ? '新增' : '编辑'" :visible.sync="visible" :close-on-click-modal="false"
-    :close-on-press-escape="false" :before-close="beforeClose">
+    :close-on-press-escape="false" :before-close="beforeClose" @close="$emit('close')">
     <el-form :model="formData" ref="authprivAdd" label-position="left" label-width="120px" v-loading="loading">
 
       <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key"
@@ -27,43 +27,30 @@
 </template>
 
 <script>
-import dealerApi from '@/api/marketing/dealer-authorization'
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
+
+const initFormColumns = () =>
+  FormColumns.map((column) => {
+    const clearable = column.clearable || true;
+    return {
+      ...column,
+      clearable,
+    };
+  });
 
 export default {
 
   name: 'authprivAdd',
 
   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.map((column) => {
-        const clearable = column.clearable || true;
-        return {
-          ...column,
-          clearable,
-        };
-      });
-
-    const initFormData = () => arr2Obj(initFormColumns(), "key", "value")
 
     return {
       visible: false,
       isAdd: true,
       loading: false,
-      formData: { ...initFormData() },
+      formData: { ...initParams(initFormColumns()) },
       formColumns: initFormColumns(),
 
     }
@@ -71,41 +58,41 @@ export default {
   methods: {
     // 控制弹窗展示
     setVisible(val) {
-
       this.visible = val;
-
     },
     setFormData(data) {
 
-      this.loading = true;
       if (data.id) {
 
+        this.loading = true;
+
+        this.isAdd = false;
+
         let objData = { ...data };
 
         objData['time'] = [objData.startTime, objData.endTime];
 
-        // delete data.startTime
-        // delete data.endTime
         this.formData = objData;
 
+        setTimeout(() => {
+          this.loading = false;
+        }, 250);
+
+        return
       }
 
-      setTimeout(() => {
-        this.loading = false;
-      }, 250);
-      
+      this.isAdd = true;
     },
     // 重置表单数据
     handleResetData() {
-      for (const key in this.formData) {
-        this.formData[key] = '';
+      this.formData = {
+        ...initParams(initFormColumns())
       }
-
       this.$refs['authprivAdd'].clearValidate();
     },
     // 取消
     handleCancel() {
-        this.handleResetData();
+      this.handleResetData();
       this.setVisible(false);
     },
     // 确定
@@ -113,35 +100,48 @@ export default {
 
       console.log(this.formData, 'this.formData');
 
-      this.$refs[formName].validate((valid) => {
+      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;
+
           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'),
+            ...(
+              this.isAdd ? {
+                status: '0',
+                createPerson: name,
+                createTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+              } : {}
+            )
+
           }
           delete params['time']
           console.log(params, 'params--------');
 
-          if (this.isAdd) {
-            // 新增
-            dealerApi.dealerInsert(params).then(res => {
-
-            }).catch(error => {
-
-            })
-          } else {
-            // 编辑
-            dealerApi.dealerUpdate(params).then(res => {
+          try {
+            this.loading = true;
+            let { code, msg } = await (this.isAdd ?
+              dealerApi.insert(params) :
+              dealerApi.update(params))
 
-            }).catch(error => {
+            if (code === 200) {
+              this.handleCancel();
+            }
 
-            })
+          } catch (error) {
+            console.log(error, 'error');
+          } finally {
+            this.loading = false;
           }
 
-          // this.setVisible(false);
         } else {
           console.log('error submit!!');
           return false;

+ 56 - 0
src/views/marketing/dealer-authorization/column.js

@@ -0,0 +1,56 @@
+export const TableColumns = [
+  { key: "authorizedProductsCode", title: "授权产品 编码", show: true, width: 160 },
+  { key: "dealerName", title: "经销商名称", show: true, width: 200 },
+  { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false, },
+  { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true, width: 200 },
+  { key: "authorizedProductsName", title: "授权产品 名称", show: true, width: 200 },
+  { key: "status", title: "状态", show: true },
+  { key: "createPerson", title: "创建人", show: true },
+  { key: "createTime", title: "创建时间", show: true, width: 160 },
+  { key: "updatePerson", title: "最后修改人", show: true },
+  { key: "updateTime", title: "最后修改时间", show: true, width: 160 },
+  { key: "id", title: "主键id----该值不显示", show: false },
+  { key: "startTime", title: "开始时间", show: false },
+  { key: "endTime", title: "结束时间", show: false },
+  { key: "issueTime", title: "授权书开具时间", show: false },
+]
+
+export const SearchColumns = [
+  { key: "dealerName", title: "经销商名称", type: "Input" },
+  { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
+  { key: "authorizedProductsName", title: "授权产品", type: "Input" },
+  // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+  {
+    key: "status", title: "状态", type: "Select", options: [
+      { value: 0, label: '自由态' },
+      { value: 1, label: '审批中' },
+      { value: 2, label: '已审核' },
+      { value: 3, label: '已驳回' },
+    ]
+  },
+  // { title: "授权时间", key: "time", type: "DateRange" },
+  {
+    title: "授权时间",
+    key: "startTime",
+    type: "Date",
+    config: {
+      placeholder: '开始时间'
+    }
+  },
+  {
+    title: "至",
+    key: "endTime",
+    type: "Date",
+    config: {
+      placeholder: '结束时间'
+    }
+  },
+]
+
+export 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' },
+]

+ 86 - 105
src/views/marketing/dealer-authorization/index.vue

@@ -2,7 +2,7 @@
 <template>
   <el-card class="dealerAuthorization" v-loading="loading" :body-style="{ padding: 0 }">
 
-    <authprivAdd ref="addDialogRef"></authprivAdd>
+    <authprivAdd ref="addDialogRef" @close="handleRefresh"></authprivAdd>
     <authprivSee ref="seeDialogRef"></authprivSee>
 
     <!-- 检索区 -->
@@ -13,14 +13,18 @@
 
         <el-input v-if="column.type == 'Input'" v-model="searchParams[column.key]" clearable></el-input>
 
-        <el-select v-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
+        <el-select v-else-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
           <el-option v-for="op in column.options" :label="op.label" :value="op.value"></el-option>
         </el-select>
 
-        <el-date-picker v-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable type="daterange"
-          format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
+        <el-date-picker v-else-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable
+          type="daterange" format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
           end-placeholder="结束日期">
         </el-date-picker>
+
+        <el-date-picker v-else-if="column.type == 'Date'" v-model="searchParams[column.key]" format="yyyy-MM-dd "
+          clearable value-format="yyyy-MM-dd" type="date" :placeholder="column.config.placeholder" style="width: 192px;">
+        </el-date-picker>
       </el-form-item>
 
       <el-form-item>
@@ -36,7 +40,7 @@
       <el-col :span="24" style="text-align: right">
         <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="handleSubmit">提交</el-button> -->
         <el-button size="mini" @click="handleDownload">下载授权书</el-button>
       </el-col>
     </el-row>
@@ -44,147 +48,102 @@
     <!-- 数据展示 -->
     <el-table class="da-table" @row-dblclick="handleOpenSeeDialog" @select="handleSelect" :data="tableData"
       highlight-current-row max-height="500">
-      <el-table-column type="selection" width="35"></el-table-column>
+      <el-table-column type="selection" width="45"></el-table-column>
       <el-table-column type="index" width="55" label="序号"></el-table-column>
       <el-table-column v-for="column in tableColumns" :label="column.title" v-if="column.show"
-        :width="column.width || 180">
+        :width="column.width || 120" show-overflow-tooltip>
         <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 type="text" size="small" @click="handleOpenAddDialog(scope.row)"
+          <el-button type="text" size="mini" @click="handleOpenAddDialog(scope.row)"
             v-hasPermi="['pu:authorization:edit']">编辑</el-button>
-          <el-button type="text" size="small" @click="handleDelDialog(scope.row)"
+          <el-button type="text" size="mini" @click="handleDelDialog(scope.row)"
+            v-if="scope.row.status == '0' || scope.row.status == '3'"
             v-hasPermi="['pu:authorization:remove']">删除</el-button>
-          <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button>
+          <!-- <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>
         </template>
       </el-table-column>
     </el-table>
 
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+    <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="total, prev, pager, next, sizes, jumper">
+      :layout="layout">
     </el-pagination>
 
   </el-card>
 </template>
 
 <script>
-import authprivAdd from './authprivAdd.vue';
-import authprivSee from './authprivSee.vue';
-import dealerApi from '@/api/marketing/dealer-authorization'
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { TableColumns, SearchColumns } from './column';
+import { initParams } from '../utils/init';
 
 export default {
 
   name: 'dealerAuthorization',
   components: {
-    authprivAdd,
-    authprivSee,
+    authprivAdd: () => import('./authprivAdd.vue'),
+    authprivSee: () => import('./authprivSee.vue'),
   },
 
   data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    // 查询条件列
-    const searchColumns = [
-      { key: "dealerName", title: "经销商名称", type: "Input" },
-      { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
-      { key: "authorizedProductsName", title: "授权产品", type: "Input" },
-      // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
-      {
-        key: "status", title: "状态", type: "Select", options: [
-          { value: 0, label: '自由态' },
-          { value: 1, label: '审批中' },
-          { value: 2, label: '已审核' },
-          { value: 3, label: '已驳回' },
-        ]
-      },
-      { title: "授权时间", key: "time", type: "DateRange" },
-    ];
-
-    // 表列
-    const tableColumns = [
-      { key: "authorizedProductsCode", title: "授权产品 编码", show: true },
-      { key: "dealerName", title: "经销商名称", show: true },
-      { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false },
-      { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true },
-      { key: "authorizedProductsName", title: "授权产品 名称", show: true },
-      { key: "status", title: "状态", show: true },
-      { key: "createPerson", title: "创建人", show: true },
-      { key: "createTime", title: "创建时间", show: true },
-      { key: "updatePerson", title: "最后修改人", show: true },
-      { key: "updateTime", title: "最后修改时间", show: true },
-      { key: "id", title: "主键id----该值不显示", show: false },
-      { key: "startTime", title: "开始时间", show: false },
-      { key: "endTime", title: "结束时间", show: false },
-      { key: "issueTime", title: "授权书开具时间", show: false },
-    ];
-
-    const initTableColumns = () => tableColumns;
-    const initSearchColumns = () => searchColumns;
-    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
+    const initTableColumns = () => TableColumns;
+    const initSearchColumns = () => SearchColumns;
     return {
       loading: false,
       searchColumns: initSearchColumns(),
       searchParams: {
-        // isAsc: "desc",
-        // reasonable: "",
-        // orderByColumn: "",
-        ...initSearchParams(),
+        ...initParams(initSearchColumns()),
       },
       tableColumns: initTableColumns(),
-      tableData: [
-        {
-          authorizedProductsCode: "授权产品 编码",
-          dealerName: "经销商名称",
-          authorizedAreaCode: "授权区域/医院 编码",
-          authorizedAreaName: "授权区域/医院 名称",
-          authorizedProductsName: "授权产品 名称",
-          status: "0",
-          createPerson: "创建人",
-          createTime: "创建时间",
-          updatePerson: "最后修改人",
-          updateTime: "最后修改时间",
-          id: "主键id----该值不显示",
-          startTime: "2023-01-02",
-          endTime: "2025-01-01",
-          issueTime: "2023-01-02",
-        }
-      ],
+      tableData: [],
       checkedList: [],
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
+      page: {
+        pageNum: 1,
+        pageSize: 25,
+        total: 0
+      },
       pageSizes: [10, 20, 50, 100],
+      layout: 'total, prev, pager, next, sizes, jumper',
     }
   },
   methods: {
     // 查询---列表查询
-    handelSearch() {
+    async handelSearch() {
       this.loading = true;
       console.log(this.searchParams, '查询');
-      let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+      // let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+      let { pageNum, pageSize } = this.page;
       let params = {
         ...this.searchParams,
-        startTime: isTime ? this.searchParams.time[0] : '',
-        endTime: isTime ? this.searchParams.time[1] : '',
+        // startTime: isTime ? this.searchParams.time[0] : '',
+        // endTime: isTime ? this.searchParams.time[1] : '',
+        pageNum: pageNum,
+        pageSize: pageSize,
       }
       delete params['time']
       console.log(params, 'params--------');
 
-      dealerApi.dealerList(params, this.page).then(res => {
+      await dealerApi.list(params).then(res => {
         console.log(res, '获取列表');
+        let { code, rows, total } = res;
         this.loading = false;
+        if (code == 200) {
+          this.tableData = rows;
+          this.page.total = total;
+        }
       }).catch(error => {
         this.loading = false;
       })
     },
     // 重置
     handelResetSearch() {
+
       console.log('重置');
 
       for (const key in this.searchParams) {
@@ -217,7 +176,7 @@ export default {
     },
     // 刷新
     handleRefresh() {
-
+      this.handelSearch();
     },
     handleSizeChange(e) {
       this.page.pageSize = e;
@@ -249,38 +208,60 @@ export default {
       setVisible(true);
     },
     // 删除
-    handleDelDialog(rows) {
+    async handleDelDialog(rows) {
       console.log(rows, '删除');
-
-      // dealerApi.dealerDelete().then(res => {
-      //   console.log(res, '删除');
-      // }).catch(error => {
-
-      // })
+      let { id } = rows;
+      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;
+      }
     },
     // 提交
-    handleSubmit() {
-      console.log('批量提交');
+    handleSubmit(row) {
+
+      console.log(row, '提交');
       let params = {
         id: '',
         status: ''
       }
-      // 编辑
-      // dealerApi.dealerUpdate(params).then(res => {
-      //   console.log(res, '编辑');
+      // try {
+      //   this.loading = true;
+      //   let { code, msg } = await dealerApi.submitOA();
+      //   if (code == 200) {
+      //     this.handleRefresh();
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {
+      //   this.loading = false;
+
+      // }
+
 
-      // }).catch(error => {
 
-      // })
     },
     // 下载
     handleDownload() {
       console.log('下载');
+      // try {
+      //   let { code, msg } = await dealerApi.download();
+      //   if (code == 200) {
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {}
     },
 
   },
   created() {
-
+    this.handelSearch();
   }
 
 }

+ 22 - 0
src/views/marketing/utils/date.js

@@ -0,0 +1,22 @@
+// 对Date的扩展,将 Date 转化为指定格式的String
+// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, 
+// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) 
+// 例子: 
+// (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) {
+  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() //毫秒 
+  };
+  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)));
+  return fmt;
+}

+ 11 - 0
src/views/marketing/utils/init.js

@@ -0,0 +1,11 @@
+export  const arr2Obj = function (data, keyName, valueName) {
+  return Object.fromEntries(
+    data.map((item) => [item[keyName], item[valueName]])
+  );
+};
+
+export const initParams = (params) =>{
+
+  return arr2Obj(params, "key", "value")
+
+}

+ 7 - 0
src/views/monitor/job/log.vue

@@ -145,6 +145,13 @@
         align="center"
         prop="nickName"
       />
+ <el-table-column
+        label="任务员工编号"
+        width="80"
+        align="center"
+        prop="enpno"
+      />
+
       <el-table-column
         label="任务大类"
         width="80"

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

@@ -3,8 +3,8 @@
     <el-card>
       <span>采购需求汇总详情</span>
       <div class="btn_grooup">
-        <el-button type="primary" size="small">编辑</el-button>
-        <el-button type="primary" size="small">确定</el-button>
+        <el-button type="primary" size="small" @click="editLine">编辑</el-button>
+        <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>
         <el-button type="primary" size="small" @click="closeLine">行关闭</el-button>
         <el-button type="primary" size="small">重取批量</el-button>
       </div>
@@ -16,62 +16,94 @@
           @selection-change="handleSelectionChange"
         >
         <el-table-column type="selection" width="55" />
-        <el-table-column label="序号" align="center" prop="index"/>
+        <el-table-column label="序号" align="center" type="index"/>
         <el-table-column label="行号" align="center" prop="rowNo"/>
-        <el-table-column label="物料编码" align="center" prop="code"/>
-        <el-table-column label="品名" align="center" prop="code"/>
-        <el-table-column label="规格" align="center" prop="code"/>
-        <el-table-column label="单位" align="center" prop="code"/>
+        <el-table-column label="物料编码" align="center" prop="materialCode"/>
+        <el-table-column label="品名" align="center" prop="materialName"/>
+        <el-table-column label="规格" align="center" prop="specification"/>
+        <el-table-column label="单位" align="center" prop="unit"/>
         <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-        <el-table-column label="末级供应仓库库存量" align="center" prop="code"/>
-        <el-table-column label="月销量" align="center" prop="code"/>
-        <el-table-column label="采购周期" align="center" prop="code"/>
-        <el-table-column label="最终净需求量" align="center" prop="code"/>
-        <el-table-column label="最终采购量" align="center" prop="code"/>
-        <el-table-column label="需求客户" align="center" prop="code"/>
-        <el-table-column label="最小订货量" align="center" prop="code"/>
-        <el-table-column label="最小包装量" align="center" prop="code"/>
-        <el-table-column label="修改人" align="center" prop="code"/>
-        <el-table-column label="修改原因" align="center" prop="code"/>
-        <el-table-column label="业务备注" align="center" prop="code"/>
-        <el-table-column label="有效期" align="center" prop="code"/>
-        <el-table-column label="要求交货日期" align="center" prop="code"/>
-        <el-table-column label="紧急标识" align="center" prop="code"/>
-        <el-table-column label="补单标识" align="center" prop="code"/>
+        <el-table-column label="末级供应仓库存量" align="center" prop="lastWarehouseQty"/>
+        <el-table-column label="月销量" align="center" prop="totalMonthlySales"/>
+        <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
+        <el-table-column label="最终净需求量" align="center" prop="resDemandQty"/>
+        <el-table-column label="最终采购量" align="center" prop="puQtyRes"/>
+        <el-table-column label="需求客户" align="center" prop="customerName"/>
+        <el-table-column label="最小订货量" align="center" prop="minOrderQty"/>
+        <el-table-column label="最小包装量" align="center" prop="minPackage"/>
+        <el-table-column label="最小批量" align="center" prop="minBatch"/>
+        <el-table-column label="修改人" align="center" prop="updateByName"/>
+        <el-table-column label="修改原因" align="center" prop="updateCause"/>
+        <el-table-column label="业务备注" align="center" prop="remark"/>
+        <el-table-column label="有效期" align="center" prop="expiry"/>
+        <el-table-column label="要求交货日期" align="center" prop="deliveryDate"/>
+        <el-table-column label="紧急标识" align="center" prop="isUrgency">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isUrgency"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="补单标识" align="center" prop="isReplenishment">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isReplenishment"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
         <el-table-column label="需求单单号" align="center" prop="code"/>
-        <el-table-column label="供应仓库" align="center" prop="code"/>
-        <el-table-column label="供应库位" align="center" prop="code"/>
-        <el-table-column label="业务类型" align="center" prop="code"/>
-        <el-table-column label="行状态" align="center" prop="code"/>
-        <el-table-column label="收货仓库" align="center" prop="code"/>
-        <el-table-column label="收货货位" align="center" prop="code"/>
-        <el-table-column label="采购员" align="center" prop="code"/>
-        <el-table-column label="制单人" align="center" prop="code"/>
-        <el-table-column label="审核人员" align="center" prop="code"/>
-        <el-table-column label="请购单号" align="center" prop="code"/>
-        <el-table-column label="品类" align="center" prop="code"/>
-        <el-table-column label="注册人" align="center" prop="code"/>
-        <el-table-column label="集团预测分类" align="center" prop="code"/>
-        <el-table-column label="修改时间" align="center" prop="code"/>
-        <el-table-column label="采购员编码" align="center" prop="code"/>
-        <el-table-column label="采购组织" align="center" prop="code"/>
-        <el-table-column label="物料类别" align="center" prop="code"/>
-        <el-table-column label="有效期单位" align="center" prop="code"/>
-        <el-table-column label="最小批量" align="center" prop="code"/>
-        <el-table-column label="业务部门" align="center" prop="code"/>
-        <el-table-column label="需求部门" align="center" prop="code"/>
-        <el-table-column label="批号锁定标识" align="center" prop="code"/>
-        <el-table-column label="采购需求单审批人" align="center" prop="code"/>
-        <el-table-column label="需求单审批时间" align="center" prop="code"/>
-        <el-table-column label="需求单提交时间" align="center" prop="code"/>
-        <el-table-column label="需求单提交人" align="center" prop="code"/>
-        <el-table-column label="处理需求时间" align="center" prop="code"/>
-        <el-table-column label="处理需求人员" align="center" prop="code"/>
-        <el-table-column label="汇总确认人" align="center" prop="code"/>
-        <el-table-column label="汇总确认时间" align="center" prop="code"/>
-        <el-table-column label="转请购时间" align="center" prop="code"/>
-        <el-table-column label="转请购人员" align="center" prop="code"/>
-        <el-table-column label="价格类型" align="center" prop="code"/>
+        <el-table-column label="供应仓库" align="center" prop="lastWarehouseName"/>
+        <el-table-column label="供应货位" align="center" prop="lastAllocationName"/>
+        <el-table-column label="业务类型" align="center" prop="billType"/>
+        <el-table-column label="行状态" align="center" prop="status"/>
+        <el-table-column label="收货仓库" align="center" prop="deliveryWarehouseName"/>
+        <el-table-column label="收货货位" align="center" prop="deliveryAllocationName"/>
+        <el-table-column label="采购员" align="center" prop="buyerName"/>
+        <el-table-column label="制单人" align="center" prop="billMaker"/>
+        <el-table-column label="审核人员" align="center" prop="approver"/>
+        <!-- <el-table-column label="请购单号" align="center" prop="code"/> -->
+        <el-table-column label="品类" align="center" prop="materialCategory"/>
+        <el-table-column label="注册人" align="center" prop="registrant"/>
+        <el-table-column label="集团预测分类" align="center" prop="forecastClassify"/>
+        <el-table-column label="修改时间" align="center" prop="updateTime"/>
+        <el-table-column label="采购员编码" align="center" prop="buyer"/>
+        <el-table-column label="采购组织" align="center" prop="orgName"/>
+        <el-table-column label="有效期单位" align="center" prop="expiryUnit"/>
+        <el-table-column label="业务部门" align="center" prop="businessDeptName"/>
+        <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
+        <el-table-column label="批号锁定标识" align="center" prop="isBatchLock">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isBatchLock"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="采购需求单审批人" align="center" prop="approveName"/>
+        <el-table-column label="需求单审批时间" align="center" prop="approverFinishTime"/>
+        <el-table-column label="需求单提交时间" align="center" prop="createTime"/>
+        <el-table-column label="需求单提交人" align="center" prop="createByName"/>
+        <el-table-column label="处理需求时间" align="center" prop="processTime"/>
+        <el-table-column label="处理需求人员" align="center" prop="processPersonal"/>
+        <el-table-column label="汇总确认人" align="center" prop="affirmer"/>
+        <el-table-column label="汇总确认时间" align="center" prop="affirmerTime"/>
+        <!-- <el-table-column label="转请购时间" align="center" prop="code"/>
+        <el-table-column label="转请购人员" align="center" prop="code"/> -->
+        <el-table-column label="价格类型" align="center" prop="priceType"/>
       </el-table>
     </el-card>
 
@@ -84,7 +116,7 @@
 </template>
 
 <script>
-import {getSummaryDetail, shutDownSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryDetail, shutDownSummary, editSummaryMx } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'checkDemandSummary',
   props: ['pageStu','row', 'disable'],
@@ -94,8 +126,12 @@ export default {
   },
   data() {
     return{
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       tableList: [],
-      ids: []
+      ids: [],
+      lineDisable: true,
     }
   },
   created() {
@@ -128,6 +164,19 @@ export default {
         }
       })
     },
+    editLine() {
+      console.log('sonList`````', this.tableList)
+      this.lineDisable = false
+    },
+    saveLine() {
+      editSummaryMx(this.tableList).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("保存成功");
+          this.lineDisable = true
+          this.getDetails(this.row)
+        }
+      })
+    },
     // 行关闭
     closeLine() {
       if (this.ids.length == 0) {

+ 327 - 175
src/views/purchase/DemandSummary/index.vue

@@ -4,45 +4,38 @@
       <el-form class="search_area" label-width="120px">
         <el-row :gutter="10">
           <el-col :span="1.5">
-            <el-form-item label="单据状态">
-              <el-select v-model="queryParams.code" size="small" style="width: 200px" clearable>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+            <el-form-item label="行状态">
+              <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <el-input
-              v-model="queryParams.cgy"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-              />
+              <el-select size="small" v-model="queryParams.buyerName" @focus="chooseRefer('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-input
-              v-model="queryParams.pl"
+              <el-select
+              v-model="queryParams.materialName"
               size="small"
-              placeholder=""
               clearable
+              @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
               style="width: 200px"
-              />
+              >
+              <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="生产厂家">
               <el-input
-              v-model="queryParams.sccj"
+              v-model="queryParams.manufacturer"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
               />
@@ -50,8 +43,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="search">搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -60,55 +53,41 @@
         <div v-show="expanded">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="物料类别">
-                <el-select v-model="queryParams.wllb" size="small" style="width: 200px" clearable>
+              <el-form-item label="预测分类">
+                <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.predictive_classify" :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.zqdw" size="small" style="width: 200px" clearable>
+                <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.sys_period_unit" :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-input
-                v-model="queryParams.ywbm"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <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-input
-                v-model="queryParams.shr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <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">
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-form-item label="转请购单号">
                 <el-input
                 v-model="queryParams.zqgdh"
@@ -118,11 +97,11 @@
                 style="width: 200px"
                 />
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :span="1.5">
               <el-form-item label="采购需求单号">
                 <el-input
-                v-model="queryParams.cgxqdh"
+                v-model="queryParams.code"
                 size="small"
                 placeholder=""
                 clearable
@@ -133,7 +112,7 @@
             <el-col :span="1.5">
               <el-form-item label="注册人">
                 <el-input
-                v-model="queryParams.zcr"
+                v-model="queryParams.registrant"
                 size="small"
                 placeholder=""
                 clearable
@@ -143,12 +122,9 @@
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="业务类型">
-                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
+                <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -158,46 +134,31 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="单据来源">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
+                  <el-option
+                    v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="需求客户">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                  <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应仓库">
-                <el-input
-                v-model="queryParams.zcr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
+                  <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应库位">
-                <el-select 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 size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
+                  <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -206,38 +167,32 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="物料编码">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-input readonly size="small" v-model="queryParams.names" style="width: 200px">
+                  <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+                </el-input>
+                <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="默认采购组织">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+                  <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="需求日期">
-                <el-input
-                v-model="queryParams.zcr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.demandDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-form-item label="转请购时间">
                 <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
                   <el-option
@@ -248,30 +203,32 @@
                   </el-option>
                 </el-select>
               </el-form-item>
-            </el-col>
+            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="汇总审核时间">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.auditTime"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="汇总确认时间">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.yesTime"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
           </el-row>
@@ -282,8 +239,8 @@
     
       <el-card>
         <div class="btn_grooup">
-          <el-button type="primary" size="small">编辑</el-button>
-          <el-button type="primary" size="small">保存</el-button>
+          <el-button type="primary" size="small" @click="editList">编辑</el-button>
+          <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
           <el-button type="primary" size="small" @click="audits">审核</el-button>
@@ -299,72 +256,95 @@
             </el-dropdown-menu>
           </el-dropdown>
 
-          <el-button type="primary" size="small">转请购</el-button>
+          <!-- <el-button type="primary" size="small">转请购</el-button> -->
         </div>
         <el-table 
           :data="tableList" 
           fit
           show-summary
-          max-height="680"
+          max-height="480"
           @selection-change="handleSelectionChange"
+          :key="isUpdate"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column label="一级品类" align="center" prop="code"/>
-          <el-table-column label="物料编码" align="center" prop="code"/>
-          <el-table-column label="品名" align="center" prop="code"/>
-          <el-table-column label="规格" align="center" prop="code"/>
-          <el-table-column label="单位" align="center" prop="demandUnit"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="需求单位数" align="center" prop="code"/>
-          <el-table-column label="总最终净需求量" align="center" prop="code"/>
+          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
+          <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
+          <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
+          <el-table-column label="规格" align="center" prop="specification" width="200px"/>
+          <el-table-column label="单位" align="center" prop="unit"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
+          <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+          <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
+          <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column label="需求可用周期" align="center" prop="demandCycle"/>
+          <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
           <el-table-column label="呆滞量" align="center" prop="dullQut"/>
           <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
-          <el-table-column label="中心公共库存" align="center" prop="centralPublicStock"/>
-          <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse"/>
-          <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock"/>
-          <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock"/>
+          <el-table-column label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
+          <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
+          <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
+          <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
           <el-table-column label="电商仓库" align="center" prop="commerceWarehouse"/>
           <el-table-column label="采购在途" align="center" prop="buyTransit"/>
           <el-table-column label="借出在途" align="center" prop="lendTransit"/>
           <el-table-column label="调拨在途" align="center" prop="transferTransit"/>
           <el-table-column label="库存总计" align="center" prop="stockTotal"/>
-          <el-table-column label="最小包装量" align="center" prop="minPackage"/>
-          <el-table-column label="最小订货量" align="center" prop="minOrder"/>
+          <el-table-column label="最小包装量" align="center" prop="minPackage" width="100px"/>
+          <el-table-column label="最小订货量" align="center" prop="minOrder" width="100px"/>
           <el-table-column label="最小批量" align="center" prop="minBatch"/>
-          <el-table-column label="人工调整数" align="center" prop="artificialAdjust"/>
-          <el-table-column label="修改原因" align="center" prop="modifyReason"/>
-          <el-table-column label="建议采购量" align="center" prop="suggestionPurchase"/>
-          <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty"/>
-          <el-table-column label="最终采购量" align="center" prop="finalBuyQty"/>
-          <el-table-column label="二级品类" align="center" prop="code"/>
-          <el-table-column label="三级品类" align="center" prop="code"/>
-          <el-table-column label="四级品类" align="center" prop="code"/>
+          <el-table-column label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
+          <el-table-column label="修改原因" align="center" prop="modifyReason" width="150px">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
+          <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
+          <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
+          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
+          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
           <el-table-column label="单据状态" align="center" prop="status"/>
-          <el-table-column label="采购员" align="center" prop="buyerName"/>
-          <el-table-column label="默认采购组织" align="center" prop="code"/>
+          <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">
+                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+                </el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
+                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+                </el-input>
+            </template>
+          </el-table-column>
           <el-table-column label="有效期" align="center" prop="validityPeriod"/>
-          <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit"/>
+          <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="code"/>
+          <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
           <el-table-column label="单据来源" align="center" prop="billSource"/>
           <el-table-column label="行号" align="center" prop="rowNo"/>
-          <el-table-column label="注册人" align="center" prop="code"/>
+          <el-table-column label="注册人" align="center" prop="registrant"/>
           <el-table-column label="可用量" align="center" prop="qty"/>
-          <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy"/>
-          <el-table-column label="集团预测分类" align="center" prop="forecastClassification"/>
-          <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession"/>
-          <el-table-column label="中心仓可用量" align="center" prop="code"/>
-          <el-table-column label="物料类别" align="center" prop="materialCategory"/>
-          <el-table-column label="业务部门" align="center" prop="departmentName"/>
+          <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
+          <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
+          <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
+          <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
+          <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/>
+          <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/>
           <el-table-column label="需求单位" align="center" prop="demandUnit"/>
-          <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor"/>
+          <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
           <el-table-column
           fixed="right"
           label="操作"
           align="center"
-          width="150"
+          width="100"
           >
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
@@ -385,59 +365,137 @@
     </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"/>
+
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
   </div>
 </template>
 
 <script>
 import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
+import popDialog from '@/components/PopDialog/index.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
+  dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers,
+    TreeRefers,
+    popDialog
   },
   data() {
     return {
+      isUpdate: false,
       expanded: false,
       // 页面配置
       isList: true,
       // 页面状态
       page: '',
       queryParams: {
+        rowStatus: [],
+        buyerName: '',
+        materialName: '',
+        manufacturer: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
         code: '',
-        cgy: '',
-        pl: '',
-        sccj: '',
-        wllb: '',
-        zqdw: '',
-        ywbm: '',
-        shr: '',
-        zqgdh: '',
-        cgxqdh: '',
-        zcr: '',
-        ywlx: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCode: '',
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        auditTime: '',
+        yesTime: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
+      personOptions: [],
+      classOptions: [],
+      deptOptions: [],
+      auditOptions: [],
+      customerOptions: [],
+      lastWarehouseOptions: [],
+      lastAllocationOptions: [],
+      orgOptions: [],
       options: [{
         value: '0', label: '是',
       }, {
         value: '2', label: '否'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       tableList: [],
       total: 0,
       rowDetail: {},
       disable: false,
+      lineDisable: true,
       ids: [],
       allSelection: [],
+      // 子表index
+      tableIndex: null,
+      referConditionMx: {
+        type: '',
+        isPage: true,
+        title: ''
+      }
     }
   },
   created() {
     this.getList(this.queryParams)
   },
   methods: {
+    // 搜索
+    search() {
+      this.getList(this.queryParams)
+    },
+    reset() {
+      this.queryParams = {
+        rowStatus: [],
+        buyerName: '',
+        materialName: '',
+        manufacturer: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
+        code: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCode: '',
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        auditTime: '',
+        yesTime: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     getList(params){
       getSummaryList(params).then(res => {
         if (res.code === 200) {
@@ -474,6 +532,19 @@ export default {
     drop() {
       this.expanded = !this.expanded
     },
+    editList() {
+      console.log('Lists`````',this.tableList)
+      this.lineDisable = false
+    },
+    saveList() {
+      editSummaryList(this.tableList).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("保存成功");
+          this.lineDisable = true
+          this.getList(this.queryParams)
+        }
+      })
+    },
     confirms() {
       if (this.ids.length == 0) {
         this.$modal.msgWarning("请选中至少一条数据");
@@ -523,6 +594,80 @@ export default {
         })
       } 
     },
+    // 搜索区参照选择
+    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.title == '采购员') {
+        this.personOptions = selection
+        this.queryParams.buyerName = selection[0].id
+      }
+      if (this.referCondition.title == '业务部门') {
+        this.deptOptions = selection
+        this.queryParams.departmentName = selection[0].id
+      }
+      if (this.referCondition.title == '审核人') {
+        this.auditOptions = selection
+        this.queryParams.puManagerAuditor = selection[0].id
+      }
+      if (this.referCondition.title == '需求客户') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      if (this.referCondition.title == '末级供应仓库') {
+        this.lastWarehouseOptions = selection
+        this.queryParams.lastWarehouse = selection[0].id
+      }
+      if (this.referCondition.title == '末级供应库位') {
+        this.lastAllocationOptions = selection
+        this.queryParams.lastAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '默认采购组织') {
+        this.orgOptions = selection
+        this.queryParams.purchaseOrg = selection[0].id
+      }
+      if (this.referConditionMx.title == '采购员') {
+        console.log('选择进了吗',this.tableList)
+        this.tableList[this.tableIndex].buyer = selection[0].code
+        this.tableList[this.tableIndex].buyerName = selection[0].name
+      }
+      if (this.referConditionMx.title == '默认采购组织') {
+        console.log('选择进了吗',this.tableList)
+        this.tableList[this.tableIndex].purchaseOrg = selection[0].id
+        this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
+      }
+    },
+    // 搜索区树形选择
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.queryParams.materialName = selection.id
+    },
+    // 搜索区物料编码
+    chooseMaterial() {
+      this.$refs.materialRefer.init()
+    },
+    selectMaterial(selection) {
+      this.queryParams.materialCode = selection[0].id
+      this.queryParams.names = selection[0].name
+    },
+        // 明细行选择业务部门参照带出业务部门数据
+    chooseSon(index, type, isPage, title) {
+      this.tableIndex = index
+      this.referConditionMx.type = type
+      this.referConditionMx.isPage = isPage
+      this.referConditionMx.title = title
+      this.$refs.refer.init(this.referConditionMx)
+    }
   }
 }
 </script>
@@ -532,6 +677,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;
@@ -541,4 +687,10 @@ export default {
 .lines {
   margin-top: 0;
 }
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
 </style>

+ 79 - 57
src/views/purchase/MaterialClassDivision/add.vue

@@ -84,9 +84,10 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料编码">
-              <el-input :disabled="disable" style="width: 200px" size="small" readonly v-model="basicForm.material">
+              <el-input :disabled="disable" style="width: 200px" size="small" readonly v-model="basicForm.materialCode">
                   <el-button slot="append" icon="el-icon-more" @click="test01"></el-button>
               </el-input>
+              <el-input v-show="false" style="width: 200px" size="small" v-model="basicForm.material"></el-input>
             </el-form-item>
           </el-col>
 
@@ -123,12 +124,12 @@
                     style="width: 200px"
                     :disabled="disable"
                     clearable
-                    @focus="chooseOrganizations"
+                    @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
                     <el-option
                       v-for="item in organizationsOptions"
                       :key="item.id"
-                      :label="item.label"
+                      :label="item.name"
                       :value="item.id"
                     />
                 </el-select>
@@ -144,7 +145,7 @@
                   :disabled="disable"
                   v-model="basicForm.orderPersonal"
                   clearable
-                  @focus="chooseStaff"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
                 >
                   <el-option
                     v-for="item in staffOptions"
@@ -176,7 +177,7 @@
                   :disabled="disable"
                   v-model="basicForm.buyer"
                   clearable
-                  @focus="chooseStaff2"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
                 >
                   <el-option
                     v-for="item in staff2Options"
@@ -248,17 +249,7 @@
       :single="true"
     />
 
-    <orgs
-      ref="orgs"
-      @doSubmit="acceptOrgs"
-      :single="true"
-    />
-
-    <staff
-      ref="staff"
-      @doSubmit="acceptStaff"
-      :single="true"
-    />
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
 
     <staff2
       ref="staff2"
@@ -277,8 +268,9 @@ import { getDetail } from '@/api/classify/basic';
 // 物料编码
 import popDialog from '@/components/PopDialog/index.vue'
 // 公用一个树形(组织部门传值不同)
-import orgs from '@/components/PopDialog/organization.vue'
-import staff from '@/components/PopDialog/staff.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'
@@ -287,8 +279,7 @@ export default {
   components: {
     fourClass,
     popDialog,
-    orgs,
-    staff,
+    Refers,
     staff2
   },
   props: ['pageStu','row', 'disable'],
@@ -307,6 +298,7 @@ export default {
         materialClassifyThreeName: '',
         materialClassifyFourName: '',
         material: '',
+        materialCode: '',
         materialName: '',
         manufacturer: '',
         org: '',
@@ -325,6 +317,11 @@ export default {
       options: [{
         value: 0, label: '仓库1'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       organizationsOptions: [],
       staffOptions: [],
       staff2Options: [],
@@ -360,7 +357,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -369,9 +366,12 @@ export default {
       getDivisions(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
-          this.getOrgDetails(res.data.org)
-          this.getStaffDetails(res.data.orderPersonal)
-          this.getStaffDetails2(res.data.buyer)
+          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)
         }
       })
     },
@@ -400,7 +400,8 @@ export default {
     selectionsToInput (selections) {
       console.log('父组件拿到的:', selections)
       this.selectData = selections
-      this.basicForm.material = selections[0].code
+      this.basicForm.material = selections[0].id
+      this.basicForm.materialCode = selections[0].code
       this.basicForm.materialName = selections[0].name
     },
     // 显示物料编码列表
@@ -409,48 +410,69 @@ export default {
       this.$refs.contractSelect.init()
     },
     // 选择默认采购组织
-    acceptOrgs (selections) {
-      console.log('接收的采购组织', selections)
-      this.basicForm.org = selections.id
-      this.getOrgDetails(selections.id)
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
     },
-    // 默认采购组织显示列表
-    chooseOrganizations () {
-      this.$refs.organizations.blur()
-      this.$refs.orgs.init('1')
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '选择所属组织') {
+        this.organizationsOptions = selection
+        this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.basicForm.orderPersonal = selection[0].code
+        this.basicForm.orderPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.basicForm.buyer = selection[0].code
+        this.basicForm.buyerName = selection[0].name
+      }
     },
-    // 采购组织回显
-    getOrgDetails(id) {
-      getOrgs({deptId: id}).then(res => {
-        if (res.code === 200) {
-          this.organizationsOptions = res.data
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id }).then(res => {
+        if (type == 'ORG_PARAM') {
+          this.organizationsOptions = res.rows
         }
-      })
-    },
-    // 选择订单员
-    acceptStaff (selections) {
-      this.staffOptions = selections
-      this.basicForm.orderPersonal = selections[0].code
-      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
+        if (type == 'CONTACTS_PARAM' && title == '订单员') {
+          this.staffOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM' && title == '采购员') {
+          this.staff2Options = res.rows
         }
       })
     },
+    // 选择订单员
+    // 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)
     },
     // 采购员显示列表

+ 47 - 61
src/views/purchase/MaterialClassDivision/index.vue

@@ -5,50 +5,42 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料一级大类编码">
-              <el-select v-model="queryParams.materialClassifyOne" 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.materialClassifyOne"
+                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.materialClassifyOneName" 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.materialClassifyOneName"
+                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.materialClassifyTwo" 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.materialClassifyTwo"
+                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.materialClassifyTwoName" 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.materialClassifyTwoName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -64,26 +56,22 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料三级大类编码">
-              <el-select v-model="queryParams.materialClassifyThree" 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.materialClassifyThree"
+                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.materialClassifyThreeName" 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.materialClassifyThreeName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -100,14 +88,12 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类名称">
-              <el-select v-model="queryParams.materialClassifyFourName" 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.materialClassifyFourName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -211,19 +197,18 @@
               导出<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>
-          <el-button type="primary" size="small">打印</el-button>
         </div>
         <el-table 
           :data="tableList" 
           fit
-          max-height="680"
+          max-height="480"
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
@@ -236,7 +221,7 @@
           <el-table-column label="物料编码" align="center" width="150" prop="material" />
           <el-table-column label="物料名称" align="center" prop="materialName" />
           <el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column label="所属组织" align="center" width="120" prop="orgName" />
+          <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
           <el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
           <el-table-column label="采购员" align="center" width="150" prop="buyerName" />
           <el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
@@ -308,7 +293,7 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
         value: 0, label: '仓库1'
@@ -385,6 +370,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;

+ 410 - 186
src/views/purchase/PurchaseDemandList/add.vue

@@ -8,8 +8,7 @@
               <el-input
                 v-model="basicForm.code"
                 size="small"
-                placeholder=""
-                clearable
+                disabled
                 style="width: 200px"
               />
             </el-form-item>
@@ -17,7 +16,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="组织">
-              <el-select size="small" v-model="basicForm.org" :disabled="disable" @focus="chooseOrg" style="width: 200px">
+              <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -25,7 +24,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求处理方式">
-              <el-select v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
+              <el-select disabled v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_processing_mode" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -34,7 +33,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="单据状态">
-              <el-select v-model="basicForm.status" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select disabled v-model="basicForm.status" size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -43,7 +42,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="basicForm.customer" :disabled="disable" @focus="chooseCustomer" style="width: 200px">
+              <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -51,19 +50,19 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求客户名称">
-              <el-input v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
+              <el-input disabled v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
             </el-form-item>
           </el-col>
 
          <el-col :span="1.5">
             <el-form-item label="客户负责人">
-              <el-input v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
+              <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
             </el-form-item>
           </el-col>
 
          <el-col :span="1.5">
             <el-form-item label="需求人员">
-                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="disable" @focus="choosePerson" style="width: 200px">
+                <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-select>
             </el-form-item>
@@ -71,12 +70,12 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="basicForm.demandDept" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+                  v-for="item in deptOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -86,6 +85,7 @@
             <el-form-item label="需求日期">
               <el-date-picker
                 v-model="basicForm.demandDate"
+                disabled
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -97,7 +97,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="单据来源">
-              <el-select v-model="basicForm.source" size="small" style="width: 200px">
+              <el-select v-model="basicForm.source" disabled 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>
@@ -106,7 +106,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="供应仓库">
-              <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseHouse" style="width: 200px">
+              <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>
@@ -114,7 +114,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="供应货位">
-              <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="disable" @focus="chooseGoods" style="width: 200px">
+              <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>
@@ -122,7 +122,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="basicForm.billType" size="small" style="width: 200px">
+              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -131,7 +131,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="basicForm.isSpeical" size="small" style="width: 200px">
+              <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -155,8 +155,7 @@
               <el-input
                 v-model="basicForm.isMonthleyCalculate"
                 size="small"
-                placeholder=""
-                clearable
+                disabled
                 style="width: 200px"
               />
             </el-form-item>
@@ -167,7 +166,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -179,9 +178,9 @@
     <span>明细信息</span>
     <el-card>
       <div class="btn_grooup">
-        <el-button type="primary" size="small" @click="addLine">增行</el-button>
-        <el-button type="primary" size="small" >批量调整</el-button>
-        <el-button type="primary" size="small" v-if="pageStu == 'check' || pageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+        <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
+        <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
+        <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
       </div>
 
       <el-table 
@@ -193,244 +192,326 @@
           <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" >
+          <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 v-model="scope.row.index"/>
+                <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="150">
+          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyOneName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="二级品类" align="center" width="150" prop="materialClassifyTwoName">
+          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyTwoName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="三级品类" align="center" width="150" prop="materialClassifyThreeName">
+          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyThreeName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="四级品类" align="center" width="150" prop="materialClassifyFourName">
+          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyFourName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留比例" align="center" width="150" prop="reservedProportion">
+          <el-table-column label="预留比例" align="center" prop="reservedProportion" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedProportion"/>
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
+                  <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+                <!-- <el-input v-model="scope.row.reservedProportion"/> -->
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留周期" align="center" width="150" prop="reservedPeriod">
+          <el-table-column label="预留周期" align="center" prop="reservedPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedPeriod"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留数量" align="center" width="150" prop="reservedQty">
+          <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="采购员名称" align="center" prop="buyerName" />
-          <el-table-column label="采购员" align="center" width="150" prop="buyer" />
-          <el-table-column label="物料编码" align="center" width="120" prop="materialCode">
+          <el-table-column label="采购员名称" align="center" prop="buyerName" width="120px"/>
+          <el-table-column label="采购员" align="center"  prop="buyer"/>
+          <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialCode"/>
+                <el-input readonly size="small" v-model="scope.row.materialCode">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
+                </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="物料名称" align="center" width="150" prop="materialName" />
-          <el-table-column label="规格" align="center" width="150" prop="specification" />
-          <el-table-column label="型号" align="center" width="150" prop="model" />
-          <el-table-column label="单位" align="center" width="150" prop="unit	" />
-          <el-table-column label="生产厂家/代理人" align="center" width="150" prop="registrant" />
-          <el-table-column label="注册人" align="center" width="150" prop="registrant" />
-          <el-table-column label="采购周期" align="center" width="150" prop="puPeriod">
+          <el-table-column label="物料名称" align="center"  prop="materialName" width="230px" />
+          <el-table-column label="规格" align="center"  prop="specification" />
+          <el-table-column label="型号" align="center"  prop="model" />
+          <el-table-column label="单位" align="center"  prop="unit" />
+          <el-table-column label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
+          <el-table-column label="注册人" align="center"  prop="registrant" width="150px"/>
+          <el-table-column label="采购周期" align="center"  prop="puPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.puPeriod"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期单位" align="center" width="150" prop="expiryUnit" />
-          <el-table-column label="有效期" align="center" width="150" prop="updateTime" />
-          <el-table-column label="最小包装" align="center" width="150" prop="minPackage" />
-          <el-table-column label="最小订货量" align="center" width="150" prop="minOrderQty" />
-          <el-table-column label="最小批量" align="center" width="150" prop="minBatch	" />
-          <el-table-column label="安全库存" align="center" width="150" prop="safeStock	">
+          <el-table-column label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
+          <el-table-column label="有效期" align="center"  prop="expiry" width="120px"/>
+          <el-table-column label="最小包装" align="center"  prop="minPackage" width="120px"/>
+          <el-table-column label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
+          <el-table-column label="最小批量" align="center"  prop="minBatch" width="120px"/>
+          <el-table-column label="安全库存" align="center"  prop="safeStock" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.safeStock"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="月均销量" align="center" width="150" prop="averageQtyMonth" />
-          <el-table-column label="实际(业务)需求量" align="center" width="150" prop="qty">
+          <el-table-column label="月均销量" align="center"  prop="averageQtyMonth" width="120px"/>
+          <el-table-column label="实际(业务)需求量" align="center"  prop="qty" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.qty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="需求可用周期" align="center" width="150" prop="demandPeriod" />
-          <el-table-column label="集团预测分类" align="center" width="150" prop="forecastClassify" />
-          <el-table-column label="交货日期" align="center" width="150" prop="deliveryDate">
+          <el-table-column label="需求可用周期" align="center"  prop="demandPeriod" width="120px"/>
+          <el-table-column label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
+          <el-table-column label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.deliveryDate"/>
+                <el-date-picker
+                  v-model="scope.row.deliveryDate"
+                  :readonly="sonDisable"
+                  type="datetime"
+                  size="small"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期">
+                </el-date-picker>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单标识" align="center" width="150" prop="isReplenishment">
+          <el-table-column label="补单标识" align="center"  prop="isReplenishment" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.isReplenishment"/>
+                <el-switch
+                  v-model="scope.row.isReplenishment"
+                  :disabled="sonDisable"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="批号锁定标识" align="center" width="150" prop="isBatchLock">
+          <el-table-column label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.isBatchLock"/>
+                  <el-switch
+                    v-model="scope.row.isBatchLock"
+                    :disabled="sonDisable"
+                    active-value="Y"
+                    inactive-value="N"
+                    active-color="#13ce66"
+                    inactive-color="#a1a3a9">
+                  </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="业务备注" align="center" width="150" prop="remark">
+          <el-table-column label="业务备注" align="center"  prop="remark" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.remark"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
               </el-form-item>
             </template>
           </el-table-column> 
-          <el-table-column label="采购备注" align="center" width="150" prop="puRemark" />
-          <!-- <el-table-column label="末级供应仓库存量" align="center" width="150" prop="lastWarehouseQty" /> -->
-          <!-- <el-table-column label="调拨占有量" align="center" width="150" prop="superiorAllotQty"></el-table-column> -->
-          <el-table-column label="最终净需求量" align="center" width="150" prop="resDemandQty">
+          <el-table-column label="采购备注" align="center"  prop="puRemark" width="150px"/>
+          <!-- <el-table-column label="末级供应仓库存量" align="center"  prop="lastWarehouseQty" /> -->
+          <!-- <el-table-column label="调拨占有量" align="center"  prop="superiorAllotQty"></el-table-column> -->
+          <el-table-column label="最终净需求量" align="center"  prop="resDemandQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.resDemandQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="末级供应仓库" align="center" width="150" prop="lastWarehouseName">
+          <el-table-column label="末级供应仓库" align="center"  prop="lastWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.lastWarehouseName"/>
+                <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" width="150" prop="deliveryWarehouseName">
+          <el-table-column label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.deliveryWarehouseName"/>
+                <el-input readonly size="small" v-model="scope.row.deliveryWarehouseName">
+                  <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" width="150" prop="lastAllocationName">
+          <el-table-column label="末级供应货位" align="center"  prop="lastAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.lastAllocationName"/>
+                <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" width="150" prop="deliveryAllocation" />
-          <el-table-column label="收货货位" align="center" width="150" prop="deliveryAllocationName">
+          <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 v-model="scope.row.deliveryAllocationName"/>
+                <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-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="紧急标识" align="center" width="150" prop="isUrgency">
+          <el-table-column label="紧急标识" align="center" prop="isUrgency" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.isUrgency"/>
+                <el-switch
+                  v-model="scope.row.isUrgency"
+                  :disabled="sonDisable"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center" width="150" prop="purOrgName" />
-          <el-table-column label="默认采购组织编码" align="center" width="150" prop="puOrg" />
-          <!-- <el-table-column label="末级供应调拨待入量" align="center" width="150" prop="lastStockQty">
+          <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 v-model="scope.row.lastStockQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.lastStockQty"/>
               </el-form-item>
             </template>
-          </el-table-column> -->
-          <el-table-column label="上级供应中心现存量" align="center" width="150" prop="superiorCenterQty" />
-          <el-table-column label="上级库存被调拨占用量" align="center" width="150" prop="superiorAllotQty" />
-          <el-table-column label="可用量" align="center" width="150" prop="availableQty" />
-          <el-table-column label="调拨状态" align="center" width="150" prop="statusAllot">
+          </el-table-column>
+          <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/>
+          <el-table-column label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/>
+          <el-table-column label="可用量" align="center"  prop="availableQty"/>
+          <el-table-column label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.statusAllot"/>
+                <el-switch
+                  v-model="scope.row.statusAllot"
+                  :disabled="sonDisable"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#a1a3a9">
+                </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商编码" align="center" width="150" prop="additionalSupplier">
+          <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.additionalSupplier"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplier">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="补单供应商名称" align="center" width="150" prop="additionalSupplierCode">
+          <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierCode" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.additionalSupplierCode"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="周期单位" align="center" width="150" prop="periodUnit">
+          <el-table-column label="周期单位" align="center"  prop="periodUnit" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.periodUnit"/>
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
+                  <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+                <!-- <el-input v-model="scope.row.periodUnit"/> -->
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="需求客户" align="center" width="150" prop="customer">
+          <!-- <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>
+          <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input readonly size="small" v-model="scope.row.deliveryAddressName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
+          <el-table-column label="联系人" align="center"  prop="contacts"/>
+          <el-table-column label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
+          <el-table-column label="详细地址" align="center"  prop="address" width="200px"/>
+          <el-table-column label="价格类型" align="center"  prop="priceType" width="150px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.priceType">
+                  <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+                <!-- <el-input v-model="scope.row.periodUnit"/> -->
+              </el-form-item>
+            </template>
           </el-table-column>
-          <!-- <el-table-column label="末级供应库存组织" align="center" width="150" prop="updateTime"></el-table-column> -->
-          <el-table-column label="中心仓可用量" align="center" width="150" prop="updateTime"></el-table-column>
-          <!-- <el-table-column label="调拨单号" align="center" width="150" prop="updateTime"></el-table-column> -->
-          <!-- <el-table-column label="收货地址" align="center" width="150" prop="updateTime"></el-table-column> -->
-          <!-- <el-table-column label="收货地址编码" align="center" width="150" prop="updateTime" /> -->
-          <el-table-column label="联系人" align="center" width="150" prop="contacts" />
-          <!-- <el-table-column label="联系人电话" align="center" width="150" prop="updateTime" /> -->
-          <!-- <el-table-column label="详细地址" align="center" width="150" prop="updateTime" /> -->
-          <!-- <el-table-column label="价格类型" align="center" width="150" prop="updateTime"></el-table-column> -->
           <el-table-column
-          fixed="right"
-          label="操作"
-          align="center"
-          width="150"
-          >
+            fixed="right"
+            label="操作"
+            align="center"
+            >
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="delLine(scope.row)">删除</el-button>
+            <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -438,12 +519,15 @@
   </el-form>
 
     <div class="btn_group">
+      <el-col :span="1.5">
+        <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <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="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+        <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check'">提交</el-button>
       </el-col>
-      <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
-      </el-col> -->
       <el-col :span="1.5">
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
@@ -451,23 +535,29 @@
       <Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
 
       <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+      <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
+
     </div>
   </div>
 </template>
 
 <script>
 import Reserved from './reserved.vue'
-import Refers from './refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand} from '@/api/purchase/purchaseDemand.js'
+import Refers from '@/components/Refers/refers.vue'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
+// 明细行选择物料参照
+import popDialog from '@/components/PopDialog/index.vue'
 export default {
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
-  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business'],
+  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   components: {
     Reserved,
-    Refers
+    Refers,
+    popDialog
   },
   model: {
     prop: 'isList',
@@ -475,21 +565,26 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       dialog: {
         config: false
       },
       basicForm: {
         code: '',
         org: '',
-        demandBusinessType: '',
-        status: '',
+        orgName: '',
+        demandBusinessType: '1',
+        status: '0',
         customer: '',
         customerName: '',
+        customerCode: '',
         customerPrincipal: '',
         demandPersonal: '',
         demandDept: '',
         demandDate: '',
-        source: '',
+        source: '1',
         warehouse: '',
         goodsAllocation: '',
         billType: '',
@@ -508,12 +603,19 @@ export default {
       tableList: [],
       referCondition: {
         type: 'ORG_PARAM',
-        search: '',
         isPage: true,
-        title: '选择组织'
+        title: '选择组织',
+        pkOrg: '',
       },
+      referConditionMx: {
+        type: 'DEPT_PARAM',
+        isPage: true,
+        title: '选择部门'
+      },
+      tableIndex: null,
       orgOptions: [],
       personOptions: [],
+      deptOptions: [],
       customerOptions: [],
       houseOptions: [],
       goodsOptions: []
@@ -528,15 +630,41 @@ export default {
     }
   },
   methods: {
-    save() {
-      if(this.pageStu == 'add') {
-        addDemand(this.basicForm).then(res => {
+    copy() {
+      this.$modal.msgSuccess("复制成功");
+      this.sonPageStu = 'add'
+      this.sonDisable = false
+      this.getDetails(this.row)
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+    },
+    handleData() {
+      console.log('222')
+      // 复制新增把id,编码置为空,子表去掉id
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+      if (this.basicForm.puDemandItemList.length !== 0) {
+        this.basicForm.puDemandItemList.forEach(item => {
+          if (item.id) {
+            delete item.id
+          }
+          if (item.demandId) {
+            delete item.demandId
+          }
+        })
+      }
+    },
+    async save() {
+      if(this.sonPageStu == 'add') {
+        await this.handleData()
+        await addDemand(this.basicForm).then(res => {
+          console.log(333)
           if (res.code === 200) {
             this.$modal.msgSuccess("保存成功");
             this.back()
           }
         })
-      } else if (this.pageStu == 'edit') {
+      } else if (this.sonPageStu == 'edit') {
         editDemand(this.basicForm).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("编辑成功");
@@ -545,7 +673,14 @@ export default {
         })
       }
     },
-    submit() {},
+    submit() {
+      submitDemand(this.basicForm).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.back()
+        }
+      })
+    },
     // 增行
     addLine() {
       const newLine = {
@@ -567,12 +702,17 @@ export default {
         materialClassifyFour: null,
         materialClassifyFourName: null,
         materialCode: null,
+        material: null,
         materialName: null,
+        classifyId: null,
         specification: null,
         unit: null,
+        unitName: null,
+        manufacturerName: null,
         registrant: null,
         puPeriod: null,
         expiryUnit: null,
+        expiry: null,
         minPackage: null,
         minOrderQty: null,
         minBatch: null,
@@ -589,9 +729,9 @@ export default {
         demandPeriod: null,
         forecastClassify: null,
         deliveryDate: null,
-        isUrgency: null,
-        isReplenishment: null,
-        isBatchLock: null,
+        isUrgency: 'N',
+        isReplenishment: 'N',
+        isBatchLock: 'N',
         remark: null,
         puRemark: null,
         lastWarehouseQty: null,
@@ -611,7 +751,7 @@ export default {
         superiorCenterQty: null,
         superiorAllotQty: null,
         availableQty: null,
-        statusAllot: null,
+        statusAllot: 'N',
         additionalSupplier: null,
         additionalSupplierCode: null,
         periodUnit: null,
@@ -647,11 +787,12 @@ export default {
       }
       this.basicForm.puDemandItemList.push(newLine)
     },
-    delLine(row) {
-      console.log('删除行:', row)
-      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
-        return item.id !== row.id
-      })
+    delLine(index) {
+      console.log('删除行:', index)
+      // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+      //   return item.id !== row.id
+      // })
+      this.basicForm.puDemandItemList.splice(index,1)
     },
     back() {
       this.$emit('jugislist', true)
@@ -673,8 +814,14 @@ export default {
               reciveForm.puDemandItemList = res.rows
               console.log('reciveForm',reciveForm)
               this.basicForm = reciveForm
-              this.reBackRefer({type: 'ORG_PARAM', search: this.basicForm.org, isPage: false})
+              if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+              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) }
             }
+            console.log('111')
           })
         }
       })
@@ -689,56 +836,56 @@ export default {
       this.dialog.config = val
     },
     // 回显参照框
-    reBackRefer(val) {
-      getRefer(val).then(res => {
-        console.log("🚀 ~ file: add.vue:706 ~ getRefer ~ res:", res)
+    reBackRefer(type, id) {
+      getRefer({type: type, id: id}).then(res => {
+        if(type == 'ORG_PARAM') {
+          this.orgOptions = res.rows
+        }
+        if (type == 'CUSTOMER_PARAM') {
+          this.customerOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM') {
+          this.personOptions = res.rows
+        }
+        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() {
-      this.referCondition.type = 'ORG_PARAM'
-      this.referCondition.search = ''
-      this.referCondition.isPage = true
-      this.referCondition.title = '选择组织'
-      this.$refs.refer.init(this.referCondition)
-    },
-    chooseCustomer () {
-      this.referCondition.type = ''
-      this.referCondition.search = ''
-      this.referCondition.isPage = true
-      this.referCondition.title = '选择客户'
-      this.$refs.refer.init(this.referCondition)
-    },
-    choosePerson() {
-      this.referCondition.type = 'CONTACTS_PARAM'
-      this.referCondition.search = ''
-      this.referCondition.isPage = true
-      this.referCondition.title = '需求人员'
-      this.$refs.refer.init(this.referCondition)
-    },
-    chooseHouse() {
-      this.referCondition.type = 'WAREHOUSE_PARAM'
-      this.referCondition.search = ''
-      this.referCondition.isPage = true
-      this.referCondition.title = '供应仓库'
-      this.$refs.refer.init(this.referCondition)
-    },
-    chooseGoods() {
-      this.referCondition.type = 'ALLOCATION_PARAM'
-      this.referCondition.search = ''
-      this.referCondition.isPage = true
-      this.referCondition.title = '供应货位'
+    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) {
-      console.log("🚀 ~ file: add.vue:732 ~ selectionsToInput ~ selection:", selection)
       if(this.referCondition.type == 'ORG_PARAM') {
         this.orgOptions = selection
         this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if(this.referCondition.type == 'CUSTOMER_PARAM') {
+        this.customerOptions = selection
+        this.basicForm.customer = selection[0].id
+        this.basicForm.customerName = selection[0].name
+        this.basicForm.customerCode = selection[0].code
       }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
         this.basicForm.demandPersonal = selection[0].id
       }
+      if(this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.basicForm.demandDept = selection[0].id
+      }
       if(this.referCondition.type == 'WAREHOUSE_PARAM') {
         this.houseOptions = selection
         this.basicForm.warehouse = selection[0].id
@@ -747,6 +894,83 @@ export default {
         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].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].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
+      }
+      if(this.referConditionMx.title == '选择收货地址') {
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
+        this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
+        this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
+        this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
+        this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
+      }
+    },
+    // 明细行选择物料编码带出数据
+    chooseMaterial(index) {
+      console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
+      this.tableIndex = index
+      this.$refs.materialRefer.init()
+    },
+    selectMaterial(selection) {
+      console.log('选中的物料', selection)
+      // 通过选择物料查询采购员
+      queryMan(selection[0].id).then(res => {
+        if(res.code === 200 && res.rows.length !== 0) {
+          this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
+          this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
+        }
+      })
+      this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
+      this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
+      this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
+      this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
+      this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
+      this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
+      this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
+      this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
+      this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
+      this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
+      this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
+      this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
+      this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
+      this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
+      // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
+      this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
+      this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
+      this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
+      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
+    },
+    // 明细行选择业务部门参照带出业务部门数据
+    chooseDept(index, type, isPage, title) {
+      this.tableIndex = index
+      this.referConditionMx.type = type
+      this.referConditionMx.isPage = isPage
+      this.referConditionMx.title = title
+      this.$refs.refer.init(this.referConditionMx)
     }
   }
 }

+ 273 - 97
src/views/purchase/PurchaseDemandList/index.vue

@@ -5,37 +5,24 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="单据编码">
-              <el-select v-model="queryParams.code" 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.code"
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="供应仓库">
-              <el-select v-model="queryParams.warehouse" 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 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 v-model="queryParams.customer" 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 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>
@@ -53,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>
@@ -62,49 +49,23 @@
         <div v-show="expanded">
         <el-row :gutter="10">
           <el-col :span="1.5">
-            <el-form-item label="单据类型">
-              <el-select v-model="queryParams.threeName" 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-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="需求人员">
-              <el-select v-model="queryParams.demandPersonal" 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 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 v-model="queryParams.goodsAllocation" 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 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" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select 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>
@@ -114,37 +75,34 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="queryParams.billType" 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 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-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="queryParams.demandDept" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+                  v-for="item in deptOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="需求日期">
-            <el-input
-              v-model="queryParams.demandDate"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+              <el-date-picker
+                v-model="queryParams.demandDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                size="small"
+                style="width: 200px"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -152,7 +110,6 @@
             <el-input
               v-model="queryParams.remark"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -178,18 +135,18 @@
             </el-dropdown-menu>
           </el-dropdown>
 
-          <el-dropdown size="small" @command="handleCommand">
+          <el-dropdown size="small" @command="handleExport">
             <el-button size="small" type="primary" style="margin: 0 10px;">
               导出<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="导出明细">导出明细</el-dropdown-item>
+              <el-dropdown-item command="选中导出">选中导出</el-dropdown-item>
+              <el-dropdown-item command="全部导出">全部导出</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
 
           <el-button type="primary" size="small" @click="delItems">删除</el-button>
-          <el-button type="primary" size="small">打印</el-button>
+          <!-- <el-button type="primary" size="small">打印</el-button> -->
         </div>
         <el-table 
           :data="tableList" 
@@ -198,19 +155,19 @@
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column label="编码" align="center" prop="code"/>
-          <el-table-column label="需求日期" align="center" width="200" prop="demandDate" />
-          <el-table-column label="单据状态" align="center" prop="status" />
+          <el-table-column label="编码" align="center" width="200" prop="code"/>
+          <el-table-column label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
           <!-- <el-table-column label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
-          <el-table-column label="业务类型" align="center" width="150" prop="billType"/>
+          <el-table-column label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
           <!-- <el-table-column label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
-          <el-table-column label="需求人员" align="center" width="150" prop="demandPersonalName" />
-          <el-table-column label="需求客户" align="center" prop="customerName" />
-          <el-table-column label="需求部门" align="center" width="150" prop="demandDeptName" />
+          <el-table-column label="需求人员" align="center" prop="demandPersonalName" />
+          <el-table-column label="需求客户" align="center" prop="customerName" width="150"/>
+          <el-table-column label="需求部门" align="center" prop="demandDeptName" width="150"/>
           <!-- <el-table-column label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
           <!-- <el-table-column label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
-          <el-table-column label="单据来源" align="center" width="150" prop="source" />
-          <el-table-column label="组织" align="center" width="150" prop="orgName" />
+          <el-table-column label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
+          <el-table-column label="组织" align="center" width="200" prop="orgName"/>
           <el-table-column label="备注" align="center" width="150" prop="remark" />
           <el-table-column
           fixed="right"
@@ -220,8 +177,8 @@
           >
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
-            <el-button type="text" size="small" @click="deleteids(scope.row)">删除</el-button>
+            <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
         </el-table>
@@ -238,22 +195,75 @@
       </el-card>
     </div>
 
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div>
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+  
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
+// 导入的token
+import { getToken } from "@/utils/auth";
 import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getDemandList, delDemand, downLoadDemand} from '@/api/purchase/purchaseDemand.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers
   },
+  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   data() {
     return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/pu/demand/import"
+      },
+      // 下拉收起配置
       expanded: false,
       // 页面配置
       isList: true,
@@ -264,7 +274,6 @@ export default {
         warehouse: '',
         customer: '',
         isProcess: '',
-        threeName: '',
         demandPersonal: '',
         goodsAllocation: '',
         source: '',
@@ -273,13 +282,23 @@ export default {
         demandDate: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
+      },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
       },
       options: [{
-        value: '1', label: '是',
+        value: '0', label: '是',
       }, {
-        value: '0', label: '否'
+        value: '2', label: '否'
       }],
+      houseOptions: [],
+      customerOptions: [],
+      personOptions: [],
+      goodsOptions: [],
+      deptOptions: [],
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -291,6 +310,70 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 格式化表格内容
+    formatterStatus(row) {
+      switch(row.status){
+        case '0':
+          return '未提交'
+        case '1':
+          return '审批中'
+        case '2':
+          return '已完成'
+        case '3':
+          return '已驳回'
+      }
+    },
+    formatterBillType(row) {
+      switch (row.billType) {
+        case 'ZQBH':
+          return '周期备货'
+        case 'FXXQ':
+          return '分销需求'
+        case 'TSXQ':
+          return '特殊采购需求'
+        case 'BDXQ':
+          return '补单需求'
+        case 'JJXQ':
+          return '紧急需求单'
+        case 'XPXQ':
+          return '新品需求'
+        case 'HZBM':
+          return '合作部门需求'
+      }
+    },
+    formatterSource(row) {
+      switch (row.source) {
+        case '1':
+          return '手工导入'
+        case '2':
+          return '按客户计算'
+        case '3':
+          return '按仓库计算'
+        case '4':
+          return '手工新增'
+      }
+    },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        code: '',
+        warehouse: '',
+        customer: '',
+        isProcess: '',
+        demandPersonal: '',
+        goodsAllocation: '',
+        source: '',
+        billType: '',
+        demandDept: '',
+        demandDate: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 5
+      }
+      this.getList(this.queryParams)
+    },
     getList(params){
       getDemandList(params).then(res => {
         if (res.code === 200) {
@@ -325,6 +408,69 @@ export default {
           window.URL.revokeObjectURL(href); // 释放blob对象
         })
       }
+      if (command == '数据导入') {
+        this.upload.title = "用户导入"
+        this.upload.open = true
+      }
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList(this.queryParams);
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    handleExport(command) {
+      if(command == '选中导出') {
+        if (this.ids.length == 0) {
+          this.$modal.msgWarning("请选中至少一条数据");
+        } else {
+          let param = {all: false, ids: this.ids}
+          exportDemand(param).then(res => {
+            const blob = new Blob([res], {
+              type: "application/vnd.ms-excel;charset=UTF-8",
+            });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+            const downloadElement = document.createElement("a"); //创建a标签
+            const href = window.URL.createObjectURL(blob); // 创建下载的链接
+            // var temp = res.headers["content-disposition"]; 
+            // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+            // var name = fileName.split(";")[0]; //切割成文件名
+            downloadElement.href = href;  //下载地址
+            downloadElement.download = '选中导出'; // 下载后文件名
+            document.body.appendChild(downloadElement);
+            downloadElement.click(); // 点击下载
+            document.body.removeChild(downloadElement); // 下载完成移除元素
+            window.URL.revokeObjectURL(href); // 释放blob对象
+          })
+        }
+      } else {
+        let param2 = {all: true}
+        exportDemand(param2).then(res => {
+          const blob = new Blob([res], {
+            type: "application/vnd.ms-excel;charset=UTF-8",
+          });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+          const downloadElement = document.createElement("a"); //创建a标签
+          const href = window.URL.createObjectURL(blob); // 创建下载的链接
+          // var temp = res.headers["content-disposition"]; 
+          // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+          // var name = fileName.split(";")[0]; //切割成文件名
+          downloadElement.href = href;  //下载地址
+          downloadElement.download = '全部导出'; // 下载后文件名
+          document.body.appendChild(downloadElement);
+          downloadElement.click(); // 点击下载
+          document.body.removeChild(downloadElement); // 下载完成移除元素
+          window.URL.revokeObjectURL(href); // 释放blob对象
+        })
+      }
     },
     addDivision() {
       this.isList = false
@@ -346,7 +492,7 @@ export default {
     // 行内删除
     deleteids(row) {
       console.log('row', row)
-      this.$modal.confirm('确认信息').then(() => {
+      this.$modal.confirm('确定删除选择数据?').then(() => {
         delDemand(row.id).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("删除成功");
@@ -383,6 +529,35 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
+    },
+    // 搜索区参照选择
+    chooseOrg(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
+      }
+      if (this.referCondition.type == 'CUSTOMER_PARAM') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        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
+      }
     }
   }
 }
@@ -393,6 +568,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;

+ 1 - 1
src/views/purchase/PurchaseDemandList/reserved.vue

@@ -83,7 +83,7 @@ export default {
   },
   methods: {
     getDetails(row) {
-      getResevedDetail(row.id).then(res => {
+      getResevedDetail(row.code).then(res => {
         if (res.code === 200) {
           // this.basicForm = res.data
         }

+ 197 - 84
src/views/purchase/purchase-contract/config/add.js → src/views/purchase/apply/add/column.js

@@ -1,11 +1,14 @@
-const columns = [
+export const Columns = [
   {
-    key: "puOrg",
+    key: "puOrgName",
     title: "采购组织",
     type: "InputDialog",
     config: {
-      componentName: "Organization",
-      dataMapping: { puOrg: "deptName" },
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        puOrg: "code",
+        puOrgName: "name",
+      },
     },
     require: true,
   },
@@ -17,25 +20,30 @@ const columns = [
     require: true,
   },
   {
-    key: "buyer",
+    key: "buyerName",
     title: "采购员",
     type: "InputDialog",
     config: {
-      componentName: "User",
+      componentName: "ORG_PARAM",
       dataMapping: {
-        buyer: "userName",
-        puDept: "deptName",
+        buyer: "userId",
+        buyerName: "userName",
+        puDept: "deptId",
+        puDeptName: "deptName",
       },
     },
     require: true,
   },
   {
-    key: "supplier",
+    key: "supplierName",
     title: "供应商",
     type: "InputDialog",
     config: {
-      componentName: "Supplier",
-      dataMapping: { supplier: "name" },
+      componentName: "SUPPLIER_PARAM",
+      dataMapping: {
+        supplier: "code",
+        supplierName: "name",
+      },
     },
     require: true,
   },
@@ -51,14 +59,20 @@ const columns = [
   {
     key: "puMoneyYear",
     title: "本年度采购额",
-    type: "Input",
+    type: "InputNumber",
     require: true,
   },
   {
-    key: "puDept",
+    key: "puDeptName",
     title: "采购部门",
     type: "InputDialog",
-    config: { componentName: "Department" },
+    config: {
+      componentName: "DEPT_PARAM",
+      dataMapping: {
+        puDept: "code",
+        puDeptName: "name",
+      },
+    },
     require: true,
   },
   {
@@ -100,7 +114,6 @@ const columns = [
     title: "合同生效日期",
     type: "DatePicker",
     require: true,
-    config: { type: "date" },
   },
   {
     key: "brandGrossRate",
@@ -125,14 +138,13 @@ const columns = [
     title: "合同终止日期",
     type: "DatePicker",
     require: true,
-    config: { type: "date" },
   },
   {
     key: "invoiceTax",
     title: "发票税率",
     type: "InputDialog",
     config: {
-      componentName: "Tax",
+      componentName: "ORG_PARAM",
       dataMapping: {
         invoiceTax: "mattaxesname",
       },
@@ -154,7 +166,6 @@ const columns = [
     title: "合同签订日期",
     type: "DatePicker",
     require: true,
-    config: { type: "date" },
   },
   {
     key: "deliveryType",
@@ -172,13 +183,14 @@ const columns = [
     disabled: true,
   },
   {
-    key: "contractPartyc",
+    key: "contractPartycName",
     title: "合同丙方",
     type: "InputDialog",
     config: {
-      componentName: "Supplier",
+      componentName: "SUPPLIER_PARAM",
       dataMapping: {
-        contractPartyc: "name",
+        contractPartyc: "code",
+        contractPartycName: "name",
       },
     },
   },
@@ -201,7 +213,6 @@ const columns = [
     title: "合同创建时间",
     type: "DatePicker",
     disabled: true,
-    config: { type: "date" },
   },
   {
     key: "isTarget",
@@ -272,14 +283,14 @@ const columns = [
   { key: "area", title: "区域", type: "Input" },
   { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
   {
-    key: "paymentAgreement",
+    key: "paymentAgreementName",
     title: "付款协议",
     type: "InputDialog",
     config: {
-      componentName: "PaymentPlan",
+      componentName: "PAYAGREEMENT_PARAM",
       dataMapping: {
-        buyer: "userName",
-        puDept: "deptName",
+        paymentAgreement: "code",
+        paymentAgreementName: "name",
       },
     },
     require: true,
@@ -288,16 +299,16 @@ const columns = [
     key: "taxPrice",
     title: "价税合计",
     type: "InputNumber",
-    config: { controlsPosition: "right" },
   },
   {
-    key: "currency",
+    key: "currencyName",
     title: "币种",
     type: "InputDialog",
     config: {
-      componentName: "Currency",
+      componentName: "CURRENCY_PARAM",
       dataMapping: {
-        currency: "name",
+        currency: "code",
+        currencyName: "name",
       },
     },
     require: true,
@@ -319,83 +330,185 @@ const columns = [
   // { key: "delFlag", title: "删除标记" },
 ];
 
-export const initColumns = () => columns;
-
-const tabColumns = [
+export const TabColumns = [
   {
+    show: {
+      contractType: [1, 2],
+    },
     title: "物料基本信息",
-    key: "first",
+    key: "contractItemList",
     tableColumns: [
-      { title: "序号", key: "" },
-      { title: "赠品", key: "" },
-      { title: "物料编码", key: "" },
-      { title: "物料名称", key: "" },
-      { title: "规格", key: "" },
-      { title: "生产厂家", key: "" },
-      { title: "收货客户", key: "" },
-      { title: "品牌", key: "" },
-      { title: "采购数量", key: "" },
-      { title: "采购单位", key: "" },
-      { title: "计价数量", key: "" },
-      { title: "税率%", key: "" },
-      { title: "含税单价", key: "" },
-      { title: "含税金额合计", key: "", width: 150 },
-      { title: "价格有效期(起)", key: "", width: 150 },
-      { title: "计划到货日期", key: "", width: 150 },
-      { title: "来源类型", key: "" },
-      { title: "来源单号", key: "" },
-      { title: "需求单号", key: "" },
-      { title: "备注", key: "" },
+      { 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: "second",
+    key: "contractClauseList",
     tableColumns: [
-      { title: "序号", key: "" },
-      { title: "条款编码", key: "" },
-      { title: "条款名称", key: "" },
-      { title: "条款内容", key: "" },
-      { title: "变量序号", key: "" },
-      { title: "变量内容", key: "" },
-      { title: "备注", key: "" },
+      { 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: "third",
+    key: "contractExpenseList",
     tableColumns: [
-      { title: "序号", key: "" },
-      { title: "费用编码", key: "" },
-      { title: "费用名称", key: "" },
-      { title: "费用金额", key: "" },
-      { title: "备注", key: "" },
+      { title: "费用编码", key: "code", type: "Input" },
+      { title: "费用名称", key: "name", type: "Input" },
+      {
+        title: "费用金额",
+        key: "money",
+        type: "InputNumber",
+        width: 200,
+      },
+      { title: "备注", key: "remark", type: "Input" },
     ],
   },
   {
     title: "付款协议信息",
-    key: "fourth",
+    key: "contractAgreementList",
     tableColumns: [
-      { title: "序号", key: "" },
-      { title: "付款阶段", key: "" },
-      { title: "是否预付款", key: "" },
-      { title: "是否质保金", key: "" },
-      { title: "结算方式", key: "" },
-      { title: "付款起点", key: "" },
-      { title: "付款金额", key: "" },
-      { title: "付款比例%", key: "" },
-      { title: "账期天数", key: "" },
-      { title: "备注", key: "" },
+      {
+        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: "fifth",
+    key: "contractApplyOrgList",
     tableColumns: [
-      { title: "序号", key: "" },
-      { title: "组织名称", key: "" },
-      { title: "组织编码", key: "" },
+      { title: "组织名称", key: "orgName", type: "Input" },
+      { title: "组织编码", key: "org", type: "Input" },
     ],
   },
 ];
-export const initTabColumns = () => tabColumns;

+ 380 - 0
src/views/purchase/apply/add/index.vue

@@ -0,0 +1,380 @@
+<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),
+}));
+
+export default {
+  name: "AddDrawer",
+  dicts: initDicts(NewColumns),
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+  },
+  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;
+      this.fetchCode();
+    },
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    async fetchCode() {
+      try {
+        this.loading = true;
+        this.params.code = await generateCode();
+      } 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;
+      console.log("arr", arr);
+      prop.push(initParams(arr, "key", "value"));
+    },
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    handleSava() {
+      this.setVisible(false);
+    },
+    // 保存并新增
+    async handleSubmit() {
+      try {
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await add({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+  },
+  created() {
+    console.log("ADD CREATED");
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+        >
+          <h3>新增</h3>
+          <div style="text-align: right">
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" type="danger" @click="handleSava"
+              >保 存</el-button
+            >
+            <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
+              >
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <!-- <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div> -->
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+              >
+                <template slot-scope="scope">
+                  <span v-if="!cColumn.type">
+                    {{ scope.row[cColumn.key] }}</span
+                  >
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :size="size"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-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>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button :size="size" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 50 - 0
src/views/purchase/apply/column.js

@@ -0,0 +1,50 @@
+export const TableColumns = [
+  { key: "id", title: "id" },
+  { key: "status", title: "单据状态" },
+  { key: "priceName", title: "价格名称" },
+  { key: "supplier", title: "供应商" },
+  {
+    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: "币种名称" },
+  { key: "explain", title: "价格合理性说明" },
+  { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员名称" },
+  { key: "puDept", title: "采购部门" },
+  { key: "puDeptName", title: "采购部门名称" },
+  { key: "sourceType", title: "来源单据类型" },
+  { key: "source", title: "来源单据号" },
+  { key: "isEffective", title: "是否已推价格" },
+  { key: "effectiveDate", title: "生效日期" },
+  { key: "file", title: "附件" },
+  { key: "tenantId", title: "租户号" },
+  { key: "revision", title: "乐观锁" },
+  { key: "createByName", title: "创建人名称" },
+  { key: "updateByName", title: "更新人" },
+  { key: "delFlag", title: "删除标记" },
+];
+
+export const SearchColumns = TableColumns.filter((element) => element.search);

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

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

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

@@ -0,0 +1,194 @@
+<script>
+import { TableColumns, SearchColumns } from "./column";
+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"),
+  },
+  data() {
+    return {
+      size: "mini",
+      loading: false,
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
+      tableData: [],
+      tableColumns: TableColumns,
+      page: initPage(),
+      layout: initLayout(),
+      pageSizes: initPageSizes(),
+    };
+  },
+  computed: {},
+  created() {
+    this.handleQueryList();
+  },
+  methods: {
+    //
+    async fetchList(params, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await list({
+          pageNum,
+          pageSize,
+          ...params,
+        });
+        if (code === 200) {
+          this.tableData = 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;
+      }
+    },
+    // 查询操作
+    handleQueryList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 重置操作
+    handleResetList() {
+      this.page = initPage();
+      this.params = initParams(SearchColumns);
+      this.fetchList(this.params, this.page);
+    },
+    // 删除操作
+    async handleDeleteList(prop) {
+      try {
+        this.loading = true;
+        const { id } = prop;
+        const { code, msg } = await remove(id);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.fetchList(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) {
+      this.page.pageSize = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 当前页变
+    handleCurrentChange(prop) {
+      this.page.pageNum = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 打开新增drawer
+    handleOpenAddDrawer() {
+      console.log(this.$refs.AddDrawerFef);
+      const { setVisible } = this.$refs.AddDrawerFef;
+      setVisible(true);
+    },
+    // 打开查看drawer
+    async handleOpenSeeDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+    // 打开编辑drawer
+    async handleOpenEditDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+  },
+};
+</script>
+
+<template>
+  <el-card
+    v-loading="loading"
+    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">
+        <el-col
+          v-for="column in searchColumns"
+          :key="column.title"
+          :xl="4"
+          :lg="4"
+          :md="8"
+          :sm="12"
+          :xs="24"
+        >
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-model="params[column.key]"
+              :placeholder="column.placeholder"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </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"
+      :size="size"
+      style="width: 100%; margin: 20px 0 0 0"
+    >
+      <el-table-column
+        v-for="(column, index) in tableColumns"
+        :key="index"
+        :prop="column.key"
+        :label="column.title"
+        :width="column.width || 180"
+        :show-overflow-tooltip="column.showOverflowTooltip || true"
+      >
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button
+            @click.native.prevent="handleDeleteList(scope.row)"
+            type="text"
+            size="small"
+          >
+            删 除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :total="page.total"
+      :page-sizes="pageSizes"
+      :page-size="page.pageSize"
+      :current-page="page.pageNum"
+      :layout="layout"
+      style="margin: 16px 0"
+    >
+    </el-pagination>
+  </el-card>
+</template>

+ 317 - 0
src/views/purchase/apply/see/index.vue

@@ -0,0 +1,317 @@
+<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,
+  }),
+}));
+
+export default {
+  name: "SeeDrawer",
+  dicts: initDicts(NewColumns),
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+    tabName: function (newProp) {
+      const { id } = this.params;
+      this.fetchTable(id, newProp);
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 查询详细
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await item(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        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;
+      }
+    },
+    // 取消操作
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(Columns);
+    },
+    // 编辑操作
+    handleOpenEditDrawer(prop) {
+      this.setVisible(false);
+      this.$parent.$parent.handleOpenEditDrawer(prop);
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</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"
+      >
+        <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"
+          >
+            <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"
+      >
+        <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-row> -->
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

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

@@ -0,0 +1,514 @@
+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" },
+    ],
+  },
+];

+ 380 - 0
src/views/purchase/catalogue/add/index.vue

@@ -0,0 +1,380 @@
+<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),
+}));
+
+export default {
+  name: "AddDrawer",
+  dicts: initDicts(NewColumns),
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+  },
+  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;
+      this.fetchCode();
+    },
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    async fetchCode() {
+      try {
+        this.loading = true;
+        this.params.code = await generateCode();
+      } 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;
+      console.log("arr", arr);
+      prop.push(initParams(arr, "key", "value"));
+    },
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    handleSava() {
+      this.setVisible(false);
+    },
+    // 保存并新增
+    async handleSubmit() {
+      try {
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await add({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+  },
+  created() {
+    console.log("ADD CREATED");
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+        >
+          <h3>新增</h3>
+          <div style="text-align: right">
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" type="danger" @click="handleSava"
+              >保 存</el-button
+            >
+            <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
+              >
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <!-- <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div> -->
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+              >
+                <template slot-scope="scope">
+                  <span v-if="!cColumn.type">
+                    {{ scope.row[cColumn.key] }}</span
+                  >
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :size="size"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-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>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button :size="size" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 61 - 0
src/views/purchase/catalogue/column.js

@@ -0,0 +1,61 @@
+export const TableColumns = [
+  { key: "id", title: "id" },
+  { key: "puOrg", title: "采购组织" },
+  {
+    key: "puOrgName",
+    title: "采购组织名称",
+    search: true,
+    config: {
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        puOrg: "code",
+        puOrgName: "name",
+      },
+    },
+  },
+  { key: "material", title: "物料编码", search: true },
+  { key: "materialClassify", title: "物料一级分类", search: true },
+  { key: "manufacturer", title: "生产厂家" },
+  { key: "materialName", title: "物料名称" },
+  { key: "model", title: "物料型号" },
+  { key: "specification", title: "物料规格" },
+  { key: "supplier", title: "供应商" },
+  {
+    key: "supplierName",
+    title: "供应商名称",
+    search: true,
+    config: {
+      componentName: "SUPPLIER_PARAM",
+      dataMapping: {
+        supplier: "code",
+        supplierName: "name",
+      },
+    },
+  },
+  { key: "customer", title: "客户" },
+  { key: "customerName", title: "客户名称" },
+  { key: "taxPrice", title: "主含税单价" },
+  { key: "unit", title: "主单位" },
+  { key: "unitName", title: "主单位名称" },
+  { key: "effectiveDate", title: "价格生效日期" },
+  { key: "endDate", title: "价格失效日期" },
+  { key: "buyer", title: "采购员" },
+  { key: "buyerName", title: "采购员名称" },
+  { key: "source", title: "来源单据编号", search: true },
+  { key: "status", title: "有效状态" },
+  { key: "enableStatus", title: "启用状态" },
+  { key: "convertRate", title: "换算率" },
+  { key: "materialStatus", title: "物料启用状态" },
+  { key: "isDistribution", title: "配送价" },
+  { key: "priceType", title: "价格类型" },
+  { key: "demandCode", title: "采购需求单号" },
+  { key: "expiryEarly", title: "效期预警" },
+  { key: "priority", title: "含税/无税优先" },
+  { key: "tenantId", title: "租户号" },
+  { key: "revision", title: "乐观锁" },
+  { key: "createByName", title: "创建人" },
+  { key: "updateByName", title: "更新人名称" },
+  { key: "delFlag", title: "删除标记" },
+];
+
+export const SearchColumns = TableColumns.filter((element) => element.search);

+ 399 - 0
src/views/purchase/catalogue/edit/index.vue

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

+ 194 - 0
src/views/purchase/catalogue/index.vue

@@ -0,0 +1,194 @@
+<script>
+import { TableColumns, SearchColumns } from "./column";
+import { list, remove } from "@/api/business/purchase/catalogue";
+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"),
+  },
+  data() {
+    return {
+      size: "mini",
+      loading: false,
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
+      tableData: [],
+      tableColumns: TableColumns,
+      page: initPage(),
+      layout: initLayout(),
+      pageSizes: initPageSizes(),
+    };
+  },
+  computed: {},
+  created() {
+    this.handleQueryList();
+  },
+  methods: {
+    //
+    async fetchList(params, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await list({
+          pageNum,
+          pageSize,
+          ...params,
+        });
+        if (code === 200) {
+          this.tableData = 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;
+      }
+    },
+    // 查询操作
+    handleQueryList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 重置操作
+    handleResetList() {
+      this.page = initPage();
+      this.params = initParams(SearchColumns);
+      this.fetchList(this.params, this.page);
+    },
+    // 删除操作
+    async handleDeleteList(prop) {
+      try {
+        this.loading = true;
+        const { id } = prop;
+        const { code, msg } = await remove(id);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.fetchList(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) {
+      this.page.pageSize = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 当前页变
+    handleCurrentChange(prop) {
+      this.page.pageNum = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 打开新增drawer
+    handleOpenAddDrawer() {
+      console.log(this.$refs.AddDrawerFef);
+      const { setVisible } = this.$refs.AddDrawerFef;
+      setVisible(true);
+    },
+    // 打开查看drawer
+    async handleOpenSeeDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+    // 打开编辑drawer
+    async handleOpenEditDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+  },
+};
+</script>
+
+<template>
+  <el-card
+    v-loading="loading"
+    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">
+        <el-col
+          v-for="column in searchColumns"
+          :key="column.title"
+          :xl="4"
+          :lg="4"
+          :md="8"
+          :sm="12"
+          :xs="24"
+        >
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-model="params[column.key]"
+              :placeholder="column.placeholder"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </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"
+      :size="size"
+      style="width: 100%; margin: 20px 0 0 0"
+    >
+      <el-table-column
+        v-for="(column, index) in tableColumns"
+        :key="index"
+        :prop="column.key"
+        :label="column.title"
+        :width="column.width || 180"
+        :show-overflow-tooltip="column.showOverflowTooltip || true"
+      >
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button
+            @click.native.prevent="handleDeleteList(scope.row)"
+            type="text"
+            size="small"
+          >
+            删 除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :total="page.total"
+      :page-sizes="pageSizes"
+      :page-size="page.pageSize"
+      :current-page="page.pageNum"
+      :layout="layout"
+      style="margin: 16px 0"
+    >
+    </el-pagination>
+  </el-card>
+</template>

+ 317 - 0
src/views/purchase/catalogue/see/index.vue

@@ -0,0 +1,317 @@
+<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,
+  }),
+}));
+
+export default {
+  name: "SeeDrawer",
+  dicts: initDicts(NewColumns),
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+    tabName: function (newProp) {
+      const { id } = this.params;
+      this.fetchTable(id, newProp);
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 查询详细
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await item(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        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;
+      }
+    },
+    // 取消操作
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(Columns);
+    },
+    // 编辑操作
+    handleOpenEditDrawer(prop) {
+      this.setVisible(false);
+      this.$parent.$parent.handleOpenEditDrawer(prop);
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</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"
+      >
+        <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"
+          >
+            <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"
+      >
+        <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-row> -->
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

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

@@ -0,0 +1,514 @@
+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" },
+    ],
+  },
+];

+ 380 - 0
src/views/purchase/contract/add/index.vue

@@ -0,0 +1,380 @@
+<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),
+}));
+
+export default {
+  name: "AddDrawer",
+  dicts: initDicts(NewColumns),
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+  },
+  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;
+      this.fetchCode();
+    },
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    async fetchCode() {
+      try {
+        this.loading = true;
+        this.params.code = await generateCode();
+      } 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;
+      console.log("arr", arr);
+      prop.push(initParams(arr, "key", "value"));
+    },
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    handleSava() {
+      this.setVisible(false);
+    },
+    // 保存并新增
+    async handleSubmit() {
+      try {
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await add({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+  },
+  created() {
+    console.log("ADD CREATED");
+  },
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<template>
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      v-loading="loading"
+      :size="size"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+        >
+          <h3>新增</h3>
+          <div style="text-align: right">
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" type="danger" @click="handleSava"
+              >保 存</el-button
+            >
+            <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
+              >
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <!-- <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div> -->
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+              >
+                <template slot-scope="scope">
+                  <span v-if="!cColumn.type">
+                    {{ scope.row[cColumn.key] }}</span
+                  >
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :size="size"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-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>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button :size="size" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 64 - 0
src/views/purchase/contract/column.js

@@ -0,0 +1,64 @@
+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 SearchColumns = TableColumns.filter((element) => element.search);

+ 399 - 0
src/views/purchase/contract/edit/index.vue

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

+ 225 - 0
src/views/purchase/contract/index.vue

@@ -0,0 +1,225 @@
+<script>
+import { TableColumns, SearchColumns } from "./column";
+import { list, remove } from "@/api/business/purchase/catalogue";
+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"),
+  },
+  data() {
+    return {
+      size: "mini",
+      loading: false,
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
+      tableData: [],
+      tableColumns: TableColumns,
+      page: initPage(),
+      layout: initLayout(),
+      pageSizes: initPageSizes(),
+    };
+  },
+  computed: {},
+  created() {
+    this.handleQueryList();
+  },
+  methods: {
+    //
+    async fetchList(params, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await list({
+          pageNum,
+          pageSize,
+          ...params,
+        });
+        if (code === 200) {
+          this.tableData = 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;
+      }
+    },
+    // 查询操作
+    handleQueryList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 重置操作
+    handleResetList() {
+      this.page = initPage();
+      this.params = initParams(SearchColumns);
+      this.fetchList(this.params, this.page);
+    },
+    // 刷新操作
+    handleRefreshList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 删除操作
+    async handleDeleteList(prop) {
+      try {
+        this.loading = true;
+        const { id } = prop;
+        const { code, msg } = await remove(id);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.fetchList(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) {
+      this.page.pageSize = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 当前页变
+    handleCurrentChange(prop) {
+      this.page.pageNum = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 打开新增drawer
+    handleOpenAddDrawer() {
+      console.log(this.$refs.AddDrawerFef);
+      const { setVisible } = this.$refs.AddDrawerFef;
+      setVisible(true);
+    },
+    // 打开查看drawer
+    async handleOpenSeeDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+    // 打开编辑drawer
+    async handleOpenEditDrawer(prop) {
+      const { id } = prop;
+      const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+  },
+};
+</script>
+
+<template>
+  <el-card
+    v-loading="loading"
+    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="right"
+      label-width="85px"
+      :model="params"
+    >
+      <el-row :gutter="24">
+        <el-col
+          v-for="column in searchColumns"
+          :key="column.title"
+          :xl="6"
+          :lg="6"
+          :md="8"
+          :sm="12"
+          :xs="24"
+        >
+          <el-form-item :prop="column.key" :label="column.title">
+            <el-input
+              v-model="params[column.key]"
+              :placeholder="column.placeholder"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-search"
+            @click="handleQueryList"
+          ></el-button>
+          <el-button
+            circle
+            :size="size"
+            icon="el-icon-refresh"
+            @click="handleResetList"
+          ></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-col>
+    </el-row>
+    <el-table
+      @row-dblclick="handleOpenSeeDrawer"
+      :data="tableData"
+      :size="size"
+      style="width: 100%; margin: 20px 0 0 0"
+    >
+      <el-table-column
+        v-for="(column, index) in tableColumns"
+        :key="index"
+        :prop="column.key"
+        :label="column.title"
+        :width="column.width || 180"
+        :show-overflow-tooltip="column.showOverflowTooltip || true"
+      >
+      </el-table-column>
+      <el-table-column fixed="right" label="操作" width="120">
+        <template slot-scope="scope">
+          <el-button
+            @click.native.prevent="handleDeleteList(scope.row)"
+            type="text"
+            size="small"
+          >
+            删 除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :total="page.total"
+      :page-sizes="pageSizes"
+      :page-size="page.pageSize"
+      :current-page="page.pageNum"
+      :layout="layout"
+      style="margin: 16px 0"
+    >
+    </el-pagination>
+  </el-card>
+</template>

+ 317 - 0
src/views/purchase/contract/see/index.vue

@@ -0,0 +1,317 @@
+<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,
+  }),
+}));
+
+export default {
+  name: "SeeDrawer",
+  dicts: initDicts(NewColumns),
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        contractItemList: [],
+        contractClauseList: [],
+        contractExpenseList: [],
+        contractAgreementList: [],
+        contractApplyOrgList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "contractItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "contractItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+    tabName: function (newProp) {
+      const { id } = this.params;
+      this.fetchTable(id, newProp);
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 查询详细
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await item(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        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;
+      }
+    },
+    // 取消操作
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(Columns);
+    },
+    // 编辑操作
+    handleOpenEditDrawer(prop) {
+      this.setVisible(false);
+      this.$parent.$parent.handleOpenEditDrawer(prop);
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</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"
+      >
+        <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"
+          >
+            <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"
+      >
+        <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-row> -->
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 59 - 23
src/views/purchase/deliveryAddress/add.vue

@@ -28,24 +28,16 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-input
-                v-model="basicForm.warehouseCode"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.warehouseCode" :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>
          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="仓库属性">
-              <el-select v-model="basicForm.warehouseProperty" size="small" style="width: 200px" clearable :disabled="disable">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+          <el-form-item label="仓库属性">
+              <el-select :disabled="disable" v-model="basicForm.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>
@@ -65,13 +57,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-input
-                v-model="basicForm.contactsName"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <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>
             </el-form-item>
          </el-col>
 
@@ -89,13 +77,16 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-input
+              <el-select
                 v-model="basicForm.materialClassify"
                 size="small"
                 :disabled="disable"
                 clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
                 style="width: 200px"
-              />
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -151,14 +142,25 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
 <script>
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
 export default {
   name: 'addAddress',
+  dicts: ['sys_warehouse_attribute'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers,
+    TreeRefers
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
@@ -181,11 +183,19 @@ export default {
         sendStatus: '',
         remark: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       options: [{
         value: '1', label: '是',
       }, {
         value: '0', label: '否'
       }],
+      houseOptions: [],
+      contactsOptions: [],
+      classOptions: [],
       basicRules: {}
     }
   },
@@ -232,6 +242,32 @@ export default {
         }
       })
     },
+    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.basicForm.warehouseCode = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        this.basicForm.contactsName = selection[0].id
+      }
+    },
+    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.basicForm.materialClassify = selection.id
+    },
   }
 }
 </script>

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

@@ -179,12 +179,11 @@
           <el-button type="primary" size="small">停用</el-button>
           <el-button type="primary" size="small">同步NC</el-button>
           <el-button type="primary" size="small">删除</el-button>
-          <el-button type="primary" size="small">打印</el-button>
         </div>
         <el-table 
           :data="tableList" 
           fit
-          max-height="680"
+          max-height="480"
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
@@ -346,6 +345,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;

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

@@ -1,7 +1,7 @@
 <script>
-import { taskList } from "@/api/business/purchase/purchase-task";
-// import AddPurchaseTaskDrawer from "./add-purchase-task.vue";
-// import SeePurchaseTaskDrawer from "./see-purchase-task.vue";
+import { taskList } from "@/api/business/purchase/task";
+// import AddPurchaseTaskDrawer from "./add-task.vue";
+// import SeePurchaseTaskDrawer from "./see-task.vue";
 // import DirectSourcingTable from "./direct-sourcing.vue";
 export default {
   name: "PuchaseTask",

+ 0 - 314
src/views/purchase/purchase-contract/add-purchase-contract.vue

@@ -1,314 +0,0 @@
-<script>
-import { add } from "@/api/business/purchase/purchase-contract";
-import { arr2obj } from "@/utils/data-transform";
-import {
-  initDicts,
-  initRules,
-  initParams,
-  initComponents,
-} from "@/utils/init-something";
-import { initColumns } from "./config/add";
-
-export default {
-  name: "AddPurchaseContractDrawer",
-  components: initComponents(initColumns()),
-  dicts: initDicts(initColumns()),
-  data() {
-    return {
-      visible: true,
-      columns: initColumns(),
-      rules: initRules(initColumns()),
-      params: initParams(initColumns()),
-      tabColumns: initTabColumns(),
-      tabName: "first",
-      tabTableDatas: {
-        first: [],
-        second: [],
-        third: [],
-        fourth: [],
-        fifth: [],
-      },
-      currentComponent: { name: "", title: "", value: "", row: {} },
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    beforeOpen() {
-      const { deptName, nickName, orgName } = this.$store.state.user;
-      this.params.puOrg = orgName;
-      this.params.buyer = nickName;
-      this.params.puDept = deptName;
-    },
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    addTableRow() {},
-    cancel() {
-      this.setVisible(false);
-      this.params = arr2obj(this.columns, "key", "value");
-    },
-    sava() {
-      this.setVisible(false);
-    },
-    async submitSava() {
-      console.log(this.params);
-      return;
-      try {
-        const res = await add(this.params);
-        console.log("res", res);
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.setVisible(false);
-      }
-    },
-    //
-    openAsyncInputDialog(prop, type) {
-      try {
-        const {
-          key,
-          title,
-          config: { componentName },
-        } = prop;
-        this.currentComponent.row = prop;
-        this.currentComponent.title = title;
-        this.currentComponent.name = componentName;
-        if (type === "change") {
-          this.currentComponent.value = this.params[key];
-        }
-        if (type === "click") {
-          this.currentComponent.value = "";
-        }
-        this.$nextTick(() => {
-          const { setVisible } = this.$refs[componentName];
-          setVisible(true);
-        });
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-      }
-    },
-    updateParams(prop) {
-      const {
-        config: { dataMapping },
-      } = this.currentComponent.row;
-      for (let key in dataMapping) {
-        this.params[key] = prop[dataMapping[key]];
-      }
-    },
-  },
-  created() {
-    // console.log("this,", initComponents(initColumns()));
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <div
-        slot="header"
-        style="
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-        "
-      >
-        <h3>新增</h3>
-        <div style="text-align: right">
-          <el-button size="mini" @click="cancel">取消</el-button>
-          <el-button size="mini" type="danger" @click="sava">保存</el-button>
-          <el-button size="mini" type="info" @click="submitSava">
-            保存并新增
-          </el-button>
-        </div>
-      </div>
-      <component
-        v-if="currentComponent.name"
-        :is="currentComponent.name"
-        :ref="currentComponent.name"
-        :title="currentComponent.title"
-        :value="currentComponent.value"
-        @confirm="updateParams"
-      ></component>
-      <el-row>
-        <el-form
-          size="mini"
-          label-position="right"
-          label-width="135px"
-          :model="params"
-          :rules="rules"
-        >
-          <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>
-              <el-input
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-                @blur="openAsyncInputDialog(column, 'change')"
-                @change="openAsyncInputDialog(column, 'change')"
-              >
-                <template #suffix>
-                  <el-icon
-                    class="el-icon-s-operation"
-                    style="cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, 'click')"
-                  ></el-icon>
-                </template>
-              </el-input>
-              <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-s-operation"
-                    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://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-form-item>
-          </el-col>
-        </el-form>
-      </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" @tab-click="handleClick" style="width: 100%">
-        <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%">
-            <el-table-column
-              v-for="(cColumn, cIndex) in column.tableColumns"
-              :key="cIndex"
-              :prop="cColumn.key"
-              :label="cColumn.title"
-              :width="cColumn.width"
-            >
-            </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">增行</el-button>
-      </el-row>
-    </el-card>
-  </el-drawer>
-</template>

+ 0 - 386
src/views/purchase/purchase-contract/direct-sourcing.vue

@@ -1,386 +0,0 @@
-<script>
-export default {
-  name: "DirectSourcing",
-  components: {},
-  data() {
-    const tableColumns = [
-      { title: "价格来源", key: "a" },
-      { title: "供应商", key: "b" },
-      { title: "采购组织", key: "c" },
-      { title: "客户", key: "d" },
-      { title: "价格类型", key: "e" },
-      { title: "配送价", key: "f" },
-      { title: "币种", key: "g" },
-      { title: "价格有效期", key: "h" },
-      { title: "税率", key: "i" },
-      { title: "协议单价", key: "j" },
-      {
-        title: "未执行量",
-        key: "k",
-        edit: true,
-        editConfig: { type: "InputNumber", controlsPosition: "right" },
-      },
-      {
-        title: "采购量",
-        key: "l",
-        edit: true,
-        editConfig: { type: "InputNumber", controlsPosition: "right" },
-      },
-      {
-        title: "计划到货",
-        key: "m",
-        edit: true,
-        editConfig: { type: "DatePicker", showType: "date" },
-      },
-      {
-        title: "期望到货",
-        key: "n",
-        edit: true,
-        editConfig: { type: "DatePicker", showType: "date" },
-      },
-      {
-        title: "备注",
-        key: "o",
-        edit: true,
-        editConfig: { type: "Textarea" },
-      },
-    ];
-    const initTableColumns = () => tableColumns;
-    return {
-      tableColumns: initTableColumns(),
-      data: [
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-      ],
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
-      pageSizes: [25, 50, 100],
-    };
-  },
-  computed: {},
-  watch: {
-    data: {
-      handler: function (n) {
-        console.log(n);
-      },
-      deep: true,
-    },
-  },
-  methods: {},
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-
-<template>
-  <div class="directSourcing" style="height: 50vh">
-    <el-table :data="data" height="calc(50vh)" style="width: 100%">
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
-        <template slot-scope="scope">
-          <el-input-number
-            v-if="column.edit && column.editConfig.type === 'InputNumber'"
-            v-model="scope.row[column.key]"
-            :controls-position="column.editConfig.controlsPosition"
-            :min="column.editConfig.min"
-            :max="column.editConfig.max"
-            :size="column.editConfig.size || 'mini'"
-            :placeholder="column.editConfig.placeholder"
-            style="width: 90%"
-          ></el-input-number>
-          <el-date-picker
-            v-else-if="column.edit && column.editConfig.type === 'DatePicker'"
-            v-model="scope.row[column.key]"
-            :type="column.editConfig.showType"
-            :picker-options="column.editConfig.pickerOptions"
-            :size="column.editConfig.size || 'mini'"
-            :placeholder="column.editConfig.placeholder"
-            style="width: 90%"
-          ></el-date-picker>
-          <el-input
-            v-else-if="column.edit && column.editConfig.type === 'Textarea'"
-            v-model="scope.row[column.key]"
-            type="textarea"
-            :autosize="column.editConfig.autosize || true"
-            :size="column.editConfig.size || 'mini'"
-            style="width: 90%"
-          ></el-input>
-          <span v-else>{{ scope.row[column.key] }}</span>
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
-    </el-pagination>
-  </div>
-</template>
-
-<style scoped></style>

+ 0 - 264
src/views/purchase/purchase-contract/index.vue

@@ -1,264 +0,0 @@
-<script>
-import { list } from "@/api/business/purchase/purchase-contract";
-import AddPurchaseContractDrawer from "./add-purchase-contract.vue";
-import SeePurchaseContractDrawer from "./see-purchase-contract.vue";
-// import DirectSourcingTable from "./direct-sourcing.vue";
-export default {
-  name: "PuchaseTask",
-  components: {
-    AddPurchaseContractDrawer,
-    SeePurchaseContractDrawer,
-    // DirectSourcingTable,
-  },
-  data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    const searchColumns = [
-      { title: "合同名称", key: "contractName", type: "Input" },
-    ];
-    const initSearchColumns = () => searchColumns;
-    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
-    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: "合同名称" },
-      { 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: "删除标记" },
-    ];
-    const initTableColumns = () => tableColumns;
-    return {
-      loading: false,
-      isSimpleSearch: true,
-      searchColumns: initSearchColumns(),
-      searchParams: {
-        isAsc: "desc",
-        reasonable: "",
-        orderByColumn: "",
-        ...initSearchParams(),
-      },
-      tableColumns: initTableColumns(),
-      tableData: [{ materialName: 1 }],
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
-      pageSizes: [25, 50, 100],
-    };
-  },
-  computed: {
-    showSearchColumns() {
-      return this.isSimpleSearch
-        ? this.searchColumns.slice(0, 4)
-        : this.searchColumns;
-    },
-  },
-  //   watch: {
-  //     $route: {
-  //       handler: function (route) {
-  //         this.redirect = route.query && route.query.redirect;
-  //       },
-  //       immediate: true,
-  //     },
-  //   },
-  created() {
-    this.fetchTaskList();
-    console.log("Vue", this);
-  },
-  methods: {
-    async fetchTaskList() {
-      this.loading = true;
-      try {
-        const { code, msg, rows, total } = await list({
-          ...this.page,
-          ...this.searchParams,
-        });
-        if (code === 200) {
-          this.total = total;
-          this.tableData = 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;
-      }
-    },
-    handleSearchChange() {
-      this.isSimpleSearch = !this.isSimpleSearch;
-      this.$notify.info({
-        title: this.isSimpleSearch ? "Simple Search" : "All Search",
-      });
-    },
-    handleSizeChange() {},
-    handleCurrentChange() {},
-    handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.addDrawerFef;
-      setVisible(true);
-      setTimeout(() => {
-        this.$notify.info("Open Add Drawer");
-      }, 250);
-    },
-    handleOpenSeeDrawer() {
-      const { setVisible } = this.$refs.seeDrawerFef;
-      setVisible(true);
-      setTimeout(() => {
-        this.$notify.info("Open See Drawer");
-      }, 250);
-    },
-  },
-};
-</script>
-
-<template>
-  <el-card
-    v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
-    :body-style="{ padding: 0 }"
-  >
-    <AddPurchaseContractDrawer ref="addDrawerFef"></AddPurchaseContractDrawer>
-    <SeePurchaseContractDrawer ref="seeDrawerFef"></SeePurchaseContractDrawer>
-    <el-form
-      size="mini"
-      label-position="right"
-      label-width="85px"
-      :model="searchParams"
-      style="padding: 20px 0 0 0"
-    >
-      <el-row :gutter="24">
-        <el-col :span="20">
-          <el-row :gutter="20">
-            <el-col
-              v-for="column in showSearchColumns"
-              :key="column.title"
-              :xl="6"
-              :lg="6"
-              :md="8"
-              :sm="12"
-              :xs="24"
-            >
-              <el-form-item :prop="column.key" :label="column.title">
-                <el-input
-                  v-model="searchParams[column.key]"
-                  :placeholder="column.placeholder"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-col>
-        <el-col
-          :span="3"
-          :offset="1"
-          style="text-align: right; padding-right: 40px"
-        >
-          <el-button type="primary" size="mini">搜索</el-button>
-          <el-button size="mini">重置</el-button>
-        </el-col>
-      </el-row>
-    </el-form>
-    <el-divider>
-      <i
-        :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
-        style="cursor: pointer"
-        @click="handleSearchChange"
-      ></i>
-    </el-divider>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">123</el-col>
-      <el-col :span="18" style="text-align: right">
-        <el-button
-          size="mini"
-          type="danger"
-          style="margin: 0 10px 0 0"
-          @click="handleOpenAddDrawer"
-        >
-          新增
-        </el-button>
-      </el-col>
-    </el-row>
-    <el-table
-      @row-dblclick="handleOpenSeeDrawer"
-      :data="tableData"
-      size="mini"
-      style="width: 100%; margin: 20px 0 0 0"
-    >
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
-    </el-pagination>
-  </el-card>
-</template>

+ 0 - 404
src/views/purchase/purchase-contract/see-purchase-contract.vue

@@ -1,404 +0,0 @@
-<script>
-export default {
-  name: "SeePurchaseContractDrawer",
-  data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    const columns = [
-      { key: "puOrg", title: "采购组织", type: "TagSelect", require: true },
-      { key: "code", title: "合同编码", type: "Input" },
-      { key: "contractName", title: "合同名称", type: "Input", require: true },
-      { key: "supplier", title: "供应商", type: "TagSelect", require: true },
-      { key: "contractType", title: "合同类型", type: "Select", require: true },
-      { key: "puDept", title: "采购部门", type: "TagSelect", require: true },
-      { key: "buyer", title: "采购员", type: "TagSelect" },
-      { key: "source", title: "合同来源", type: "Select" },
-      {
-        key: "signDate",
-        title: "合同签订日期",
-        type: "DatePicker",
-        require: true,
-      },
-      {
-        key: "effectiveDate",
-        title: "合同生效日期",
-        type: "DatePicker",
-        require: true,
-      },
-      { key: "endDate", title: "合同终止日期", type: "DatePicker" },
-      { key: "externalContract", title: "外部合同号", type: "Input" },
-      { key: "refusalReasons", title: "拒绝理由", type: "Input" },
-      { 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: "projectName", title: "项目名称", type: "TagSelect" },
-      { key: "projectCode", title: "项目编号", type: "Input" },
-      { key: "area", title: "区域", type: "Input" },
-      { key: "consigneePhone", title: "收货人联系方式", type: "Input" },
-      { key: "paymentAgreement", title: "付款协议", type: "TagSelect" },
-      { key: "currency", title: "币种", type: "TagSelect", require: true },
-      { key: "taxPrice", title: "价税合计", type: "InputNumber" },
-      { key: "guaranteePeriod", title: "质保期", type: "Input" },
-
-      // { key: "lastPuMoney", title: "上年度采购额" },
-      // { key: "buyerName", title: "采购员名称" },
-      // { key: "supplierName", title: "供应商名称" },
-      // { key: "puMoneyYear", title: "本年度采购额" },
-      // { key: "puDeptName", title: "采购部门名称" },
-      // { key: "supplierTier", title: "供应商层级" },
-      // { key: "grossRateAverage", title: "平均毛利率" },
-      // { key: "approveFlow", title: "审批流程" },
-      // { key: "consumableClass", title: "耗材类别" },
-      // { key: "brandGrossRate", title: "同类品牌及毛利率" },
-      // { key: "contractFormat", title: "合同格式" },
-      // { key: "productName", title: "产品类别&名称" },
-      // { key: "invoiceTax", title: "发票税率" },
-      // { key: "emergencyDegree", title: "紧急程度" },
-      // { key: "project", title: "项目医院" },
-      // { key: "deliveryType", 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: "rollbackPolicy", title: "退换货政策" },
-      // { key: "contractContent", title: "合同主要内容" },
-      // { key: "currencyName", title: "币种名称" },
-      // { key: "tenantId", title: "租户号" },
-      // { key: "revision", title: "乐观锁" },
-      // { key: "createByName", title: "创建人" },
-      // { key: "updateByName", title: "创建人名称" },
-      // { key: "delFlag", title: "删除标记" },
-    ];
-    const initColumns = () =>
-      columns.map((column) => {
-        const clearable = column.clearable || true;
-        if (column.type === "InputNumber") {
-          return {
-            ...column,
-            clearable,
-            config: { controlsPosition: "right" },
-          };
-        }
-        if (column.type === "DatePicker") {
-          return {
-            ...column,
-            clearable,
-            config: { type: "date" },
-          };
-        }
-        return {
-          ...column,
-          clearable,
-        };
-      });
-    const initParams = () => arr2Obj(initColumns(), "key", "value");
-    const tabColumns = [
-      {
-        title: "物料基本信息",
-        key: "first",
-        tableColumns: [
-          { title: "序号", key: "" },
-          { title: "赠品", key: "" },
-          { title: "物料编码", key: "" },
-          { title: "物料名称", key: "" },
-          { title: "规格", key: "" },
-          { title: "生产厂家", key: "" },
-          { title: "收货客户", key: "" },
-          { title: "品牌", key: "" },
-          { title: "采购数量", key: "" },
-          { title: "采购单位", key: "" },
-          { title: "计价数量", key: "" },
-          { title: "税率%", key: "" },
-          { title: "含税单价", key: "" },
-          { title: "含税金额合计", key: "" },
-          { title: "价格有效期(起)", key: "" },
-          { title: "计划到货日期", key: "" },
-          { title: "来源类型", key: "" },
-          { title: "来源单号", key: "" },
-          { title: "需求单号", key: "" },
-          { title: "备注", key: "" },
-        ],
-      },
-      {
-        title: "合同条款",
-        key: "second",
-        tableColumns: [
-          { title: "序号", key: "" },
-          { title: "条款编码", key: "" },
-          { title: "条款名称", key: "" },
-          { title: "条款内容", key: "" },
-          { title: "变量序号", key: "" },
-          { title: "变量内容", key: "" },
-          { title: "备注", key: "" },
-        ],
-      },
-      {
-        title: "合同费用",
-        key: "third",
-        tableColumns: [
-          { title: "序号", key: "" },
-          { title: "费用编码", key: "" },
-          { title: "费用名称", key: "" },
-          { title: "费用金额", key: "" },
-          { title: "备注", key: "" },
-        ],
-      },
-      {
-        title: "付款协议信息",
-        key: "fourth",
-        tableColumns: [
-          { title: "序号", key: "" },
-          { title: "付款阶段", key: "" },
-          { title: "是否预付款", key: "" },
-          { title: "是否质保金", key: "" },
-          { title: "结算方式", key: "" },
-          { title: "付款起点", key: "" },
-          { title: "付款金额", key: "" },
-          { title: "付款比例%", key: "" },
-          { title: "账期天数", key: "" },
-          { title: "备注", key: "" },
-        ],
-      },
-      {
-        title: "合同执行组织范围",
-        key: "fifth",
-        tableColumns: [
-          { title: "序号", key: "" },
-          { title: "组织名称", key: "" },
-          { title: "组织编码", key: "" },
-        ],
-      },
-    ];
-    const initTabColumns = () => tabColumns;
-    return {
-      visible: false,
-      columns: initColumns(),
-      params: initParams(),
-      options: [
-        {
-          value: "选项1",
-          label: "黄金糕",
-        },
-        {
-          value: "选项2",
-          label: "双皮奶",
-        },
-        {
-          value: "选项3",
-          label: "蚵仔煎",
-        },
-        {
-          value: "选项4",
-          label: "龙须面",
-        },
-        {
-          value: "选项5",
-          label: "北京烤鸭",
-        },
-      ],
-      tabColumns: initTabColumns(),
-      tabName: "first",
-      tabTableDatas: {
-        first: [],
-        second: [],
-        third: [],
-        fourth: [],
-        fifth: [],
-      },
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-  },
-  created() {
-    console.log(this.params, this.columns);
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-drawer
-    title="我是标题"
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    :before-close="handleClose"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <div
-        slot="header"
-        style="
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-        "
-      >
-        <h3>查看</h3>
-        <div style="text-align: right">
-          <el-button size="mini" @click="setVisible(false)">取消</el-button>
-          <el-button size="mini" type="info" @click="setVisible(false)"
-            >保存并新增</el-button
-          >
-          <el-button size="mini" type="danger" @click="setVisible(false)"
-            >保存</el-button
-          >
-        </div>
-      </div>
-      <el-row>
-        <el-form
-          size="mini"
-          label-position="right"
-          label-width="150px"
-          :model="params"
-        >
-          <el-col
-            v-for="(column, index) in columns"
-            :key="index"
-            :span="column.span || 8"
-          >
-            <el-form-item
-              :prop="column.key"
-              :label="column.title"
-              :required="column.required"
-            >
-              <el-input
-                v-if="column.type === 'Input'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                style="width: 90%"
-              ></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"
-                style="width: 90%"
-              ></el-input-number>
-              <el-select
-                v-if="column.type === 'Select'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                style="width: 90%"
-              >
-                <el-option
-                  v-for="item in options"
-                  :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"
-                style="width: 90%"
-              >
-                <template #prefix>
-                  <el-icon
-                    class="el-icon-s-operation"
-                    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"
-                :picker-options="column.pickerOptions"
-                style="width: 90%"
-              >
-              </el-date-picker>
-              <el-upload
-                v-if="column.type === 'Upload'"
-                :file-list="params[column.key]"
-                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-form-item>
-          </el-col>
-        </el-form>
-      </el-row>
-    </el-card>
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <el-tabs v-model="tabName" @tab-click="handleClick" style="width: 100%">
-        <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%">
-            <el-table-column
-              v-for="(cColumn, cIndex) in column.tableColumns"
-              :key="cIndex"
-              :prop="cColumn.key"
-              :label="cColumn.title"
-            >
-            </el-table-column>
-          </el-table>
-        </el-tab-pane>
-      </el-tabs>
-    </el-card>
-  </el-drawer>
-</template>

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

@@ -0,0 +1,459 @@
+export const Columns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    type: "InputDialog",
+    config: {
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        puOrg: "code",
+        puOrgName: "name",
+      },
+    },
+    require: true,
+  },
+  {
+    key: "billTypeName",
+    title: "订单类型",
+    type: "Select",
+    require: true,
+    config: {
+      optionsName: "sys_order_type", // 字典名
+    },
+  },
+  // { key: "billTypeName", title: "订单类型名称", },
+  { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
+  { key: "code", title: "订单编号", type: "Input", },
+  {
+    key: "billDate",
+    title: "订单日期",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    type: "InputDialog",
+    config: {
+      componentName: "SUPPLIER_PARAM",
+      dataMapping: {
+        supplier: "code",
+        supplierName: "name",
+      },
+    },
+    require: true,
+  },
+  {
+    key: "paymentAgreementName",
+    title: "付款协议",
+    type: "InputDialog",
+    config: {
+      componentName: "PAYAGREEMENT_PARAM",
+      dataMapping: {
+        paymentAgreement: "code",
+        paymentAgreementName: "name",
+      },
+    },
+  },
+  {
+    key: "finalTypeName",
+    title: "结算方式",
+    type: "InputDialog",
+    config: {
+      componentName: "BALATYPE_PARAM",
+      dataMapping: {
+        finalType: "code",
+        finalTypeName: "name",
+      },
+    },
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    type: "InputDialog",
+    config: {
+      componentName: "CURRENCY_PARAM",
+      dataMapping: {
+        currency: "code",
+        currencyName: "name",
+      },
+    },
+  },
+  {
+    key: "buyerName",
+    title: "采购员",
+    type: "InputDialog",
+    config: {
+      componentName: "ORG_PARAM",
+      dataMapping: {
+        buyer: "userId",
+        buyerName: "userName",
+        puDept: "deptId",
+        puDeptName: "deptName",
+      },
+    },
+    require: true,
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    type: "InputDialog",
+    config: {
+      componentName: "DEPT_PARAM",
+      dataMapping: {
+        puDept: "code",
+        puDeptName: "name",
+      },
+    },
+    require: true,
+  },
+  {
+    key: "customerName",
+    title: "收货客户",
+    type: "InputDialog",
+    width: 200,
+    config: {
+      componentName: "CUSTOMER_PARAM",
+      dataMapping: {
+        customer: "code",
+        customerName: "name",
+      },
+    },
+  },
+  {
+    key: "qty",
+    title: "总数量",
+    type: "InputNumber",
+    config: { controlsPosition: "right" },
+  },
+  {
+    key: "originalQty",
+    title: "原始总数量",
+    type: "InputNumber",
+    config: { controlsPosition: "right" },
+  },
+  { key: "money", title: "价税合计", type: "Input", },
+  { key: "originalMoney", title: "原始总金额", type: "Input", },
+  { key: "notaxMoney", title: "无税金额", type: "Input", },
+  {
+    key: "status",
+    title: "单据状态",
+    type: "Select",
+    require: true,
+    config: {
+      optionsName: "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",
+    title: "WMS入库仓库", // 收货仓库
+    type: "InputDialog",
+    config: {
+      componentName: "WAREHOUSE_PARAM",
+      dataMapping: {
+        warehouse: "code",
+        warehouseName: "name",
+      }
+    },
+  },
+  {
+    key: "goodsAllocationName",
+    title: "货位",
+    type: "InputDialog",
+    config: {
+      componentName: "ALLOCATION_PARAM",
+      dataMapping: {
+        goodsAllocation: "code",
+        goodsAllocationName: "name",
+      },
+      queryParams: {
+        pkOrg: 'puOrg',
+      }
+    },
+    width: 200,
+  },
+  { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
+  { key: "isInvoice", title: "发票标识", type: "Checkbox", },
+  { key: "supplierOrderNo", title: "供应商订单号", type: "Input", },
+  { key: "rebateMoney", title: "订单使用返利金额", type: "Input", },
+  { key: "deductionMoney", title: "订单抵扣余款金额", type: "Input", },
+  { key: "address", title: "收货地址", type: "Input", },
+  { key: "contacts", title: "收货联系人", type: "Input", },
+  {
+    key: "customerDeptName",
+    title: "客户部门",
+    type: "InputDialog",
+    width: 200,
+    config: {
+      componentName: "CUSTOMERDEPT_PARAM",
+      dataMapping: {
+        customerDept: "code",
+        customerDeptName: "name",
+      },
+    },
+  },
+  {
+    key: "supplierContactsName",
+    title: "供应商业务联系人",
+    type: "InputDialog",
+    config: {
+      componentName: "SUPPLIERCONTACTS_PARAM",
+      dataMapping: {
+        supplierContacts: "code",
+        supplierContactsName: "name",
+      },
+    },
+    width: 200,
+  },
+  { key: "isUrgency", title: "紧急程度", type: "Checkbox", },
+  { key: "isSendWms", title: "已同步WMS", type: "Checkbox", },
+  // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
+  // { key: "agentName", title: "代理人名称", },
+  { key: "isClose", title: "最终关闭", type: "Checkbox", },
+  { key: "closeTime", title: "最终关闭日期", type: "Input", },
+  { 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: "isDeliver", title: "是否发货", type: "Checkbox", },
+  {
+    key: "retReason",
+    title: "退换原因",
+    type: "InputDialog",
+    config: {
+      componentName: "RETREASON_PARAM",
+      dataMapping: {
+        retReason: "code",
+        // retReasonName: "name",
+      },
+    },
+  },
+  {
+    key: "processTypeName",
+    title: "处理方式",
+    type: "InputDialog",
+    config: {
+      componentName: "PROCESSTYPE_PARAM",
+      dataMapping: {
+        processType: "code",
+        processTypeName: "name",
+      },
+    },
+  },
+  { key: "isEnd", title: "整单关闭标识", type: "Input", },
+  {
+    key: "projectNow",
+    title: "在建工程项目",
+    type: "InputDialog",
+    config: {
+      componentName: "PROJECT_PARAM",
+      dataMapping: {
+        projectNow: "code",
+        // processTypeName: "name",
+      },
+    },
+  },
+  {
+    key: "operatingItems",
+    title: "经营性项目",
+    type: "InputDialog",
+    config: {
+      componentName: "OPERATING_PARAM",
+      dataMapping: {
+        operatingItems: "code",
+        // processTypeName: "name",
+      },
+    },
+  },
+  { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
+  { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
+  { key: "marketingCode", title: "销售订单号", type: "Input", },
+  { key: "isArrival", title: "到货超期", type: "Checkbox", },
+  { key: "createByName", title: "创建人名称", type: "Input", },
+  { key: "updateByName", title: "更新人名称", type: "Input", },
+  { key: "flowId", title: "OA流程ID", type: "Input", },
+  { key: "approver", title: "审批人", type: "Input", },
+  {
+    key: "approverFinishTime",
+    title: "审批时间",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
+  {
+    key: "approveTime",
+    title: "提交时间",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
+
+];
+
+// export const initColumns = () => columns;
+
+export const TabColumns = [
+  {
+    title: '物料信息',
+    key: 'puOrderItemList',
+    tableColumns: [
+      // { key: "id", title: "主键" },
+      { key: "rowNo", title: "行号", type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", },
+      // {key: "material",title: "物料",type: "Input",   },
+      { key: "materialName", title: "物料名称", type: "Input", },
+      {
+        key: "materialCode",
+        title: "物料编码",
+        type: "InputDialog",
+        config: {
+          componentName: "MATERIAL_PARAM",
+          dataMapping: {
+            material: "id",
+            materialName: "name",
+            materialCode: "code",
+          },
+        },
+      },
+      { key: "materialClassify", title: "物料分类", type: "Input", },
+      { key: "materialManufacturersCode", title: "厂家物料编码", type: "Input", },
+      { key: "specification", title: "规格", type: "Input", },
+      { key: "model", title: "型号", type: "Input", },
+      { key: "isMedcine", title: "医药物料", type: "Input", },
+      { key: "manufacturer", title: "生产厂家代理人", type: "Input", },
+      { key: "isDrug", title: "物料药品属性", type: "Input", },
+      { key: "unit", title: "单位", type: "Input", },
+      { key: "qty", title: "数量", type: "Input", },
+      { key: "taxPrice", title: "含税单价", type: "Input", },
+      { key: "money", title: "价税合计", type: "Input", },
+      { key: "tax", title: "税率", type: "Input", },
+      { key: "taxDeductMoneya", title: "折扣金额", type: "Input", },
+      { key: "arrivalQty", title: "已到货数量", type: "Input", },
+      { key: "unarrivedQty", title: "未到货数量", type: "Input", },
+      { key: "notaxMoney", title: "无税金额", type: "Input", },
+      { key: "priceSource", title: "价格目录ID", type: "Input", },
+      { key: "isStorage", title: "入库关闭", type: "Input", },
+      { key: "isInvoice", title: "开票关闭", type: "Input", },
+      { key: "isArrival", title: "到货关闭", type: "Input", },
+      { key: "isPayment", title: "付款关闭", type: "Input", },
+      { key: "isGift", title: "赠品", type: "Input", },
+      {
+        key: "warehouseName",
+        title: "收货仓库", //WMS入库仓库
+        type: "InputDialog",
+        config: {
+          componentName: "WAREHOUSE_PARAM",
+          dataMapping: {
+            warehouse: "code",
+            warehouseName: "name",
+          }
+        },
+        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: "storageCondition",
+        title: "存储条件",
+        type: "Select",
+        config: {
+          optionsName: "sys_storage_condition",
+        },
+      },
+      {
+        key: "carriageCondition",
+        title: "运输条件",
+        type: "Select",
+        config: {
+          optionsName: "sys_conditions_carriage",
+        },
+      },
+
+      { key: "isBatchLock", title: "批号锁定标识", type: "Input", },
+      { key: "isReplenishment", title: "补单标识", type: "Input", },
+      { 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: "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: "priceType",
+        title: "价格类型",
+        type: "Select",
+        config: {
+          optionsName: "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: "price", title: "无税单价", type: "Input", }
+    ]
+  },
+  {
+    title: '执行结果',
+    key: 'puOrderExecuteList',
+    tableColumns: [
+      // { key: "id", title: "主键",type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "rowno", title: "行号", type: "Input", },
+      {
+        key: "materialName",
+        title: "物料",
+        type: "InputDialog",
+        config: {
+          componentName: "MATERIAL_PARAM",
+          dataMapping: {
+            material: "id",
+            materialName: "name",
+            // materialCode: "code",
+          },
+        },
+      },
+      // { 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", },
+    ]
+  },
+];
+
+// export const initTabColumns = () => tabColumns;

+ 266 - 0
src/views/purchase/purchase-order/add/index.vue

@@ -0,0 +1,266 @@
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import { Columns, TabColumns } from "./column";
+
+const NewColumns = initColumns(Columns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...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'))
+});
+
+
+export default {
+  name: "AddPurchaseOrderDrawer",
+  dicts: initDicts(SelectColumns),
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+
+  data() {
+    return {
+      visible: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+
+      params: {
+        ...initParams(NewColumns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+
+      tabColumns: NewTabColumns,
+
+      tabName: "puOrderItemList",
+    };
+  },
+  computed: {},
+  watch: {},
+  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;
+    },
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 增行
+    addTableRow(prop) {
+      const arr = this.tabColumns.find(
+        (element) => element.key === this.tabName
+      ).tableColumns;
+      prop.push(initParams(arr, "key", "value"));
+    },
+    // 删行
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    async handleSava() {
+      // this.setVisible(false);
+      console.log(this.params, 'params');
+      try {
+        const { code, msg } = await orderApi.create(this.params);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+
+
+
+    },
+    // 保存并新增
+    async handleSubmit() {
+      try {
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await orderApi.create({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
+        });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+  },
+  created() {
+    console.log("ADD CREATED");
+  },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form 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">
+        <div slot="header" style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          ">
+          <h3>新增</h3>
+          <div style="text-align: right">
+            <el-button size="mini" @click="handleCancel">取消</el-button>
+            <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
+            <el-button size="mini" type="info" @click="handleSubmit">
+              保存并新增
+            </el-button>
+          </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" :query-params="column.config.queryParams" :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-checkbox v-else-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>
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column 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>
+                  <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>
+                  <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"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :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> -->
+                </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-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 179 - 0
src/views/purchase/purchase-order/column.js

@@ -0,0 +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: "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: "物料名称" },
+       { 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);

+ 282 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -0,0 +1,282 @@
+<script>
+import { Columns, TabColumns } from "../add/column";
+import orderApi from "@/api/business/purchase/purchase-order";
+import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+
+const NewColumns = initColumns(Columns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+// 
+const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+NewTabColumns.forEach(column => {
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+});
+
+export default {
+  name: "EditPurchaseOrderDrawer",
+  dicts: initDicts(SelectColumns),
+  components: {
+    DrInputDialog: () => import("@/components/input-dialog/index.vue"),
+  },
+  data() {
+    return {
+      size: "mini",
+      visible: false,
+      loading: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "puOrderItemList",
+    };
+  },
+  computed: {},
+  watch: {
+    "params.contractType": function (newProp) {
+      this.tabColumns = NewTabColumns.filter((element) =>
+        newProp === "1" ? element.key !== "puOrderItemList" : element
+      );
+      this.tabName = this.tabColumns[0].key;
+    },
+    tabName: function (newProp) {
+      const { id } = this.params;
+      // this.fetchTable(id, newProp);
+    },
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    // 查询详细
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await orderApi.details(prop);
+        if (code === 200) {
+          this.params = { ...this.params, ...data };
+          console.log(this.params, 'this.params----------');
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } 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"));
+    },
+    // 删除行
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
+    },
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
+    },
+    // 保存
+    async handleSava() {
+
+      try {
+        this.loading = true;
+        const { code, msg } = await (this.handleIsRevise(this.params.status) ?
+          orderApi.revision(this.params)
+          : orderApi.edit(this.params)
+        )
+        if (code === 200) {
+          this.setVisible(false);
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+
+    },
+    beforeOpen() {
+    },
+    // 判断修订还是编辑
+    handleIsRevise(status) {
+      return status == '2';
+    },
+  },
+  created() {
+    console.log("ADD CREATED");
+    console.log(this.params, 'this.params');
+  },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form v-loading="loading" :size="size" 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>{{ handleIsRevise(params.status) ? '修订' : '编辑' }}</h3>
+          <div style="text-align: right">
+            <el-button :size="size" @click="handleCancel">取 消</el-button>
+            <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
+          </div>
+        </div>
+        <el-row>
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+            <el-form-item :prop="column.key" :label="column.title">
+              <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input>
+              <dr-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>
+              <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-checkbox v-else-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
+                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <!-- <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div> -->
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column label="序号">
+                <template slot-scope="scope">
+                  {{ scope.$index + 1 }}
+                </template>
+              </el-table-column>
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
+                <template slot-scope="scope">
+                  <span v-if="!cColumn.type">
+                    {{ scope.row[cColumn.key] }}</span>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    :size="size" style="width: 100%">
+                  </el-input>
+                  <dr-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"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :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-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
+                  </el-input-number>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 365 - 0
src/views/purchase/purchase-order/index.vue

@@ -0,0 +1,365 @@
+<!-- 采购订单修订—— 列表 -->
+<script>
+import { TableColumns, SearchColumns, TabColumns } from "./column";
+import orderApi from "@/api/business/purchase/purchase-order";
+import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+export default {
+  name: "PuchaseOrder",
+  components: {
+    AddDrawer: () => import('./add/index.vue'),
+    SeeDrawer: () => import('./see/index.vue'),
+    EditDrawer: () => import('./edit/index.vue'),
+  },
+  data() {
+
+    // const tabColumns = [
+    //   {
+    //     title: '物料信息',
+    //     key: 'first',
+    //     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: 'second',
+    //     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: "删除标记" }
+    //     ]
+    //   },
+    // ];
+    const initTabColumns = () => TabColumns;
+    return {
+      loading: false,
+      isSimpleSearch: true,
+      pageSizes: initPageSizes(),
+      layout: initLayout(),
+      page: initPage(),
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
+
+      tableColumns: TableColumns,
+      tableData: [],
+      tabColumns: initTabColumns(),
+      tabName: "puOrderItemList",
+      tabTableDatas: {
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+    };
+  },
+  computed: {
+    showSearchColumns() {
+      console.log(this.searchColumns, 'this.searchColumns');
+      return this.isSimpleSearch
+        ? this.searchColumns.slice(0, 4)
+        : this.searchColumns;
+    },
+  },
+  //   watch: {
+  //     $route: {
+  //       handler: function (route) {
+  //         this.redirect = route.query && route.query.redirect;
+  //       },
+  //       immediate: true,
+  //     },
+  //   },
+  created() {
+    this.fetchList(this.params, this.page);
+    console.log("Vue", this);
+  },
+  methods: {
+    async fetchList(params, page) {
+      try {
+        this.loading = true;
+        const { pageNum, pageSize } = page;
+        const { code, msg, rows, total } = await orderApi.list({
+          pageNum,
+          pageSize,
+          ...params,
+        });
+        if (code === 200) {
+          this.page.total = total;
+          this.tableData = 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;
+      }
+    },
+    handleSearchChange() {
+      this.isSimpleSearch = !this.isSimpleSearch;
+      this.$notify.info({
+        title: this.isSimpleSearch ? "Simple Search" : "All Search",
+      });
+    },
+    // 页大小变
+    handleSizeChange(prop) {
+      this.page.pageSize = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 当前页变
+    handleCurrentChange(prop) {
+      this.page.pageNum = prop;
+      this.fetchList(this.params, this.page);
+    },
+    // 刷新操作
+    handleRefreshList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 查询操作
+    handleQueryList() {
+      this.fetchList(this.params, this.page);
+    },
+    // 重置操作
+    handleResetList() {
+
+      this.page = initPage();
+      this.params = initParams(SearchColumns);
+      this.fetchList(this.params, this.page);
+    },
+    handleTabClick() { },
+    // 新增
+    handleOpenAddDrawer() {
+      const { setVisible } = this.$refs.addDrawerFef;
+      setVisible(true);
+    },
+    // 查看
+    async handleOpenSeeDrawer(row) {
+      const { id } = row;
+      const { setVisible, fetchItem } = this.$refs.seeDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+    // 编辑、修订
+    async handleOpenEditDrawer(row) {
+      const { id } = row;
+      const { setVisible, fetchItem } = this.$refs.editDrawerFef;
+      await setVisible(true);
+      await fetchItem(id);
+    },
+    // 获取子表信息
+    async handleDetailsData(row) {
+      console.log(row, '获取详情信息');
+      try {
+        const { code, msg, data } = await orderApi.details(row.id);
+        if (code === 200) {
+          // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
+          for (const key in this.tabTableDatas) {
+            this.tabTableDatas[key] = data[key];
+          }
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.loading = false;
+      }
+    },
+    // 删除操作
+    async handleDeleteList(row) {
+      try {
+        this.loading = true;
+        const { id } = row;
+        console.log(id, 'id');
+        const { code, msg } = await orderApi.remove(id);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.fetchList(this.params, this.page);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 提交
+    async handleSubmit(row) {
+
+    }
+
+  },
+};
+</script>
+
+<template>
+  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
+    <SeeDrawer ref="seeDrawerFef"></SeeDrawer>
+    <AddDrawer ref="addDrawerFef" @close="handleRefreshList"></AddDrawer>
+    <EditDrawer ref="editDrawerFef" @close="handleRefreshList"></EditDrawer>
+
+    <el-form size="mini" label-position="right" label-width="100px" :model="params" style="padding: 20px 0 0 0">
+      <el-row :gutter="24">
+        <el-col :span="20">
+          <el-row :gutter="20">
+            <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+              <el-form-item :prop="column.key" :label="column.title">
+                <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
+              </el-form-item>
+            </el-col>
+          </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 size="mini" @click="handleResetList">重置</el-button>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <el-divider>
+      <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
+        @click="handleSearchChange"></i>
+    </el-divider>
+
+    <!-- 操作 -->
+    <el-row :gutter="24" style="padding: 0 20px">
+      <!-- <el-col :span="6">123</el-col> -->
+      <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
+        <el-button-group style="margin-left: 10px">
+          <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</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-group>
+
+        <el-button-group style="margin-left: 10px">
+          <el-button size="mini">采购退货</el-button>
+          <el-button size="mini">整单关闭</el-button>
+          <el-button size="mini">附件管理</el-button>
+          <el-button size="mini">单据追溯</el-button>
+        </el-button-group>
+      </el-col>
+    </el-row>
+
+    <el-table @row-dblclick="handleOpenSeeDrawer" @row-click="handleDetailsData" :data="tableData" size="mini"
+      highlight-current-row style="width: 100%; margin: 20px 0 0 0">
+      <el-table-column type="index" width="50" label="序号"></el-table-column>
+      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+        :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+      </el-table-column>
+      <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)">
+            {{ 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 v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+            @click.stop="handleSubmit(scope.row)">提交</el-button>
+        </template>
+      </el-table-column>
+
+    </el-table>
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
+      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+      :layout="layout">
+    </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-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>
+        </el-table>
+      </el-tab-pane>
+    </el-tabs>
+
+  </el-card>
+</template>

+ 190 - 0
src/views/purchase/purchase-order/see/index.vue

@@ -0,0 +1,190 @@
+<!-- 采购订单修订—— 查看 -->
+<script>
+import {
+  initColumns,
+  initDicts,
+  initRules,
+  initParams,
+} from "@/utils/init";
+import { Columns, TabColumns } from "../add/column";
+import orderApi from "@/api/business/purchase/purchase-order";
+
+const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns, {
+    disabled: true,
+    readonly: true,
+  }),
+}));
+
+
+export default {
+  name: "SeePurchaseOrderDrawer",
+  dicts: initDicts(NewColumns),
+  data() {
+    return {
+      visible: false,
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "puOrderItemList",
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+
+    //查询详情
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await orderApi.details(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 取 消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(Columns);
+    },
+    beforeOpen() { },
+  },
+  created() { },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form size="mini" label-position="right" 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="mini" @click="handleCancel">取 消</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 === '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-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+                false-label="N" :disabled="column.disabled" :readonly="column.readonly">
+              </el-checkbox>
+
+              <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">
+        <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"
+                    :readonly="cColumn.readonly" 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" :readonly="cColumn.readonly" 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="cColumn.disabled"
+                    :readonly="cColumn.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>
+                  <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+                    :disabled="cColumn.disabled" false-label="N"></el-checkbox>
+                </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-row> -->
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

+ 0 - 249
src/views/purchase/purchase-task/add-purchase-task.vue

@@ -1,249 +0,0 @@
-<script>
-import { add } from "@/api/business/purchase/purchase-contract";
-import { arr2obj } from "@/utils/data-transform";
-import {
-  initDicts,
-  initRules,
-  initParams,
-  initComponents,
-} from "@/utils/init-something";
-import { initColumns } from "./config/add";
-
-export default {
-  name: "AddPurchaseTaskDrawer",
-  // components: initComponents(initColumns()),
-  dicts: initDicts(initColumns()),
-  data() {
-    return {
-      visible: false,
-      columns: initColumns(),
-      rules: initRules(initColumns()),
-      params: initParams(initColumns()),
-      currentComponent: { name: "", title: "", value: "", row: {} },
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    //
-    openAsyncInputDialog(prop, type) {
-      try {
-        const {
-          key,
-          title,
-          config: { componentName },
-        } = prop;
-        this.currentComponent.row = prop;
-        this.currentComponent.title = title;
-        this.currentComponent.name = componentName;
-        if (type === "change") {
-          this.currentComponent.value = this.params[key];
-        }
-        if (type === "click") {
-          this.currentComponent.value = "";
-        }
-        this.$nextTick(() => {
-          const { setVisible } = this.$refs[componentName];
-          setVisible(true);
-        });
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-      }
-    },
-    updateParams(prop) {
-      const {
-        config: { dataMapping },
-      } = this.currentComponent.row;
-      for (let key in dataMapping) {
-        this.params[key] = prop[dataMapping[key]];
-      }
-    },
-  },
-  created() {
-    console.log(this.params);
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-drawer
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    @open="beforeOpen"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <div
-        slot="header"
-        style="
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-        "
-      >
-        <h3>新增</h3>
-        <div style="text-align: right">
-          <el-button size="mini" @click="cancel">取消</el-button>
-          <el-button size="mini" type="danger" @click="sava">保存</el-button>
-          <el-button size="mini" type="info" @click="submitSava">
-            保存并新增
-          </el-button>
-        </div>
-      </div>
-      <component
-        v-if="currentComponent.name"
-        :is="currentComponent.name"
-        :ref="currentComponent.name"
-        :title="currentComponent.title"
-        :value="currentComponent.value"
-        @confirm="updateParams"
-      ></component>
-      <el-row>
-        <el-form
-          size="mini"
-          label-position="right"
-          label-width="135px"
-          :model="params"
-          :rules="rules"
-        >
-          <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>
-              <el-input
-                v-if="column.type === 'InputDialog'"
-                v-model="params[column.key]"
-                :placeholder="column.placeholder"
-                :clearable="column.clearable"
-                :disabled="column.disabled"
-                style="width: 100%"
-                @blur="openAsyncInputDialog(column, 'change')"
-                @change="openAsyncInputDialog(column, 'change')"
-              >
-                <template #suffix>
-                  <el-icon
-                    class="el-icon-s-operation"
-                    style="cursor: pointer"
-                    @click.native.stop="openAsyncInputDialog(column, 'click')"
-                  ></el-icon>
-                </template>
-              </el-input>
-              <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 && 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-s-operation"
-                    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://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-form-item>
-          </el-col>
-        </el-form>
-      </el-row>
-    </el-card>
-  </el-drawer>
-</template>

+ 0 - 386
src/views/purchase/purchase-task/direct-sourcing.vue

@@ -1,386 +0,0 @@
-<script>
-export default {
-  name: "DirectSourcing",
-  components: {},
-  data() {
-    const tableColumns = [
-      { title: "价格来源", key: "a" },
-      { title: "供应商", key: "b" },
-      { title: "采购组织", key: "c" },
-      { title: "客户", key: "d" },
-      { title: "价格类型", key: "e" },
-      { title: "配送价", key: "f" },
-      { title: "币种", key: "g" },
-      { title: "价格有效期", key: "h" },
-      { title: "税率", key: "i" },
-      { title: "协议单价", key: "j" },
-      {
-        title: "未执行量",
-        key: "k",
-        edit: true,
-        editConfig: { type: "InputNumber", controlsPosition: "right" },
-      },
-      {
-        title: "采购量",
-        key: "l",
-        edit: true,
-        editConfig: { type: "InputNumber", controlsPosition: "right" },
-      },
-      {
-        title: "计划到货",
-        key: "m",
-        edit: true,
-        editConfig: { type: "DatePicker", showType: "date" },
-      },
-      {
-        title: "期望到货",
-        key: "n",
-        edit: true,
-        editConfig: { type: "DatePicker", showType: "date" },
-      },
-      {
-        title: "备注",
-        key: "o",
-        edit: true,
-        editConfig: { type: "Textarea" },
-      },
-    ];
-    const initTableColumns = () => tableColumns;
-    return {
-      tableColumns: initTableColumns(),
-      data: [
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-        {
-          a: 1,
-          b: 1,
-          c: 1,
-          d: 1,
-          e: 1,
-          f: 1,
-          g: 1,
-          h: 1,
-          i: 1,
-          j: 1,
-          k: 1,
-          l: 1,
-          m: 1,
-          n: 1,
-          o: 1,
-        },
-      ],
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
-      pageSizes: [25, 50, 100],
-    };
-  },
-  computed: {},
-  watch: {
-    data: {
-      handler: function (n) {
-        console.log(n);
-      },
-      deep: true,
-    },
-  },
-  methods: {},
-  created() {},
-  mounted() {},
-  destroyed() {},
-};
-</script>
-
-<template>
-  <div class="directSourcing" style="height: 50vh">
-    <el-table :data="data" height="calc(50vh)" style="width: 100%">
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
-        <template slot-scope="scope">
-          <el-input-number
-            v-if="column.edit && column.editConfig.type === 'InputNumber'"
-            v-model="scope.row[column.key]"
-            :controls-position="column.editConfig.controlsPosition"
-            :min="column.editConfig.min"
-            :max="column.editConfig.max"
-            :size="column.editConfig.size || 'mini'"
-            :placeholder="column.editConfig.placeholder"
-            style="width: 90%"
-          ></el-input-number>
-          <el-date-picker
-            v-else-if="column.edit && column.editConfig.type === 'DatePicker'"
-            v-model="scope.row[column.key]"
-            :type="column.editConfig.showType"
-            :picker-options="column.editConfig.pickerOptions"
-            :size="column.editConfig.size || 'mini'"
-            :placeholder="column.editConfig.placeholder"
-            style="width: 90%"
-          ></el-date-picker>
-          <el-input
-            v-else-if="column.edit && column.editConfig.type === 'Textarea'"
-            v-model="scope.row[column.key]"
-            type="textarea"
-            :autosize="column.editConfig.autosize || true"
-            :size="column.editConfig.size || 'mini'"
-            style="width: 90%"
-          ></el-input>
-          <span v-else>{{ scope.row[column.key] }}</span>
-        </template>
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
-    </el-pagination>
-  </div>
-</template>
-
-<style scoped></style>

+ 0 - 598
src/views/purchase/purchase-task/index.vue

@@ -1,598 +0,0 @@
-<script>
-import { taskList } from "@/api/business/purchase/purchase-task";
-import AddPurchaseTaskDrawer from "./add-purchase-task.vue";
-import SeePurchaseTaskDrawer from "./see-purchase-task.vue";
-import DirectSourcingTable from "./direct-sourcing.vue";
-export default {
-  name: "PuchaseTask",
-  components: {
-    AddPurchaseTaskDrawer,
-    SeePurchaseTaskDrawer,
-    DirectSourcingTable,
-  },
-  data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    const searchColumns = [
-      { title: "物料分类", key: "", type: "TagSelect" },
-      { title: "物料", key: "", type: "TagSelect" },
-      { title: "物料编码", key: "material", type: "Input" },
-      { title: "物料描述", key: "materialDesc", type: "Input" },
-      { title: "需求组织", key: "", type: "TagSelect" },
-      { title: "需求日期", key: "", type: "DatePicker" },
-      { title: "计划人员", key: "", type: "TagSelect" },
-      { title: "采购组织", key: "", type: "TagSelect" },
-      { title: "创建时间", key: "", type: "DatePicker" },
-      { title: "采购员", key: "", type: "TagSelect" },
-      { title: "状态", key: "", type: "Select" },
-      {
-        title: "来源单据号",
-        key: "",
-        type: "Input",
-        placeholder: "请输入来源单据号,多个用英文逗号分割",
-      },
-      { title: "收货组织", key: "", type: "TagSelect" },
-      { title: "采购分类", key: "", type: "Input" },
-      // { title: "受理人", key: "", type: "TagSelect" },
-      { title: "项目", key: "", type: "TagSelect" },
-      { title: "需求部门", key: "", type: "TagSelect" },
-      { title: "需求人", key: "", type: "TagSelect" },
-      { title: "ERP信息", key: "", type: "Input" },
-    ];
-    const initSearchColumns = () => searchColumns;
-    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
-    const tableColumns = [
-      {
-        title: "物料名称",
-        key: "materialName",
-      },
-      {
-        title: "物料编码",
-        key: "material",
-      },
-      {
-        title: "来源单据号",
-        key: "material",
-      },
-      {
-        title: "来源单据行号",
-        key: "material",
-      },
-      {
-        title: "采购数量",
-        key: "material",
-      },
-      {
-        title: "采购单位",
-        key: "material",
-      },
-      {
-        title: "采购换算率",
-        key: "material",
-      },
-      {
-        title: "主数量",
-        key: "material",
-      },
-      {
-        title: "主计量单位",
-        key: "material",
-      },
-      {
-        title: "计价单位",
-        key: "material",
-      },
-      {
-        title: "计价换算率",
-        key: "material",
-      },
-      {
-        title: "计价数量",
-        key: "material",
-      },
-      {
-        title: "未执行数量",
-        key: "material",
-      },
-      {
-        title: "主未执行数量",
-        key: "material",
-      },
-      {
-        title: "计价未执行数量",
-        key: "material",
-      },
-      {
-        title: "已执行数量",
-        key: "material",
-      },
-      {
-        title: "交易类型",
-        key: "material",
-      },
-      {
-        title: "分配日期",
-        key: "material",
-      },
-      {
-        title: "SKU编码",
-        key: "material",
-      },
-      {
-        title: "SKU名称",
-        key: "material",
-      },
-      {
-        title: "SKU规格说明",
-        key: "material",
-      },
-      {
-        title: "SKU型号",
-        key: "material",
-      },
-      {
-        title: "SKU规格",
-        key: "material",
-      },
-      {
-        title: "产品规格",
-        key: "material",
-      },
-      {
-        title: "产品型号",
-        key: "material",
-      },
-      {
-        title: "物料描述",
-        key: "material",
-      },
-      {
-        title: "品牌",
-        key: "material",
-      },
-      {
-        title: "计划价",
-        key: "material",
-      },
-      {
-        title: "需求附件",
-        key: "material",
-      },
-      {
-        title: "物料附件",
-        key: "material",
-      },
-      {
-        title: "项目",
-        key: "material",
-      },
-      {
-        title: "建议供应商",
-        key: "material",
-      },
-      {
-        title: "需求组织",
-        key: "material",
-      },
-      {
-        title: "需求部门",
-        key: "material",
-      },
-      {
-        title: "需求人",
-        key: "material",
-      },
-      {
-        title: "已下单采购数量",
-        key: "material",
-      },
-      {
-        title: "采购组织",
-        key: "material",
-      },
-      {
-        title: "采购员",
-        key: "material",
-      },
-      {
-        title: "计划员",
-        key: "material",
-      },
-      {
-        title: "计划部门",
-        key: "material",
-      },
-      {
-        title: "联系电话",
-        key: "material",
-      },
-      {
-        title: "采购分类",
-        key: "material",
-      },
-      {
-        title: "收货人",
-        key: "material",
-      },
-      {
-        title: "收货地址",
-        key: "material",
-      },
-      {
-        title: "收货人电话",
-        key: "material",
-      },
-      {
-        title: "需求时间",
-        key: "material",
-      },
-      // {
-      //   title: "受理状态",
-      //   key: "material",
-      // },
-      {
-        title: "状态",
-        key: "material",
-      },
-      // {
-      //   title: "受理人",
-      //   key: "material",
-      // },
-      {
-        title: "委托受理人",
-        key: "material",
-      },
-      {
-        title: "弹性分单条件",
-        key: "material",
-      },
-      {
-        title: "备注",
-        key: "material",
-      },
-      {
-        title: "ERP相关信息",
-        key: "material",
-      },
-      {
-        title: "创建时间",
-        key: "material",
-      },
-      {
-        title: "最新价格",
-        key: "material",
-      },
-      {
-        title: "生产厂家",
-        key: "material",
-      },
-      {
-        title: "报价供应商",
-        key: "material",
-      },
-      {
-        title: "历史最低价",
-        key: "material",
-      },
-      {
-        title: "生产订单状态",
-        key: "material",
-      },
-      // {
-      //   title: "寻源退回原因",
-      //   key: "material",
-      // },
-      {
-        title: "收货仓库档案编码",
-        key: "material",
-      },
-      {
-        title: "自定义项16",
-        key: "material",
-      },
-      {
-        title: "收货客户",
-        key: "material",
-      },
-      {
-        title: "入库仓库",
-        key: "material",
-      },
-      {
-        title: "货位",
-        key: "material",
-      },
-      {
-        title: "指定供应商",
-        key: "material",
-      },
-      {
-        title: "单位",
-        key: "material",
-      },
-      {
-        title: "自定义项15",
-        key: "material",
-      },
-      {
-        title: "收货地址",
-        key: "material",
-      },
-      {
-        title: "收货联系人",
-        key: "material",
-      },
-      {
-        title: "需求来源",
-        key: "material",
-      },
-    ];
-    const initTableColumns = () => tableColumns;
-    const initTableData = () => {
-      const data = [];
-      for (let index = 0; index < 25; index++) {
-        data.push({ materialName: index });
-      }
-      return data;
-    };
-    return {
-      loading: false,
-      isSimpleSearch: true,
-      searchColumns: initSearchColumns(),
-      searchParams: {
-        isAsc: "desc",
-        reasonable: "",
-        orderByColumn: "",
-        ...initSearchParams(),
-      },
-      tableColumns: initTableColumns(),
-      tableData: initTableData(),
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
-      pageSizes: [25, 50, 100],
-    };
-  },
-  computed: {
-    showSearchColumns() {
-      return this.isSimpleSearch
-        ? this.searchColumns.slice(0, 4)
-        : this.searchColumns;
-    },
-  },
-  //   watch: {
-  //     $route: {
-  //       handler: function (route) {
-  //         this.redirect = route.query && route.query.redirect;
-  //       },
-  //       immediate: true,
-  //     },
-  //   },
-  created() {
-    // this.fetchTaskList();
-    console.log("Vue", this);
-  },
-  methods: {
-    async fetchTaskList() {
-      this.loading = true;
-      try {
-        const { code, msg, rows, total } = await taskList({
-          ...this.page,
-          ...this.searchParams,
-        });
-        if (code === 200) {
-          this.total = total;
-          this.tableData = 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;
-      }
-    },
-    handleSearchChange() {
-      this.isSimpleSearch = !this.isSimpleSearch;
-      this.$notify.info({
-        title: this.isSimpleSearch ? "Simple Search" : "All Search",
-      });
-    },
-    handleSizeChange() {},
-    handleCurrentChange() {},
-    handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.addDrawerFef;
-      setTimeout(() => {
-        setVisible(true);
-        this.$notify.info("Open Add Drawer");
-      }, 250);
-    },
-    handleOpenSeeDrawer() {
-      const { setVisible } = this.$refs.seeDrawerFef;
-      setVisible(true);
-      setTimeout(() => {
-        this.$notify.info("Open See Drawer");
-      }, 250);
-    },
-  },
-};
-</script>
-
-<template>
-  <el-card
-    v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
-    :body-style="{ padding: 0 }"
-  >
-    <AddPurchaseTaskDrawer ref="addDrawerFef"></AddPurchaseTaskDrawer>
-    <SeePurchaseTaskDrawer ref="seeDrawerFef"></SeePurchaseTaskDrawer>
-    <el-form
-      size="mini"
-      label-position="right"
-      label-width="85px"
-      :model="searchParams"
-      style="padding: 20px 0 0 0"
-    >
-      <el-row :gutter="24">
-        <el-col :span="22">
-          <el-row :gutter="20">
-            <el-col
-              v-for="column in showSearchColumns"
-              :key="column.title"
-              :xl="6"
-              :lg="6"
-              :md="8"
-              :sm="12"
-              :xs="24"
-            >
-              <el-form-item :prop="column.key" :label="column.title">
-                <el-input
-                  v-model="searchParams[column.key]"
-                  :placeholder="column.placeholder"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-col>
-        <el-col :span="2">
-          <el-row :gutter="24">
-            <el-col :span="24">
-              <el-button type="primary" size="mini">搜索</el-button>
-            </el-col>
-            <el-col
-              v-show="!isSimpleSearch"
-              :span="24"
-              style="margin: 10px 0 0"
-            >
-              <el-button size="mini">重置</el-button>
-            </el-col>
-          </el-row>
-        </el-col>
-      </el-row>
-    </el-form>
-    <el-divider>
-      <i
-        :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
-        style="cursor: pointer"
-        @click="handleSearchChange"
-      ></i>
-    </el-divider>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="6">123</el-col>
-      <el-col :span="18" style="text-align: right">
-        <el-button
-          size="mini"
-          type="danger"
-          style="margin: 0 10px 0 0"
-          @click="handleOpenAddDrawer"
-        >
-          新增
-        </el-button>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="margin: 0 10px 0 0">
-            发布
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>发布寻源</el-dropdown-item>
-            <el-dropdown-item>发布委托</el-dropdown-item>
-            <el-dropdown-item>采购方案</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-
-        <el-dropdown placement="bottom-start">
-          <el-button
-            size="mini"
-            style="border-right: 0; border-radius: 3px 0 0 3px"
-          >
-            首次协议直采
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>首次协议直采</el-dropdown-item>
-            <el-dropdown-item>余量协议直采</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="border-right: 0; border-radius: 0">
-            跟单采购
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>按合同(普通)取价</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-button size="mini" style="border-right: 0; border-radius: 0">
-          Excel导出
-        </el-button>
-        <el-button
-          size="mini"
-          style="margin: 0; border-right: 0; border-radius: 0"
-        >
-          退回请购
-        </el-button>
-        <el-dropdown placement="bottom-start">
-          <el-button size="mini" style="border-right: 0; border-radius: 0">
-            清单采购
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>商超匹配下单</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-        <el-button
-          size="mini"
-          disabled
-          style="margin: 0 10px 0 0; border-radius: 0 3px 3px 0"
-        >
-          一键合同下单
-        </el-button>
-        <el-button size="mini" style="margin: 0 10px 0 0">删除</el-button>
-        <el-dropdown placement="bottom-end">
-          <el-button size="mini">
-            更多
-            <i class="el-icon-arrow-down el-icon--right"></i>
-          </el-button>
-          <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item>抢单</el-dropdown-item>
-            <el-dropdown-item>批量修改收货组织</el-dropdown-item>
-            <el-dropdown-item>批量退回</el-dropdown-item>
-            <el-dropdown-item>退回需求申请</el-dropdown-item>
-            <el-dropdown-item>刷新缓存</el-dropdown-item>
-          </el-dropdown-menu>
-        </el-dropdown>
-      </el-col>
-    </el-row>
-    <el-table
-      @row-dblclick="handleOpenSeeDrawer"
-      :data="tableData"
-      size="mini"
-      style="width: 100%; margin: 20px 0 0 0"
-    >
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
-      </el-table-column>
-    </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
-    </el-pagination>
-    <DirectSourcingTable></DirectSourcingTable>
-  </el-card>
-</template>

+ 0 - 158
src/views/purchase/purchase-task/see-purchase-task.vue

@@ -1,158 +0,0 @@
-<script>
-export default {
-  name: "SeePurchaseTaskDrawer",
-  data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    const columns = [
-      {
-        title: "采购组织",
-        key: "puOrg",
-        type: "TagSelect",
-        value: [],
-        required: true,
-      },
-      { title: "需求来源", key: "source", type: "Input", value: "采购创建" },
-      { title: "采购员", key: "buyer", value: [], type: "TagSelect" },
-      { title: "交易类型", key: "billYpe", value: [], type: "TagSelect" },
-      { title: "物料编码", key: "material", type: "Input", required: true },
-      {
-        title: "物料名称",
-        key: "materialName",
-        type: "TagSelect",
-        value: [],
-        required: true,
-      },
-      {
-        title: "物料/物料描述",
-        key: "materialDesc",
-        type: "TagSelect",
-        value: [],
-        required: true,
-      },
-      { title: "生产厂家", key: "manufacturer", type: "Input" },
-      { title: "收货客户", key: "customer", type: "TagSelect", value: [] },
-      {
-        title: "采购单位",
-        key: "puUnit",
-        type: "TagSelect",
-        value: [],
-        required: true,
-      },
-      {
-        title: "采购数量",
-        key: "puQty",
-        type: "InputNumber",
-        required: true,
-      },
-      {
-        title: "需求时间",
-        key: "demandDate",
-        type: "DatePicker",
-        config: { type: "date" },
-      },
-      { title: "项目名称", key: "projectName", type: "TagSelect", value: [] },
-      { title: "需求人", key: "demandPersonal", type: "TagSelect", value: [] },
-      {
-        title: "需求组织",
-        key: "demandOrg",
-        type: "TagSelect",
-        value: [],
-        require: true,
-      },
-      { title: "需求部门", key: "demandDept", type: "TagSelect", value: [] },
-      { title: "建议供应商", key: "supplier", type: "TagSelect", value: [] },
-      { title: "收货人", key: "a", type: "TagSelect", value: [] },
-      { title: "收货组织", key: "b", type: "TagSelect", value: [] },
-      { title: "收货人联系方式", key: "c", type: "Input" },
-      { title: "收货地址", key: "d", type: "Input" },
-      { title: "收货仓库", key: "e", type: "TagSelect", value: [] },
-      {
-        title: "指定供应商",
-        key: "assignSupplier",
-        type: "TagSelect",
-        value: [],
-      },
-      { title: "单位", key: "unit", type: "TagSelect", value: [] },
-      { title: "收货地址", key: "f", type: "TagSelect", value: [] },
-    ];
-    const initColumns = () => columns;
-    const initParams = () => arr2Obj(initColumns(), "key", "value");
-    return {
-      visible: false,
-      loading: false,
-      columns: initColumns(),
-      params: initParams(),
-    };
-  },
-  computed: {},
-  watch: {},
-  methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    async fetchTaskItem() {
-      this.loading = true;
-      try {
-        // do something
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-      }
-    },
-  },
-  created() {
-    console.log(this.params);
-  },
-  mounted() {},
-  destroyed() {},
-};
-</script>
-<template>
-  <el-drawer
-    title="我是标题"
-    direction="btt"
-    size="100%"
-    :with-header="false"
-    :visible.sync="visible"
-    :before-close="handleClose"
-  >
-    <el-card
-      :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-      }"
-      style="margin: 10px"
-    >
-      <el-descriptions title="采购任务详情" direction="vertical" :column="3">
-        <el-descriptions-item
-          v-for="(column, index) in columns"
-          :key="index"
-          :label="column.title"
-        >
-          {{ params[column.key] }}
-        </el-descriptions-item>
-      </el-descriptions>
-    </el-card>
-    <el-card
-      :body-style="{
-        'text-align': 'right',
-        padding: '10px 20px',
-      }"
-      style="
-        position: fixed;
-        left: 0;
-        bottom: 0;
-        margin: 10px;
-        width: calc(100% - 20px);
-      "
-    >
-      <el-button size="mini" @click="setVisible(false)">返回</el-button>
-    </el-card>
-  </el-drawer>
-</template>

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

@@ -0,0 +1,61 @@
+export const TableColumns = [
+  { key: "id", title: "主键" },
+  { key: "material", title: "物料", search: true, type: "Input" },
+  { key: "materialName", title: "物料名称", search: true, type: "Input" },
+  {
+    key: "status",
+    title: "状态",
+    search: true,
+    type: "Select",
+    config: {
+      optionsName: "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: "supplierName", title: "建议供应商名称" },
+  { key: "puOrg", title: "采购组织" },
+  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
+  { key: "currency", title: "币种" },
+  { key: "currencyName", title: "币种名称" },
+  { key: "billYpe", title: "交易类型" },
+  { key: "source", title: "需求来源" },
+  { key: "customer", title: "收货客户" },
+  { key: "customerName", title: "收货客户名称" },
+  { key: "puUnit", title: "采购单位" },
+  { key: "puUnitName", title: "采购单位名称" },
+  { key: "puQty", title: "采购数量" },
+  { key: "demandDate", title: "需求时间", search: true, type: "Input" },
+  { key: "projectName", title: "项目名称" },
+  { key: "demandPersonal", title: "需求人" },
+  {
+    key: "demandPersonalName",
+    title: "需求人名称",
+    search: true,
+    type: "Input",
+  },
+  { key: "demandOrg", title: "需求组织", search: true, type: "Input" },
+  { key: "demandOrgName", title: "需求组织名称" },
+  { key: "demandDept", title: "需求部门" },
+  { key: "demandDeptName", title: "需求部门名称", search: true, type: "Input" },
+  { key: "isBack", title: "是否退回" },
+  { key: "baskCause", title: "退回原因" },
+  { key: "backDate", title: "退回日期" },
+  { key: "assignSupplier", title: "指定供应商" },
+  { key: "assignSupplierName", 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: "物料编码" },
+];
+
+export const SearchColumns = TableColumns.filter((element) => element.search);

+ 0 - 0
src/views/purchase/purchase-task/config/add.js → src/views/purchase/task/config/add.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác