Przeglądaj źródła

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

002390 2 lat temu
rodzic
commit
59cc9c2241

+ 5 - 40
src/api/business/purchase/catalogue.js

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

+ 1 - 1
src/api/purchase/DemandSummary.js

@@ -57,7 +57,7 @@ export function editSummaryList(data) {
 export function shutDownSummary(id) {
   return request({
     url: `/pu/demand/item/summary/shutDown/${id}`,
-    method: 'get',
+    method: 'put',
   })
 }
 // 采购需求明细行编辑

+ 103 - 35
src/components/popover-select/index.vue

@@ -127,7 +127,6 @@ export default {
     },
     // fetch list
     async fetchList(prop, page) {
-      console.log(prop, 'prop------------');
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
@@ -151,14 +150,17 @@ export default {
     // reset list
     async resetList() {
       const { type, queryParams } = this.$props;
-      this.model = { type, ...this.model, ...queryParams };
-      const { page, model } = this;
-      await this.fetchList(model, page);
+      this.model = {
+        ...queryParams,
+        ...this.model,
+        search: "",
+        type,
+      };
+      await this.fetchList(this.model, this.page);
     },
     // query list
     async queryList() {
-      const { page, model } = this;
-      await this.fetchList(model, page);
+      await this.fetchList(this.model, this.page);
     },
     // row click
     rowClick(prop) {
@@ -211,42 +213,92 @@ export default {
       }
       this.$emit("update:source", source);
       // emit change
-      this.$emit("change", prop, source, type,);
+      this.$emit("change", prop, source, type);
     },
   },
-  created() { },
-  mounted() { },
-  destroyed() { },
+  created() {},
+  mounted() {},
+  destroyed() {},
 };
 </script>
 <template>
   <div>
-    <el-input v-model="innerValue" :size="size" :disabled="disabled" :readonly="readonly" :clearable="clearable"
-      :placeholder="placeholder">
-      <el-button :disabled="disabled" slot="append" icon="el-icon-search" @click="open"></el-button>
+    <el-input
+      v-model="innerValue"
+      :size="size"
+      :disabled="disabled"
+      :readonly="readonly"
+      :clearable="clearable"
+      :placeholder="placeholder"
+    >
+      <el-button
+        :disabled="disabled"
+        slot="append"
+        icon="el-icon-search"
+        @click="open"
+      ></el-button>
     </el-input>
-    <el-dialog :title="`${title}(${multiple ? '多选' : '单选'})`" :width="width" :visible.sync="visible"
-      :close-on-click-modal="false" :close-on-press-escape="false" append-to-body @close="hide">
-      <el-form v-loading="loading" :size="size" :inline="true" :model="model" @submit.native.prevent>
+    <el-dialog
+      :title="`${title}(${multiple ? '多选' : '单选'})`"
+      :width="width"
+      :visible.sync="visible"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+      @close="hide"
+    >
+      <el-form
+        v-loading="loading"
+        :size="size"
+        :inline="true"
+        :model="model"
+        @submit.native.prevent
+      >
         <el-form-item prop="search">
-          <el-input v-model="model.search" @change="queryList" @keydown.enter="queryList">
+          <el-input
+            v-model="model.search"
+            @change="queryList"
+            @keydown.enter="queryList"
+          >
           </el-input>
         </el-form-item>
         <el-form-item>
           <el-button icon="el-icon-refresh" @click="resetList"></el-button>
         </el-form-item>
-        <el-table ref="multipleTable" :data="data" :size="size" height="45vh" highlight-current-row
-          style="width: 100%; margin-bottom: 20px" @row-click="rowClick" @row-dblclick="rowDblclick"
-          @selection-change="selectionChange">
+        <el-table
+          ref="multipleTable"
+          :data="data"
+          :size="size"
+          height="45vh"
+          highlight-current-row
+          style="width: 100%; margin-bottom: 20px"
+          @row-click="rowClick"
+          @row-dblclick="rowDblclick"
+          @selection-change="selectionChange"
+        >
           <el-table-column width="55" type="selection" align="center">
           </el-table-column>
-          <el-table-column v-for="(column, index) in TableColumnTemp" :key="index" :prop="column.key"
-            :label="column.title" :width="column.width" show-overflow-tooltip>
+          <el-table-column
+            v-for="(column, index) in TableColumnTemp"
+            :key="index"
+            :prop="column.key"
+            :label="column.title"
+            :width="column.width"
+            show-overflow-tooltip
+          >
           </el-table-column>
         </el-table>
-        <el-pagination :layout="layout" :total="page.total" :page-sizes="pageSizes" :small="size === 'mini'"
-          :page-size="page.pageSize" :current-page="page.pageNum" background @size-change="pageSizeChange"
-          @current-change="pageNumberChange">
+        <el-pagination
+          :layout="layout"
+          :total="page.total"
+          :page-sizes="pageSizes"
+          :small="size === 'mini'"
+          :page-size="page.pageSize"
+          :current-page="page.pageNum"
+          background
+          @size-change="pageSizeChange"
+          @current-change="pageNumberChange"
+        >
         </el-pagination>
       </el-form>
       <div style="margin-top: 20px; text-align: right">
@@ -254,26 +306,42 @@ export default {
         <el-button :size="size" @click="confirm(selectData)"> 确 定 </el-button>
       </div>
     </el-dialog>
-    <div style="
+    <div
+      style="
         position: absolute;
         left: 10px;
         top: 50%;
         transform: translateY(-50%);
         padding-right: 30px;
         overflow: hidden;
-      ">
+      "
+    >
       <div v-if="multiple && selectData.length">
-        <el-popover :offset="-10" :width="width" :visible-arrow="false" title="" content="" trigger="click"
-          placement="bottom-start">
+        <el-popover
+          :offset="-10"
+          :width="width"
+          :visible-arrow="false"
+          title=""
+          content=""
+          trigger="click"
+          placement="bottom-start"
+        >
           <el-tag slot="reference" :size="size" style="margin-right: 10px">
             + {{ selectData.length }}
           </el-tag>
-          <el-tag v-for="(tag, index) in selectData" :size="size" hit closable :style="{
-            display: 'flex',
-            justifyContent: 'space-between',
-            alignItems: 'center',
-            margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
-          }" @close="deleteTag(index)">
+          <el-tag
+            v-for="(tag, index) in selectData"
+            :size="size"
+            hit
+            closable
+            :style="{
+              display: 'flex',
+              justifyContent: 'space-between',
+              alignItems: 'center',
+              margin: selectData.length - 1 === index ? '0' : '0 0 5px 0',
+            }"
+            @close="deleteTag(index)"
+          >
             {{ tag.name }}
           </el-tag>
         </el-popover>

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

@@ -79,7 +79,7 @@
         <el-table-column label="采购员编码" align="center" prop="buyer"/>
         <el-table-column label="采购组织" align="center" prop="orgName"/>
         <el-table-column label="有效期单位" align="center" prop="expiryUnit"/>
-        <el-table-column label="业务部门" align="center" prop="businessDeptName"/>
+        <!-- <el-table-column label="业务部门" align="center" prop="businessDeptName"/> -->
         <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
         <el-table-column label="批号锁定标识" align="center" prop="isBatchLock">
           <template slot-scope="scope">
@@ -97,10 +97,10 @@
         <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="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"/>

+ 38 - 39
src/views/purchase/DemandSummary/index.vue

@@ -13,8 +13,8 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="采购员">
-              <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 clearable size="small" v-model="queryParams.buyer" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
+                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -62,6 +62,13 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="审核人">
+                <el-select clearable size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="1.5">
               <el-form-item label="周期单位">
                 <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
                   <el-option
@@ -69,7 +76,7 @@
                   </el-option>
                 </el-select>
               </el-form-item>
-            </el-col>
+            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
@@ -84,31 +91,13 @@
                 />
               </el-form-item>
             </el-col> -->
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-form-item label="业务部门">
-                <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
                   <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="审核人">
-                <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
-                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="采购需求单号">
-                <el-input
-                v-model="queryParams.code"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
+            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
@@ -117,7 +106,6 @@
                 <el-input
                 v-model="queryParams.registrant"
                 size="small"
-                placeholder=""
                 clearable
                 style="width: 200px"
                 />
@@ -146,21 +134,21 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="需求客户">
-                <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
                   <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应仓库">
-                <el-select size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
                   <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应库位">
-                <el-select size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
                   <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -182,7 +170,7 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="物料编码">
-                <el-input readonly size="small" v-model="queryParams.names" style="width: 200px">
+                <el-input clearable size="small" v-model="queryParams.names" @focus="chooseMaterial" style="width: 200px">
                   <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                 </el-input>
                 <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
@@ -190,7 +178,7 @@
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="默认采购组织">
-                <el-select size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+                <el-select clearable size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
                   <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
@@ -211,7 +199,17 @@
 
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="汇总审核时间">
+              <el-form-item label="采购需求单号">
+                <el-input
+                v-model.trim="queryParams.code"
+                size="small"
+                clearable
+                style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="处理审核时间">
                 <el-date-picker
                   v-model="queryParams.auditTime"
                   type="date"
@@ -223,7 +221,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="汇总确认时间">
+              <el-form-item label="处理确认时间">
                 <el-date-picker
                   v-model="queryParams.yesTime"
                   type="date"
@@ -247,7 +245,7 @@
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
           <el-button type="primary" size="small" @click="audits">审核</el-button>
-          <el-button type="primary" size="small" @click="cancelAudits">弃审</el-button>
+          <!-- <el-button type="primary" size="small" @click="cancelAudits">弃审</el-button> -->
 
           <el-dropdown size="small" @command="handleCommand">
             <el-button size="small" type="primary" style="margin: 0 10px;">
@@ -334,13 +332,13 @@
           <el-table-column label="单据来源" align="center" prop="billSource"/>
           <el-table-column label="行号" align="center" prop="rowNo"/>
           <el-table-column label="注册人" align="center" prop="registrant"/>
-          <el-table-column label="可用量" align="center" prop="qty"/>
+          <!-- <el-table-column label="可用量" align="center" prop="qty"/> -->
           <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
           <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
           <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
           <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
-          <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/>
-          <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/>
+          <!-- <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/> -->
+          <!-- <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/> -->
           <el-table-column label="需求单位" align="center" prop="demandUnit"/>
           <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
           <el-table-column
@@ -367,7 +365,7 @@
       </el-card>
     </div>
 
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="reset"/>
   
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 
@@ -438,6 +436,7 @@ export default {
       page: '',
       queryParams: {
         rowStatus: [],
+        buyer: '',
         buyerName: '',
         materialName: '',
         manufacturer: '',
@@ -641,7 +640,7 @@ export default {
     selectionsToInput(selection) {
       if (this.referCondition.title == '采购员') {
         this.personOptions = selection
-        this.queryParams.buyerName = selection[0].id
+        this.queryParams.buyerName = selection[0].code
       }
       if (this.referCondition.title == '业务部门') {
         this.deptOptions = selection
@@ -649,7 +648,7 @@ export default {
       }
       if (this.referCondition.title == '审核人') {
         this.auditOptions = selection
-        this.queryParams.puManagerAuditor = selection[0].id
+        this.queryParams.puManagerAuditor = selection[0].code
       }
       if (this.referCondition.title == '需求客户') {
         this.customerOptions = selection

+ 27 - 26
src/views/purchase/PurchaseDemandList/add.vue

@@ -164,11 +164,11 @@
         >
           <el-table-column type="selection"/>
           <el-table-column label="序号" type="index" align="center"/>
-          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus"/>
+          <el-table-column label="行状态" align="center" prop="status" :formatter="hangStatus" width="150px"/>
           <el-table-column label="行号" align="center" prop="rowNo" />
           <!-- <el-table-column label="业务部门名称" align="center" width="180px"/> -->
           <!-- <el-table-column label="业务部门" align="center" width="180px"/> -->
-          <el-table-column label="需求客户" align="center"  prop="customerName"/>
+          <el-table-column label="需求客户" align="center"  prop="demandCustomerName" width="200px"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -200,7 +200,7 @@
           <el-table-column label="预留比例" align="center" prop="reservedProportion" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
+                <el-select clearable :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>
@@ -211,14 +211,14 @@
           <el-table-column label="预留周期" align="center" prop="reservedPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
           <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -227,7 +227,7 @@
           <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.materialCode">
+                <el-input clearable size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
@@ -235,26 +235,26 @@
           </el-table-column>
           <el-table-column label="物料名称" align="center"  prop="materialName" width="230px" />
           <el-table-column label="规格" align="center"  prop="specification" />
-          <el-table-column label="型号" align="center"  prop="model" />
-          <el-table-column label="单位" align="center"  prop="unit" />
+          <el-table-column label="型号" align="center"  prop="model"/>
+          <el-table-column label="单位" align="center"  prop="unitName"/>
           <el-table-column label="生产厂家/代理人" align="center"  prop="manufacturerName" width="230px"/>
           <el-table-column label="注册人" align="center"  prop="registrant" width="150px"/>
           <el-table-column label="采购周期" align="center"  prop="puPeriod" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
           <el-table-column label="有效期" align="center"  prop="expiry" width="120px"/>
+          <el-table-column label="有效期单位" align="center"  prop="expiryUnit" width="120px"/>
           <el-table-column label="最小包装" align="center"  prop="minPackage" width="120px"/>
           <el-table-column label="最小订货量" align="center"  prop="minOrderQty" width="120px"/>
           <el-table-column label="最小批量" align="center"  prop="minBatch" width="120px"/>
           <el-table-column label="安全库存" align="center"  prop="safeStock" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -262,7 +262,7 @@
           <el-table-column label="实际(业务)需求量" align="center"  prop="qty" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -274,6 +274,7 @@
                 <el-date-picker
                   v-model="scope.row.deliveryDate"
                   :readonly="sonDisable"
+                  clearable
                   type="datetime"
                   size="small"
                   value-format="yyyy-MM-dd HH:mm:ss"
@@ -313,24 +314,24 @@
           <el-table-column label="业务备注" align="center"  prop="remark" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
               </el-form-item>
             </template>
           </el-table-column> 
           <el-table-column label="采购备注" align="center"  prop="puRemark" width="150px"/>
           <!-- <el-table-column label="末级供应仓库存量" align="center"  prop="lastWarehouseQty" /> -->
-          <!-- <el-table-column label="调拨占有量" align="center"  prop="superiorAllotQty"></el-table-column> -->
+          <el-table-column label="调拨占有量" align="center"  prop="superiorAllotQty" width="150px"/>
           <el-table-column label="最终净需求量" align="center"  prop="resDemandQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
               </el-form-item>
             </template>
           </el-table-column>
           <el-table-column label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.deliveryWarehouseName">
+                <el-input clearable 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>
@@ -339,7 +340,7 @@
           <el-table-column label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.deliveryAllocationName">
+                <el-input clearable readonly size="small" v-model="scope.row.deliveryAllocationName">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
@@ -385,7 +386,7 @@
           <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.additionalSupplier">
+                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplier">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
@@ -394,28 +395,27 @@
           <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
+                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="周期单位" align="center"  prop="periodUnit" width="150px">
+          <!-- <el-table-column label="周期单位" align="center"  prop="periodUnit" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
+                <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
                   <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
-                <!-- <el-input v-model="scope.row.periodUnit"/> -->
               </el-form-item>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <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="centralWarehouseQty" width="200px"/>
           <el-table-column label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.deliveryAddressName">
+                <el-input clearable size="small" v-model="scope.row.deliveryAddressName" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
@@ -428,7 +428,7 @@
           <el-table-column label="价格类型" align="center"  prop="priceType" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select :disabled="sonDisable" size="small" v-model="scope.row.priceType">
+                <el-select clearable :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>
@@ -910,6 +910,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
       this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
       this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
+      this.basicForm.puDemandItemList[this.tableIndex].expiry = selection[0].usefulLife
       this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
       // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
       this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty

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

@@ -213,7 +213,7 @@
       </div>
     </el-dialog>
 
-    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
+    <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="resetList"/>
   
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>

+ 3 - 9
src/views/purchase/apply/add/index.vue

@@ -1,7 +1,7 @@
 <script>
 import { TableColumns } from "../column";
-import { ITEM, ADD } from "@/api/business/purchase/apply";
-import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
+import { ADD } from "@/api/business/purchase/apply";
+import { initDicts, initRules, initParams } from "@/utils/init";
 
 export default {
   name: "AddDialog",
@@ -35,13 +35,6 @@ export default {
       try {
         this.loading = true;
         this.params = prop;
-        // const { code, msg, data } = await FIRSTDIRECT(prop);
-        // if (code === 200) {
-        //   this.data = data;
-        //   this.$notify.success({ title: msg });
-        // } else {
-        //   this.$notify.warning({ title: msg });
-        // }
       } catch (err) {
         //
       } finally {
@@ -58,6 +51,7 @@ export default {
             });
             if (code === 200) {
               this.hide();
+              this.$emit("submit-success");
               this.$notify.success({ title: msg });
             } else {
               this.$notify.warning({ title: msg });

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

@@ -57,7 +57,7 @@ export const TableColumns = [
     readonly: true,
   },
   {
-    key: "explain",
+    key: "explainStr",
     title: "价格合理性说明",
     inputType: "Input",
     require: true,
@@ -84,7 +84,7 @@ export const TableColumns = [
     key: "puDeptName",
     title: "采购部门",
     inputType: "PopoverSelect",
-    referName: "CONTACTS_PARAM",
+    referName: "DEPT_PARAM",
     dataMapping: {
       puDept: "code",
       puDeptName: "name",
@@ -162,7 +162,6 @@ export const SearchColumns = [
     title: "供应商",
     inputType: "PopoverSelect",
     referName: "SUPPLIER_PARAM",
-    valueKey: "name",
     dataMapping: {
       supplier: "code",
       supplierName: "name",
@@ -173,10 +172,46 @@ export const SearchColumns = [
     title: "采购组织",
     inputType: "PopoverSelect",
     referName: "ORG_PARAM",
-    valueKey: "name",
     dataMapping: {
       puOrg: "code",
       puOrgName: "name",
     },
   },
+  {
+    key: "buyerName",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      buyer: "code",
+      buyerName: "name",
+    },
+  },
+  {
+    key: "currencyName",
+    title: "币种",
+    inputType: "PopoverSelect",
+    referName: "CURRENCY_PARAM",
+    dataMapping: {
+      currency: "code",
+      currencyName: "name",
+    },
+  },
+  {
+    key: "puDeptName",
+    title: "采购部门",
+    inputType: "PopoverSelect",
+    referName: "DEPT_PARAM",
+    dataMapping: {
+      puDept: "code",
+      puDeptName: "name",
+    },
+  },
+  {
+    key: "isEffective",
+    title: "是否已推价格",
+    inputType: "Switch",
+    activeValue: "1",
+    inactiveValue: "0",
+  },
 ];

+ 27 - 4
src/views/purchase/apply/index.vue

@@ -122,7 +122,7 @@ export default {
     <el-form
       :size="size"
       :model="params"
-      label-width="75px"
+      label-width="auto"
       label-position="right"
       style="padding: 20px 20px 0"
     >
@@ -134,12 +134,35 @@ export default {
         >
           <el-form-item :prop="column.key" :label="column.title">
             <el-input
+              v-if="column.inputType === 'Input'"
               v-model="params[column.key]"
               :placeholder="column.placeholder"
+              style="width: 100%"
             ></el-input>
+            <el-switch
+              v-if="column.inputType === 'Switch'"
+              v-model="params[column.key]"
+              active-value="1"
+              inactive-value="0"
+            >
+            </el-switch>
+            <dr-popover-select
+              v-if="column.inputType === 'PopoverSelect'"
+              v-model="params[column.key]"
+              :size="size"
+              :source.sync="params"
+              :title="column.title"
+              :type="column.referName"
+              :multiple="column.multiple"
+              :readonly="column.readonly"
+              :value-key="column.valueKey"
+              :placeholder="column.placeholder"
+              :data-mapping="column.dataMapping"
+            >
+            </dr-popover-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label-width="0">
             <el-button
               circle
@@ -181,13 +204,13 @@ export default {
           >
             复 制
           </el-button>
-          <el-button
+          <!-- <el-button
             @click.native.prevent="editItem(scope.row)"
             type="text"
             size="small"
           >
             编 辑
-          </el-button>
+          </el-button> -->
           <el-button
             @click.native.prevent="deleteItem(scope.row)"
             type="text"

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

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

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

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

+ 47 - 25
src/views/purchase/catalogue/column.js

@@ -1,20 +1,25 @@
 export const TableColumns = [
-  { key: "id", title: "id" },
-  { key: "puOrg", title: "采购组织" },
   {
     key: "puOrgName",
-    title: "采购组织名称",
-    search: true,
-    config: {
-      componentName: "ORG_PARAM",
-      dataMapping: {
-        puOrg: "code",
-        puOrgName: "name",
-      },
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    valueKey: "name",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
     },
+    require: true,
   },
-  { key: "material", title: "物料编码", search: true },
-  { key: "materialClassify", title: "物料一级分类", search: true },
+  {
+    key: "puOrg",
+    title: "采购组织编码",
+    inputType: "Input",
+    disabled: true,
+    readonly: true,
+  },
+  { key: "material", title: "物料编码" },
+  { key: "materialClassify", title: "物料一级分类" },
   { key: "manufacturer", title: "生产厂家" },
   { key: "materialName", title: "物料名称" },
   { key: "model", title: "物料型号" },
@@ -23,14 +28,6 @@ export const TableColumns = [
   {
     key: "supplierName",
     title: "供应商名称",
-    search: true,
-    config: {
-      componentName: "SUPPLIER_PARAM",
-      dataMapping: {
-        supplier: "code",
-        supplierName: "name",
-      },
-    },
   },
   { key: "customer", title: "客户" },
   { key: "customerName", title: "客户名称" },
@@ -41,7 +38,7 @@ export const TableColumns = [
   { key: "endDate", title: "价格失效日期" },
   { key: "buyer", title: "采购员" },
   { key: "buyerName", title: "采购员名称" },
-  { key: "source", title: "来源单据编号", search: true },
+  { key: "source", title: "来源单据编号" },
   { key: "status", title: "有效状态" },
   { key: "enableStatus", title: "启用状态" },
   { key: "convertRate", title: "换算率" },
@@ -51,11 +48,36 @@ export const TableColumns = [
   { key: "demandCode", title: "采购需求单号" },
   { key: "expiryEarly", title: "效期预警" },
   { key: "priority", title: "含税/无税优先" },
-  { key: "tenantId", title: "租户号" },
-  { key: "revision", title: "乐观锁" },
   { key: "createByName", title: "创建人" },
   { key: "updateByName", title: "更新人名称" },
-  { key: "delFlag", title: "删除标记" },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+export const SearchColumns = [
+  {
+    key: "puOrgName",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    referName: "ORG_PARAM",
+    dataMapping: {
+      puOrg: "code",
+      puOrgName: "name",
+    },
+  },
+  {
+    key: "manufacturer",
+    title: "生产厂家",
+    inputType: "Input",
+  },
+  {
+    key: "supplierName",
+    title: "供应商",
+    inputType: "PopoverSelect",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      supplier: "code",
+      supplierName: "name",
+    },
+  },
+  { key: "source", title: "来源单据编号", inputType: "Input" },
+  { key: "material", title: "物料编码", inputType: "Input" },
+];

+ 106 - 236
src/views/purchase/catalogue/edit/index.vue

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

+ 90 - 95
src/views/purchase/catalogue/index.vue

@@ -1,13 +1,13 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { list, remove } from "@/api/business/purchase/catalogue";
+import { LIST } from "@/api/business/purchase/catalogue";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
-  name: "PuchaseContract",
+  name: "PuchaseCatalogue",
   components: {
-    AddDrawer: () => import("./add/index.vue"),
-    SeeDrawer: () => import("./see/index.vue"),
-    EditDrawer: () => import("./edit/index.vue"),
+    // AddDrawer: () => import("./add/index.vue"),
+    // SeeDrawer: () => import("./see/index.vue"),
+    EditDialog: () => import("./edit/index.vue"),
   },
   data() {
     return {
@@ -24,18 +24,18 @@ export default {
   },
   computed: {},
   created() {
-    this.handleQueryList();
+    this.queryList(this.params, this.page);
   },
   methods: {
     //
-    async fetchList(params, page) {
+    async fetchList(prop, page) {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
-          ...params,
+          ...prop,
         });
         if (code === 200) {
           this.tableData = rows;
@@ -51,62 +51,30 @@ export default {
       }
     },
     // 查询操作
-    handleQueryList() {
+    queryList() {
       this.fetchList(this.params, this.page);
     },
     // 重置操作
-    handleResetList() {
+    resetList() {
       this.page = initPage();
       this.params = initParams(SearchColumns);
       this.fetchList(this.params, this.page);
     },
-    // 删除操作
-    async handleDeleteList(prop) {
-      try {
-        this.loading = true;
-        const { id } = prop;
-        const { code, msg } = await remove(id);
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.fetchList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        //
-      } finally {
-        this.loading = false;
-      }
-    },
     // 页大小变
-    handleSizeChange(prop) {
+    sizeChange(prop) {
       this.page.pageSize = prop;
       this.fetchList(this.params, this.page);
     },
     // 当前页变
-    handleCurrentChange(prop) {
+    currentChange(prop) {
       this.page.pageNum = prop;
       this.fetchList(this.params, this.page);
     },
-    // 打开新增drawer
-    handleOpenAddDrawer() {
-      console.log(this.$refs.AddDrawerFef);
-      const { setVisible } = this.$refs.AddDrawerFef;
-      setVisible(true);
-    },
-    // 打开查看drawer
-    async handleOpenSeeDrawer(prop) {
-      const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.SeeDrawerFef;
-      await setVisible(true);
-      await fetchItem(id);
-    },
-    // 打开编辑drawer
-    async handleOpenEditDrawer(prop) {
-      const { id } = prop;
-      const { setVisible, fetchItem } = this.$refs.EditDrawerFef;
-      await setVisible(true);
-      await fetchItem(id);
+    // 打开编辑dialog
+    async openEditDialog(prop) {
+      return;
+      const { open } = this.$refs.Editdialog;
+      await open(prop);
     },
   },
 };
@@ -118,42 +86,80 @@ export default {
     style="width: calc(100% - 24px); height: 100%; margin: 10px"
     :body-style="{ padding: 0 }"
   >
-    <see-drawer ref="SeeDrawerFef"></see-drawer>
-    <add-drawer ref="AddDrawerFef" @close="handleResetList"></add-drawer>
-    <edit-drawer ref="EditDrawerFef" @close="handleResetList"></edit-drawer>
-    <el-form :size="size" label-position="top" :model="params">
-      <el-row :gutter="24" style="padding: 0 20px">
-        <el-col
-          v-for="column in searchColumns"
-          :key="column.title"
-          :xl="4"
-          :lg="4"
-          :md="8"
-          :sm="12"
-          :xs="24"
-        >
-          <el-form-item :prop="column.key" :label="column.title">
-            <el-input
-              v-model="params[column.key]"
-              :placeholder="column.placeholder"
-            ></el-input>
-          </el-form-item>
+    <!-- <see-drawer ref="SeeDrawerFef"></see-drawer> -->
+    <!-- <add-drawer ref="AddDrawerFef" @close="resetList"></add-drawer> -->
+    <edit-dialog ref="Editdialog" @submit-success="resetList"></edit-dialog>
+    <el-form
+      :size="size"
+      :model="params"
+      label-width="auto"
+      label-position="right"
+      style="padding: 20px 0 0"
+    >
+      <el-row style="display: flex; flex-wrap: wrap">
+        <el-col :span="22">
+          <el-row :gutter="20" style="display: flex; flex-wrap: wrap">
+            <el-col
+              v-for="column in searchColumns"
+              :key="column.title"
+              :span="column.span || 6"
+            >
+              <el-form-item :prop="column.key" :label="column.title">
+                <el-input
+                  v-if="column.inputType === 'Input'"
+                  v-model="params[column.key]"
+                  :placeholder="column.placeholder"
+                  style="width: 100%"
+                ></el-input>
+                <el-switch
+                  v-if="column.inputType === 'Switch'"
+                  v-model="params[column.key]"
+                  active-value="1"
+                  inactive-value="0"
+                >
+                </el-switch>
+                <dr-popover-select
+                  v-if="column.inputType === 'PopoverSelect'"
+                  v-model="params[column.key]"
+                  :size="size"
+                  :source.sync="params"
+                  :title="column.title"
+                  :type="column.referName"
+                  :multiple="column.multiple"
+                  :readonly="column.readonly"
+                  :value-key="column.valueKey"
+                  :placeholder="column.placeholder"
+                  :data-mapping="column.dataMapping"
+                >
+                </dr-popover-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-col>
+        <el-col :span="1" :offset="1">
+          <el-row style="display: flex; flex-wrap: wrap">
+            <el-col :span="24" style="margin-bottom: 20px">
+              <el-button
+                circle
+                :size="size"
+                icon="el-icon-search"
+                @click="queryList(params, page)"
+              ></el-button>
+            </el-col>
+            <el-col :span="24">
+              <el-button
+                circle
+                :size="size"
+                icon="el-icon-refresh"
+                @click="resetList"
+              ></el-button>
+            </el-col>
+          </el-row>
         </el-col>
-        <el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24"> </el-col>
       </el-row>
     </el-form>
-    <el-row :gutter="24" style="padding: 0 20px">
-      <el-col :span="24">
-        <el-button :size="size" icon="el-icon-search" @click="handleQueryList"
-          >搜索</el-button
-        >
-        <el-button :size="size" icon="el-icon-refresh" @click="handleResetList"
-          >重置</el-button
-        >
-      </el-col>
-    </el-row>
     <el-table
-      @row-dblclick="handleOpenSeeDrawer"
+      @row-dblclick="openEditDialog"
       :data="tableData"
       :size="size"
       style="width: 100%; margin: 20px 0 0 0"
@@ -167,21 +173,10 @@ export default {
         :show-overflow-tooltip="column.showOverflowTooltip || true"
       >
       </el-table-column>
-      <el-table-column fixed="right" label="操作" width="120">
-        <template slot-scope="scope">
-          <el-button
-            @click.native.prevent="handleDeleteList(scope.row)"
-            type="text"
-            size="small"
-          >
-            删 除
-          </el-button>
-        </template>
-      </el-table-column>
     </el-table>
     <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
+      @size-change="sizeChange"
+      @current-change="currentChange"
       :total="page.total"
       :page-sizes="pageSizes"
       :page-size="page.pageSize"

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

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

+ 10 - 6
src/views/purchase/contract/add/index.vue

@@ -298,21 +298,25 @@ export default {
                   <span v-else> {{ scope.row[cColumn.key] }}</span>
                 </template>
               </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
+              <el-table-column fixed="right" label="操作" width="75">
                 <template slot="header" slot-scope="scope">
-                  <el-button :size="size" @click="rowAdd(params[tabName])">
-                    增 行
+                  <el-button
+                    circle
+                    icon="el-icon-plus"
+                    :size="size"
+                    @click="rowAdd(tabName)"
+                  >
                   </el-button>
                 </template>
                 <template slot-scope="scope">
                   <el-button
+                    circle
+                    icon="el-icon-minus"
+                    :size="size"
                     @click.native.prevent="
                       rowDelete(params[tabName], scope.$index)
                     "
-                    type="text"
-                    size="small"
                   >
-                    删行
                   </el-button>
                 </template>
               </el-table-column>

+ 8 - 8
src/views/purchase/contract/column.js

@@ -46,7 +46,7 @@ export const Columns = [
     title: "合同类型",
     inputType: "Select",
     require: true,
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_contract_type",
   },
   {
     key: "puMoneyYear",
@@ -70,7 +70,7 @@ export const Columns = [
     title: "供应商层级",
     inputType: "Select",
     require: true,
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_supplier_tier",
   },
   { key: "contractName", title: "合同名称", inputType: "Input", require: true },
   {
@@ -84,14 +84,14 @@ export const Columns = [
     title: "审批流程",
     inputType: "Select",
     require: true,
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_approve_flow",
   },
   {
     key: "consumableClass",
     title: "耗材类别",
     inputType: "Select",
     require: true,
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_consumable_class",
   },
   {
     key: "effectiveDate",
@@ -138,7 +138,7 @@ export const Columns = [
     title: "紧急程度",
     inputType: "Select",
     require: true,
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_emergency_degree",
   },
   { key: "project", title: "项目医院", inputType: "Input", require: true },
   {
@@ -151,7 +151,7 @@ export const Columns = [
     key: "deliveryType",
     title: "交货方式",
     inputType: "Select",
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_delivery_type",
   },
   {
     key: "source",
@@ -180,7 +180,7 @@ export const Columns = [
     key: "freightMethods",
     title: "运费承担方式",
     inputType: "Select",
-    referName: "sys_yes_no",
+    referName: "puarchase_contract_freight_methods",
   },
   {
     key: "signDate",
@@ -267,7 +267,7 @@ export const Columns = [
   { key: "area", title: "区域", inputType: "Input" },
   { key: "consigneePhone", title: "收货人联系方式", inputType: "Input" },
   {
-    key: "paymentAgreementName",
+    key: "paymentAgreement",
     title: "付款协议",
     inputType: "PopoverSelect",
     referName: "PAYAGREEMENT_PARAM",

+ 13 - 7
src/views/purchase/contract/edit/index.vue

@@ -326,19 +326,25 @@ export default {
                   <span v-else> {{ scope.row[cColumn.key] }}</span>
                 </template>
               </el-table-column>
-              <el-table-column fixed="right" label="操作" width="120">
+              <el-table-column fixed="right" label="操作" width="75">
                 <template slot="header" slot-scope="scope">
-                  <el-button :size="size" @click="rowAdd(tabName)">
-                    增 行
+                  <el-button
+                    circle
+                    icon="el-icon-plus"
+                    :size="size"
+                    @click="rowAdd(tabName)"
+                  >
                   </el-button>
                 </template>
                 <template slot-scope="scope">
                   <el-button
-                    @click.native.prevent="rowDelete(tabName, scope)"
-                    type="text"
-                    size="small"
+                    circle
+                    icon="el-icon-minus"
+                    :size="size"
+                    @click.native.prevent="
+                      rowDelete(params[tabName], scope.$index)
+                    "
                   >
-                    删行
                   </el-button>
                 </template>
               </el-table-column>

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

@@ -61,7 +61,7 @@ export default {
       this.queryList(this.params, this.page);
     },
     // 删除操作
-    async deleteList(prop) {
+    async deleteItem(prop) {
       try {
         this.loading = true;
         const { id } = prop;
@@ -138,7 +138,7 @@ export default {
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label-width="0">
             <el-button
               circle
@@ -186,7 +186,7 @@ export default {
             编 辑
           </el-button>
           <el-button
-            @click.native.prevent="deleteList(scope.row)"
+            @click.native.prevent="deleteItem(scope.row)"
             type="text"
             size="small"
           >

+ 20 - 13
src/views/purchase/task/column.js

@@ -4,36 +4,38 @@ export const TableColumns = [
   { key: "materialName", title: "物料名称" },
   // { key: "material", title: "物料" },
   { key: "materialDesc", title: "物料描述" },
-  { key: "manufacturerName", title: "生产厂家名称" },
+  { key: "manufacturerName", title: "生产厂家" },
   { key: "puQty", title: "采购数量" },
   {
     key: "priceinputType",
     title: "价格类型",
+    inputType: "Select",
     referName: "sys_price_inputType",
   },
-  { key: "puUnitName", title: "采购单位名称" },
+  { key: "puUnitName", title: "采购单位" },
   // { key: "id", title: "主键" },
   {
     key: "status",
     title: "状态",
+    inputType: "Select",
     referName: "purchase_task_status",
   },
   // { key: "manufacturer", title: "生产厂家" },
   // { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称" },
+  { key: "buyerName", title: "采购员" },
   // { key: "supplier", title: "建议供应商" },
-  { key: "supplierName", title: "建议供应商名称" },
+  { key: "supplierName", title: "建议供应商" },
   // { key: "puOrg", title: "采购组织" },
   {
     key: "puOrgName",
-    title: "采购组织名称",
+    title: "采购组织",
   },
   // { key: "currency", title: "币种" },
-  { key: "currencyName", title: "币种名称" },
+  { key: "currencyName", title: "币种" },
   { key: "billYpe", title: "交易类型" },
   { key: "source", title: "需求来源" },
   // { key: "customer", title: "收货客户" },
-  { key: "customerName", title: "收货客户名称" },
+  { key: "customerName", title: "收货客户" },
   // { key: "puUnit", title: "采购单位" },
 
   { key: "demandDate", title: "需求时间" },
@@ -41,19 +43,24 @@ export const TableColumns = [
   // { key: "demandPersonal", title: "需求人" },
   {
     key: "demandPersonalName",
-    title: "需求人名称",
+    title: "需求人",
   },
   // { key: "demandOrg", title: "需求组织" },
-  { key: "demandOrgName", title: "需求组织名称" },
+  { key: "demandOrgName", title: "需求组织" },
   // { key: "demandDept", title: "需求部门" },
-  { key: "demandDeptName", title: "需求部门名称" },
-  { key: "isBack", title: "是否退回" },
+  { key: "demandDeptName", title: "需求部门" },
+  {
+    key: "isBack",
+    title: "是否退回",
+    inputType: "Select",
+    referName: "sys_yes_no",
+  },
   { key: "baskCause", title: "退回原因" },
   { key: "backDate", title: "退回日期" },
   // { key: "assignSupplier", title: "指定供应商" },
-  { key: "assignSupplierName", title: "指定供应商名称" },
+  { key: "assignSupplierName", title: "指定供应商" },
   // { key: "unit", title: "单位" },
-  { key: "unitName", title: "单位名称" },
+  { key: "unitName", title: "单位" },
   // { key: "file", title: "附件" },
   // { key: "tenantId", title: "租户号" },
   // { key: "revision", title: "乐观锁" },

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

@@ -14,23 +14,30 @@ export default {
   computed: {},
   watch: {},
   methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    beforeOpenDoSome(prop) {
+    //
+    open(prop) {
+      this.visible = true;
       const documentIds = prop.map((item) => item.id);
       this.params.documentIds = documentIds;
     },
-    async handleComfire(prop) {
+    //
+    hide() {
+      this.visible = false;
+      this.params.baskCause = "";
+      this.params.documentIds = [];
+    },
+    //
+    async submit(prop) {
       try {
         this.loading = true;
         const { baskCause, documentIds } = prop;
         const { code, msg } = await DOCUMENTSRETURN({
-          baskCause: baskCause,
-          documentIds: documentIds,
+          baskCause,
+          documentIds,
         });
         if (code === 200) {
-          this.visible = false;
+          this.hide();
+          this.$emit("submit-success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -41,10 +48,6 @@ export default {
         this.loading = false;
       }
     },
-    hide() {
-      this.params.baskCause = "";
-      this.params.documentIds = [];
-    },
   },
   created() {},
   mounted() {},
@@ -53,7 +56,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog :visible.sync="visible" title="退回需求" @close="hide">
+  <el-dialog width="25%" :visible.sync="visible" title="退回需求" @close="hide">
     <el-alert
       title="请填写退单原因"
       type="info"
@@ -62,10 +65,10 @@ export default {
       style="margin-bottom: 10px"
     >
     </el-alert>
-    <el-input :size="size" v-model="params.baskCause"></el-input>
+    <el-input v-model="params.baskCause" :size="size"></el-input>
     <span slot="footer">
       <el-button :size="size" @click="visible = false">取 消</el-button>
-      <el-button :size="size" type="primary" @click="handleComfire(params)"
+      <el-button :size="size" type="primary" @click="submit(params)"
         >确 定</el-button
       >
     </span>

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

@@ -1,7 +1,7 @@
 <script>
 import { TableColumns } from "./column";
-import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 import { initColumns } from "@/utils/init";
+import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 export default {
   name: "FirstDirectPurchaseDialog",
   components: {},
@@ -35,10 +35,11 @@ export default {
           this.data = data;
           this.$notify.success({ title: msg });
         } else {
+          this.hide();
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
-        //
+        this.hide();
       } finally {
         this.loading = false;
       }
@@ -57,6 +58,7 @@ export default {
         const { code, msg } = await ADD(params);
         if (code === 200) {
           this.hide();
+          this.$emit("submit-success");
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -146,20 +148,9 @@ export default {
       </el-table>
       <div slot="footer" style="text-align: right; margin-top: 10px">
         <el-button :size="size" @click="hide">取 消</el-button>
-        <el-button :size="size" @click="submit">更 新</el-button>
+        <el-button :size="size" @click="submit">提 交</el-button>
       </div>
     </div>
-    <!-- <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
-    </el-pagination> -->
   </el-dialog>
 </template>
 

+ 27 - 19
src/views/purchase/task/index.vue

@@ -107,25 +107,14 @@ export default {
     },
     // 退回需求
     async openDocumentsReturnDialog(prop) {
-      const { setVisible, beforeOpenDoSome } = this.$refs.DocReturnDialog;
-      await setVisible(true);
-      await beforeOpenDoSome(prop);
+      const { open } = this.$refs.DocReturnDialog;
+      await open(prop);
     },
     // 转派
     async openModifyBuyerDialog(prop) {
       const { id } = prop;
-      const { setVisible, beforeOpenDoSome } = this.$refs.ModifyBuyerDialog;
-      await setVisible(true);
-      await beforeOpenDoSome(id);
-    },
-    // 导出
-    async useExport(prop, page) {
-      const { pageNum, pageSize } = page;
-      this.download(
-        "pu/order/generate/export",
-        { ...prop, pageNum, pageSize },
-        `KONG_${new Date().getTime()}.xlsx`
-      );
+      const { open } = this.$refs.ModifyBuyerDialog;
+      await open(id);
     },
     // 打开查看drawer
     async openSeeDialog(prop) {
@@ -138,6 +127,15 @@ export default {
       const { open } = this.$refs.FirstDirectDialog;
       await open(prop);
     },
+    // 导出
+    async useExport(prop, page) {
+      const { pageNum, pageSize } = page;
+      this.download(
+        "pu/order/generate/export",
+        { ...prop, pageNum, pageSize },
+        `KONG_${new Date().getTime()}.xlsx`
+      );
+    },
   },
 };
 </script>
@@ -149,9 +147,19 @@ export default {
     :body-style="{ padding: 0 }"
   >
     <see-dialog ref="SeeDialog"></see-dialog>
-    <first-direct-dialog ref="FirstDirectDialog"></first-direct-dialog>
-    <doc-return-dialog ref="DocReturnDialog"></doc-return-dialog>
-    <modify-buyer-dialog ref="ModifyBuyerDialog"></modify-buyer-dialog>
+    <first-direct-dialog
+      ref="FirstDirectDialog"
+      @submit-success="resetList"
+    ></first-direct-dialog>
+    <doc-return-dialog
+      ref="DocReturnDialog"
+      @submit-success="resetList"
+    ></doc-return-dialog>
+    <modify-buyer-dialog
+      ref="ModifyBuyerDialog"
+      @submit-success="resetList"
+    ></modify-buyer-dialog>
+    <el-backtop target=".el-scrollbar__wrap"></el-backtop>
     <el-form
       :size="size"
       :model="params"
@@ -235,7 +243,7 @@ export default {
             </dr-popover-tree-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label-width="0">
             <el-button
               circle

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

@@ -14,19 +14,34 @@ export default {
   computed: {},
   watch: {},
   methods: {
-    setVisible(prop) {
-      this.visible = prop;
-    },
-    beforeOpenDoSome(prop) {
+    //
+    open(prop) {
+      this.visible = true;
       this.params.id = prop;
     },
-    async handleComfire(prop) {
+    //
+    hide() {
+      this.visible = false;
+      this.params.id = "";
+      this.params.buyer = "";
+      this.params.buyerName = "";
+    },
+    //
+    async submit(prop) {
       try {
         this.loading = true;
-        const { code, msg } = await MODEIFYBUYER([prop]);
+        const { id, buyer, buyerName } = prop;
+        const { code, msg } = await MODEIFYBUYER([
+          {
+            id,
+            buyer,
+            buyerName,
+          },
+        ]);
         if (code === 200) {
+          this.hide();
+          this.$emit("submit-success");
           this.$notify.success({ title: msg });
-          this.visible = false;
         } else {
           this.$notify.warning({ title: msg });
         }
@@ -36,11 +51,6 @@ export default {
         this.loading = false;
       }
     },
-    hide() {
-      this.params.id = "";
-      this.params.buyer = "";
-      this.params.buyerName = "";
-    },
   },
   created() {},
   mounted() {},
@@ -49,7 +59,7 @@ export default {
 </script>
 
 <template>
-  <el-dialog :visible.sync="visible" title="转派" @close="hide">
+  <el-dialog width="25%" :visible.sync="visible" title="转派" @close="hide">
     <el-alert
       title="转派后,采购任务将会从您的采购任务清单中删除,转移到转派目标人员的已受理采购任务清单中,您确定要转派吗?"
       type="info"
@@ -77,7 +87,7 @@ export default {
     </el-form>
     <span slot="footer">
       <el-button :size="size" @click="visible = false">取 消</el-button>
-      <el-button :size="size" type="primary" @click="handleComfire(params)"
+      <el-button :size="size" type="primary" @click="submit(params)"
         >确 定</el-button
       >
     </span>

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

@@ -2,7 +2,7 @@
 import { TableColumns as Columns } from "../column";
 import { ITEM } from "@/api/business/purchase/task";
 import { initDicts, initParams } from "@/utils/init";
-
+console.log("initDicts(Columns)", initDicts(Columns));
 export default {
   name: "SeeDialog",
   dicts: initDicts(Columns),