refactor: 重构组件逻辑与样式优化

- 在 App.vue 中重构站点信息的获取与应用逻辑,提升代码可读性与维护性。
- 更新 Search.vue 组件,优化搜索框的样式与结构,增强用户体验。
- 在 element.scss 中注释掉不再使用的样式,并新增确认收货按钮的样式。
- 改进多个页面的布局与样式,确保响应式设计的一致性与美观性。
- 更新订单相关组件的按钮样式,提升视觉一致性与可用性。
This commit is contained in:
田香琪
2026-06-30 21:09:28 +08:00
parent ec948b5496
commit 28a857249a
121 changed files with 5122 additions and 2182 deletions

View File

@@ -69,6 +69,8 @@
<el-form-item label="支持电子面单">
<el-switch
v-model="form.standBy"
active-value="true"
inactive-value="false"
inline-prompt
active-text="开"
inactive-text="关"
@@ -106,10 +108,12 @@ import {
const defaultForm = () => ({
name: "",
code: "",
standBy: false,
standBy: "false",
disabled: "CLOSE",
});
const normalizeStandBy = (value) => (value === true || value === "true" ? "true" : "false");
export default {
name: "logistics",
data() {
@@ -159,7 +163,7 @@ export default {
const data = res.result.records;
data.forEach((e) => {
e.switch = e.disabled === "OPEN";
e.standBy = e.standBy == "null" || !e.standBy ? false : !!e.standBy;
e.standBy = normalizeStandBy(e.standBy);
});
this.data = data;
this.total = res.result.total;
@@ -167,11 +171,12 @@ export default {
});
},
changeSwitch(row) {
this.form.name = row.name;
this.form.code = row.code;
this.form.standBy = row.standBy;
this.form.disabled = row.disabled === "CLOSE" ? "OPEN" : "CLOSE";
updateLogistics(row.id, this.form).then((res) => {
updateLogistics(row.id, {
name: row.name,
code: row.code,
standBy: normalizeStandBy(row.standBy),
disabled: row.disabled === "CLOSE" ? "OPEN" : "CLOSE",
}).then((res) => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
@@ -186,7 +191,10 @@ export default {
this.submitLoading = true;
if (this.modalTitle === "添加") {
const payload = { ...this.form };
const payload = {
...this.form,
standBy: normalizeStandBy(this.form.standBy),
};
delete payload.id;
addLogistics(payload).then((res) => {
this.submitLoading = false;
@@ -197,7 +205,10 @@ export default {
}
});
} else {
updateLogistics(this.id, this.form).then((res) => {
updateLogistics(this.id, {
...this.form,
standBy: normalizeStandBy(this.form.standBy),
}).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
@@ -222,7 +233,7 @@ export default {
this.form = {
name: v.name,
code: v.code,
standBy: v.standBy == "null" || !v.standBy ? false : !!v.standBy,
standBy: normalizeStandBy(v.standBy),
disabled: v.disabled,
};
this.modalVisible = true;