1.完成新增盘点单页面功能

feature-order-fix
x_z 2 years ago
parent 6645e2ef42
commit af40695ede

@ -42,7 +42,7 @@ export function submitAudit(params) {
export function deleteCountOrderDetail(data) {
return axios({
url: "/invCount/codes/deleteCode",
url: "/invCount/order/detail/deleteOrderDetail",
method: "post",
data: data
});

@ -287,6 +287,7 @@
>
<countOrderCodes
:codeQuery="codeQuery"
:getCountOrderDetail="getCountOrderDetail"
></countOrderCodes>
</el-dialog>
</div>
@ -371,7 +372,8 @@ export default {
codesNum: 0,
codeQuery: {
productId: null,
orderIdFk: null
orderIdFk: null,
edit: true
},
codesVisible: false
};
@ -399,6 +401,7 @@ export default {
let detailData = {
orderIdFk: this.formData.orderId,
productId: product.relIdFk,
nameCode: product.nameCode,
batchNo: product.batchNo,
produceDate: product.productionDate,
expireDate: product.expireDate
@ -512,10 +515,11 @@ export default {
this.selectInvProductVisible = false;
},
deleteOrderDetail(index, row) {
if (isBlank(row.id)) {
//
this.codeArray.splice(index, 1);
} else {
this.$confirm('此操作将删除单据详情, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
let params = {id: row.id}
deleteCountOrderDetail(params).then((res) => {
@ -528,16 +532,18 @@ export default {
this.codeArray = result.data.list || [];
});
} else {
this.$message.error(res.data);
this.$message.error(res.data.message);
}
})
}
}).catch(() => {
});
},
showCodes(row) {
this.codesVisible = true;
this.codeQuery = {
orderIdFk: this.formData.orderId,
productId: row.productId
productId: row.productId,
edit: true
}
},
getInputFocus(event) {
@ -559,7 +565,8 @@ export default {
this.codeArray = res.data.list || [];
this.detailTotal = res.data.total || 0;
}
})
});
this.getCountOrderCodesNum();
},
addCode() {
this.formData.code.trim();

@ -22,6 +22,24 @@
width="500"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="操作"
width="120"
fixed="right"
v-if="codeQuery.edit"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.stop="true"
@click.native="deleteCountCode(scope.row)"
>减一
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
@ -37,7 +55,7 @@
<script>
import {getCountCodesList} from "@/api/inventory/invCountCodes";
import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes";
export default {
name: "codeQuery",
@ -46,6 +64,10 @@ export default {
type: Object,
required: true,
},
getCountOrderDetail: {
type: Function,
required: true
}
},
data() {
return {
@ -111,9 +133,28 @@ export default {
this.total = 0;
})
},
intentBack() {
this.$router.go(-1);
deleteCountCode(row) {
this.$confirm('是否删除此条码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
orderIdFk: row.orderIdFk,
productId: row.productId,
code: row.code
};
deleteCode(params).then((res) => {
if (res.code === 20000) {
this.$message.success("删除成功!");
this.getCodeList();
this.getCountOrderDetail();
} else {
this.$message.error(res.data.message);
}
})
}).catch(() => {
});
},
},
created() {

Loading…
Cancel
Save