diff --git a/src/api/inventory/invCountOrder.js b/src/api/inventory/invCountOrder.js index 71adf5e..ad89b00 100644 --- a/src/api/inventory/invCountOrder.js +++ b/src/api/inventory/invCountOrder.js @@ -55,3 +55,11 @@ export function addCountOrderDetail(data) { data: data }); } + +export function updateCountOrderStatus(data) { + return axios({ + url: "/invCount/order/updateCountOrderStatus", + method: "post", + data: data + }); +} diff --git a/src/views/inventory/addCountOrder.vue b/src/views/inventory/addCountOrder.vue index b55bd56..ce713f5 100644 --- a/src/views/inventory/addCountOrder.vue +++ b/src/views/inventory/addCountOrder.vue @@ -305,7 +305,7 @@ import { deleteCountOrderDetail, addCountOrderDetail } from "@/api/inventory/invCountOrder"; -import {getCountCodesList, deleteCode, addCode, getCodesNum} from "@/api/inventory/invCountCodes"; +import {addCode, getCodesNum} from "@/api/inventory/invCountCodes"; import countOrderCodes from "@/views/inventory/countOrderCodes"; diff --git a/src/views/inventory/invCountOrderAudit.vue b/src/views/inventory/invCountOrderAudit.vue index a90390a..cc9f0da 100644 --- a/src/views/inventory/invCountOrderAudit.vue +++ b/src/views/inventory/invCountOrderAudit.vue @@ -63,7 +63,7 @@ @current-change="handleChange" > - + @@ -83,7 +83,7 @@ type="text" size="small" @click.native.stop="auditCountOrder(scope.row)" - >审批 + >审核 @@ -109,9 +109,9 @@ - - - + + @@ -122,7 +122,7 @@ @@ -154,6 +154,21 @@ :total="detailTotal" > + + + + + @@ -163,8 +178,14 @@ import {filterUplLocInv} from "@/api/basic/invWarehouse"; import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {userInfo} from "@/api/auth/login"; import {isBlank} from "@/utils/strUtil"; -import {getCountOrderList, getCountOrderDetailList, deleteCountOrder} from "@/api/inventory/invCountOrder"; +import { + getCountOrderList, + getCountOrderDetailList, + deleteCountOrder, + updateCountOrderStatus +} from "@/api/inventory/invCountOrder"; import {getSpaceCodeList} from "@/api/inventory/invSpace"; +import countOrderCodes from "@/views/inventory/countOrderCodes"; export default { data() { @@ -202,7 +223,13 @@ export default { countStatusMap: { 0: '亏损', 1: '盈利' - } + }, + codeQuery: { + orderIdFk: null, + productId: null, + edit: false + }, + codesVisible: false }; }, methods: { @@ -219,19 +246,24 @@ export default { page: 1, limit: 20, }; + this.onRestDetail(); + this.invChange(); + this.getList(); + }, + onRestDetail() { this.detailQuery = { orderIdFk: null, page: 1, limit: 20 }; + this.detailList = []; this.detailTotal = 0; - this.invChange(); - this.getList(); }, onSubmit() { this.loading = true; this.filterQuery.page = 1; this.getList(); + this.onRestDetail(); }, handleCurrentChange(val) { this.filterQuery.page = val; @@ -262,8 +294,8 @@ export default { getCountOrderDetailList() { getCountOrderDetailList(this.detailQuery).then((res) => { if (res.code === 20000) { - this.list = res.data.list || []; - this.total = res.data.total || 0; + this.detailList = res.data.list || []; + this.detailTotal = res.data.total || 0; } }).catch(() => { }); @@ -341,17 +373,60 @@ export default { } }, handleChange(row) { - this.detailQuery.orderIdFk = row.id; + this.detailQuery.orderIdFk = row.orderId; this.detailQuery.page = 1; this.getCountOrderDetailList(); }, intentDetail(row) { - + this.codeQuery = { + orderIdFk: row.orderIdFk, + productId: row.productId, + edit: false + }; + this.codesVisible = true; }, auditCountOrder(row) { + let params = { + id: row.id, + status: null + }; + this.$confirm('请选择审核意见', '提示', { + confirmButtonText: '通过', + cancelButtonText: '驳回', + type: 'warning', + center: true + }).then(() => { + params.status = 2; //审核通过 + updateCountOrderStatus(params).then((res) => { + if (res.code === 20000) { + this.$message.success("审核通过"); + this.getList(); + this.onRestDetail(); + } else { + this.$message.error(res.data.message); + } + }).catch(() => { + }); + }).catch(() => { + params.status = 0; //驳回到上一个状态 + updateCountOrderStatus(params).then((res) => { + if (res.code === 20000) { + this.$message.success("审核通过"); + this.$message.success("已驳回"); + this.getList(); + this.onRestDetail(); + } else { + this.$message.error(res.data.message); + } + }).catch(() => { + }); + }); }, }, + components: { + countOrderCodes + }, created() { this.getStorage(); //获取用户默认仓库信息 diff --git a/src/views/inventory/invCountOrderCompleted.vue b/src/views/inventory/invCountOrderCompleted.vue index 1e6074e..ac83fb1 100644 --- a/src/views/inventory/invCountOrderCompleted.vue +++ b/src/views/inventory/invCountOrderCompleted.vue @@ -18,6 +18,7 @@ + + + + {{ item.name }} + + + - + - - - - + + + + + + + + - - - - - + + + + - + + + + + + + + + + + + + - - - - - + + - + + + + @@ -108,7 +151,14 @@ import {filterUplLocInv} from "@/api/basic/invWarehouse"; import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {userInfo} from "@/api/auth/login"; import {isBlank} from "@/utils/strUtil"; - +import { + getCountOrderList, + getCountOrderDetailList, + deleteCountOrder, + updateCountOrderStatus +} from "@/api/inventory/invCountOrder"; +import {getSpaceCodeList} from "@/api/inventory/invSpace"; +import countOrderCodes from "@/views/inventory/countOrderCodes"; export default { data() { @@ -116,17 +166,43 @@ export default { filterQuery: { invWarehouseCode: null, invStorageCode: null, + invSpaceCode: null, + status: 2, page: 1, limit: 20, customerId: null, }, + detailQuery: { + orderIdFk: null, + page: 1, + limit: 20 + }, list: [], + detailList: [], storageList: [], subInvList: [], + spaceCodeList: [], codeDetailVisible: false, total: 0, + detailTotal: 0, loading: true, invWarehouseDisabled: true, + invSpaceDisabled: true, + statusMap: { + 0: "未提交", + 1: "未审核", + 2: "已审核" + }, + countStatusMap: { + 0: '亏损', + 1: '盈利' + }, + codeQuery: { + orderIdFk: null, + productId: null, + edit: false + }, + codesVisible: false }; }, methods: { @@ -138,31 +214,78 @@ export default { customerId: null, invWarehouseCode: null, invStorageCode: null, + invSpaceCode: null, + status: 1, page: 1, limit: 20, }; + this.onRestDetail(); this.invChange(); this.getList(); }, + onRestDetail() { + this.detailQuery = { + orderIdFk: null, + page: 1, + limit: 20 + }; + this.detailList = []; + this.detailTotal = 0; + }, onSubmit() { this.loading = true; this.filterQuery.page = 1; this.getList(); + this.onRestDetail(); }, handleCurrentChange(val) { this.filterQuery.page = val; this.getList(); }, + handleCurrentDetailChange(val) { + this.detailQuery.page = val; + this.getCountOrderDetailList(); + }, getList() { this.loading = true; this.filterQuery.customerId = store.getters.customerId; + getCountOrderList(this.filterQuery).then((res) => { + this.loading = false; + if (res.code === 20000) { + this.list = res.data.list || []; + this.total = res.data.total || 0; + } else { + this.list = []; + this.total = 0; + } + }).catch((error) => { + this.loading = false; + this.list = []; + this.total = 0; + }); + }, + getCountOrderDetailList() { + getCountOrderDetailList(this.detailQuery).then((res) => { + if (res.code === 20000) { + this.detailList = res.data.list || []; + this.detailTotal = res.data.total || 0; + } + }).catch(() => { + }); }, - deleteOrders(data) { this.loading = true; let query = { id: data, } + deleteCountOrder(query).then((res) => { + if (res.code === 20000) { + this.$message.success("删除成功"); + this.getList(); + } else { + this.$message.error(res.message()); + } + }) }, deleteDialog(rowId) { @@ -186,11 +309,12 @@ export default { .catch(() => { }); }, - invChange() { - this.filterQuery.invWarehouseCode = ""; + this.filterQuery.invWarehouseCode = null; + this.filterQuery.invSpaceCode = null; this.subInvList = []; - if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") { + this.spaceCodeList = []; + if (!isBlank(this.filterQuery.invStorageCode)) { this.invWarehouseDisabled = false; let query = { pcode: this.filterQuery.invStorageCode @@ -205,27 +329,86 @@ export default { this.invWarehouseDisabled = true; } }, + invWarehouseChange() { + this.invSpaceDisabled = false; + this.filterQuery.invSpaceCode = null; + if (!isBlank(this.filterQuery.invWarehouseCode) && !isBlank(this.filterQuery.invStorageCode)) { + //查询货位列表 + let params = { + invStorageCode: this.filterQuery.invStorageCode, + invWarehouseCode: this.filterQuery.invWarehouseCode + }; + getSpaceCodeList(params).then((res) => { + if (res.code === 20000) { + this.spaceCodeList = res.data || []; + } + }) + } + }, + handleChange(row) { + this.detailQuery.orderIdFk = row.orderId; + this.detailQuery.page = 1; + this.getCountOrderDetailList(); + }, + intentDetail(row) { + this.codeQuery = { + orderIdFk: row.orderIdFk, + productId: row.productId, + edit: false + }; + this.codesVisible = true; + }, + auditCountOrder(row) { + let params = { + id: row.id, + status: null + }; + this.$confirm('请选择审核意见', '提示', { + confirmButtonText: '通过', + cancelButtonText: '驳回', + type: 'warning', + center: true + }).then(() => { + params.status = 2; //审核通过 + updateCountOrderStatus(params).then((res) => { + if (res.code === 20000) { + this.$message.success("审核通过"); + this.getList(); + this.onRestDetail(); + } else { + this.$message.error(res.data.message); + } + }).catch(() => { + }); + }).catch(() => { + params.status = 0; //驳回到上一个状态 + updateCountOrderStatus(params).then((res) => { + if (res.code === 20000) { + this.$message.success("审核通过"); + this.$message.success("已驳回"); + this.getList(); + this.onRestDetail(); + } else { + this.$message.error(res.data.message); + } + }).catch(() => { + }); + }); + + }, }, - mounted() { - document.body.ondrop = function (event) { - event.preventDefault(); - event.stopPropagation(); - }; + components: { + countOrderCodes }, created() { this.getStorage(); - this.findMethod(); - let query = this.$route.query; - this.filterQuery = Object.assign(this.filterQuery, query); - this.filterQuery.limit = parseInt(this.filterQuery.limit); - // 加载表格数据 //获取用户默认仓库信息 userInfo().then((res) => { if (res.code === 20000) { if (!isBlank(res.data.locInvCode)) { this.filterQuery.invStorageCode = res.data.locInvCode; - this.invChange(); this.filterQuery.invWarehouseCode = res.data.locSubInvCode; + this.invChange(); } this.getList(); }