From 18c30d6dc5e1c0890378ae3314b8936046a59562 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Fri, 27 May 2022 16:32:24 +0800
Subject: [PATCH] fix: BUG
---
src/store/modules/sales/product.js | 2 +-
src/views/chat/index.vue | 21 +++++++++++++++------
src/views/permission/employee/form.vue | 17 ++++++++++++++---
src/views/sales/order/detail.vue | 21 +++++++++++++++------
src/views/sales/product/form/step1.vue | 20 +++++++++++++++++++-
src/views/sales/product/form/step2.vue | 7 ++++++-
6 files changed, 70 insertions(+), 18 deletions(-)
diff --git a/src/store/modules/sales/product.js b/src/store/modules/sales/product.js
index 8e8c6a2..b83ed7d 100644
--- a/src/store/modules/sales/product.js
+++ b/src/store/modules/sales/product.js
@@ -115,7 +115,7 @@ const actions = {
data.virtualProductModifyDTOList = data.fileList.map((item) => {
return {
shipType: 1,
- shipContent: item,
+ shipContent: encodeURIComponent(item),
};
});
if (data.autoSend) {
diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue
index eb865a1..e782fd2 100644
--- a/src/views/chat/index.vue
+++ b/src/views/chat/index.vue
@@ -109,7 +109,12 @@
/>
发送
@@ -188,12 +193,16 @@
const handleLoadMore = () => {
store.dispatch('chat/querySessionMessage', { topMessageId: unref(sessionMessageList)[0].id });
};
- const handleSendMessage = () => {
- if (state.message) {
- store.dispatch('chat/submitMessage', { text: state.message });
- state.message = '';
+ const handleSendMessage = (e) => {
+ if (e && e.shiftKey) {
+ state.message += '\n';
} else {
- proxy.$message.warning('发送消息不能为空');
+ if (state.message) {
+ store.dispatch('chat/submitMessage', { text: state.message });
+ state.message = '';
+ } else {
+ proxy.$message.warning('发送消息不能为空');
+ }
}
};
diff --git a/src/views/permission/employee/form.vue b/src/views/permission/employee/form.vue
index d9e20e1..677ce20 100644
--- a/src/views/permission/employee/form.vue
+++ b/src/views/permission/employee/form.vue
@@ -114,6 +114,7 @@
phone: '',
remark: '',
userName: '',
+ password: '',
roleIds: [],
});
const permissionList = reactive([]);
@@ -156,9 +157,19 @@
data.voucherClueUrl = data.voucherClueUrls.join(',');
let res = await store.dispatch('employee/save', data);
if (res) {
- if (!data.id) {
- unref(refsForm).resetFields();
- }
+ Object.assign(form, {
+ id: null,
+ departmentId: null,
+ email: '',
+ employeeName: '',
+ employeeType: 1,
+ isEnable: false,
+ phone: '',
+ remark: '',
+ userName: '',
+ password: '',
+ roleIds: [],
+ });
handleClose();
}
} catch (e) {
diff --git a/src/views/sales/order/detail.vue b/src/views/sales/order/detail.vue
index ef35c79..ccd74f6 100644
--- a/src/views/sales/order/detail.vue
+++ b/src/views/sales/order/detail.vue
@@ -118,10 +118,13 @@
¥{{ new Number(row.realAmount).toFixed(2) }}
-
- 合计:
- ¥{{ new Number(state.sum).toFixed(2) }}
-
+
+
买家留言:{{ state.form.useMessage || '无' }}
+
+ 合计:
+ ¥{{ new Number(state.sum).toFixed(2) }}
+
+
费用信息
@@ -274,8 +277,14 @@
margin-bottom: @layout-space;
}
.summary {
- text-align: right;
- margin-top: @layout-space;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin: @layout-space 0;
+ .right {
+ text-align: right;
+ margin-bottom: 0;
+ }
}
}
.red {
diff --git a/src/views/sales/product/form/step1.vue b/src/views/sales/product/form/step1.vue
index d216cdf..191cde6 100644
--- a/src/views/sales/product/form/step1.vue
+++ b/src/views/sales/product/form/step1.vue
@@ -148,7 +148,7 @@
data.mainPicture = data.pictureList[0];
state.form.id = await store.dispatch('product/save', state.form);
if (state.form.id) {
- unref(state.refsForm).resetFields();
+ store.commit('layout/closeTab', { current: true });
router.push({
name: 'UpdateProduct',
params: {
@@ -156,6 +156,24 @@
step: 2,
},
});
+ state.form = {
+ id: null,
+ categoryId: null,
+ productType: 1,
+ name: null,
+ remark: null,
+ isRecommend: false,
+ singleBuyLimit: 1,
+ limit: 0,
+ postage: 0,
+ remoteAreaPostage: 10,
+ pictureList: [],
+ fileList: [],
+ autoSend: null,
+ detail: null,
+ isEnable: false,
+ virtualProductModifyDTOList: [],
+ };
}
} catch (e) {
console.info('取消保存', e);
diff --git a/src/views/sales/product/form/step2.vue b/src/views/sales/product/form/step2.vue
index 0148ecb..2890efd 100644
--- a/src/views/sales/product/form/step2.vue
+++ b/src/views/sales/product/form/step2.vue
@@ -121,6 +121,7 @@
skuValue: [],
form: {
id: null,
+ productType: 1,
attrsGroupList: [],
skuInfos: [],
},
@@ -130,7 +131,11 @@
const id = route.params.id;
if (id && id !== state.form.id) {
state.form.id = id;
- let res = await store.dispatch('productSkus/search', id);
+ let res = await store.dispatch('product/detail', id);
+ if (res) {
+ Object.assign(state.form, state.form);
+ }
+ res = await store.dispatch('productSkus/search', id);
state.form.skuInfos = res.map((item) => {
return {
...item,