新增耗材入库-ai批量入库

This commit is contained in:
gyq
2025-11-28 18:02:17 +08:00
parent 89f9283163
commit abcec9f62b
9 changed files with 494 additions and 58 deletions

View File

@@ -681,13 +681,15 @@ export default {
shopId: this.shopInfo.id
});
this.trade = res;
this.tradeLoading = false;
this.tradeSale = res.sale;
this.tradeVip = res.vip;
this.tradeCount = res.count;
} catch (error) {
console.log(error);
}
setTimeout(() => {
this.tradeLoading = false;
}, 500);
},
lineChartTypeChange(i) {
this.lineChartType = i;

View File

@@ -8,9 +8,8 @@
<el-form :model="query" inline label-position="left">
<template v-if="orderType == 2">
<el-form-item>
<el-input placeholder="商品名称" v-model="query.productName" />
<el-input placeholder="商品名称" v-model="query.productName" clearable />
</el-form-item>
<el-form-item v-if="isHeadShop == 1 && loginType == 0">
<el-select v-model="shopId" placeholder="选择分店" style="width: 200px; margin-right: 10px"
@change="getCategory">
@@ -35,12 +34,12 @@
<el-radio-button value="custom">自定义</el-radio-button>
</el-radio-group>
<el-date-picker class="u-m-l-10" v-model="query.createdAt" type="daterange" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" :disabled-date="disabledDate"
v-if="timeValue == 'custom'"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="getTableData">查询</el-button>
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
<el-button icon="download" v-loading="downloadLoading" @click="downloadHandle">
<span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span>
@@ -205,7 +204,7 @@ export default {
orderType: "2",
categorys: [],
query: {
createdAt: [],
createdAt: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
productName: "",
prodCategoryId: "",
},
@@ -225,6 +224,12 @@ export default {
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop,
loginType: localStorage.getItem("loginType"),
shopInfo: JSON.parse(localStorage.getItem("userInfo")),
disabledDate: (time) => {
// dayjs().startOf('day'):获取今天的 00:00:00
// dayjs(time):将原生 Date 转为 dayjs 对象
// isAfter判断目标日期是否在今天之后
return dayjs(time).isAfter(dayjs().startOf('day'));
}
};
},
filters: {
@@ -268,9 +273,9 @@ export default {
// 获取订单汇总
async daycount() {
try {
if (this.query.createdAt[1]) {
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
}
// if (this.query.createdAt[1]) {
// this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
// }
const res = await saleSummaryApi.count({
beginDate: this.query.createdAt[0],
endDate: this.query.createdAt[1],
@@ -289,9 +294,9 @@ export default {
async downloadHandle() {
try {
this.downloadLoading = true;
if (this.query.createdAt[1]) {
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
}
// if (this.query.createdAt[1]) {
// this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
// }
const file = await saleSummaryApi.export({
beginDate: this.query.createdAt[0],
endDate: this.query.createdAt[1],
@@ -307,7 +312,7 @@ export default {
},
// 重置查询
resetHandle() {
this.timeValue = "";
this.timeValue = 'today';
this.query = { ...this.resetQuery };
this.page = 1;
this.getTableData();
@@ -327,9 +332,9 @@ export default {
this.tableData.loading = true;
try {
this.daycount();
if (this.query.createdAt[1]) {
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
}
// if (this.query.createdAt[1]) {
// this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
// }
const res = await saleSummaryApi.page({
page: this.tableData.page,
size: this.tableData.size,
@@ -347,11 +352,17 @@ export default {
} catch (error) {
console.log(error);
}
this.tableData.loading = false;
setTimeout(() => {
this.tableData.loading = false;
}, 500);
},
// 切换时间
timeChange(e) {
this.query.createdAt = formatDateRange(e)
if (e !== 'custom') {
this.query.createdAt = formatDateRange(e)
} else {
this.query.createdAt = []
}
},
},
};