浏览代码

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

002201 2 年之前
父节点
当前提交
7d8ff981cf

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

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

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


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

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

+ 52 - 53
src/views/purchase/DemandSummary/add.vue

@@ -16,62 +16,61 @@
           @selection-change="handleSelectionChange"
         >
         <el-table-column type="selection" width="55" />
-        <el-table-column label="序号" align="center" prop="index"/>
+        <el-table-column label="序号" align="center" type="index"/>
         <el-table-column label="行号" align="center" prop="rowNo"/>
-        <el-table-column label="物料编码" align="center" prop="code"/>
-        <el-table-column label="品名" align="center" prop="code"/>
-        <el-table-column label="规格" align="center" prop="code"/>
-        <el-table-column label="单位" align="center" prop="code"/>
+        <el-table-column label="物料编码" align="center" prop="materialCode"/>
+        <el-table-column label="品名" align="center" prop="materialName"/>
+        <el-table-column label="规格" align="center" prop="specification"/>
+        <el-table-column label="单位" align="center" prop="unit"/>
         <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-        <el-table-column label="末级供应仓库库存量" align="center" prop="code"/>
-        <el-table-column label="月销量" align="center" prop="code"/>
-        <el-table-column label="采购周期" align="center" prop="code"/>
-        <el-table-column label="最终净需求量" align="center" prop="code"/>
-        <el-table-column label="最终采购量" align="center" prop="code"/>
-        <el-table-column label="需求客户" align="center" prop="code"/>
-        <el-table-column label="最小订货量" align="center" prop="code"/>
-        <el-table-column label="最小包装量" align="center" prop="code"/>
-        <el-table-column label="修改人" align="center" prop="code"/>
-        <el-table-column label="修改原因" align="center" prop="code"/>
-        <el-table-column label="业务备注" align="center" prop="code"/>
-        <el-table-column label="有效期" align="center" prop="code"/>
-        <el-table-column label="要求交货日期" align="center" prop="code"/>
-        <el-table-column label="紧急标识" align="center" prop="code"/>
-        <el-table-column label="补单标识" align="center" prop="code"/>
+        <el-table-column label="末级供应仓库存量" align="center" prop="lastWarehouseQty"/>
+        <el-table-column label="月销量" align="center" prop="totalMonthlySales"/>
+        <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
+        <el-table-column label="最终净需求量" align="center" prop="resDemandQty"/>
+        <el-table-column label="最终采购量" align="center" prop="puQtyRes"/>
+        <el-table-column label="需求客户" align="center" prop="customerName"/>
+        <el-table-column label="最小订货量" align="center" prop="minOrderQty"/>
+        <el-table-column label="最小包装量" align="center" prop="minPackage"/>
+        <el-table-column label="修改人" align="center" prop="updateByName"/>
+        <el-table-column label="修改原因" align="center" prop="updateCause"/>
+        <el-table-column label="业务备注" align="center" prop="remark"/>
+        <el-table-column label="有效期" align="center" prop="expiry"/>
+        <el-table-column label="要求交货日期" align="center" prop="deliveryDate"/>
+        <el-table-column label="紧急标识" align="center" prop="isUrgency"/>
+        <el-table-column label="补单标识" align="center" prop="isReplenishment"/>
         <el-table-column label="需求单单号" align="center" prop="code"/>
-        <el-table-column label="供应仓库" align="center" prop="code"/>
-        <el-table-column label="供应库位" align="center" prop="code"/>
-        <el-table-column label="业务类型" align="center" prop="code"/>
-        <el-table-column label="行状态" align="center" prop="code"/>
-        <el-table-column label="收货仓库" align="center" prop="code"/>
-        <el-table-column label="收货货位" align="center" prop="code"/>
-        <el-table-column label="采购员" align="center" prop="code"/>
-        <el-table-column label="制单人" align="center" prop="code"/>
-        <el-table-column label="审核人员" align="center" prop="code"/>
-        <el-table-column label="请购单号" align="center" prop="code"/>
-        <el-table-column label="品类" align="center" prop="code"/>
-        <el-table-column label="注册人" align="center" prop="code"/>
-        <el-table-column label="集团预测分类" align="center" prop="code"/>
-        <el-table-column label="修改时间" align="center" prop="code"/>
-        <el-table-column label="采购员编码" align="center" prop="code"/>
-        <el-table-column label="采购组织" align="center" prop="code"/>
-        <el-table-column label="物料类别" align="center" prop="code"/>
-        <el-table-column label="有效期单位" align="center" prop="code"/>
-        <el-table-column label="最小批量" align="center" prop="code"/>
-        <el-table-column label="业务部门" align="center" prop="code"/>
-        <el-table-column label="需求部门" align="center" prop="code"/>
-        <el-table-column label="批号锁定标识" align="center" prop="code"/>
-        <el-table-column label="采购需求单审批人" align="center" prop="code"/>
-        <el-table-column label="需求单审批时间" align="center" prop="code"/>
-        <el-table-column label="需求单提交时间" align="center" prop="code"/>
-        <el-table-column label="需求单提交人" align="center" prop="code"/>
-        <el-table-column label="处理需求时间" align="center" prop="code"/>
-        <el-table-column label="处理需求人员" align="center" prop="code"/>
-        <el-table-column label="汇总确认人" align="center" prop="code"/>
-        <el-table-column label="汇总确认时间" align="center" prop="code"/>
-        <el-table-column label="转请购时间" align="center" prop="code"/>
-        <el-table-column label="转请购人员" align="center" prop="code"/>
-        <el-table-column label="价格类型" align="center" prop="code"/>
+        <el-table-column label="供应仓库" align="center" prop="lastWarehouseName"/>
+        <el-table-column label="供应货位" align="center" prop="lastAllocationName"/>
+        <el-table-column label="业务类型" align="center" prop="billType"/>
+        <el-table-column label="行状态" align="center" prop="status"/>
+        <el-table-column label="收货仓库" align="center" prop="deliveryWarehouseName"/>
+        <el-table-column label="收货货位" align="center" prop="deliveryAllocationName"/>
+        <el-table-column label="采购员" align="center" prop="buyerName"/>
+        <el-table-column label="制单人" align="center" prop="billMaker"/>
+        <el-table-column label="审核人员" align="center" prop="approver"/>
+        <!-- <el-table-column label="请购单号" align="center" prop="code"/> -->
+        <el-table-column label="品类" align="center" prop="materialCategory"/>
+        <el-table-column label="注册人" align="center" prop="registrant"/>
+        <el-table-column label="集团预测分类" align="center" prop="forecastClassify"/>
+        <el-table-column label="修改时间" align="center" prop="updateTime"/>
+        <el-table-column label="采购员编码" align="center" prop="buyer"/>
+        <el-table-column label="采购组织" align="center" prop="orgName"/>
+        <el-table-column label="有效期单位" align="center" prop="expiryUnit"/>
+        <el-table-column label="最小批量" align="center" prop="minBatch"/>
+        <el-table-column label="业务部门" align="center" prop="businessDeptName"/>
+        <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
+        <el-table-column label="批号锁定标识" align="center" prop="isBatchLock"/>
+        <el-table-column label="采购需求单审批人" align="center" prop="approveName"/>
+        <el-table-column label="需求单审批时间" align="center" prop="approverFinishTime"/>
+        <el-table-column label="需求单提交时间" align="center" prop="createTime"/>
+        <el-table-column label="需求单提交人" align="center" prop="createByName"/>
+        <el-table-column label="处理需求时间" align="center" prop="processTime"/>
+        <el-table-column label="处理需求人员" align="center" prop="processPersonal"/>
+        <el-table-column label="汇总确认人" align="center" prop="affirmer"/>
+        <el-table-column label="汇总确认时间" align="center" prop="affirmerTime"/>
+        <!-- <el-table-column label="转请购时间" align="center" prop="code"/>
+        <el-table-column label="转请购人员" align="center" prop="code"/> -->
+        <el-table-column label="价格类型" align="center" prop="priceType"/>
       </el-table>
     </el-card>
 

+ 91 - 58
src/views/purchase/DemandSummary/index.vue

@@ -4,37 +4,31 @@
       <el-form class="search_area" label-width="120px">
         <el-row :gutter="10">
           <el-col :span="1.5">
-            <el-form-item label="单据状态">
-              <el-select v-model="queryParams.code" size="small" style="width: 200px" clearable>
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+            <el-form-item label="行状态">
+              <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
+                <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <el-input
-              v-model="queryParams.cgy"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-              />
+              <el-select size="small" v-model="queryParams.buyerName" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="品类">
-              <el-input
-              v-model="queryParams.pl"
+              <el-select
+              v-model="queryParams.manufacturer"
               size="small"
-              placeholder=""
               clearable
+              @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
               style="width: 200px"
-              />
+              >
+              <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+            </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -305,82 +299,82 @@
           :data="tableList" 
           fit
           show-summary
-          max-height="680"
+          max-height="480"
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column label="一级品类" align="center" prop="code"/>
-          <el-table-column label="物料编码" align="center" prop="code"/>
-          <el-table-column label="品名" align="center" prop="code"/>
-          <el-table-column label="规格" align="center" prop="code"/>
-          <el-table-column label="单位" align="center" prop="demandUnit"/>
-          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer"/>
-          <el-table-column label="需求单位数" align="center" prop="code"/>
-          <el-table-column label="总最终净需求量" align="center" prop="code"/>
+          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
+          <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
+          <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
+          <el-table-column label="规格" align="center" prop="specification" width="200px"/>
+          <el-table-column label="单位" align="center" prop="unit"/>
+          <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
+          <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
-          <el-table-column label="需求可用周期" align="center" prop="demandCycle"/>
+          <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
           <el-table-column label="呆滞量" align="center" prop="dullQut"/>
           <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
-          <el-table-column label="中心公共库存" align="center" prop="centralPublicStock"/>
-          <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse"/>
-          <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock"/>
-          <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock"/>
+          <el-table-column label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
+          <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
+          <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
+          <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
           <el-table-column label="电商仓库" align="center" prop="commerceWarehouse"/>
           <el-table-column label="采购在途" align="center" prop="buyTransit"/>
           <el-table-column label="借出在途" align="center" prop="lendTransit"/>
           <el-table-column label="调拨在途" align="center" prop="transferTransit"/>
           <el-table-column label="库存总计" align="center" prop="stockTotal"/>
-          <el-table-column label="最小包装量" align="center" prop="minPackage"/>
-          <el-table-column label="最小订货量" align="center" prop="minOrder"/>
+          <el-table-column label="最小包装量" align="center" prop="minPackage" width="100px"/>
+          <el-table-column label="最小订货量" align="center" prop="minOrder" width="100px"/>
           <el-table-column label="最小批量" align="center" prop="minBatch"/>
-          <el-table-column label="人工调整数" align="center" prop="artificialAdjust"/>
-          <el-table-column label="修改原因" align="center" prop="modifyReason">
+          <el-table-column label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
+          <el-table-column label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
-          <el-table-column label="建议采购量" align="center" prop="suggestionPurchase"/>
-          <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty"/>
+          <el-table-column label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
+          <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
           <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
                 <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
-          <el-table-column label="二级品类" align="center" prop="code"/>
-          <el-table-column label="三级品类" align="center" prop="code"/>
-          <el-table-column label="四级品类" align="center" prop="code"/>
+          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
+          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
+          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
           <el-table-column label="单据状态" align="center" prop="status"/>
-          <el-table-column label="采购员" align="center" prop="buyerName">
+          <el-table-column label="采购员" align="center" prop="buyerName" width="120px">
             <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">
+          <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <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="validityPeriodUnit" width="100px"/>
           <el-table-column label="业务类型" align="center" prop="businessType"/>
-          <el-table-column label="安全库存量" align="center" prop="code"/>
+          <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
           <el-table-column label="单据来源" align="center" prop="billSource"/>
           <el-table-column label="行号" align="center" prop="rowNo"/>
-          <el-table-column label="注册人" align="center" prop="code"/>
+          <el-table-column label="注册人" align="center" prop="registrant"/>
           <el-table-column label="可用量" align="center" prop="qty"/>
-          <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy"/>
-          <el-table-column label="集团预测分类" align="center" prop="forecastClassification"/>
-          <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession"/>
-          <el-table-column label="中心仓可用量" align="center" prop="code"/>
-          <el-table-column label="物料类别" align="center" prop="materialCategory"/>
-          <el-table-column label="业务部门" align="center" prop="departmentName"/>
+          <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
+          <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
+          <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
+          <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
+          <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/>
+          <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/>
           <el-table-column label="需求单位" align="center" prop="demandUnit"/>
-          <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor"/>
+          <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
           <el-table-column
           fixed="right"
           label="操作"
           align="center"
-          width="150"
+          width="100"
           >
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
@@ -401,18 +395,27 @@
     </div>
 
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+  
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
 <script>
 import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
+  dicts: ['sys_row_status'],
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers,
+    TreeRefers
   },
   data() {
     return {
@@ -422,9 +425,9 @@ export default {
       // 页面状态
       page: '',
       queryParams: {
-        code: '',
-        cgy: '',
-        pl: '',
+        rowStatus: [],
+        buyerName: '',
+        manufacturer: '',
         sccj: '',
         wllb: '',
         zqdw: '',
@@ -437,11 +440,18 @@ export default {
         pageNum: 1,
         pageSize: 10
       },
+      personOptions: [],
+      classOptions: [],
       options: [{
         value: '0', label: '是',
       }, {
         value: '2', label: '否'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -553,6 +563,28 @@ export default {
         })
       } 
     },
+    // 搜索区参照选择
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      this.personOptions = selection
+      this.queryParams.buyerName = selection[0].id
+    },
+    // 搜索区树形选择
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.queryParams.manufacturer = selection.id
+    }
   }
 }
 </script>
@@ -562,6 +594,7 @@ export default {
   height: calc(100vh - 84px);
   padding: 12px;
   box-sizing: border-box;
+  overflow-y: scroll;
 }
 .btn_grooup {
   margin-bottom: 10px;

+ 138 - 121
src/views/purchase/PurchaseDemandList/add.vue

@@ -16,7 +16,7 @@
 
         <el-col :span="1.5">
             <el-form-item label="组织">
-              <el-select size="small" v-model="basicForm.org" :disabled="disable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
+              <el-select size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
                 <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -42,7 +42,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select size="small" v-model="basicForm.customer" :disabled="disable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+              <el-select size="small" v-model="basicForm.customer" :disabled="sonDisable" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -62,7 +62,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求人员">
-                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="disable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-select size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
                   <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
             </el-form-item>
@@ -70,7 +70,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="basicForm.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+              <el-select v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
                   v-for="item in deptOptions"
                   :key="item.id"
@@ -85,6 +85,7 @@
             <el-form-item label="需求日期">
               <el-date-picker
                 v-model="basicForm.demandDate"
+                :disabled="sonDisable"
                 type="date"
                 value-format="yyyy-MM-dd"
                 size="small"
@@ -96,7 +97,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="单据来源">
-              <el-select v-model="basicForm.source" size="small" style="width: 200px">
+              <el-select v-model="basicForm.source" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -105,7 +106,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="供应仓库">
-              <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
+              <el-select size="small" v-model="basicForm.warehouse" :disabled="sonDisable" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
                 <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -113,7 +114,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="供应货位">
-              <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="disable" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
+              <el-select size="small" v-model="basicForm.goodsAllocation" :disabled="sonDisable" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
                 <el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -121,7 +122,7 @@
 
          <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="basicForm.billType" size="small" style="width: 200px">
+              <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
@@ -130,7 +131,7 @@
 
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select v-model="basicForm.isSpeical" size="small" style="width: 200px">
+              <el-select v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
                 <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -165,7 +166,7 @@
               <el-input
                 v-model="basicForm.remark"
                 size="small"
-                placeholder=""
+                :disabled="sonDisable"
                 clearable
                 style="width: 200px"
               />
@@ -177,9 +178,9 @@
     <span>明细信息</span>
     <el-card>
       <div class="btn_grooup">
-        <el-button type="primary" size="small" @click="addLine">增行</el-button>
-        <el-button type="primary" size="small" >批量调整</el-button>
-        <el-button type="primary" size="small" v-if="pageStu == 'check' || pageStu == 'edit'" @click="showReserved">货权预留单</el-button>
+        <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
+        <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
+        <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
       </div>
 
       <el-table 
@@ -189,63 +190,57 @@
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection"/>
-          <el-table-column label="序号" type="index" align="center" prop="index"/>
+          <el-table-column label="序号" type="index" align="center"/>
           <el-table-column label="行状态" align="center" prop="status" />
-          <el-table-column label="行号" align="center" >
-            <template slot-scope="scope">
-              <el-form-item class="hang">
-                <el-input v-model="scope.row.index"/>
-              </el-form-item>
-            </template>
-          </el-table-column>
-          <el-table-column label="业务部门名称" align="center" width="200px">
+          <el-table-column label="行号" align="center" prop="rowNo" />
+          <el-table-column label="业务部门名称" align="center" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.businessDeptName"/>
+                <el-input readonly size="small" v-model="scope.row.businessDeptName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="业务部门" align="center" width="200px">
+          <el-table-column label="业务部门" align="center" width="180px">
             <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 readonly size="small" v-model="scope.row.businessDept">
+                <!-- <el-button :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'DEPT_PARAM', true, '选择部门')"></el-button> -->
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="一级品类" align="center" >
+          <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyOneName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="二级品类" align="center"  prop="materialClassifyTwoName">
+          <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyTwoName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="三级品类" align="center"  prop="materialClassifyThreeName">
+          <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyThreeName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="四级品类" align="center"  prop="materialClassifyFourName">
+          <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialClassifyFourName"/>
+                <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留比例" align="center"  prop="reservedProportion">
+          <el-table-column label="预留比例" align="center" prop="reservedProportion" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select v-model="scope.row.reservedProportion">
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
                   <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
@@ -253,72 +248,74 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留周期" align="center"  prop="reservedPeriod">
+          <el-table-column label="预留周期" align="center" prop="reservedPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedPeriod"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="预留数量" align="center"  prop="reservedQty">
+          <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.reservedQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="采购员名称" align="center" prop="buyerName" />
-          <el-table-column label="采购员" align="center"  prop="buyer" />
-          <el-table-column label="物料编码" align="center" width="120" prop="materialCode">
+          <el-table-column label="采购员名称" align="center" prop="buyerName" width="120px"/>
+          <el-table-column label="采购员" align="center"  prop="buyer"/>
+          <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.materialCode">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
+                <el-input readonly size="small" v-model="scope.row.materialCode">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="物料名称" align="center"  prop="materialName" />
+          <el-table-column label="物料名称" align="center"  prop="materialName" width="230px" />
           <el-table-column label="规格" align="center"  prop="specification" />
           <el-table-column label="型号" align="center"  prop="model" />
           <el-table-column label="单位" align="center"  prop="unit" />
-          <el-table-column label="生产厂家/代理人" align="center"  prop="manufacturerName"/>
-          <el-table-column label="注册人" align="center"  prop="registrant" />
-          <el-table-column label="采购周期" align="center"  prop="puPeriod">
+          <el-table-column label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
+          <el-table-column label="注册人" align="center"  prop="registrant" width="150px"/>
+          <el-table-column label="采购周期" align="center"  prop="puPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.puPeriod"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期单位" align="center"  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">
+          <el-table-column label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
+          <el-table-column label="有效期" align="center"  prop="expiry" width="120px"/>
+          <el-table-column label="最小包装" align="center"  prop="minPackage" width="120px"/>
+          <el-table-column label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
+          <el-table-column label="最小批量" align="center"  prop="minBatch" width="120px"/>
+          <el-table-column label="安全库存" align="center"  prop="safeStock" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.safeStock"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="月均销量" align="center"  prop="averageQtyMonth" />
-          <el-table-column label="实际(业务)需求量" align="center"  prop="qty">
+          <el-table-column label="月均销量" align="center"  prop="averageQtyMonth" width="120px"/>
+          <el-table-column label="实际(业务)需求量" align="center"  prop="qty" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.qty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="需求可用周期" align="center"  prop="demandPeriod" />
-          <el-table-column label="集团预测分类" align="center"  prop="forecastClassify" />
-          <el-table-column label="交货日期" align="center"  prop="deliveryDate" width="150px">
+          <el-table-column label="需求可用周期" align="center"  prop="demandPeriod" width="120px"/>
+          <el-table-column label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
+          <el-table-column label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-date-picker
                   v-model="scope.row.deliveryDate"
+                  :readonly="sonDisable"
                   type="date"
+                  size="small"
                   value-format="yyyy-MM-dd"
                   placeholder="选择日期">
                 </el-date-picker>
@@ -330,12 +327,11 @@
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isReplenishment"
+                  :disabled="sonDisable"
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
-                  inactive-color="#ff4949"
-                  active-text="是"
-                  inactive-text="否">
+                  inactive-color="#a1a3a9">
                 </el-switch>
               </el-form-item>
             </template>
@@ -345,38 +341,37 @@
               <el-form-item class="hang">
                   <el-switch
                     v-model="scope.row.isBatchLock"
+                    :disabled="sonDisable"
                     active-value="Y"
                     inactive-value="N"
                     active-color="#13ce66"
-                    inactive-color="#ff4949"
-                    active-text="是"
-                    inactive-text="否">
+                    inactive-color="#a1a3a9">
                   </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="业务备注" align="center"  prop="remark">
+          <el-table-column label="业务备注" align="center"  prop="remark" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.remark"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
               </el-form-item>
             </template>
           </el-table-column> 
-          <el-table-column label="采购备注" align="center"  prop="puRemark" />
+          <el-table-column label="采购备注" align="center"  prop="puRemark" width="150px"/>
           <!-- <el-table-column label="末级供应仓库存量" align="center"  prop="lastWarehouseQty" /> -->
           <!-- <el-table-column label="调拨占有量" align="center"  prop="superiorAllotQty"></el-table-column> -->
-          <el-table-column label="最终净需求量" align="center"  prop="resDemandQty">
+          <el-table-column label="最终净需求量" align="center"  prop="resDemandQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.resDemandQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
               </el-form-item>
             </template>
           </el-table-column>
           <el-table-column label="末级供应仓库" align="center"  prop="lastWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <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 readonly size="small" v-model="scope.row.lastWarehouseName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择末级供应仓库')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -384,8 +379,8 @@
           <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-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
+                <el-input readonly size="small" v-model="scope.row.deliveryWarehouseName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -393,60 +388,58 @@
           <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-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择末级供应货位')"></el-button>
+                <el-input readonly size="small" v-model="scope.row.lastAllocationName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择末级供应货位')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="收货货位编码" align="center"  prop="deliveryAllocation"/>
+          <el-table-column label="收货货位编码" align="center"  prop="deliveryAllocation" width="200px"/>
           <el-table-column label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.deliveryAllocationName">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位')"></el-button>
+                <el-input readonly size="small" v-model="scope.row.deliveryAllocationName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="紧急标识" align="center"  prop="isUrgency" width="100px">
+          <el-table-column label="紧急标识" align="center" prop="isUrgency" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.isUrgency"
+                  :disabled="sonDisable"
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
-                  inactive-color="#ff4949"
-                  active-text="是"
-                  inactive-text="否">
+                  inactive-color="#a1a3a9">
                 </el-switch>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" />
-          <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" />
-          <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty">
+          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
+          <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
+          <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.lastStockQty"/>
+                <el-input :readonly="sonDisable" size="small" v-model="scope.row.lastStockQty"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="上级供应中心现存量" align="center"  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="superiorCenterQty" width="200px"/>
+          <el-table-column label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/>
+          <el-table-column label="可用量" align="center"  prop="availableQty"/>
           <el-table-column label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
                 <el-switch
                   v-model="scope.row.statusAllot"
+                  :disabled="sonDisable"
                   active-value="Y"
                   inactive-value="N"
                   active-color="#13ce66"
-                  inactive-color="#ff4949"
-                  active-text="是"
-                  inactive-text="否">
+                  inactive-color="#a1a3a9">
                 </el-switch>
               </el-form-item>
             </template>
@@ -454,8 +447,8 @@
           <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-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplier">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -463,14 +456,14 @@
           <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierCode" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input v-model="scope.row.additionalSupplierCode"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierCode"/>
               </el-form-item>
             </template>
           </el-table-column>
           <el-table-column label="周期单位" align="center"  prop="periodUnit" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select v-model="scope.row.periodUnit">
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
                   <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
@@ -485,26 +478,26 @@
               </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="superiorStockOrgName" width="200px"></el-table-column>
+          <el-table-column label="中心仓可用量" align="center"  prop="updateTime" width="200px"></el-table-column>
           <el-table-column label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input 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 readonly size="small" v-model="scope.row.deliveryAddressName">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="收货地址编码" align="center"  prop="deliveryAddress"></el-table-column>
+          <el-table-column label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
           <el-table-column label="联系人" align="center"  prop="contacts"/>
-          <el-table-column label="联系人电话" align="center"  prop="contactsPhone" />
-          <el-table-column label="详细地址" align="center"  prop="address" />
+          <el-table-column label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
+          <el-table-column label="详细地址" align="center"  prop="address" width="200px"/>
           <el-table-column label="价格类型" align="center"  prop="priceType" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select v-model="scope.row.priceType">
+                <el-select :disabled="sonDisable" size="small" v-model="scope.row.priceType">
                   <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
@@ -518,7 +511,7 @@
             align="center"
             >
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="delLine(scope.$index, scope.row)">删除</el-button>
+            <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -527,13 +520,13 @@
 
     <div class="btn_group">
       <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="copy" v-if="pageStu == 'check'">复制</el-button>
+        <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button type="primary" size="small" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
+        <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
       </el-col>
       <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'check'">提交</el-button>
+        <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check'">提交</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button size="small" plain @click="back">返回</el-button>
@@ -551,7 +544,7 @@
 
 <script>
 import Reserved from './reserved.vue'
-import Refers from './refers.vue'
+import Refers from '@/components/Refers/refers.vue'
 import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
@@ -572,6 +565,9 @@ export default {
   },
   data() {
     return {
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       dialog: {
         config: false
       },
@@ -633,20 +629,39 @@ export default {
   methods: {
     copy() {
       this.$modal.msgSuccess("复制成功");
-      this.pageStu = 'add'
+      this.sonPageStu = 'add'
+      this.sonDisable = false
       this.getDetails(this.row)
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+    },
+    handleData() {
+      console.log('222')
+      // 复制新增把id,编码置为空,子表去掉id
+      this.basicForm.id = ''
+      this.basicForm.code = ''
+      if (this.basicForm.puDemandItemList.length !== 0) {
+        this.basicForm.puDemandItemList.forEach(item => {
+          if (item.id) {
+            delete item.id
+          }
+          if (item.demandId) {
+            delete item.demandId
+          }
+        })
+      }
     },
-    save() {
-      if(this.pageStu == 'add') {
-        // 复制新增把id置为空
-        this.basicForm.id = ''
-        addDemand(this.basicForm).then(res => {
+    async save() {
+      if(this.sonPageStu == 'add') {
+        await this.handleData()
+        await addDemand(this.basicForm).then(res => {
+          console.log(333)
           if (res.code === 200) {
             this.$modal.msgSuccess("保存成功");
             this.back()
           }
         })
-      } else if (this.pageStu == 'edit') {
+      } else if (this.sonPageStu == 'edit') {
         editDemand(this.basicForm).then(res => {
           if (res.code === 200) {
             this.$modal.msgSuccess("编辑成功");
@@ -691,6 +706,7 @@ export default {
         registrant: null,
         puPeriod: null,
         expiryUnit: null,
+        expiry: null,
         minPackage: null,
         minOrderQty: null,
         minBatch: null,
@@ -799,6 +815,7 @@ export default {
               if(this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
               if(this.basicForm.goodsAllocation) { this.reBackRefer('ALLOCATION_PARAM', this.basicForm.goodsAllocation) }
             }
+            console.log('111')
           })
         }
       })

+ 156 - 92
src/views/purchase/PurchaseDemandList/index.vue

@@ -5,37 +5,24 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="单据编码">
-              <el-select v-model="queryParams.code" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.code"
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="供应仓库">
-              <el-select v-model="queryParams.warehouse" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select size="small" v-model="queryParams.warehouse" @focus="chooseOrg('WAREHOUSE_PARAM', true, '供应仓库')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="需求客户">
-              <el-select v-model="queryParams.customer" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -53,8 +40,8 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -62,49 +49,23 @@
         <div v-show="expanded">
         <el-row :gutter="10">
           <el-col :span="1.5">
-            <el-form-item label="单据类型">
-              <el-select v-model="queryParams.threeName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="需求人员">
-              <el-select v-model="queryParams.demandPersonal" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="供应货位">
-              <el-select v-model="queryParams.goodsAllocation" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <el-select size="small" v-model="queryParams.goodsAllocation" @focus="chooseOrg('ALLOCATION_PARAM', true, '供应货位')" style="width: 200px">
+                <el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="单据来源">
-              <el-select v-model="queryParams.source" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select v-model="queryParams.source" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -114,37 +75,34 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="业务类型">
-              <el-select v-model="queryParams.billType" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+              <el-select v-model="queryParams.billType" size="small" style="width: 200px">
+                <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="需求部门">
-              <el-select v-model="queryParams.demandDept" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
                 <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+                  v-for="item in deptOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="需求日期">
-            <el-input
-              v-model="queryParams.demandDate"
-              size="small"
-              placeholder=""
-              clearable
-              style="width: 200px"
-            />
+              <el-date-picker
+                v-model="queryParams.demandDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                size="small"
+                style="width: 200px"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -152,7 +110,6 @@
             <el-input
               v-model="queryParams.remark"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
             />
@@ -189,7 +146,7 @@
           </el-dropdown>
 
           <el-button type="primary" size="small" @click="delItems">删除</el-button>
-          <el-button type="primary" size="small">打印</el-button>
+          <!-- <el-button type="primary" size="small">打印</el-button> -->
         </div>
         <el-table 
           :data="tableList" 
@@ -198,19 +155,19 @@
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column label="编码" align="center" prop="code"/>
-          <el-table-column label="需求日期" align="center" width="200" prop="demandDate" />
-          <el-table-column label="单据状态" align="center" prop="status" />
+          <el-table-column label="编码" align="center" width="200" prop="code"/>
+          <el-table-column label="需求日期" align="center" width="120" prop="demandDate"/>
+          <el-table-column label="单据状态" align="center" prop="satus" :formatter="formatterStatus"/>
           <!-- <el-table-column label="是否已处理需求" align="center" width="150" prop="isProcess" /> -->
-          <el-table-column label="业务类型" align="center" width="150" prop="billType"/>
+          <el-table-column label="业务类型" align="center" prop="billType" :formatter="formatterBillType"/>
           <!-- <el-table-column label="是否特殊需求" align="center" width="150" prop="isSpeical" /> -->
-          <el-table-column label="需求人员" align="center" width="150" prop="demandPersonalName" />
-          <el-table-column label="需求客户" align="center" prop="customerName" />
-          <el-table-column label="需求部门" align="center" width="150" prop="demandDeptName" />
+          <el-table-column label="需求人员" align="center" prop="demandPersonalName" />
+          <el-table-column label="需求客户" align="center" prop="customerName" width="150"/>
+          <el-table-column label="需求部门" align="center" prop="demandDeptName" width="150"/>
           <!-- <el-table-column label="供应仓库" align="center" width="120" prop="warehouseName" /> -->
           <!-- <el-table-column label="供应货位" align="center" width="150" prop="goodsAllocationName" /> -->
-          <el-table-column label="单据来源" align="center" width="150" prop="source" />
-          <el-table-column label="组织" align="center" width="150" prop="orgName" />
+          <el-table-column label="单据来源" align="center" prop="source" width="120" :formatter="formatterSource"/>
+          <el-table-column label="组织" align="center" width="200" prop="orgName"/>
           <el-table-column label="备注" align="center" width="150" prop="remark" />
           <el-table-column
           fixed="right"
@@ -220,8 +177,8 @@
           >
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="small" @click="edit(scope.row)">编辑</el-button>
-            <el-button type="text" size="small" @click="deleteids(scope.row)">删除</el-button>
+            <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="small" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
         </el-table>
@@ -239,19 +196,24 @@
     </div>
 
     <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+  
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
 import Add from './add.vue'
+import Refers from '@/components/Refers/refers.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getDemandList, delDemand, downLoadDemand, exportDemand } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
     Add,
-    CollapseTransition
+    CollapseTransition,
+    Refers
   },
+  dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business', 'sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
   data() {
     return {
       expanded: false,
@@ -264,7 +226,6 @@ export default {
         warehouse: '',
         customer: '',
         isProcess: '',
-        threeName: '',
         demandPersonal: '',
         goodsAllocation: '',
         source: '',
@@ -273,13 +234,23 @@ export default {
         demandDate: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
+      },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
       },
       options: [{
-        value: '1', label: '是',
+        value: '0', label: '是',
       }, {
-        value: '0', label: '否'
+        value: '2', label: '否'
       }],
+      houseOptions: [],
+      customerOptions: [],
+      personOptions: [],
+      goodsOptions: [],
+      deptOptions: [],
       tableList: [],
       total: 0,
       rowDetail: {},
@@ -291,6 +262,70 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 格式化表格内容
+    formatterStatus(row) {
+      switch(row.status){
+        case '0':
+          return '未提交'
+        case '1':
+          return '审批中'
+        case '2':
+          return '已完成'
+        case '3':
+          return '已驳回'
+      }
+    },
+    formatterBillType(row) {
+      switch (row.billType) {
+        case 'ZQBH':
+          return '周期备货'
+        case 'FXXQ':
+          return '分销需求'
+        case 'TSXQ':
+          return '特殊采购需求'
+        case 'BDXQ':
+          return '补单需求'
+        case 'JJXQ':
+          return '紧急需求单'
+        case 'XPXQ':
+          return '新品需求'
+        case 'HZBM':
+          return '合作部门需求'
+      }
+    },
+    formatterSource(row) {
+      switch (row.source) {
+        case '1':
+          return '手工导入'
+        case '2':
+          return '按客户计算'
+        case '3':
+          return '按仓库计算'
+        case '4':
+          return '手工新增'
+      }
+    },
+    searchList() {
+      this.getList(this.queryParams)
+    },
+    resetList() {
+      this.queryParams = {
+        code: '',
+        warehouse: '',
+        customer: '',
+        isProcess: '',
+        demandPersonal: '',
+        goodsAllocation: '',
+        source: '',
+        billType: '',
+        demandDept: '',
+        demandDate: '',
+        remark: '',
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams)
+    },
     getList(params){
       getDemandList(params).then(res => {
         if (res.code === 200) {
@@ -426,6 +461,35 @@ export default {
     },
     drop() {
       this.expanded = !this.expanded
+    },
+    // 搜索区参照选择
+    chooseOrg(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        this.queryParams.warehouse = selection[0].id
+      }
+      if (this.referCondition.type == 'CUSTOMER_PARAM') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.personOptions = selection
+        this.queryParams.demandPersonal = selection[0].id
+      }
+      if (this.referCondition.type == 'ALLOCATION_PARAM') {
+        this.goodsOptions = selection
+        this.queryParams.goodsAllocation = selection[0].id
+      }
+      if (this.referCondition.type == 'DEPT_PARAM') {
+        this.deptOptions = selection
+        this.queryParams.demandDept = selection[0].id
+      }
     }
   }
 }

+ 4 - 4
src/views/purchase/purchase-order/add/column.js

@@ -1,4 +1,4 @@
-const columns = [
+export const Columns = [
   // { key: "id", title: "主键",type: "Input", },
   {
     key: "puOrg",
@@ -212,9 +212,9 @@ const columns = [
 
 ];
 
-export const initColumns = () => columns;
+// export const initColumns = () => columns;
 
-const tabColumns = [
+export const TabColumns = [
   {
     title: '物料信息',
     key: 'puOrderItemList',
@@ -328,4 +328,4 @@ const tabColumns = [
   },
 ];
 
-export const initTabColumns = () => tabColumns;
+// export const initTabColumns = () => tabColumns;

+ 291 - 165
src/views/purchase/purchase-order/add/index.vue

@@ -1,195 +1,269 @@
 <script>
 import orderApi from "@/api/business/purchase/purchase-order";
 import { arr2obj } from "@/utils/data-transform";
-import {
-  initDicts,
-  initRules,
-  initParams,
-  initComponents,
-} from "@/utils/init";
-import { initColumns, initTabColumns } from "./column";
+import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import { Columns, TabColumns } from "./column";
+// import {
+//   initDicts,
+//   initRules,
+//   initParams,
+//   initComponents,
+// } from "@/utils/init";
+// import { initColumns, initTabColumns } from "./column";
+
+const NewColumns = initColumns(Columns);
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
 
 export default {
   name: "AddPurchaseContractDrawer",
-  components: initComponents(initColumns()),
-  dicts: initDicts(initColumns()),
+  dicts: initDicts(NewColumns),
+  components: {
+    DrInputDialog: () => import("@/views/input-dialog/index.vue"),
+  },
+
   data() {
     return {
       visible: false,
-      columns: initColumns(),
-      rules: initRules(initColumns()),
-      params: initParams(initColumns()),
-      tabColumns: initTabColumns(),
-      tabName: "puOrderItemList",
-      tabTableParams: {
+      columns: NewColumns,
+      rules: initRules(NewColumns),
+
+      params: {
+        ...initParams(NewColumns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
-      currentComponent: { name: "", title: "", value: "", row: {}, source: {} },
+
+      tabColumns: NewTabColumns,
+
+      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;
+      const { deptName, deptId, name, id, orgName, orgId } =
+        this.$store.state.user;
+      this.params.puOrg = orgId;
+      this.params.puOrgName = orgName;
+      this.params.buyer = id;
+      this.params.buyerName = name;
+      this.params.puDept = deptId;
+      this.params.puDeptName = deptName;
     },
     setVisible(prop) {
       this.visible = prop;
     },
     addTableRow(prop) {
-      this.$notify.info({ message: prop });
-      this.tabTableParams[prop].push(
-        arr2obj(
-          initTabColumns().find((element) => element.key === prop).tableColumns,
-          "key",
-          ""
-        )
-      );
-      console.log(this.tabTableParams);
+      const arr = this.tabColumns.find(
+        (element) => element.key === this.tabName
+      ).tableColumns;
+      prop.push(initParams(arr, "key", "value"));
     },
-    cancel() {
-      this.setVisible(false);
-      this.params = arr2obj(this.columns, "key", "value");
+    delTableRow(prop, index) {
+      prop.splice(index, 1);
     },
-    sava() {
-      let data = {
-        ...this.params,
-        ...this.tabTableParams
-      }
-      console.log(data, 'data');
-      // this.setVisible(false);
+    // 取消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(this.columns, "key", "value");
     },
-    async submitSava() {
-      console.log(this.params);
-      return;
+    // 保存
+    handleSava() {
+      this.setVisible(false);
     },
-    //
-    openAsyncInputDialog(prop, source, type) {
+    // 保存并新增
+    async handleSubmit() {
       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);
+        const createById = this.params.buyer;
+        const createByName = this.params.buyerName;
+        const updateById = this.$store.state.user.id;
+        const updateByName = this.$store.state.user.name;
+        const { code, msg } = await add({
+          createById,
+          createByName,
+          updateById,
+          updateByName,
+          ...this.params,
         });
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
       } catch (err) {
         this.$notify.error({ title: "error", message: err });
       } finally {
-        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]];
+        // this.setVisible(false);
       }
     },
   },
   created() {
-    // console.log("this,", initComponents(initColumns()));
+    console.log("ADD CREATED");
   },
-  mounted() { },
-  destroyed() { },
+  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="
+  <el-drawer
+    direction="btt"
+    size="100%"
+    :with-header="false"
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+  >
+    <el-form
+      size="mini"
+      label-position="right"
+      label-width="135px"
+      :model="params"
+      :rules="rules"
+    >
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }"
+        style="margin: 10px"
+      >
+        <div
+          slot="header"
+          style="
             display: flex;
             justify-content: space-between;
             align-items: center;
-          ">
+          "
+        >
           <h3>新增</h3>
           <div style="text-align: right">
-            <el-button size="mini" @click="cancel">取消</el-button>
-            <el-button size="mini" type="danger" @click="sava">保存</el-button>
-            <el-button size="mini" type="info" @click="submitSava">
+            <el-button size="mini" @click="handleCancel">取消</el-button>
+            <el-button size="mini" type="danger" @click="handleSava"
+              >保存</el-button
+            >
+            <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
             </el-button>
           </div>
         </div>
-        <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-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-input
+                v-if="column.type === 'Input'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <dr-input-dialog
+                v-if="column.type === 'InputDialog'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :readonly="column.readonly"
+                :title="column.title"
+                :type="column.config.componentName"
+                :data-mapping="column.config.dataMapping"
+                :source.sync="params"
+              >
+              </dr-input-dialog>
+              <el-input
+                v-if="column.type === 'Textarea'"
+                v-model="params[column.key]"
+                type="textarea"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input>
+              <el-input-number
+                v-if="column.type === 'InputNumber'"
+                v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              ></el-input-number>
+              <el-select
+                v-if="column.type === 'Select'"
+                v-model="params[column.key]"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in dict.type[column.config.optionsName]"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-
-              <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <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>
+                  <el-icon
+                    class="el-icon-view"
+                    style="cursor: pointer"
+                    @click.stop="$message.info(234)"
+                  ></el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
                 </el-option>
               </el-select>
-
-              <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
+              <el-date-picker
+                v-if="column.type === 'DatePicker'"
+                v-model="params[column.key]"
+                :type="column.config.type"
+                :placeholder="column.placeholder"
+                :clearable="column.clearable"
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions"
+                style="width: 100%"
+              >
               </el-date-picker>
-
-              <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://jsonplaceholder.typicode.com/posts/" multiple>
+              <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>
@@ -202,50 +276,102 @@ export default {
           </el-col>
         </el-row>
       </el-card>
-      <el-card :body-style="{
-        padding: '20px',
-        display: 'flex',
-        'flex-wrap': 'wrap',
-        position: 'relative',
-      }" style="margin: 10px">
-        <el-tabs v-model="tabName" @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">
+      <el-card
+        :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+          position: 'relative',
+        }"
+        style="margin: 10px"
+      >
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane
+            v-for="(column, index) in tabColumns"
+            :key="index"
+            :label="column.title"
+            :name="column.key"
+          >
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column
+                v-for="(cColumn, cIndex) in column.tableColumns"
+                :key="cIndex"
+                :prop="cColumn.key"
+                :label="cColumn.title"
+                :width="cColumn.width"
+              >
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%"></el-input>
-
-                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
-                    style="width: 100%"></el-input-number>
-
-                  <el-input v-if="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')">
+                  <el-input
+                    v-if="cColumn.type === 'Input'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input>
+                  <dr-input-dialog
+                    v-if="cColumn.type === 'InputDialog'"
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly"
+                    :title="cColumn.title"
+                    :type="cColumn.config.componentName"
+                    :data-mapping="cColumn.config.dataMapping"
+                    :source.sync="scope.row"
+                    size="mini"
+                  >
+                  </dr-input-dialog>
+                  <el-input-number
+                    v-if="cColumn.type === 'InputNumber'"
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition"
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled"
+                    size="mini"
+                    style="width: 100%"
+                  ></el-input-number>
+                  <el-input
+                    v-if="column.type === 'InputDialog'"
+                    v-model="params[column.key]"
+                    :placeholder="column.placeholder"
+                    :clearable="column.clearable"
+                    :disabled="column.disabled"
+                    :readonly="column.readonly"
+                    style="width: 100%; cursor: pointer"
+                  >
                     <template #suffix>
-                      <el-icon class="el-icon-s-operation" style="cursor: pointer" @click.native.stop="
-                        openAsyncInputDialog(cColumn, scope.row, 'click')
-                        "></el-icon>
+                      <el-icon class="el-icon-thumb"></el-icon>
                     </template>
                   </el-input>
-
-                  <el-checkbox v-if="cColumn.type === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button
+                    @click.native.prevent="
+                      delTableRow(params[tabName], scope.$index)
+                    "
+                    type="text"
+                    size="small"
+                  >
+                    删行
+                  </el-button>
                 </template>
               </el-table-column>
             </el-table>
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button size="mini" @click="addTableRow(tabName)">增行</el-button>
+          <el-button size="mini" @click="addTableRow(params[tabName])"
+            >增行</el-button
+          >
         </el-row>
       </el-card>
     </el-form>

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

@@ -0,0 +1,78 @@
+export 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: "中台采购订单号" }
+];
+
+export const SearchColumns = TableColumns.filter((element) => element.search);

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

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

+ 112 - 102
src/views/purchase/purchase-order/index.vue

@@ -1,8 +1,10 @@
 <!-- 采购订单修订—— 列表 -->
 <script>
+import { TableColumns, SearchColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
+import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 import AddPurchaseOrderDrawer from "./add/index.vue";
-import SeePurchaseOrderDrawer from "./see-purchase-order.vue";
+import SeePurchaseOrderDrawer from "./see/index.vue";
 // import DirectSourcingTable from "./direct-sourcing.vue";
 export default {
   name: "PuchaseTask",
@@ -17,94 +19,94 @@ export default {
         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 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 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: '物料信息',
@@ -210,14 +212,21 @@ export default {
     return {
       loading: false,
       isSimpleSearch: true,
-      searchColumns: initSearchColumns(),
-      searchParams: {
-        isAsc: "desc",
-        reasonable: "",
-        orderByColumn: "",
-        ...initSearchParams(),
-      },
-      tableColumns: initTableColumns(),
+      pageSizes: initPageSizes(),
+      layout: initLayout(),
+      page: initPage(),
+      searchColumns: SearchColumns,
+      params: initParams(SearchColumns),
+
+      tableColumns: TableColumns,
+      // searchColumns: initSearchColumns(),
+      // searchParams: {
+      //   isAsc: "desc",
+      //   reasonable: "",
+      //   orderByColumn: "",
+      //   ...initSearchParams(),
+      // },
+      // tableColumns: initTableColumns(),
       tableData: [{ puOrgName: 1 }],
       tabColumns: initTabColumns(),
       tabName: "first",
@@ -225,9 +234,10 @@ export default {
         first: [],
         second: [],
       },
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
-      pageSizes: [25, 50, 100],
+      // page: { pageNum: 1, pageSize: 25 },
+      // total: 0,
+      // pageSizes: [25, 50, 100],
+      detailsData: {}
     };
   },
   computed: {
@@ -299,7 +309,7 @@ export default {
       try {
         const { code, msg, data } = await orderApi.orderDetails(row.id);
         if (code === 200) {
-
+          this.detailsData = data;
           // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
           this.tabTableDatas.first = data.puOrderItemList;
           this.tabTableDatas.second = data.puOrderExecuteList;
@@ -322,7 +332,7 @@ export default {
     <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-form size="mini" label-position="right" label-width="85px" :model="params" style="padding: 20px 0 0 0">
       <el-row :gutter="24">
         <el-col :span="20">
           <el-row :gutter="20">
@@ -386,7 +396,7 @@ export default {
     </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">
+      :layout="layout">
     </el-pagination>
 
     <!-- <el-card :body-style="{

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

@@ -1,352 +0,0 @@
-<!-- 采购订单修订—— 查看 -->
-<script>
-export default {
-  name: "SeePurchaseContractDrawer",
-  data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    const columns = [
-      // { key: "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>

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

@@ -0,0 +1,393 @@
+<!-- 采购订单修订—— 查看 -->
+<script>
+import {
+  initColumns,
+  initDicts,
+  initRules,
+  initParams,
+} from "@/utils/init";
+import { Columns, TabColumns } from "../add/column";
+
+const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
+const NewTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+
+
+export default {
+  name: "SeePurchaseContractDrawer",
+  dicts: initDicts(NewColumns),
+  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: NewColumns,
+      rules: initRules(NewColumns),
+      params: {
+        ...initParams(NewColumns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      },
+
+      tabColumns: NewTabColumns,
+      tabName: "puOrderItemList",
+      // tabTableDatas: {
+      //   first: [],
+      //   second: [],
+      //   // third: [],
+      //   // fourth: [],
+      //   // fifth: [],
+      // },
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    //
+    async fetchItem(prop) {
+      try {
+        this.loading = true;
+        const { code, msg, data } = await item(prop);
+        if (code === 200) {
+          this.params = data;
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 取 消
+    handleCancel() {
+      this.setVisible(false);
+      this.params = initParams(Columns);
+    },
+  },
+  created() { },
+  mounted() { },
+  destroyed() { },
+};
+</script>
+<template>
+  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+    @close="$emit('close')">
+    <el-form size="mini" label-position="right" label-width="135px" :model="params" :rules="rules">
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+      }" style="margin: 10px">
+        <div slot="header" style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          ">
+          <h3>查看</h3>
+          <div style="text-align: right">
+            <el-button size="mini" @click="handleCancel">取 消</el-button>
+          </div>
+        </div>
+        <el-row>
+          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
+            <el-form-item :prop="column.key" :label="column.title">
+              <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" style="width: 100%"></el-input>
+              <el-input-number v-else-if="column.type === 'InputNumber'" v-model="params[column.key]"
+                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" :readonly="column.readonly"
+                style="width: 100%"></el-input-number>
+              <el-select v-else-if="column.type === 'Select'" v-model="params[column.key]"
+                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                :readonly="column.readonly" style="width: 100%">
+                <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+              <el-date-picker v-else-if="column.type === 'DatePicker'" v-model="params[column.key]"
+                :type="column.config.type" :placeholder="column.placeholder" :clearable="column.clearable"
+                :disabled="column.disabled" :readonly="column.readonly" :picker-options="column.pickerOptions"
+                style="width: 100%">
+              </el-date-picker>
+              <el-upload v-else-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
+                :readonly="column.readonly" drag action="https://jsonplaceholder.typicode.com/posts/" multiple>
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或<em>点击上传</em>
+                </div>
+                <div class="el-upload__tip" slot="tip">
+                  只能上传jpg/png文件,且不超过500kb
+                </div>
+              </el-upload>
+              <el-input v-else v-model="params[column.key]" :placeholder="column.placeholder"
+                :clearable="column.clearable" :disabled="column.disabled" :readonly="column.readonly"
+                style="width: 100%"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-card>
+      <el-card :body-style="{
+        padding: '20px',
+        display: 'flex',
+        'flex-wrap': 'wrap',
+        position: 'relative',
+      }" style="margin: 10px">
+        <el-tabs v-model="tabName" style="width: 100%">
+          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+            <el-table :data="params[column.key]" style="width: 100%">
+              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
+                :label="cColumn.title" :width="cColumn.width">
+                <template slot-scope="scope">
+                  <el-tag v-if="cColumn.key === 'index'">
+                    {{ scope.$index + 1 }}
+                  </el-tag>
+                  <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    size="mini" style="width: 100%"></el-input>
+                  <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
+                    style="width: 100%"></el-input-number>
+                  <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+                    :readonly="column.readonly" style="width: 100%; cursor: pointer"
+                    @click.native.stop="openAsyncInputDialog(column, params)">
+                    <template #suffix>
+                      <el-icon class="el-icon-thumb"></el-icon>
+                    </template>
+                  </el-input>
+                </template>
+              </el-table-column>
+              <el-table-column fixed="right" label="操作" width="120">
+                <template slot-scope="scope">
+                  <el-button @click.native.prevent="
+                    delTableRow(params[tabName], scope.$index)
+                    " type="text" size="small">
+                    删行
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+        <el-row style="position: absolute; top: 20px; right: 20px">
+          <el-button size="mini" @click="addTableRow(params[tabName])">增行</el-button>
+        </el-row>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>

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

@@ -5,13 +5,11 @@ import {
   initDicts,
   initRules,
   initParams,
-  initComponents,
 } from "@/utils/init";
 import { initColumns } from "./config/add";
 
 export default {
   name: "AddPurchaseTaskDrawer",
-  // components: initComponents(initColumns()),
   dicts: initDicts(initColumns()),
   data() {
     return {

+ 3 - 3
vue.config.js

@@ -37,15 +37,15 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        // target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // 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本地
+        // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",