Procházet zdrojové kódy

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

002201 před 2 roky
rodič
revize
01d04615a0

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

@@ -80,6 +80,15 @@ const documentsReturn = (data) => {
   });
 }
 
+// 采购订单退回
+const close = (data) => {
+  return request({
+    url: `/pu/order/close`,
+    method: "post",
+    data,
+  });
+}
+
 export default {
   list,
   details,
@@ -90,5 +99,6 @@ export default {
   remove,
   getPrice,
   documentsReturn,
+  close,
 
 }

+ 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',
   })
 }
 // 采购需求明细行编辑

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

+ 36 - 12
src/views/purchase/purchase-order/add/column.js

@@ -122,13 +122,13 @@ export const Columns = [
     key: "qty",
     title: "总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
   },
   {
     key: "originalQty",
     title: "原始总数量",
     inputType: "InputNumber",
-    config: { controlsPosition: "right" },
+    controlsPosition: "right",
   },
   { key: "money", title: "价税合计", inputType: "Input", },
   { key: "originalMoney", title: "原始总金额", inputType: "Input", },
@@ -210,7 +210,19 @@ export const Columns = [
   { key: "isUrgency", title: "紧急程度", inputType: "Checkbox", },
   { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox", },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
-  // { key: "agentName", title: "代理人名称", },
+  {
+    key: "agentName",
+    title: "代理人",
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {
+      agent: 'id',
+      agentName: 'name'
+    },
+    queryParams: () => ({}),
+    width: 200,
+  },
   { key: "isClose", title: "最终关闭", inputType: "Checkbox", },
   {
     key: "closeTime",
@@ -350,7 +362,13 @@ export const TabColumns = [
       { key: "manufacturer", title: "生产厂家代理人", inputType: "Input", width: 180 },
       { key: "isDrug", title: "物料药品属性", inputType: "Input", width: 180 },
       { key: "unit", title: "单位", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
+      },
       { key: "taxPrice", title: "含税单价", inputType: "Input", },
       { key: "money", title: "价税合计", inputType: "Input", },
       { key: "tax", title: "税率", inputType: "Input", },
@@ -359,11 +377,11 @@ export const TabColumns = [
       { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
       { key: "notaxMoney", title: "无税金额", inputType: "Input", },
       { key: "priceSource", title: "价格目录ID", inputType: "Input", },
-      { key: "isStorage", title: "入库关闭", inputType: "Input", },
-      { key: "isInvoice", title: "开票关闭", inputType: "Input", },
-      { key: "isArrival", title: "到货关闭", inputType: "Input", },
-      { key: "isPayment", title: "付款关闭", inputType: "Input", },
-      { key: "isGift", title: "赠品", inputType: "Input", width: 180 },
+      { key: "isStorage", title: "入库关闭", inputType: "Checkbox", },
+      { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", },
+      { key: "isArrival", title: "到货关闭", inputType: "Checkbox", },
+      { key: "isPayment", title: "付款关闭", inputType: "Checkbox", },
+      { key: "isGift", title: "赠品", inputType: "Checkbox", },
       {
         key: "warehouseName",
         title: "收货仓库", //WMS入库仓库
@@ -400,8 +418,8 @@ export const TabColumns = [
         width: 180
       },
 
-      { key: "isBatchLock", title: "批号锁定标识", inputType: "Input", },
-      { key: "isReplenishment", title: "补单标识", inputType: "Input", },
+      { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
+      { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
       { key: "isUrgency", title: "紧急标识", inputType: "Input", },
       { key: "originalQty", title: "原始数量", inputType: "Input", },
       { key: "originalMoney", title: "原始金额", inputType: "Input", },
@@ -453,7 +471,13 @@ export const TabColumns = [
         width: 180
       },
       { key: "specification", title: "规格", inputType: "Input", },
-      { key: "qty", title: "数量", inputType: "Input", },
+      {
+        key: "qty",
+        title: "数量",
+        inputType: "InputNumber",
+        controlsPosition: "right",
+        width: 120
+      },
       { key: "stroageQty", title: "累计到货主数量", inputType: "Input", width: 120 },
       { key: "stockQty", title: "累计入库主数量", inputType: "Input", width: 120 },
       { key: "invoiceQty", title: "累计开票主数量", inputType: "Input", width: 120 },

+ 71 - 36
src/views/purchase/purchase-order/add/index.vue

@@ -57,7 +57,6 @@ export default {
     "params": {
       handler(nVal, oVal) {
 
-
         // 组织变化
         if (nVal.puOrg != oVal.puOrg) {
           console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
@@ -94,6 +93,41 @@ export default {
     setVisible(prop) {
       this.visible = prop;
     },
+    // 复制赋值
+    async setCopyParams(id) {
+      console.log(id, 'iid-----------------------');
+      try {
+        const { code, msg, data } = await orderApi.details(id);
+
+        if (code === 200) {
+
+          this.params = {
+            ...data,
+            id: '',
+            code: '',
+            status: '0',
+            source: '3',
+          };
+
+          for (const key in this.params) {
+
+            if (Array.isArray(this.params[key])) {
+
+              this.params[key].forEach(v => {
+
+                v.id = '';
+
+              })
+            }
+          }
+
+        }
+      } catch (err) {
+        //
+      } finally {
+        // this.loading = false;
+      }
+    },
     // 增行
     addTableRow(prop) {
       for (const key in this.params) {
@@ -185,36 +219,36 @@ export default {
     },
     // 保存并新增
     async handleSubmit() {
-      // this.$refs["orderAddForm"].validate(async (valid) => {
-      //   if (valid) {
-      try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await orderApi.create({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
-        if (code === 200) {
-          this.$notify.success({ title: msg });
-          this.setVisible(false);
+      this.$refs["orderAddForm"].validate(async (valid) => {
+        if (valid) {
+          try {
+            const createById = this.params.buyer;
+            const createByName = this.params.buyerName;
+            const updateById = this.$store.state.user.id;
+            const updateByName = this.$store.state.user.name;
+            const { code, msg } = await orderApi.create({
+              createById,
+              createByName,
+              updateById,
+              updateByName,
+              ...this.params,
+            });
+            if (code === 200) {
+              this.$notify.success({ title: msg });
+              this.setVisible(false);
+            } else {
+              this.$notify.warning({ title: msg });
+            }
+          } catch (err) {
+            this.$notify.error({ title: "error", message: err });
+          } finally {
+            // this.setVisible(false);
+          }
         } else {
-          this.$notify.warning({ title: msg });
+          console.log("error submit!!");
+          return false;
         }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        // this.setVisible(false);
-      }
-      //   } else {
-      //     console.log("error submit!!");
-      //     return false;
-      //   }
-      // });
+      });
     },
     // 子表参照改变之后
     handleReferChange(val, source, type) {
@@ -229,7 +263,7 @@ export default {
       }
     },
 
-    // 子表input
+    // 子表inputNumber
     handleInputChange(row, type) {
       console.log(type, 'type');
       // 物料数量变化----询价
@@ -278,9 +312,9 @@ export default {
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
             <el-button size="mini" type="danger" @click="handleSava">保存</el-button>
-            <el-button size="mini" type="info" @click="handleSubmit">
+            <!-- <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
-            </el-button>
+            </el-button> -->
           </div>
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
@@ -302,7 +336,7 @@ export default {
               </el-input>
 
               <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
@@ -359,7 +393,7 @@ export default {
                   </el-tag>
                   <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%" @change="handleInputChange(scope.row, cColumn.key)">
+                    size="mini" style="width: 100%">
                   </el-input>
 
                   <!--  -->
@@ -371,8 +405,9 @@ export default {
                   </dr-popover-select>
 
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
+                    :controls-position="cColumn.controlsPosition" :placeholder="cColumn.placeholder"
+                    @change="handleInputChange(scope.row, cColumn.key)" :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled" size="mini" style="width: 100%">
                   </el-input-number>
 
                   <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"

+ 83 - 32
src/views/purchase/purchase-order/edit/index.vue

@@ -1,18 +1,19 @@
 <script>
-import { Columns, TabColumns } from "../add/column";
+// import { Columns, TabColumns } from "../add/column";
+import { editColumns, editTabColumns, forbidden, SelectColumns } from "./initColumn";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
 
-const NewColumns = initColumns(Columns);
-const NewTabColumns = TabColumns.map((element) => ({
-  ...element,
-  tableColumns: initColumns(element.tableColumns),
-}));
+// const NewColumns = initColumns(Columns);
+// const NewTabColumns = TabColumns.map((element) => ({
+//   ...element,
+//   tableColumns: initColumns(element.tableColumns),
+// }));
 // 
-const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
-NewTabColumns.forEach(column => {
-  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
+// const SelectColumns = NewColumns.filter(column => column.inputType === 'Select')
+// NewTabColumns.forEach(column => {
+//   SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+// });
 
 export default {
   name: "EditPurchaseOrderDrawer",
@@ -25,22 +26,22 @@ export default {
       size: "mini",
       visible: false,
       loading: false,
-      columns: NewColumns,
-      rules: initRules(NewColumns),
+      columns: editColumns,
+      rules: initRules(editColumns),
       params: {
-        ...initParams(NewColumns),
+        ...initParams(editColumns),
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
 
-      tabColumns: NewTabColumns,
+      tabColumns: editTabColumns,
       tabName: "puOrderItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
-      this.tabColumns = NewTabColumns.filter((element) =>
+      this.tabColumns = editTabColumns.filter((element) =>
         newProp === "1" ? element.key !== "puOrderItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
@@ -78,6 +79,13 @@ export default {
         this.params[key2][index].materialCode = item.materialCode;
       })
     },
+    // 判断属性是否禁用
+    handleIsForbidden(status) {
+      console.log(status);
+      let { editColumns, editTabColumns } = forbidden(status != '2');
+      this.columns = editColumns;
+      this.tabColumns = editTabColumns;
+    },
     // 查询详细
     async fetchItem(prop) {
       try {
@@ -85,7 +93,8 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          console.log(this.params, 'this.params----------');
+          console.log(this.params, 'this.params----------123');
+          this.handleIsForbidden(this.params.status);
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -166,7 +175,40 @@ export default {
     },
     beforeOpen() {
     },
-    handleReferChange(val, source) { },
+    // 子表参照改变之后
+    handleReferChange(val, source, type) {
+      console.log(val, 'val');
+      console.log(source, 'source');
+      console.log(type, 'type');
+
+      // 触发物料参照
+      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+
+        this.handleGetPrice();
+      }
+    },
+    // 子表inputNumber
+    handleInputChange(row, type) {
+      console.log(type, 'type');
+      // 物料数量变化----询价
+      if (type == 'qty' && row.material) {
+        this.handleGetPrice();
+      }
+    },
+    // 询价 getPrice
+    async handleGetPrice() {
+      try {
+        // let { puOrg, priceType, customer, assignSupplier, material, } = data;
+        let { code, data } = await orderApi.getPrice({ ...this.params })
+        if (code == 200) {
+          this.params = data;
+        }
+      } catch (error) {
+
+      } finally {
+
+      }
+    },
     // 判断修订还是编辑
     handleIsRevise(status) {
       return status == '2';
@@ -175,6 +217,8 @@ export default {
   created() {
     console.log("EDIT CREATED");
     console.log(this.params, 'this.params');
+
+
   },
   mounted() { },
   destroyed() { },
@@ -201,7 +245,7 @@ export default {
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
           </div>
         </div>
-        <el-row  style="display:flex; flex-wrap: wrap;">
+        <el-row style="display:flex; flex-wrap: wrap;">
           <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.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
@@ -210,14 +254,15 @@ export default {
               <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]" size="mini"
                 :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
                 :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
+                :disabled="column.disabled" :query-params="column.queryParams(params)">
               </dr-popover-select>
               <el-input v-if="column.inputType === '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.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :max="handleIsRevise(params.status) ? params[column.key] : 'Infinity'"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
@@ -226,8 +271,8 @@ export default {
                   :value="item.value">
                 </el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
+              <el-select v-if="column.inputType === '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>
@@ -242,8 +287,8 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
                 true-label="Y" false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
-                action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
+              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled"
+                drag action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
                 <div class="el-upload__text">
                   将文件拖到此处,或<em>点击上传</em>
@@ -285,9 +330,9 @@ export default {
 
                   <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
                     :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)" size="mini"
-                    @change="handleReferChange">
+                    :disabled="cColumn.disabled" :type="cColumn.referName" :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" size="mini" @change="handleReferChange">
                   </dr-popover-select>
 
                   <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
@@ -298,18 +343,24 @@ export default {
                     </el-option>
                   </el-select>
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N">
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" true-label="Y" false-label="N">
                   </el-checkbox>
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition"
+                    :max="handleIsRevise(params.status) ? scope.row[cColumn.key] : 'Infinity'"
+                    @change="handleInputChange(scope.row, cColumn.key)" :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="
+                  <el-button  v-if="params.source == '3'&& !handleIsRevise(params.status)" @click.native.prevent="
                     delTableRow(params[tabName], scope.$index)
                     " type="text" size="small">
                     删行
@@ -320,7 +371,7 @@ export default {
           </el-tab-pane>
         </el-tabs>
         <el-row style="position: absolute; top: 20px; right: 20px">
-          <el-button :size="size" @click="addTableRow(params[tabName])">增行</el-button>
+          <el-button v-if="params.source == '3'&& !handleIsRevise(params.status)" :size="size" @click="addTableRow(params[tabName])">增行</el-button>
         </el-row>
       </el-card>
     </el-form>

+ 80 - 0
src/views/purchase/purchase-order/edit/initColumn.js

@@ -0,0 +1,80 @@
+import { Columns, TabColumns } from "../add/column";
+import { initColumns, initParams } from "@/utils/init";
+
+
+export const editColumns = initColumns(Columns);
+
+export const editTabColumns = TabColumns.map((element) => ({
+  ...element,
+  tableColumns: initColumns(element.tableColumns),
+}));
+
+export const SelectColumns = editColumns.filter(column => column.inputType === 'Select')
+
+editTabColumns.forEach(column => {
+
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
+
+});
+
+
+
+// 禁用项
+export const forbidden = (isEdit) => {
+
+  console.log(isEdit, 'isEdit');
+  if (isEdit) {
+    console.log('编辑');
+    // 编辑
+    editColumns.forEach(item => {
+      item.disabled = false;
+      item.readonly = false;
+    })
+
+    editTabColumns.forEach(item => {
+
+      item.tableColumns.forEach(t => {
+        t.disabled = false;
+        t.readonly = false;
+      })
+    })
+  } else {
+    console.log('修订');
+    // 修订
+    editColumns.forEach(item => {
+
+      if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
+        item.key == 'supplierContactsName' || item.key == 'agentName' || item.key == 'isInvoice' ||
+        item.key == 'rebateMoney') {
+        item.disabled = false;
+        item.readonly = false;
+      } else {
+        item.disabled = true;
+        item.readonly = true;
+      }
+    })
+
+    editTabColumns.forEach(item => {
+
+      item.tableColumns.forEach(t => {
+
+        if (t.key == 'unit' || t.key == 'qty' ||
+          t.key == 'place' || t.key == 'arrivalDatePlan' || t.key == 'storageCondition' ||
+          t.key == 'carriageCondition' || t.key == 'customerName' || t.key == 'isBatchLock' ||
+          t.key == 'isReplenishment' || t.key == 'originalQty' || t.key == 'originalMoney'
+        ) {
+
+          t.disabled = false;
+          t.readonly = false;
+        } else {
+          t.disabled = true;
+          t.readonly = true;
+        }
+      })
+    })
+
+  }
+
+  return { editColumns, editTabColumns }
+
+}

+ 84 - 18
src/views/purchase/purchase-order/index.vue

@@ -10,6 +10,7 @@ import {
   initColumns,
   initDicts,
 } from "@/utils/init";
+import { finished } from "stream";
 
 const NewColumns = initColumns(TableColumns);
 const NewTabColumns = TabColumns.map((element) => ({
@@ -55,7 +56,6 @@ export default {
   },
   computed: {
     showSearchColumns() {
-      console.log(this.searchColumns, 'this.searchColumns');
       return this.isSimpleSearch
         ? this.searchColumns.slice(0, 4)
         : this.searchColumns;
@@ -75,8 +75,6 @@ export default {
           this.page.total = total;
           this.tableData = rows;
           this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -117,9 +115,23 @@ export default {
     },
     handleTabClick() { },
     // 新增
-    handleOpenAddDrawer() {
-      const { setVisible } = this.$refs.addDrawerFef;
+    handleOpenAddDrawer(copyVal) {
+      const { setVisible, setCopyParams } = this.$refs.addDrawerFef;
       setVisible(true);
+
+      copyVal.id && copyVal.id != '' && setCopyParams(copyVal.id);
+    },
+    // 复制
+    handleCopy() {
+
+      // let rowDetails = {
+      //   ... this.checkedList[0],
+      //   id: '',
+      //   code: '',
+      //   status: '0',
+      //   source: '3',
+      // };
+      this.handleOpenAddDrawer(this.checkedList[0]);
     },
     // 查看
     async handleOpenSeeDrawer(row) {
@@ -146,8 +158,6 @@ export default {
             this.tabTableDatas[key] = data[key];
           }
           this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -163,10 +173,7 @@ export default {
         console.log(id, 'id');
         const { code, msg } = await orderApi.remove(id);
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.fetchList(this.params, this.page);
-        } else {
-          this.$notify.warning({ title: msg });
         }
       } catch (err) {
         //
@@ -176,7 +183,21 @@ export default {
     },
     // 提交
     async handleSubmit(row) {
+      try {
+
+        this.loading = true;
+
+        let { code } = await orderApi.submit({ puOrderId: row.id });
+
+        if (code === 200) {
+          this.fetchList(this.params, this.page);
+        }
+
+      } catch (error) {
 
+      } finally {
+        this.loading = false;
+      }
     },
     // 判断“退回”按钮
     judgeIsAllSendBack() {
@@ -209,9 +230,53 @@ export default {
         this.loading = false;
       }
     },
+    // 判断是否满足整单关闭
+    judgeIsAllClose() {
+
+      if (this.checkedList.length == 1) {
+
+        if (this.checkedList[0].status == 0) {
+          // 未审批状态下整单关闭
+
+          return false
+        }
+      }
+      return true;
+
+    },
+    // 整单关闭
+    async handleAllClose() {
+      // 未审批状态下整单关闭
+      try {
+
+        this.loading = true;
+
+        let puOrderIds = this.checkedList.map(order => {
+
+          return order.id;
+
+        })
+
+        let { code } = await orderApi.close({ puOrderIds });
+
+        if (code === 200) {
+
+          this.fetchList(this.params, this.page);
+
+        }
+
+      } catch (error) {
+
+      } finally {
+        this.loading = false;
+      }
+    },
     handleSelect(selection, row) {
+
       this.checkedList = selection;
+
       console.log(this.checkedList, 'this.checkedList');
+
     },
 
   },
@@ -255,20 +320,21 @@ export default {
         <el-button-group style="margin-left: 10px">
           <el-button size="mini" type="danger" @click="handleOpenAddDrawer"
             v-hasPermi="['material:order:add']">新增</el-button>
-          <el-button size="mini">复制</el-button>
+          <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
 
         </el-button-group>
 
-        <el-button-group style="margin-left: 10px">
+        <!-- <el-button-group style="margin-left: 10px">
           <el-button size="mini" @click="handleAllSendBack" :key="checkedList.length"
             :disabled="judgeIsAllSendBack()">整单退回</el-button>
-        </el-button-group>
+        </el-button-group> -->
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini">采购退货</el-button>
-          <el-button size="mini">整单关闭</el-button>
-          <el-button size="mini">附件管理</el-button>
-          <el-button size="mini">单据追溯</el-button>
+          <!-- <el-button size="mini">采购退货</el-button> -->
+          <el-button size="mini" @click="handleAllClose" :key="checkedList.length"
+            :disabled="judgeIsAllClose()">整单关闭</el-button>
+          <!-- <el-button size="mini">附件管理</el-button>
+          <el-button size="mini">单据追溯</el-button> -->
         </el-button-group>
       </el-col>
     </el-row>
@@ -295,7 +361,7 @@ export default {
           <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)"
             v-hasPermi="['material:order:remove']">删除</el-button>
           <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
-            @click.stop="handleSubmit(scope.row)">提交</el-button>
+            v-hasPermi="['material:order:toOa']" @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>
       </el-table-column>
 

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

@@ -112,7 +112,7 @@ export default {
               </el-input>
 
               <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
+                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
                 :clearable="column.clearable" disabled style="width: 100%">
               </el-input-number>
               <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" disabled size="mini"
@@ -178,7 +178,7 @@ export default {
                   </dr-popover-select>
 
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
+                    :controls-position="cColumn.controlsPosition" :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" disabled size="mini" style="width: 100%">
                   </el-input-number>
 

+ 2 - 2
vue.config.js

@@ -42,10 +42,10 @@ module.exports = {
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
-        // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
+        target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
-        target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",