From 8d40ef8f1fc9995d385961a0a3913997ae5f94f1 Mon Sep 17 00:00:00 2001
From: pengda <10266652509@qq.com>
Date: Tue, 6 May 2025 15:26:01 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=BB=B7=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E6=B8=B2=E6=9F=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/super/Ranking/Purchase.vue | 65 ++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 29 deletions(-)
diff --git a/src/views/super/Ranking/Purchase.vue b/src/views/super/Ranking/Purchase.vue
index 026d89b..df14d79 100644
--- a/src/views/super/Ranking/Purchase.vue
+++ b/src/views/super/Ranking/Purchase.vue
@@ -10,14 +10,13 @@
@dialogVisibleChange="dialogVisibleChange">
-
+
-
+
元 /
-
+
字(篇/页)
@@ -25,29 +24,29 @@
-
+
元
+ end-placeholder="结束日期" value-format="yyyy-MM-dd"
+ style="width: 100%;">
-
+
-
+
@@ -72,8 +71,8 @@
-
+
@@ -169,8 +168,8 @@ export default {
unit_num: '',
cost: '',
date: '',
- sdate: '',
- edate: '',
+ start_date: '',
+ end_date: '',
},
}
},
@@ -181,12 +180,20 @@ export default {
type2nameOptions() {
if(this.type2name.length == 0) return true
+ return Object.entries(this.type2name).map(([value, label]) => ({
+ label,
+ value: Number(value) // 如果你需要 value 是数字
+ }));
+ },
+ type2filterOptions() {
+ if(this.type2name.length == 0) return true
+
let options = Object.entries(this.type2name).map(([value, label]) => ({
label,
value: Number(value) // 如果你需要 value 是数字
}));
- return [{ label: '检测类型', value: '' }, ...options];
+ return [{ label: '全部检测类型', value: '' }, ...options];
}
},
watch: {
@@ -195,11 +202,11 @@ export default {
},
'form.date'(newVal) {
if (Array.isArray(newVal) && newVal.length === 2) {
- this.form.sdate = this.formatDateTime(new Date(newVal[0]));
- this.form.edate = this.formatDateTime(new Date(newVal[1]));
+ this.form.start_date = this.formatDateTime(new Date(newVal[0]));
+ this.form.end_date = this.formatDateTime(new Date(newVal[1]));
} else {
- this.form.sdate = '';
- this.form.edate = '';
+ this.form.start_date = '';
+ this.form.end_date = '';
}
}
},
@@ -266,13 +273,12 @@ export default {
unit_num: '',
cost: '',
date: '',
- sdate: '',
- edate: '',
+ start_date: '',
+ end_date: '',
}
this.dialogVisible = true;
}, // 确认按钮事件
handleConfirm() {
- console.log('提交成功:', this.form);
const that = this
if (!that.form.type) {
this.$message.warning('请选择检测类型');
@@ -295,10 +301,10 @@ export default {
this.$message.warning(response.info);
} else {
if(that.form.id > 0){
- this.$set(this.tableData, this.tableData.findIndex(item => item.id === this.form.id), {...this.form});
+ that.$set(this.tableData, this.tableData.findIndex(item => item.id === that.form.id), {...that.form});
}else{
that.form.id = response.data
- this.tableData.unshift(that.form);
+ that.tableData.unshift(that.form);
}
}
this.dialogVisible = false;
@@ -313,7 +319,7 @@ export default {
return
}
- if (!that.form.sdate || !that.form.edate) {
+ if (!that.form.start_date || !that.form.end_date) {
this.$message.warning('请选择起止日期');
return
}
@@ -324,18 +330,19 @@ export default {
unit_price: that.form.unit_price,
unit_num: that.form.unit_num,
cost: that.form.cost,
- sdate: that.form.sdate,
- edate: that.form.edate,
+ sdate: that.form.start_date,
+ edate: that.form.end_date,
}).then(response => {
this.$nextTick(() => {
if (!response.status) {
this.$message.warning(response.info);
} else {
if(that.form.id > 0){
- this.$set(this.tableData, this.tableData.findIndex(item => item.id === this.form.id), {...this.form});
+ that.$set(this.tableData, this.tableData.findIndex(item => item.id === that.form.id), {...that.form});
}else{
that.form.id = response.data
- this.tableData.unshift(that.form);
+ that.form.is_sync = 0
+ that.tableData.unshift(that.form);
}
}
this.dialogVisible = false;