Procházet zdrojové kódy

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

002390 před 2 roky
rodič
revize
5867d8fd80

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

@@ -45,6 +45,14 @@ export function cancelAuditSummary(id) {
     method: 'get',
   })
 }
+// 采购需求汇总编辑
+export function editSummaryList(data) {
+  return request({
+    url: `/pu/demand/summary/edit`,
+    method: 'post',
+    data: data
+  })
+}
 // 采购需求汇总明细行关闭
 export function shutDownSummary(id) {
   return request({

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

@@ -24,6 +24,14 @@ export function editDemand(data) {
     data: data
   })
 }
+// 采购需求单提交
+export function submitDemand(data) {
+  return request({
+    url: `/pu/demand/submit`,
+    method: 'POST',
+    data: data
+  })
+}
 // 采购需求单基本信息详情
 export function getDemandDetail(id) {
   return request({

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

@@ -282,8 +282,8 @@
     
       <el-card>
         <div class="btn_grooup">
-          <el-button type="primary" size="small">编辑</el-button>
-          <el-button type="primary" size="small">保存</el-button>
+          <el-button type="primary" size="small" @click="editList">编辑</el-button>
+          <el-button type="primary" size="small" @click="saveList">保存</el-button>
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
           <el-button type="primary" size="small" @click="audits">审核</el-button>
@@ -334,16 +334,32 @@
           <el-table-column label="最小订货量" align="center" prop="minOrder"/>
           <el-table-column label="最小批量" align="center" prop="minBatch"/>
           <el-table-column label="人工调整数" align="center" prop="artificialAdjust"/>
-          <el-table-column label="修改原因" align="center" prop="modifyReason"/>
+          <el-table-column label="修改原因" align="center" prop="modifyReason">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
+            </template>
+          </el-table-column>
           <el-table-column label="建议采购量" align="center" prop="suggestionPurchase"/>
           <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty"/>
-          <el-table-column label="最终采购量" align="center" prop="finalBuyQty"/>
+          <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
+            </template>
+          </el-table-column>
           <el-table-column label="二级品类" align="center" prop="code"/>
           <el-table-column label="三级品类" align="center" prop="code"/>
           <el-table-column label="四级品类" align="center" prop="code"/>
           <el-table-column label="单据状态" align="center" prop="status"/>
-          <el-table-column label="采购员" align="center" prop="buyerName"/>
-          <el-table-column label="默认采购组织" align="center" prop="code"/>
+          <el-table-column label="采购员" align="center" prop="buyerName">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.buyerName"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName">
+            <template slot-scope="scope">
+                <el-input :disabled="lineDisable" v-model="scope.row.purchaseOrgName"/>
+            </template>
+          </el-table-column>
           <el-table-column label="有效期" align="center" prop="validityPeriod"/>
           <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit"/>
           <el-table-column label="业务类型" align="center" prop="businessType"/>
@@ -391,7 +407,7 @@
 <script>
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary } from '@/api/purchase/DemandSummary.js'
+import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
   components: {
@@ -430,6 +446,7 @@ export default {
       total: 0,
       rowDetail: {},
       disable: false,
+      lineDisable: true,
       ids: [],
       allSelection: [],
     }
@@ -474,6 +491,19 @@ export default {
     drop() {
       this.expanded = !this.expanded
     },
+    editList() {
+      console.log('Lists`````',this.tableList)
+      this.lineDisable = false
+    },
+    saveList() {
+      editSummaryList(this.tableList).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("保存成功");
+          this.lineDisable = true
+          this.getList(this.queryParams)
+        }
+      })
+    },
     confirms() {
       if (this.ids.length == 0) {
         this.$modal.msgWarning("请选中至少一条数据");
@@ -541,4 +571,10 @@ export default {
 .lines {
   margin-top: 0;
 }
+.hang {
+  margin: auto;
+}
+.hang ::v-deep .el-form-item__content{
+  margin-left: 0px !important;
+}
 </style>

+ 20 - 7
src/views/purchase/PurchaseDemandList/add.vue

@@ -438,12 +438,15 @@
   </el-form>
 
     <div class="btn_group">
-      <el-col :span="1.5" style="margin: 0 10px;">
+      <el-col :span="1.5">
+        <el-button type="primary" size="small" plain @click="copy" v-if="pageStu == 'check'">复制</el-button>
+      </el-col>
+      <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="save" v-if="pageStu == 'add' || pageStu == 'edit'">保存</el-button>
       </el-col>
-      <!-- <el-col :span="1.5" style="margin: 0 10px;">
-        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'edit'">提交</el-button>
-      </el-col> -->
+      <el-col :span="1.5" style="margin: 0 10px;">
+        <el-button type="primary" size="small" plain @click="submit" v-if="pageStu == 'check'">提交</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
@@ -458,7 +461,7 @@
 <script>
 import Reserved from './reserved.vue'
 import Refers from './refers.vue'
-import {addDemand,getDemandDetail, getDemandSonDetail, editDemand} from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand } from '@/api/purchase/purchaseDemand.js'
 // 用于回显参照框数据
 import {getRefer} from '@/api/purchase/basic.js'
 export default {
@@ -528,6 +531,9 @@ export default {
     }
   },
   methods: {
+    copy() {
+
+    },
     save() {
       if(this.pageStu == 'add') {
         addDemand(this.basicForm).then(res => {
@@ -545,7 +551,14 @@ export default {
         })
       }
     },
-    submit() {},
+    submit() {
+      submitDemand(this.basicForm).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.back()
+        }
+      })
+    },
     // 增行
     addLine() {
       const newLine = {
@@ -702,7 +715,7 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     chooseCustomer () {
-      this.referCondition.type = ''
+      this.referCondition.type = 'CUSTOMER_PARAM'
       this.referCondition.search = ''
       this.referCondition.isPage = true
       this.referCondition.title = '选择客户'