From 960f490367f6534479b989d12a4c879e14e7f18d Mon Sep 17 00:00:00 2001 From: woody Date: Mon, 11 Aug 2025 15:41:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(outOfStock):=20=E5=8F=91=E8=B4=A7=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E9=9D=9E=E5=9C=A8=E5=94=AE=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product.js | 8 + src/components/Delivery/unhandeled.vue | 12 +- .../components/OutOfStockProductList.vue | 243 ++++++++++++++++++ src/views/logistics/delivery/index.vue | 194 ++------------ 4 files changed, 283 insertions(+), 174 deletions(-) create mode 100644 src/views/logistics/delivery/components/OutOfStockProductList.vue diff --git a/src/api/product.js b/src/api/product.js index 20fa026..7ef9423 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -769,3 +769,11 @@ export function resetInventoryUse(data) { 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 2dd0161..1bf2d43 100644 --- a/src/components/Delivery/unhandeled.vue +++ b/src/components/Delivery/unhandeled.vue @@ -41,6 +41,13 @@ @click="orderDk" >订单抵扣 + - + +
+ + + + + + + + + + + + + + + + + + + + + 搜索 + + + +
+ + {{ item.waresName }} ({{ item.waresCode }}) + +
+ + + + + + + + + + + +
+ + {{ '取消' }} + {{ + '确认' + }} + +
+ + + + + diff --git a/src/views/logistics/delivery/index.vue b/src/views/logistics/delivery/index.vue index 558d23d..b6e3acb 100644 --- a/src/views/logistics/delivery/index.vue +++ b/src/views/logistics/delivery/index.vue @@ -6,7 +6,7 @@ :moren="moren" />
- + @@ -1156,14 +1075,15 @@ import yihandeled from '@/components/Delivery/yihandeled.vue' import nowdelivery from '@/components/Delivery/nowdelivery.vue' import * as del from '@/api/delivery.js' 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 { @@ -1175,10 +1095,8 @@ export default { } ], dialogVisible: false, - dialogList: [], - lsArr: [], - tableData: [], - productLists: [], + + productLists: '', select: {}, orderTypeList: [], // 订单类型 orderStatusList: [], // 订单状态 @@ -1196,6 +1114,7 @@ export default { yesornoList: [], // 二次发货 storehouseList: [], // 发货仓库 total: '', + selectedProductList: [], queryParams: { pageNum: 1, pageSize: 500, @@ -1255,84 +1174,15 @@ export default { }, methods: { clearProduct() { - this.tableData = [] - this.lsArr = [] + this.selectedProductList = [] this.queryParams.productIdList = [] - this.productLists = [] + 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' @@ -1477,7 +1327,8 @@ export default { }) }, // 重置 - reChongzhi() { + resetHandle() { + this.selectedProductList = [] this.queryParams = { pageNum: 1, pageSize: 500, @@ -1488,6 +1339,11 @@ export default { // 展开折叠 changeActive() { this.isActive = !this.isActive + }, + handleSubmit(products) { + this.selectedProductList = [...products] + this.queryParams.productIdList = products.map((item) => item.pkId).join(',') + this.productLists = products.map((item) => item.waresName).join(',') } } }