Jelajahi Sumber

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

002201 2 tahun lalu
induk
melakukan
69d12bc320

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

@@ -0,0 +1,44 @@
+import request from "@/utils/request";
+
+// 采购订单修订列表
+const orderList = (data) => {
+  return request({
+    url: `/pu/order/list`,
+    method: "post",
+    data,
+  });
+}
+
+// 采购订单详情
+const orderDetails = (id, params) => {
+  return request({
+    url: `/pu/order/${id}`,
+    method: "get",
+    params,
+  });
+}
+
+// 采购订单修订创建
+const orderCreate = (data) => {
+  return request({
+    url: `/pu/order/create`,
+    method: "post",
+    data,
+  });
+}
+
+// // 参照查询
+// const referQuery = (data) => {
+//   return request({
+//     url: `/refer/query`,
+//     method: "post",
+//     data,
+//   });
+// }
+
+export default {
+  orderList,
+  orderDetails,
+  orderCreate,
+
+}

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

@@ -45,6 +45,14 @@ 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({

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

+ 172 - 0
src/views/common-dialog/allocation.vue

@@ -0,0 +1,172 @@
+<!-- 货位 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "AllocationInputDialog",
+  props: ["title", "value"],
+  components: {},
+  data() {
+    // tree
+    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: "ALLOCATION_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>

+ 171 - 0
src/views/common-dialog/customer.vue

@@ -0,0 +1,171 @@
+<!-- 客户 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "CustomerInputDialog",
+  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: "CUSTOMER_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>

+ 171 - 0
src/views/common-dialog/warehouse.vue

@@ -0,0 +1,171 @@
+<!-- 仓库 -->
+<script>
+import { list, refer } from "./api/index";
+import { initParams } from "@/utils/init-something";
+
+export default {
+  name: "WarehouseInputDialog",
+  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: "WAREHOUSE_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>

+ 1 - 1
src/views/input-dialog/api/index.js

@@ -10,7 +10,7 @@ export function list(url, params) {
 
 export function refer(data, params) {
   return request({
-    url: `/refer/query`,
+    url: `/refer/query?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
     method: "POST",
     data: data,
     params: params,

+ 43 - 7
src/views/purchase/DemandSummary/index.vue

@@ -282,8 +282,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="primary" size="small" @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>
@@ -334,16 +334,32 @@
           <el-table-column label="最小订货量" align="center" prop="minOrder"/>
           <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="modifyReason">
+            <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"/>
           <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty"/>
-          <el-table-column label="最终采购量" align="center" prop="finalBuyQty"/>
+          <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="code"/>
           <el-table-column label="三级品类" align="center" prop="code"/>
           <el-table-column label="四级品类" align="center" prop="code"/>
           <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">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.buyerName"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.purchaseOrgName"/>
+            </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="businessType"/>
@@ -391,7 +407,7 @@
 <script>
 import Add from './add.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',
   components: {
@@ -430,6 +446,7 @@ export default {
       total: 0,
       rowDetail: {},
       disable: false,
+      lineDisable: true,
       ids: [],
       allSelection: [],
     }
@@ -474,6 +491,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("请选中至少一条数据");
@@ -541,4 +571,10 @@ export default {
 .lines {
   margin-top: 0;
 }
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
 </style>

+ 349 - 156
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="disable" @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="disable" @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="disable" @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="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>
@@ -106,7 +105,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="disable" @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 +113,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="disable" @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>
@@ -155,8 +154,7 @@
               <el-input
                 v-model="basicForm.isMonthleyCalculate"
                 size="small"
-                placeholder=""
-                clearable
+                disabled
                 style="width: 200px"
               />
             </el-form-item>
@@ -191,7 +189,7 @@
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection"/>
-          <el-table-column label="序号" type="index" align="center"/>
+          <el-table-column label="序号" type="index" align="center" prop="index"/>
           <el-table-column label="行状态" align="center" prop="status" />
           <el-table-column label="行号" align="center" >
             <template slot-scope="scope">
@@ -200,49 +198,69 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="一级品类" align="center" width="150">
+          <el-table-column label="业务部门名称" align="center" width="200px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input v-model="scope.row.businessDeptName"/>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column label="业务部门" align="center" width="200px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input v-model="scope.row.businessDept">
+                <!-- <el-button :disabled="disable" 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" >
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedProportion"/>
+                <el-select 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input v-model="scope.row.reservedQty"/>
@@ -250,187 +268,257 @@
             </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"  prop="buyer" />
           <el-table-column label="物料编码" align="center" width="120" prop="materialCode">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialCode"/>
+                <el-input v-model="scope.row.materialCode">
+                  <el-button :disabled="disable" 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" />
+          <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"/>
+          <el-table-column label="注册人" align="center"  prop="registrant" />
+          <el-table-column label="采购周期" align="center"  prop="puPeriod">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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" />
+          <el-table-column label="有效期" align="center"  prop="updateTime" />
+          <el-table-column label="最小包装" align="center"  prop="minPackage" />
+          <el-table-column label="最小订货量" align="center"  prop="minOrderQty"/>
+          <el-table-column label="最小批量" align="center"  prop="minBatch" />
+          <el-table-column label="安全库存" align="center"  prop="safeStock">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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" />
+          <el-table-column label="实际(业务)需求量" align="center"  prop="qty">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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" />
+          <el-table-column label="集团预测分类" align="center"  prop="forecastClassify" />
+          <el-table-column label="交货日期" align="center"  prop="deliveryDate" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.deliveryDate"/>
+                <el-date-picker
+                  v-model="scope.row.deliveryDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  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"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  active-text="是"
+                  inactive-text="否">
+                </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"
+                    active-value="Y"
+                    inactive-value="N"
+                    active-color="#13ce66"
+                    inactive-color="#ff4949"
+                    active-text="是"
+                    inactive-text="否">
+                  </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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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" />
+          <!-- <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">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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 v-model="scope.row.lastWarehouseName">
+                  <el-button :disabled="disable" 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 v-model="scope.row.deliveryWarehouseName">
+                  <el-button :disabled="disable" 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 v-model="scope.row.lastAllocationName">
+                  <el-button :disabled="disable" 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"/>
+          <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 v-model="scope.row.deliveryAllocationName">
+                  <el-button :disabled="disable" 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"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  active-text="是"
+                  inactive-text="否">
+                </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" />
+          <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" />
+          <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-input 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" />
+          <el-table-column label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" />
+          <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"
+                  active-value="Y"
+                  inactive-value="N"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  active-text="是"
+                  inactive-text="否">
+                </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 v-model="scope.row.additionalSupplier">
+                  <el-button :disabled="disable" 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-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 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"></el-table-column>
+          <el-table-column label="中心仓可用量" align="center"  prop="updateTime"></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 v-model="scope.row.deliveryAddressName">
+                  <el-button :disabled="disable" 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"></el-table-column>
+          <el-table-column label="联系人" align="center"  prop="contacts"/>
+          <el-table-column label="联系人电话" align="center"  prop="contactsPhone" />
+          <el-table-column label="详细地址" align="center"  prop="address" />
+          <el-table-column label="价格类型" align="center"  prop="priceType" width="150px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-select 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" @click="delLine(scope.$index, scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -438,12 +526,15 @@
   </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
+      <el-col :span="1.5">
+        <el-button type="primary" size="small" plain @click="copy" v-if="pageStu == 'check'">复制</el-button>
+      </el-col>
+      <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
       </el-col>
-      <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
-      </el-col> -->
+      <el-col :span="1.5" style="margin: 0 10px;">
+        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'check'">提交</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
@@ -451,6 +542,9 @@
       <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>
@@ -458,16 +552,19 @@
 <script>
 import Reserved from './reserved.vue'
 import Refers from './refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand} from '@/api/purchase/purchaseDemand.js'
+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',
@@ -481,8 +578,8 @@ export default {
       basicForm: {
         code: '',
         org: '',
-        demandBusinessType: '',
-        status: '',
+        demandBusinessType: '1',
+        status: '0',
         customer: '',
         customerName: '',
         customerPrincipal: '',
@@ -508,12 +605,18 @@ export default {
       tableList: [],
       referCondition: {
         type: 'ORG_PARAM',
-        search: '',
         isPage: true,
         title: '选择组织'
       },
+      referConditionMx: {
+        type: 'DEPT_PARAM',
+        isPage: true,
+        title: '选择部门'
+      },
+      tableIndex: null,
       orgOptions: [],
       personOptions: [],
+      deptOptions: [],
       customerOptions: [],
       houseOptions: [],
       goodsOptions: []
@@ -528,8 +631,15 @@ export default {
     }
   },
   methods: {
+    copy() {
+      this.$modal.msgSuccess("复制成功");
+      this.pageStu = 'add'
+      this.getDetails(this.row)
+    },
     save() {
       if(this.pageStu == 'add') {
+        // 复制新增把id置为空
+        this.basicForm.id = ''
         addDemand(this.basicForm).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("保存成功");
@@ -545,7 +655,14 @@ export default {
         })
       }
     },
-    submit() {},
+    submit() {
+      submitDemand(this.basicForm).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.back()
+        }
+      })
+    },
     // 增行
     addLine() {
       const newLine = {
@@ -570,6 +687,7 @@ export default {
         materialName: null,
         specification: null,
         unit: null,
+        manufacturerName: null,
         registrant: null,
         puPeriod: null,
         expiryUnit: null,
@@ -589,9 +707,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 +729,7 @@ export default {
         superiorCenterQty: null,
         superiorAllotQty: null,
         availableQty: null,
-        statusAllot: null,
+        statusAllot: 'N',
         additionalSupplier: null,
         additionalSupplierCode: null,
         periodUnit: null,
@@ -647,11 +765,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,7 +792,12 @@ 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) }
             }
           })
         }
@@ -689,56 +813,51 @@ 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
       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
       }
+      if(this.referCondition.type == 'CUSTOMER_PARAM') {
+        this.customerOptions = selection
+        this.basicForm.customer = selection[0].id
+      }
       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 +866,80 @@ 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].materialName = selection[0].name
+      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].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)
     }
   }
 }

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

@@ -178,13 +178,13 @@
             </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>
 
@@ -245,7 +245,7 @@
 <script>
 import Add from './add.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: {
@@ -326,6 +326,49 @@ export default {
         })
       }
     },
+    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
       this.page = 'add'
@@ -346,7 +389,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("删除成功");

+ 2 - 2
src/views/purchase/PurchaseDemandList/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,
       },

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

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

@@ -0,0 +1,331 @@
+const columns = [
+  // { key: "id", title: "主键",type: "Input", },
+  {
+    key: "puOrg",
+    title: "采购组织",
+    type: "InputDialog",
+    config: {
+      componentName: "Organization",
+      dataMapping: { puOrg: "deptName" },
+    },
+    require: true,
+  },
+  // { key: "puOrgName", title: "采购组织名称", },
+  {
+    key: "billType",
+    title: "订单类型",
+    type: "Select",
+    require: true,
+    config: {
+      optionsName: "", // 字典名
+    },
+  },
+  // { key: "billTypeName", title: "订单类型名称", },
+  { key: "oaDemandNo", title: "OA需求单号", type: "Input", },
+  { key: "code", title: "订单编号", type: "Input", },
+  {
+    key: "billDate",
+    title: "订单日期",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
+  {
+    key: "supplier",
+    title: "供应商",
+    type: "InputDialog",
+    config: {
+      componentName: "Supplier",
+      dataMapping: { supplier: "name" },
+    },
+    require: true,
+  },
+  // { key: "supplierName", title: "供应商名称", },
+  {
+    key: "paymentAgreement",
+    title: "付款协议",
+    type: "InputDialog",
+    config: {
+      componentName: "PaymentPlan",
+      dataMapping: {
+        buyer: "userName",
+        puDept: "deptName",
+      },
+    },
+  },
+  { key: "finalType", title: "结算方式", type: "Input", },
+  {
+    key: "currency",
+    title: "币种",
+    type: "InputDialog",
+    config: {
+      componentName: "Currency",
+      dataMapping: {
+        currency: "name",
+      },
+    },
+  },
+  // { key: "currencyName", title: "币种名称", },
+  {
+    key: "buyer",
+    title: "采购员",
+    type: "InputDialog",
+    config: {
+      componentName: "User",
+      dataMapping: {
+        buyer: "userName",
+        puDept: "deptName",
+      },
+    },
+    require: true,
+  },
+  // { key: "buyerName", title: "采购员名称", },
+  {
+    key: "puDept",
+    title: "采购部门",
+    type: "InputDialog",
+    config: { componentName: "Department" },
+    require: true,
+  },
+  // { key: "puDeptName", title: "采购部门名称", },
+  // { key: "customer", title: "收货客户", type: "Input", },
+  {
+    key: "customerName",
+    title: "收货客户名称",
+    type: "InputDialog",
+    config: { componentName: "Customer" },
+    width: 200,
+  },
+  {
+    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: "Input", },
+  { key: "freezeCause", title: "冻结原因", type: "Input", },
+  { key: "isBack", title: "退货", type: "Input", type: "Input", },
+  { key: "isMarketing", title: "已协同生成销售订单", type: "Checkbox", },
+  { key: "isMarketingSource", title: "由销售订单协同生成", type: "Checkbox", },
+  {
+    key: "warehouse",
+    title: "WMS入库仓库", // 收货仓库
+    type: "InputDialog",
+    config: { componentName: "Warehouse" },
+  },
+  // { key: "warehouseName", title: "WMS入库仓库名称", },
+  {
+    key: "goodsAllocation",
+    title: "货位",
+    type: "InputDialog",
+    config: { componentName: "Allocation" },
+    width: 200,
+  },
+  // { key: "goodsAllocationName", title: "货位名称", },
+  { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
+  { key: "isInvoice", title: "发票标识", type: "Input", },
+  { 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: "customerDept", title: "客户部门", type: "Input", },
+  // { key: "customerDeptName", title: "客户部门名称", },
+  {
+    key: "supplierContacts",
+    title: "供应商业务联系人",
+    type: "InputDialog",
+    config: { componentName: "" },
+    width: 200,
+  },
+  // { key: "supplierContactsName", title: "供应商业务联系人名称", },
+  { key: "isUrgency", title: "紧急程度", type: "Input", },
+  { 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: "InputDialog",
+    config: { componentName: "" },
+    width: 200,
+  },
+  // { key: "supplierPersonalName", title: "供应商业务员名称", },
+  { key: "isDeliver", title: "是否发货", type: "Input", },
+  {
+    key: "retReason",
+    title: "退换原因",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  {
+    key: "processType",
+    title: "处理方式",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  { key: "isEnd", title: "整单关闭标识", type: "Input", },
+  {
+    key: "projectNow",
+    title: "在建工程项目",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  {
+    key: "operatingItems",
+    title: "经营性项目",
+    type: "Input",
+    type: "InputDialog",
+    config: { componentName: "" },
+  },
+  { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
+  { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
+  { key: "marketingCode", title: "销售订单号", type: "Input", },
+  { key: "isArrival", title: "到货超期", type: "Input", },
+  // { key: "tenantId", title: "租户号", },
+  // { key: "revision", title: "乐观锁", },
+  { key: "createByName", title: "创建人名称", type: "Input", },
+  { key: "updateByName", title: "更新人名称", type: "Input", },
+  // { key: "delFlag", title: "删除标记", },
+  { key: "flowId", title: "OA流程ID", type: "Input", },
+  { key: "approver", title: "审批人", type: "Input", },
+  {
+    key: "approverFinishTime",
+    title: "审批时间",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
+  { key: "approveTime", title: "提交时间", },
+
+];
+
+export const initColumns = () => columns;
+
+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: "InputDialog",
+        config: { componentName: "" },
+        width: 200,
+      },
+      { key: "materialCode", title: "物料编码", type: "Input", },
+      { 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: "warehouse",
+        title: "收货仓库", //WMS入库仓库
+        type: "InputDialog",
+        config: { componentName: "Warehouse" },
+        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: "Input", },
+      { key: "carriageCondition", title: "运输条件", type: "Input", },
+      { 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: "Input", },
+      { key: "isDistributionPrice", title: "配送价", type: "Input", },
+      // { key: "tenantId", title: "租户号",type: "Input", },
+      // { key: "revision", title: "乐观锁",type: "Input", },
+      { key: "createByName", title: "创建人名称", type: "Input", },
+      { key: "updateByName", title: "更新人名称", type: "Input", },
+      // { key: "delFlag", 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: "无税单价" }
+    ]
+  },
+  {
+    title: '执行结果',
+    key: 'puOrderExecuteList',
+    tableColumns: [
+      // { key: "id", title: "主键",type: "Input", },
+      { key: "orderId", title: "采购订单ID", type: "Input", },
+      { key: "rowno", title: "行号", type: "Input", },
+      { key: "material", title: "物料", type: "Input", },
+      // { 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: "tenantId", title: "租户号",type: "Input", },
+      // { key: "revision", title: "乐观锁",type: "Input", },
+      { key: "createByName", title: "创建人名称", type: "Input", },
+      { key: "updateByName", title: "更新人名称", type: "Input", },
+      // { key: "delFlag", title: "删除标记" }
+    ]
+  },
+];
+
+export const initTabColumns = () => tabColumns;

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

@@ -0,0 +1,253 @@
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+import { arr2obj } from "@/utils/data-transform";
+import {
+  initDicts,
+  initRules,
+  initParams,
+  initComponents,
+} from "@/utils/init-something";
+import { initColumns, initTabColumns } from "./column";
+
+export default {
+  name: "AddPurchaseContractDrawer",
+  components: initComponents(initColumns()),
+  dicts: initDicts(initColumns()),
+  data() {
+    return {
+      visible: false,
+      columns: initColumns(),
+      rules: initRules(initColumns()),
+      params: initParams(initColumns()),
+      tabColumns: initTabColumns(),
+      tabName: "puOrderItemList",
+      tabTableParams: {
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+      currentComponent: { name: "", title: "", value: "", row: {}, source: {} },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    handleClick() { },
+    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(prop) {
+      this.$notify.info({ message: prop });
+      this.tabTableParams[prop].push(
+        arr2obj(
+          initTabColumns().find((element) => element.key === prop).tableColumns,
+          "key",
+          ""
+        )
+      );
+      console.log(this.tabTableParams);
+    },
+    cancel() {
+      this.setVisible(false);
+      this.params = arr2obj(this.columns, "key", "value");
+    },
+    sava() {
+      let data = {
+        ...this.params,
+        ...this.tabTableParams
+      }
+      console.log(data, 'data');
+      // this.setVisible(false);
+    },
+    async submitSava() {
+      console.log(this.params);
+      return;
+    },
+    //
+    openAsyncInputDialog(prop, source, type) {
+      try {
+        const {
+          key,
+          title,
+          config: { componentName },
+        } = prop;
+        this.currentComponent.row = prop;
+        this.currentComponent.title = title;
+        this.currentComponent.name = componentName;
+        this.currentComponent.source = source;
+        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 {
+        console.log(this.currentComponent, source, this.tabTableParams);
+      }
+    },
+
+    updateParams(prop) {
+      const {
+        config: { dataMapping },
+      } = this.currentComponent.row;
+      for (let key in dataMapping) {
+        this.currentComponent.source[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-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="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-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, params, 'change')"
+                @change="openAsyncInputDialog(column, params, 'change')">
+                <template #suffix>
+                  <el-icon class="el-icon-s-operation" style="cursor: pointer" @click.native.stop="
+                    openAsyncInputDialog(column, params, 'change')
+                    "></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-checkbox v-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
+                false-label="N"></el-checkbox>
+
+              <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-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="tabTableParams[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="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    size="mini" style="width: 100%" @blur="openAsyncInputDialog(cColumn, scope.row, 'change')"
+                    @change="openAsyncInputDialog(cColumn, scope.row, 'change')">
+                    <template #suffix>
+                      <el-icon class="el-icon-s-operation" style="cursor: pointer" @click.native.stop="
+                        openAsyncInputDialog(cColumn, scope.row, 'click')
+                        "></el-icon>
+                    </template>
+                  </el-input>
+
+                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
+                    false-label="N"></el-checkbox>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button size="mini" @click="addTableRow(tabName)">增行</el-button>
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

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

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

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

@@ -0,0 +1,410 @@
+<!-- 采购订单修订—— 列表 -->
+<script>
+import orderApi from "@/api/business/purchase/purchase-order";
+import AddPurchaseOrderDrawer from "./add/index.vue";
+import SeePurchaseOrderDrawer from "./see-purchase-order.vue";
+// import DirectSourcingTable from "./direct-sourcing.vue";
+export default {
+  name: "PuchaseTask",
+  components: {
+    AddPurchaseOrderDrawer,
+    SeePurchaseOrderDrawer,
+    // DirectSourcingTable,
+  },
+  data() {
+    const arr2Obj = function (data, keyName, valueName) {
+      return Object.fromEntries(
+        data.map((item) => [item[keyName], item[valueName]])
+      );
+    };
+    const searchColumns = [
+      { key: "puOrg", title: "采购组织", type: "Input" },
+      { key: "billDate", title: "订单日期", type: "DatePicker" },
+      { key: "code", title: "订单编号", type: "Input" },
+      { key: "status", title: "单据状态", type: "Input" },
+      { key: "buyerName", title: "采购员", type: "Input" },
+      { key: "supplierName", title: "供应商名称", type: "Input" },
+
+    ];
+    const initSearchColumns = () => searchColumns;
+    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
+    const tableColumns = [
+      // { key: "id", title: "主键" },
+      // { key: "puOrg", title: "采购组织" },
+      { key: "puOrgName", title: "采购组织名称" },
+      { key: "billType", title: "订单类型" },
+      { key: "code", title: "订单编号" },
+      { key: "billDate", title: "订单日期" },
+      // { key: "supplier", title: "供应商" },
+      { key: "supplierName", title: "供应商名称" },
+      { 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: "中台采购订单号" }
+    ];
+    const initTableColumns = () => tableColumns;
+    const tabColumns = [
+      {
+        title: '物料信息',
+        key: 'first',
+        tableColumns: [
+          // { key: "id", title: "主键" },
+          { 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,
+      searchColumns: initSearchColumns(),
+      searchParams: {
+        isAsc: "desc",
+        reasonable: "",
+        orderByColumn: "",
+        ...initSearchParams(),
+      },
+      tableColumns: initTableColumns(),
+      tableData: [{ puOrgName: 1 }],
+      tabColumns: initTabColumns(),
+      tabName: "first",
+      tabTableDatas: {
+        first: [],
+        second: [],
+      },
+      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 orderApi.orderList({
+          ...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() { },
+    handleTabClick() { },
+    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);
+    },
+    // 获取子表信息
+    async handleDetailsData(row) {
+      console.log(row, '获取详情信息');
+      try {
+        const { code, msg, data } = await orderApi.orderDetails(row.id);
+        if (code === 200) {
+
+          // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
+          this.tabTableDatas.first = data.puOrderItemList;
+          this.tabTableDatas.second = data.puOrderExecuteList;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.loading = false;
+      }
+    },
+  },
+};
+</script>
+
+<template>
+  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
+    <AddPurchaseOrderDrawer ref="addDrawerFef"></AddPurchaseOrderDrawer>
+    <SeePurchaseOrderDrawer ref="seeDrawerFef"></SeePurchaseOrderDrawer>
+
+    <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="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 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-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="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
+          <el-button type="text" size="small" @click="handleOpenAddDrawer(scope.row)">编辑</el-button>
+          <el-button type="text" size="small">删除</el-button>
+        </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>
+
+    <!-- <el-card :body-style="{
+      padding: '20px',
+      display: 'flex',
+      'flex-wrap': 'wrap',
+    }" style="margin: 10px"> -->
+    <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> -->
+
+  </el-card>
+</template>

+ 352 - 0
src/views/purchase/purchase-order/see-purchase-order.vue

@@ -0,0 +1,352 @@
+<!-- 采购订单修订—— 查看 -->
+<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: "id", title: "主键" },
+      { key: "puOrg", title: "采购组织" },
+      { key: "puOrgName", title: "采购组织名称" },
+      { key: "billType", title: "订单类型" },
+      { key: "billTypeName", title: "订单类型名称" },
+      { key: "oaDemandNo", title: "OA需求单号" },
+      { key: "code", title: "订单编号" },
+      { key: "billDate", title: "订单日期" },
+      { key: "supplier", title: "供应商" },
+      { key: "supplierName", title: "供应商名称" },
+      { key: "paymentAgreement", title: "付款协议" },
+      { key: "finalType", 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: "qty", title: "总数量" },
+      { key: "originalQty", title: "原始总数量" },
+      { key: "money", title: "价税合计" },
+      { key: "originalMoney", title: "原始总金额" },
+      { key: "notaxMoney", title: "无税金额" },
+      { key: "status", title: "单据状态" },
+      { key: "freezeCause", title: "冻结原因" },
+      { key: "isBack", title: "退货" },
+      { key: "isMarketing", title: "已协同生成销售订单" },
+      { key: "isMarketingSource", title: "由销售订单协同生成" },
+      { key: "warehouse", title: "WMS入库仓库" },
+      { key: "warehouseName", title: "WMS入库仓库名称" },
+      { key: "goodsAllocation", title: "货位" },
+      { key: "goodsAllocationName", title: "货位名称" },
+      { key: "isSendSrm", title: "是否同步SRM" },
+      { key: "isInvoice", title: "发票标识" },
+      { key: "supplierOrderNo", title: "供应商订单号" },
+      { key: "rebateMoney", title: "订单使用返利金额" },
+      { key: "deductionMoney", title: "订单抵扣余款金额" },
+      { key: "address", title: "收货地址" },
+      { key: "contacts", title: "收货联系人" },
+      { key: "customerDept", title: "客户部门" },
+      { key: "customerDeptName", title: "客户部门名称" },
+      { key: "supplierContacts", title: "供应商业务联系人" },
+      { key: "supplierContactsName", title: "供应商业务联系人名称" },
+      { key: "isUrgency", title: "紧急程度" },
+      { key: "isSendWms", title: "已同步WMS" },
+      { key: "agent", title: "代理人" },
+      { key: "agentName", title: "代理人名称" },
+      { key: "isClose", title: "最终关闭" },
+      { key: "closeTime", title: "最终关闭日期" },
+      { key: "applyPaymentMoney", title: "累计付款申请金额" },
+      { key: "paymentMoney", title: "累计付款金额" },
+      { key: "invoiceMoney", title: "发票金额" },
+      { key: "supplierPersonal", title: "供应商业务员" },
+      { key: "supplierPersonalName", title: "供应商业务员名称" },
+      { key: "isDeliver", title: "是否发货" },
+      { key: "retReason", title: "退换原因" },
+      { key: "processType", title: "处理方式" },
+      { key: "isEnd", title: "整单关闭标识" },
+      { key: "projectNow", title: "在建工程项目" },
+      { key: "operatingItems", title: "经营性项目" },
+      { key: "isArrivalReson", title: "到货超期原因" },
+      { key: "midOrderNo", title: "中台采购订单号" },
+      { key: "marketingCode", title: "销售订单号" },
+      { key: "isArrival", 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: "提交时间" },
+
+    ];
+    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: [
+          // { key: "id", title: "主键" },
+          { 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 {
+      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;
+    },
+    handleClick() { },
+    handleClose() { },
+  },
+  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]" readonly
+                :placeholder="column.placeholder" :clearable="column.clearable" style="width: 90%"></el-input>
+
+              <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]" readonly
+                :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]" disabled
+                :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]" disabled 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'" readonly 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>

+ 5 - 5
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
-        // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
+        target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
@@ -137,10 +137,10 @@ module.exports = {
         },
       });
       config.optimization.runtimeChunk("single"),
-        {
-          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
-          to: "./", //到根目录下
-        };
+      {
+        from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+        to: "./", //到根目录下
+      };
     });
   },
 };