From c9f3329091d09403ea1170dc7cdffee75356cd13 Mon Sep 17 00:00:00 2001
From: "pref_mail@163.com" <123456>
Date: Thu, 16 Nov 2023 11:53:13 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E9=A2=84?=
=?UTF-8?q?=E7=BA=A6=E7=9A=84=E8=BF=87=E6=BB=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/page/index/index.vue | 2 -
src/page/index/top/index.vue | 8 +-
.../distribution/reservation/reservation.vue | 2 +-
.../reservation/reservationAddFrom.vue | 28 +-
src/views/reservation/lnventory_list.vue | 2 +-
src/views/reservation/reservation_list.vue | 1098 ++++++++++++-----
6 files changed, 834 insertions(+), 306 deletions(-)
diff --git a/src/page/index/index.vue b/src/page/index/index.vue
index b1e55fed..f4890d9a 100644
--- a/src/page/index/index.vue
+++ b/src/page/index/index.vue
@@ -77,8 +77,6 @@ export default {
},
created() {
getMyCurrentWarehouse().then(res => {
- console.log(res, '初始化请求参数');
- console.log(res.data.data.name, '仓库名称');
if (res.data.data == null) {
console.log('当前没有数据');
localStorage.setItem('WarehouseName', undefined);
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index 0e2c84ef..1c629557 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -120,10 +120,10 @@ export default {
};
},
mounted() {
- getMyWarehouseList().then(res => {
- let arr = [{ name: this.dataName ? this.dataName : '', id: '0' }];
- this.datalist = arr.concat(res.data.data);
- });
+ // getMyWarehouseList().then(res => {
+ // let arr = [{ name: this.dataName ? this.dataName : '', id: '0' }];
+ // this.datalist = arr.concat(res.data.data);
+ // });
this.checkwarehousevalue = Number(localStorage.getItem('checkwarehousevalue'));
},
filters: {},
diff --git a/src/views/distribution/reservation/reservation.vue b/src/views/distribution/reservation/reservation.vue
index f5fb074e..08f6e33b 100644
--- a/src/views/distribution/reservation/reservation.vue
+++ b/src/views/distribution/reservation/reservation.vue
@@ -459,7 +459,7 @@ export default {
},
{
prop: 'mallName',
- label: '商城',
+ label: '收货单位',
type: 2,
values: '',
width: '130',
diff --git a/src/views/distribution/reservation/reservationAddFrom.vue b/src/views/distribution/reservation/reservationAddFrom.vue
index 1b4547d4..4ead8b4e 100644
--- a/src/views/distribution/reservation/reservationAddFrom.vue
+++ b/src/views/distribution/reservation/reservationAddFrom.vue
@@ -1925,9 +1925,7 @@ export default {
let page = this.page;
let params = {};
this.query.serviceType = '2';
- console.log('this.marketName :>> ', this.marketName);
params.marketName = this.marketName;
- console.log('params :>> ', params);
getInventoryList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(
res => {
const inventoryList = res.data.data;
@@ -1938,14 +1936,18 @@ export default {
this.page.total = inventoryList.total;
console.log('res :>> ', res);
- this.inventoryInfo = inventoryList.records;
+
+ // 过滤掉已选择的数量
+
+ const _inventoryInfo = inventoryList.records;
+ this.inventoryInfo = _inventoryInfo
if (this.inventoryData.length !== 0) {
// 获取ids的映射数组
const ids = this.inventoryData.map(val => val.id);
// 赋值给回显勾选的数组
- this.inventorySelectList = this.inventoryInfo.filter(val => {
+ this.inventoryInfo = _inventoryInfo.filter(val => {
// 循环获取符合条件的库存品组成数组
- return ids.includes(val.id);
+ return !ids.includes(val.id);
});
}
this.loading = false;
@@ -2628,18 +2630,7 @@ export default {
}
this.marketName = _marketName;
console.log('this.inventoryList :>> ', this.inventoryList);
- this.inventoryData = this.inventoryList;
-
- // if (this.orderData.length) {
- // this.inventoryList.some(i => {
- // let a = this.inventoryData.filter((ele) => ele.id == i.id).length >= 1;
- // if (!a) {
- // this.inventoryData.push(i);
- // }
- // });
- // } else {
- // this.inventoryData = this.selectionList;
- // }
+ this.inventoryData = [...this.inventoryData,...this.inventoryList];
this.stockListShow = false;
},
@@ -2841,7 +2832,8 @@ export default {
});
if (this.orderData.length !== 0) {
const ids = this.orderData.map(val => val.id);
- this.orderSelectList = this.stockArticleInfo.filter(val => ids.includes(val.id));
+ const _orderData = this.stockArticleInfo.filter(val => !ids.includes(val.id))
+ // this.orderSelectList = this.stockArticleInfo.filter(val => ids.includes(val.id));
console.log('orderSelectList :>> ', this.orderSelectList);
}
this.orderList = [];
diff --git a/src/views/reservation/lnventory_list.vue b/src/views/reservation/lnventory_list.vue
index c7dbfa4e..abc126d9 100644
--- a/src/views/reservation/lnventory_list.vue
+++ b/src/views/reservation/lnventory_list.vue
@@ -53,7 +53,7 @@
>
查看
- 拆包
+
diff --git a/src/views/reservation/reservation_list.vue b/src/views/reservation/reservation_list.vue
index aef1da17..08f6e33b 100644
--- a/src/views/reservation/reservation_list.vue
+++ b/src/views/reservation/reservation_list.vue
@@ -3,142 +3,289 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
搜 索
清 空
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+
+ 编辑
+
+ 取消预约
+
+ 确认预约
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+
+ 编辑
+
+ 取消预约
+
+ 确认预约
+
+ 打印
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- 批量转备货
-
- 批量转配送
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查看
- 编辑
-
- 取消预约
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
- 查看
- 编辑
- 删除
-
-
- -->
-
+
+
+
+
+
{
+ console.log(res.data);
+ downloadXls(res.data, nulName);
+ });
+ },
showdrawer(value) {
this.drawerShow = value;
},
@@ -687,9 +1057,10 @@ export default {
editsolt(scope) {
const { row } = scope;
this.$router.push({
- path: '/distribution/reservation/reservationFrom',
+ path: '/distribution/reservation/reservationAddFrom',
query: {
reservationId: row.id,
+ name: '编辑预约单',
},
});
console.log(row);
@@ -707,18 +1078,86 @@ export default {
btnsc(index, row) {
console.log(index, row);
},
- selectsc(index, row) {
+ selectscA(index, row) {
+ console.log(index, row);
+ if (row.prop === 'periodOfTimeName') {
+ this.queryA['periodOfTime'] = index;
+ } else if (row.prop === 'stockupStatusName') {
+ this.queryA['stockupStatus'] = index;
+ } else if (row.prop === 'serveTypeName') {
+ this.queryA['serveType'] = index;
+ console.log(this.queryA, '----------->');
+ } else {
+ this.queryA[row.prop] = index;
+ }
+ this.onLoad(this.page);
+ },
+ selectscB(index, row) {
+ console.log(index, row);
+ if (row.prop === 'periodOfTimeName') {
+ this.queryB['periodOfTime'] = index;
+ } else if (row.prop === 'stockupStatusName') {
+ this.queryB['stockupStatus'] = index;
+ } else if (row.prop === 'serveTypeName') {
+ this.queryB['serveType'] = index;
+ console.log(this.queryB, '----------->');
+ } else {
+ this.queryB[row.prop] = index;
+ }
+ this.onLoad(this.page);
+ },
+ timescA(index, row) {
+ console.log(index, row);
+ console.log(index, row);
+ if (!!index) {
+ index = dayjs(index).format('YYYY-MM-DD');
+ }
+ this.queryA[row.prop] = index;
+ if (!index) {
+ delete this.queryA[row.prop];
+ }
+ this.onLoad(this.page);
+ },
+ timescB(index, row) {
+ console.log(index, row);
console.log(index, row);
+ if (!!index) {
+ index = dayjs(index).format('YYYY-MM-DD');
+ }
+ this.queryB[row.prop] = index;
+ if (!index) {
+ delete this.queryB[row.prop];
+ }
+ this.onLoad(this.page);
},
- timesc(index, row) {
+ inputscA(index, row) {
console.log(index, row);
+ this.queryA[row.prop] = index;
+ if (!index) delete this.queryA[row.prop];
+ this.onLoad(this.page);
},
- inputsc(index, row) {
+ inputscB(index, row) {
console.log(index, row);
+ this.queryB[row.prop] = index;
+ if (!index) delete this.queryB[row.prop];
+ this.onLoad(this.page);
},
init() {
this.height = this.setPx(document.body.clientHeight - 340);
},
+ handleClick(e) {
+ console.log('e :>> ', e.props.name);
+ // 切换选项卡时, 清空备选中的数组
+ this.selectionList = [];
+ this.activename = e.props.name;
+ this.onLoad(this.page);
+ // if (e.props.name === 'yescheck') {
+ // this.bbb();
+ // } else {
+ // this.aaa();
+ // }
+ // console.log('this.activename :>> ', this.activename);
+ },
cancelReservationConfirm() {
if (!this.cancel.message) {
this.$message.warning('请输入取消原因!!');
@@ -754,22 +1193,18 @@ export default {
//订单来源
getDictionaryBiz('order_source').then(res => {
this.orderSourceData = res.data.data;
- console.log(this.deliveryTypeData);
});
//预约状态
getDictionaryBiz('resvervation_status').then(res => {
this.resvervationStatusData = res.data.data;
- console.log(this.deliveryTypeData);
});
//备货状态
getDictionaryBiz('stockup_status').then(res => {
this.stockupStatusData = res.data.data;
- console.log(this.deliveryTypeData);
});
//时段
getDictionaryBiz('period_of_time').then(res => {
this.periodOfTimeData = res.data.data;
- console.log(this.deliveryTypeData);
});
getDictionaryBiz('delivery_way').then(res => {
this.deliveryWayData = res.data.data;
@@ -821,7 +1256,7 @@ export default {
getListTeam(
this.page.currentPage,
this.page.pageSize,
- Object.assign(params, this.query)
+ Object.assign(params, this.queryB)
).then(res => {
// console.log(">><><",res.data.data.records);
let fo = [];
@@ -840,7 +1275,7 @@ export default {
let params = {
department: this.deptId,
};
- stockUp(params).then(res => {
+ getStockUpArea().then(res => {
// console.log("res>>>",res.data.data);
let fo = [];
res.data.data.forEach(i => {
@@ -860,7 +1295,8 @@ export default {
this.onLoad(this.page);
},
searchReset() {
- this.query = {};
+ this.queryA = {};
+ this.queryB = {};
this.page.currentPage = 1;
this.onLoad(this.page);
},
@@ -906,24 +1342,24 @@ export default {
},
handleAdd() {
this.$router.push({
- path: '/distribution/reservation/reservationFrom',
+ path: '/distribution/reservation/reservationAddFrom',
});
},
handleEdit(row) {
console.log(row);
this.$router.push({
- path: '/distribution/reservation/reservationFrom',
+ path: '/distribution/reservation/reservationAddFrom',
query: {
reservationId: row.id,
},
});
},
aaa() {
- this.query.reservationStatus = '1';
+ this.queryA.reservationStatus = '1';
this.onLoad(this.page);
},
bbb() {
- this.query.reservationStatus = '2';
+ this.queryB.reservationStatus = '2';
this.onLoad(this.page);
},
handleView(row) {
@@ -958,6 +1394,7 @@ export default {
});
// console.log(">>>>>>>>>>",ids);
},
+ //批量转备货
handleStockUp() {
this.info = {};
if (this.selectionList.length === 0) {
@@ -966,16 +1403,27 @@ export default {
}
let data = this.selectionList;
let a = [];
+ let b = [];
+ console.log('>>>>>>>>>>>>>', data);
data.forEach(d => {
- if (d.stockupStatus !== '未备货') {
+ if (d.stockupStatus === '20' || d.stockupStatusName === '待备货') {
a.push(d.reservationCode);
}
+ if (d.stockupStatus === '30' || d.stockupStatusName === '已备货') {
+ b.push(d.reservationCode);
+ }
});
if (a.length >= 1) {
this.$message.warning(a.join(',') + '预约单存在备货任务,请勿重复添加');
return;
}
+ if (b.length >= 1) {
+ this.$message.warning(a.join(',') + '预约单备货任务已完成,请勿重复添加');
+ return;
+ }
this.dialogFormCustomer = true;
+ this.info.stockupDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
+
this.getFork();
this.getTeam();
},
@@ -988,7 +1436,6 @@ export default {
this.info.goodsAreaName = item.dictValue;
}
});
-
confirms(this.info).then(res => {
this.$message({
type: 'success',
@@ -1060,77 +1507,168 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
- if (!this.query.reservationStatus) {
- this.query.reservationStatus = '1';
+ // if (!this.query.reservationStatus) {
+ // this.query.reservationStatus = '1';
+ // }
+ let query = this.queryB;
+ query.reservationStatus = '2';
+ console.log('this.activename :>> ', this.activename);
+ if (this.activename === 'nocheck') {
+ console.log('123123 :>> ', 123123);
+ query = this.queryA;
+ query.reservationStatus = this.queryA.reservationStatus || '1';
}
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ // if (this.queryA.reservationStatus)
+ getList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
const data = res.data.data;
console.log('>>>>>>>', data);
- data.records.forEach(item => {
- this.orderSourceData.forEach(a => {
- if (item.orderSource === a.dictKey) {
- item.orderSource = a.dictValue;
- }
- });
- this.stockupStatusData.forEach(b => {
- if (item.stockupStatus === b.dictKey) {
- item.stockupStatus = b.dictValue;
- }
- });
- this.resvervationStatusData.forEach(e => {
- if (item.reservationStatus === e.dictKey) {
- item.reservationStatus = e.dictValue;
- }
- });
- this.deliveryTypeData.forEach(c => {
- if (item.deliveryType === c.dictKey) {
- item.deliveryType = c.dictValue;
- }
- });
+ if (data.records) {
+ data.records.forEach(item => {
+ this.orderSourceData.forEach(a => {
+ if (item.orderSource === a.dictKey) {
+ item.orderSource = a.dictValue;
+ }
+ });
+ // this.stockupStatusData.forEach(b => {
+ // if (item.stockupStatus === b.dictKey) {
+ // item.stockupStatus = b.dictValue;
+ // }
+ // });
+ this.resvervationStatusData.forEach(e => {
+ if (item.reservationStatus === e.dictKey) {
+ item.reservationStatus = e.dictValue;
+ }
+ });
+ this.deliveryTypeData.forEach(c => {
+ if (item.deliveryType === c.dictKey) {
+ item.deliveryType = c.dictValue;
+ }
+ });
- this.deliveryWayData.forEach(c => {
- if (item.deliveryWay === c.dictKey) {
- item.deliveryWay = c.dictValue;
- }
- });
- this.periodOfTimeData.forEach(d => {
- console.log('11111111111');
- if (item.periodOfTime === d.dictKey) {
- item.periodOfTime = d.dictValue;
- }
- });
- let pa = [];
- if (item.serveType.length > 1) {
- pa = item.serveType.split(',');
- } else {
- pa.push(item.serveType);
- }
- this.addvalueServeTypeData.forEach(f => {
- pa.forEach((p, index) => {
- if (p === f.dictKey) {
- pa[index] = f.dictValue;
+ this.deliveryWayData.forEach(c => {
+ if (item.deliveryWay === c.dictKey) {
+ item.deliveryWay = c.dictValue;
+ }
+ });
+ this.periodOfTimeData.forEach(d => {
+ console.log('11111111111');
+ if (item.periodOfTime === d.dictKey) {
+ item.periodOfTime = d.dictValue;
}
});
+ let pa = [];
+ if (item.serveType.length > 1) {
+ pa = item.serveType.split(',');
+ } else {
+ pa.push(item.serveType);
+ }
+ this.addvalueServeTypeData.forEach(f => {
+ pa.forEach((p, index) => {
+ if (p === f.dictKey) {
+ pa[index] = f.dictValue;
+ }
+ });
+ });
+ item.serveType = pa.join(',');
});
- item.serveType = pa.join(',');
- });
+ }
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
},
+
+ /**
+ * 请求打印模版
+ */
+ async batchPrint(ids) {
+ const res = await patchPrintList({ ids: ids.join(',') });
+ return res;
+ },
+
+ /**
+ * 批量打印
+ */
+ async batchPrintData() {
+ if (this.selectionList.length === 0) {
+ this.$message({
+ type: 'error',
+ message: '最少选择一条数据哦',
+ });
+ return;
+ }
+ const ids = this.selectionList.map(item => item.id);
+ const res = await this.batchPrint(ids);
+ const { code, data } = res.data;
+ if (code === 200) {
+ this.dialogVisible = true;
+ console.log('data :>> ', data);
+ this.html = '';
+ data.forEach(item => {
+ return (this.html += item.templateHtml);
+ });
+ this.html;
+ }
+ },
+
+ /**
+ * 单独打印
+ */
+ async printData(rowData) {
+ const res = await this.batchPrint([rowData.row.id]);
+ const { code, data } = res.data;
+ if (code === 200) {
+ this.dialogVisible = true;
+ console.log('data :>> ', data);
+ this.html = '';
+ data.forEach(item => {
+ return (this.html += item.templateHtml);
+ });
+ this.html;
+ }
+ },
+
+ /**
+ * 调用打印机
+ */
+ printTemplate() {
+ const orderNodeList = document.querySelectorAll('.el-dialog__body>div>div>div');
+ print(orderNodeList);
+ },
},
};
-
-