From 9c6cee81c9f041748dcd7053bbbc8d6a2d53a5ce Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 12 Aug 2025 15:46:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(unhandeled):=20=E6=9C=AA=E5=90=88=E5=8D=95?= =?UTF-8?q?=E9=9D=9E=E5=9C=A8=E5=94=AE=E5=95=86=E5=93=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product.js | 17 ++ src/components/Delivery/unhandeled.vue | 24 +- .../components/OutOfStockProductList.vue | 243 ++++++++++++++++++ src/views/logistics/delivery/index.vue | 196 ++------------ 4 files changed, 302 insertions(+), 178 deletions(-) create mode 100644 src/views/logistics/delivery/components/OutOfStockProductList.vue diff --git a/src/api/product.js b/src/api/product.js index c4cc128..6416be1 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -776,3 +776,20 @@ export function get_sort(params) { params }) } + +export function resetInventoryUse(data) { + return request({ + url: 'sale/manage/wares/resetInventoryUse', + method: 'post', + data + }) +} + +export function getOutOfStockProduct(params) { + return request({ + url: 'sale/manage/wares/list-no-sale', + method: 'get', + params + }) +} + diff --git a/src/components/Delivery/unhandeled.vue b/src/components/Delivery/unhandeled.vue index 7fdbff6..a534b95 100644 --- a/src/components/Delivery/unhandeled.vue +++ b/src/components/Delivery/unhandeled.vue @@ -41,6 +41,13 @@ >订单抵扣 --> + - + { + const params = { + ...this.params, + pkWaresList: this.params.pkWaresList ? this.params.pkWaresList.split(',') : [], + mergeType: this.hdform.mergeType + } del - .deliverUnhandeldMerge( - Object.assign({}, this.params, { - mergeType: this.hdform.mergeType - }) - ) + .deliverUnhandeldMerge(params) .then((res) => { this.$message({ message: res.msg, diff --git a/src/views/logistics/delivery/components/OutOfStockProductList.vue b/src/views/logistics/delivery/components/OutOfStockProductList.vue new file mode 100644 index 0000000..8445317 --- /dev/null +++ b/src/views/logistics/delivery/components/OutOfStockProductList.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/src/views/logistics/delivery/index.vue b/src/views/logistics/delivery/index.vue index f075384..d9fef6d 100644 --- a/src/views/logistics/delivery/index.vue +++ b/src/views/logistics/delivery/index.vue @@ -6,7 +6,7 @@ :moren="moren" />
- + @@ -1286,14 +1206,16 @@ import nowdelivery from '@/components/Delivery/nowdelivery.vue' import * as del from '@/api/delivery.js' import { getvertexValue } from '@/api/member' import { getRouters } from '@/api/settle' -import { productList } from '@/api/product' +import OutOfStockProductList from './components/OutOfStockProductList.vue' + export default { name: 'Fhqd', components: { topBar, unhandeled, yihandeled, - nowdelivery + nowdelivery, + OutOfStockProductList }, data() { return { @@ -1309,7 +1231,7 @@ export default { dialogList: [], lsArr: [], tableData: [], - productLists: [], + productLists: '', systemAllList: [ { label: '是', @@ -1368,7 +1290,7 @@ export default { payTime: [], printTime: [], // 打印时间2 deliverTime: [], // 发货时间2 - productIdList: [], + pkWaresList: [], systemAll: 0 }, isActive: true, @@ -1385,7 +1307,8 @@ export default { menu2: false, menu3: false, menu4: false, - vertexList: [] // 隶属体系 + vertexList: [], // 隶属体系 + selectedProductList: [] } }, created() { @@ -1395,84 +1318,15 @@ export default { }, methods: { clearProduct() { - this.tableData = [] - this.lsArr = [] - this.queryParams.productIdList = [] - this.productLists = [] + this.selectedProductList = [] + this.queryParams.pkWaresList = [] + this.productLists = '' }, openDig() { - this.select = {} - productList(Object.assign({ isPutOn: 0 }, this.queryParams)).then( - (res) => { - res.rows.forEach((item) => { - item.quantity = 1 - item.pkProduct = item.pkProduct - item.isGift = 0 - }) - this.dialogList = res.rows - this.total = res.total - } - ) this.dialogVisible = true + this.select = {} }, - handleClose() { - this.dialogVisible = false - }, - getDataList() { - productList( - Object.assign({ isPutOn: 0 }, this.queryParams, this.select) - ).then((res) => { - res.rows.forEach((item) => { - item.quantity = 1 - item.pkProduct = item.pkProduct - item.isGift = 0 - }) - this.dialogList = res.rows - this.total = res.total - }) - }, - dialogChange(val) { - this.lsArr = val - }, - onSubmit() { - // this.tableData = [] - this.lsArr.forEach((item) => { - this.tableData.push(item) - }) - // this.tableData = this.clearArr(this.tableData) - this.dialogVisible = false - this.dialogList.forEach((row) => { - this.$refs.lessonTableRef.toggleRowSelection(row, false) - }) - // 判断重复 - const arr = this.tableData - let isTrue = false - for (var i = 0; i < arr.length; i++) { - // 首次遍历数组 - for (var j = i + 1; j < arr.length; j++) { - // 再次遍历数组 - if (arr[i].productCode == arr[j].productCode) { - if (arr[i].isGift == arr[j].isGift) { - isTrue = true - } - } - } - } - if (isTrue) { - this.$message.error('请勿选择重复的商品') - this.tableData = [] - this.lsArr = [] - this.queryParams.productIdList = [] - this.productLists = [] - return - } - this.queryParams.productIdList = [] - this.productLists = [] - this.tableData.forEach((item) => { - this.queryParams.productIdList.push(item.pkId) - this.productLists.push(item.productName) - }) - }, + tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 == 1) { return 'warning-row' @@ -1614,17 +1468,23 @@ export default { }, // 重置 reChongzhi() { + this.selectedProductList = [] this.queryParams = { pageNum: 1, pageSize: 500, orderStatus: 1 } - this.productLists = [] + this.productLists = '' this.getSearch() }, // 展开折叠 changeActive() { this.isActive = !this.isActive + }, + handleSubmit(products) { + this.selectedProductList = [...products] + this.queryParams.pkWaresList = products.map((item) => item.pkId).join(',') + this.productLists = products.map((item) => item.waresName).join(',') } } }