浏览代码

采购需求单子表删行,编辑功能完善

黄梓星 2 年之前
父节点
当前提交
1bf02fe31e

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

@@ -16,6 +16,14 @@ export function addDemand(data) {
     data: data
   })
 }
+// 采购需求单编辑
+export function editDemand(data) {
+  return request({
+    url: `/pu/demand/edit`,
+    method: 'put',
+    data: data
+  })
+}
 // 采购需求单基本信息详情
 export function getDemandDetail(id) {
   return request({

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

@@ -483,7 +483,7 @@
 </template>
 
 <script>
-import {addDemand,getDemandDetail, getDemandSonDetail} from '@/api/purchase/purchaseDemand.js'
+import {addDemand,getDemandDetail, getDemandSonDetail, editDemand} from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'addDemandList',
   props: ['pageStu','row', 'disable'],
@@ -541,12 +541,12 @@ export default {
           }
         })
       } else if (this.pageStu == 'edit') {
-        // editAddress(this.basicForm).then(res => {
-        //   if (res.code === 200) {
-        //     this.$modal.msgSuccess("编辑成功");
-        //     this.back()
-        //   }
-        // })
+        editDemand(this.basicForm).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("编辑成功");
+            this.back()
+          }
+        })
       }
     },
     submit() {},
@@ -651,6 +651,9 @@ export default {
     },
     delLine(row) {
       console.log('删除行:', row)
+      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+        return item.id !== row.id
+      })
     },
     back() {
       this.$emit('jugislist', true)

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

@@ -40,12 +40,6 @@
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
-            <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
             <el-form-item label="是否已处理需求">
               <el-select v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
                 <el-option
@@ -151,6 +145,12 @@
             />
             </el-form-item>
           </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="" label-width="20px">
+              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>