Forráskód Böngészése

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

002390 2 éve
szülő
commit
79e3234e94

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

@@ -59,4 +59,12 @@ export function shutDownSummary(id) {
     url: `/pu/demand/item/summary/shutDown/${id}`,
     method: 'get',
   })
+}
+// 采购需求明细行编辑
+export function editSummaryMx(data) {
+  return request({
+    url: `/pu/demand/item/summary/detail/edit`,
+    method: 'post',
+    data: data
+  })
 }

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

@@ -3,7 +3,8 @@
     <el-card>
       <span>采购需求汇总详情</span>
       <div class="btn_grooup">
-        <el-button type="primary" size="small">编辑</el-button>
+        <el-button type="primary" size="small" @click="editLine">编辑</el-button>
+        <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>
         <el-button type="primary" size="small">确定</el-button>
         <el-button type="primary" size="small" @click="closeLine">行关闭</el-button>
         <el-button type="primary" size="small">重取批量</el-button>
@@ -36,8 +37,30 @@
         <el-table-column label="业务备注" align="center" prop="remark"/>
         <el-table-column label="有效期" align="center" prop="expiry"/>
         <el-table-column label="要求交货日期" align="center" prop="deliveryDate"/>
-        <el-table-column label="紧急标识" align="center" prop="isUrgency"/>
-        <el-table-column label="补单标识" align="center" prop="isReplenishment"/>
+        <el-table-column label="紧急标识" align="center" prop="isUrgency">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isUrgency"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="补单标识" align="center" prop="isReplenishment">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isReplenishment"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
         <el-table-column label="需求单单号" align="center" prop="code"/>
         <el-table-column label="供应仓库" align="center" prop="lastWarehouseName"/>
         <el-table-column label="供应货位" align="center" prop="lastAllocationName"/>
@@ -59,7 +82,18 @@
         <el-table-column label="最小批量" align="center" prop="minBatch"/>
         <el-table-column label="业务部门" align="center" prop="businessDeptName"/>
         <el-table-column label="需求部门" align="center" prop="demandDeptName"/>
-        <el-table-column label="批号锁定标识" align="center" prop="isBatchLock"/>
+        <el-table-column label="批号锁定标识" align="center" prop="isBatchLock">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.isBatchLock"
+              :disabled="lineDisable"
+              active-value="Y"
+              inactive-value="N"
+              active-color="#13ce66"
+              inactive-color="#a1a3a9">
+            </el-switch>
+          </template>
+        </el-table-column>
         <el-table-column label="采购需求单审批人" align="center" prop="approveName"/>
         <el-table-column label="需求单审批时间" align="center" prop="approverFinishTime"/>
         <el-table-column label="需求单提交时间" align="center" prop="createTime"/>
@@ -83,7 +117,7 @@
 </template>
 
 <script>
-import {getSummaryDetail, shutDownSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryDetail, shutDownSummary, editSummaryMx } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'checkDemandSummary',
   props: ['pageStu','row', 'disable'],
@@ -93,8 +127,12 @@ export default {
   },
   data() {
     return{
+      // 不能直接改变props传来的值
+      sonPageStu: this.pageStu,
+      sonDisable: this.disable,
       tableList: [],
-      ids: []
+      ids: [],
+      lineDisable: true,
     }
   },
   created() {
@@ -127,6 +165,19 @@ export default {
         }
       })
     },
+    editLine() {
+      console.log('sonList`````', this.tableList)
+      this.lineDisable = false
+    },
+    saveLine() {
+      editSummaryMx(this.tableList).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("保存成功");
+          this.lineDisable = true
+          this.getDetails(this.row)
+        }
+      })
+    },
     // 行关闭
     closeLine() {
       if (this.ids.length == 0) {

+ 11 - 10
src/views/purchase/DemandSummary/index.vue

@@ -240,7 +240,7 @@
       <el-card>
         <div class="btn_grooup">
           <el-button type="primary" size="small" @click="editList">编辑</el-button>
-          <el-button type="primary" size="small" @click="saveList">保存</el-button>
+          <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
           <el-button type="primary" size="small" @click="audits">审核</el-button>
@@ -308,16 +308,18 @@
           <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
           <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
           <el-table-column label="单据状态" align="center" prop="status"/>
-          <el-table-column label="采购员" align="center" prop="buyerName" width="120px">
+          <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
-                <el-input readonly size="small" v-model="scope.row.buyerName">
+                <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
                   <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
           <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.purchaseOrgName"/>
+                <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
+                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+                </el-input>
             </template>
           </el-table-column>
           <el-table-column label="有效期" align="center" prop="validityPeriod"/>
@@ -630,8 +632,11 @@ export default {
         console.log('选择进了吗',this.tableList)
         this.tableList[this.tableIndex].buyer = selection[0].code
         this.tableList[this.tableIndex].buyerName = selection[0].name
-        this.isUpdate = !this.isUpdate
-        // this.$set(this.tableList[this.tableIndex - 1],  buyerName, selection[0].name)
+      }
+      if (this.referConditionMx.title == '默认采购组织') {
+        console.log('选择进了吗',this.tableList)
+        this.tableList[this.tableIndex].purchaseOrg = selection[0].id
+        this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
       }
     },
     // 搜索区树形选择
@@ -655,10 +660,6 @@ export default {
     },
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {
-      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", index)
-      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", type)
-      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", isPage)
-      console.log("🚀 ~ file: index.vue:653 ~ chooseSon ~ index:", title)
       this.tableIndex = index
       this.referConditionMx.type = type
       this.referConditionMx.isPage = isPage

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

@@ -579,6 +579,7 @@ export default {
         status: '0',
         customer: '',
         customerName: '',
+        customerCode: '',
         customerPrincipal: '',
         demandPersonal: '',
         demandDept: '',
@@ -871,6 +872,7 @@ export default {
         this.customerOptions = selection
         this.basicForm.customer = selection[0].id
         this.basicForm.customerName = selection[0].name
+        this.basicForm.customerCode = selection[0].code
       }
       if(this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection