linwenxin 1 éve
szülő
commit
3d7f7d05c7

+ 7 - 0
src/api/workOrderPool.js

@@ -269,6 +269,13 @@ export function orderPartsApplyRecord(params) {
     params
   })
 }
+export function orderPartsApplyItemDel(params) {
+  return request({
+    url: `/order/parts/apply/item/del`,
+    method: 'post',
+    params
+  })
+}
 
 export function orderPartsApplyItemModify(data) {
   return request({

+ 3 - 1
src/components/template/editTable.js

@@ -72,7 +72,9 @@ export default {
               }}>{attributes?.editText || '编辑'}</el-button>}
               {setShowElement(attributes?.isDel, { row, column, index }) && <el-button type="text" onClick={async () => {
                 if (funs.delete) {
-                  funs.delete({ row, column, index })
+                  funs.delete({ row, column, index }, function(){
+                    tableData.splice(index, 1)
+                  })
                 } else {
                   tableData.splice(index, 1)
                 }

+ 11 - 2
src/views/workOrder/workOrderPool/detailModule/PartsApplication/formModule.vue

@@ -9,7 +9,7 @@
 
 <script>
 import editTable from "@/components/template/editTable.js"
-import { orderPartsApplyItemModify, orderPartsApplyCancel, orderPartsApplyEnd } from "@/api/workOrderPool.js";
+import { orderPartsApplyItemModify, orderPartsApplyCancel, orderPartsApplyEnd, orderPartsApplyItemDel } from "@/api/workOrderPool.js";
 export default {
   props: {
     id: {
@@ -157,7 +157,16 @@ export default {
                     message: '保存成功'
                   })
                 })
-              }
+              },
+              delete:({ row, column, index },cb)=>{
+                orderPartsApplyItemDel({...row}).then(res=>{
+                  this.$message({
+                    type: 'success',
+                    message: '删除成功'
+                  })
+                  cb && cb()
+                })
+              },
             })
           }
         },