From f6d79d6eee41568a4ca93685a4774129b05cb310 Mon Sep 17 00:00:00 2001
From: lichong <18518571399@163.com>
Date: Tue, 2 Jul 2024 17:50:37 +0800
Subject: [PATCH] 1233
---
.../src/renderer/src/assets/json/dingdan.json | 2 +-
.../src/components/dingdantablecomponent.vue | 6 +-
front/src/renderer/src/views/dingdan.vue | 189 +++++++++++-------
3 files changed, 120 insertions(+), 77 deletions(-)
diff --git a/front/src/renderer/src/assets/json/dingdan.json b/front/src/renderer/src/assets/json/dingdan.json
index 723ccd6..927d657 100644
--- a/front/src/renderer/src/assets/json/dingdan.json
+++ b/front/src/renderer/src/assets/json/dingdan.json
@@ -63,7 +63,7 @@
"type": "number",
"tableShow": true,
"formShow": true,
- "exportS6": true
+ "exportS6": false
},
{
"label": "条码",
diff --git a/front/src/renderer/src/components/dingdantablecomponent.vue b/front/src/renderer/src/components/dingdantablecomponent.vue
index de0832e..5127bd5 100644
--- a/front/src/renderer/src/components/dingdantablecomponent.vue
+++ b/front/src/renderer/src/components/dingdantablecomponent.vue
@@ -129,9 +129,6 @@ export default {
// 设置行属性
getRowClassName({ row }) {
let rowClassName = ""
- if (row.isNotSale) {
- rowClassName = "blueRow"
- }
if (row.xiaoshoujine < row.zuigaocaigoujia) {
rowClassName = "redRow"
}
@@ -141,6 +138,9 @@ export default {
if (dayjs(row.update_at.slice(0, 19)).valueOf() > dayjs(row.create_at.slice(0, 19)).valueOf()) {
rowClassName = "lightYellowRow"
}
+ if (row.isNotSale) {
+ rowClassName = "blueRow"
+ }
return rowClassName
},
diff --git a/front/src/renderer/src/views/dingdan.vue b/front/src/renderer/src/views/dingdan.vue
index a4014c4..6ccfdf5 100644
--- a/front/src/renderer/src/views/dingdan.vue
+++ b/front/src/renderer/src/views/dingdan.vue
@@ -249,10 +249,10 @@ export default {
type: 'error'
})
} else {
- ElMessage({
- message: str.msg,
- type: 'success'
- })
+ // ElMessage({
+ // message: str.msg,
+ // type: 'success'
+ // })
this[`deal${str.subType}`](str.list)
}
})
@@ -413,7 +413,7 @@ export default {
delAll() {
ElMessageBox.confirm(
`是否删除全部数据?此操作不可逆!`,
- 'danger',
+ '危险操作',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
@@ -463,79 +463,122 @@ export default {
},
//处理销售订单的导出数据
dealexportxiaoshou(list) {
- let lilstLocal = []
- let allMoney = 0
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- let listItem = {}
- allMoney += item.xiaoshoujine
- for (let j = 0; j < this.exportxiaoshou.length; j++) {
- let headerItem = this.exportxiaoshou[j];
- listItem[headerItem.label] = item[headerItem.prop]
- }
- lilstLocal.push(listItem)
- }
- // lilstLocal.push({ "销售金额": `总计:${allMoney}` })
- let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
- let workBook = {
- SheetNames: ["sheet1"],
- Sheets: {
- ["sheet1"]: jsonWorkSheet,
+ let isNotSaleGroupy = _.filter(list, o => o.isNotSale)
+ let lowcaigoujia = _.filter(list, o => o.xiaoshoujine < o.zuigaocaigoujia)
+ let duogechanpin = _.filter(list, o => o.pinmingxuanxiang.length > 1)
+ ElMessageBox.confirm(
+ `当前还有${isNotSaleGroupy.length}条未售卖的数据未处理、${lowcaigoujia.length}条低于采购价的数据未处理、${duogechanpin.length}条多个产品的数据未处理,是否确认导出?`,
+ '导出销售订单',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ dangerouslyUseHTMLString: true,
+ type: 'danger',
}
- };
- return this.$XLSX.writeFile(workBook, `销售订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
+ )
+ .then(async () => {
+ let lilstLocal = []
+ let allMoney = 0
+ for (let i = 0; i < list.length; i++) {
+ let item = list[i];
+ let listItem = {}
+ allMoney += item.xiaoshoujine
+ for (let j = 0; j < this.exportxiaoshou.length; j++) {
+ let headerItem = this.exportxiaoshou[j];
+ listItem[headerItem.label] = item[headerItem.prop]
+ }
+ lilstLocal.push(listItem)
+ }
+ // lilstLocal.push({ "销售金额": `总计:${allMoney}` })
+ let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
+ let workBook = {
+ SheetNames: ["sheet1"],
+ Sheets: {
+ ["sheet1"]: jsonWorkSheet,
+ }
+ };
+ return this.$XLSX.writeFile(workBook, `销售订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: '取消删除',
+ })
+ })
},
//导出S6
dealexportS6(list) {
- let lilstLocal = []
- let allMoney = 0
- let allObj = {
- "厂编": "",
- "货号": "",
- "Q7平台经销商": "",
- "业务员": "",
- "业务类型": "",
- "主表备注": "",
- "仓库": "",
- "付款方式": "",
- "单价": "",
- "单据单位": "",
- "单据单位单价": "",
- "单据单位数量": "",
- "单据类型": "",
- "发货地址": "",
- "备注": "",
- "客户收货日期": "",
- "客户订单号": "",
- "店号": "",
- "批号": "",
- "数量": "",
- "是否赠品": "",
- "理货员": "",
- "销售单号": "",
- "销售日期": "",
- "预计开票日": "",
- "预订货编号": "",
- }
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- let listItem = {}
- allMoney += item.danjudanweishuliang
- for (let j = 0; j < this.exportS6.length; j++) {
- let headerItem = this.exportS6[j];
- listItem[headerItem.label] = item[headerItem.prop]
- }
- lilstLocal.push({ ...allObj, ...listItem })
- }
- // lilstLocal.push({ "单据单位数量": `总计:${allMoney}` })
- let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
- let workBook = {
- SheetNames: ["sheet1"],
- Sheets: {
- ["sheet1"]: jsonWorkSheet,
+ let isNotSaleGroupy = _.filter(list, o => o.isNotSale)
+ let lowcaigoujia = _.filter(list, o => o.xiaoshoujine < o.zuigaocaigoujia)
+ let duogechanpin = _.filter(list, o => o.pinmingxuanxiang.length > 1)
+ ElMessageBox.confirm(
+ `当前还有${isNotSaleGroupy.length}条未售卖的数据未处理、${lowcaigoujia.length}条低于采购价的数据未处理、${duogechanpin.length}条多个产品的数据未处理,是否确认导出?`,
+ '导出S6订单',
+ {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ dangerouslyUseHTMLString: true,
+ type: 'danger',
}
- };
- return this.$XLSX.writeFile(workBook, `S6订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
+ )
+ .then(async () => {
+ let lilstLocal = []
+ let allMoney = 0
+ let allObj = {
+ "厂编": "",
+ "货号": "",
+ "Q7平台经销商": "",
+ "业务员": "",
+ "业务类型": "",
+ "主表备注": "",
+ "仓库": "",
+ "付款方式": "",
+ "单价": "",
+ "单据单位": "",
+ "单据单位单价": "",
+ "单据单位数量": "",
+ "单据类型": "",
+ "发货地址": "",
+ "备注": "",
+ "客户收货日期": "",
+ "客户订单号": "",
+ "店号": "",
+ "批号": "",
+ "数量": "",
+ "是否赠品": "",
+ "理货员": "",
+ "销售单号": "",
+ "销售日期": "",
+ "预计开票日": "",
+ "预订货编号": "",
+ }
+ for (let i = 0; i < list.length; i++) {
+ let item = list[i];
+ let listItem = {}
+ allMoney += item.danjudanweishuliang
+ for (let j = 0; j < this.exportS6.length; j++) {
+ let headerItem = this.exportS6[j];
+ listItem[headerItem.label] = item[headerItem.prop]
+ }
+ lilstLocal.push({ ...allObj, ...listItem, "单据单位数量": item.xiugaihouxiaoshoushuliang })
+ }
+ // lilstLocal.push({ "单据单位数量": `总计:${allMoney}` })
+ let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
+ let workBook = {
+ SheetNames: ["sheet1"],
+ Sheets: {
+ ["sheet1"]: jsonWorkSheet,
+ }
+ };
+ return this.$XLSX.writeFile(workBook, `S6订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: '取消删除',
+ })
+ })
+
},
},