Browse Source

1233

master
lichong 9 months ago
parent
commit
f6d79d6eee
  1. 2
      front/src/renderer/src/assets/json/dingdan.json
  2. 6
      front/src/renderer/src/components/dingdantablecomponent.vue
  3. 55
      front/src/renderer/src/views/dingdan.vue

2
front/src/renderer/src/assets/json/dingdan.json

@ -63,7 +63,7 @@
"type": "number",
"tableShow": true,
"formShow": true,
"exportS6": true
"exportS6": false
},
{
"label": "条码",

6
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
},

55
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,6 +463,20 @@ export default {
},
//
dealexportxiaoshou(list) {
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(
`当前还有<span style="color:red;">${isNotSaleGroupy.length}</span>条未售卖的数据未处理、<span style="color:red;">${lowcaigoujia.length}</span>条低于采购价的数据未处理、<span style="color:red;">${duogechanpin.length}</span>条多个产品的数据未处理,是否确认导出?`,
'导出销售订单',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'danger',
}
)
.then(async () => {
let lilstLocal = []
let allMoney = 0
for (let i = 0; i < list.length; i++) {
@ -484,9 +498,30 @@ export default {
}
};
return this.$XLSX.writeFile(workBook, `销售订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
})
.catch(() => {
ElMessage({
type: 'info',
message: '取消删除',
})
})
},
//S6
dealexportS6(list) {
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(
`当前还有<span style="color:red;">${isNotSaleGroupy.length}</span>条未售卖的数据未处理、<span style="color:red;">${lowcaigoujia.length}</span>条低于采购价的数据未处理、<span style="color:red;">${duogechanpin.length}</span>条多个产品的数据未处理,是否确认导出?`,
'导出S6订单',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
dangerouslyUseHTMLString: true,
type: 'danger',
}
)
.then(async () => {
let lilstLocal = []
let allMoney = 0
let allObj = {
@ -525,7 +560,7 @@ export default {
let headerItem = this.exportS6[j];
listItem[headerItem.label] = item[headerItem.prop]
}
lilstLocal.push({ ...allObj, ...listItem })
lilstLocal.push({ ...allObj, ...listItem, "单据单位数量": item.xiugaihouxiaoshoushuliang })
}
// lilstLocal.push({ "": `${allMoney}` })
let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
@ -536,6 +571,14 @@ export default {
}
};
return this.$XLSX.writeFile(workBook, `S6订单${dayjs().format("YYYY-MM-DD_HH-mm-ss")}.xlsx`);
})
.catch(() => {
ElMessage({
type: 'info',
message: '取消删除',
})
})
},
},

Loading…
Cancel
Save