|
@@ -287,35 +287,38 @@ export default {
|
|
|
if (prop.length === 1) {
|
|
|
this.$alert("订单行不允许为空", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
- callback: (action) => {
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: `action: ${ action }`
|
|
|
- // });
|
|
|
- },
|
|
|
+ callback: (action) => {},
|
|
|
});
|
|
|
- } else {
|
|
|
- for (const key in this.params) {
|
|
|
- // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
|
|
|
- if (key === "puOrderItemList") {
|
|
|
- this.params[key].forEach((item, index) => {
|
|
|
- let flag = key === "puOrderItemList" ? "rowNo" : "rowno";
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- if (item[flag] && item[flag] === row[delNo]) {
|
|
|
- item.id
|
|
|
- ? (item["delFlag"] = "2")
|
|
|
- : this.params[key].splice(index, 1);
|
|
|
- }
|
|
|
- });
|
|
|
+ // 编辑 非手工 数量为0 不允许删除
|
|
|
+ const { source } = this.params;
|
|
|
+ if (!this.handleIsRevise() && source != "3" && row.qty == 0) {
|
|
|
+ this.$notify.warning("数量为0,不可删除当前行");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- // this.params[key][index].id ?
|
|
|
- // (this.params[key][index]['delFlag'] = '2') :
|
|
|
- // this.params[key].splice(index, 1);
|
|
|
- }
|
|
|
- }
|
|
|
+ for (const key in this.params) {
|
|
|
+ // if (key === "puOrderItemList" || key === "puOrderExecuteList") {
|
|
|
+ if (key === "puOrderItemList") {
|
|
|
+ this.params[key].forEach((item, index) => {
|
|
|
+ let flag = key === "puOrderItemList" ? "rowNo" : "rowno";
|
|
|
|
|
|
- await this.handleGetPrice();
|
|
|
+ if (item[flag] && item[flag] === row[delNo]) {
|
|
|
+ item.id
|
|
|
+ ? (item["delFlag"] = "2")
|
|
|
+ : this.params[key].splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // this.params[key][index].id ?
|
|
|
+ // (this.params[key][index]['delFlag'] = '2') :
|
|
|
+ // this.params[key].splice(index, 1);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ await this.handleGetPrice();
|
|
|
},
|
|
|
// 取消
|
|
|
handleCancel() {
|