From 923a5f718de02d413bc0317465325c7b2cc96a5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com>
Date: Wed, 14 Aug 2024 22:45:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=82=AE=E7=AE=B1=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E8=A1=A8=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/config/table.js | 13 +++++++------
src/views/order/dataConfirm/index.vue | 23 ++++++++++++++++-------
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/src/config/table.js b/src/config/table.js
index f50de19..2d09426 100644
--- a/src/config/table.js
+++ b/src/config/table.js
@@ -28,8 +28,9 @@ export default {
* 自定义列保存处理
* @tableName scTable组件的props->tableName
* @column 用户配置好的列
+ * otherParams 冗余的参数
*/
- columnSettingSave: function (tableName, column ,params) {
+ columnSettingSave: function (tableName, column ,params, otherParams) {
column.forEach((item,index)=>{
item.sort = index+1;
})
@@ -38,12 +39,12 @@ export default {
resolve(false)
return
}
- let data = {
+ let data = Object.assign({},{
column_config:column,
save_column:true,
page:1,
pageSize:this.pageSize
- }
+ },otherParams);
http.post(params.url, data).then(res=>{
if(res.code == 200 && res.data.column){
resolve(true)
@@ -58,17 +59,17 @@ export default {
* @tableName scTable组件的props->tableName
* @column 组件接受到的props->column
*/
- columnSettingConfigSave: function (tableName, config, params) {
+ columnSettingConfigSave: function (tableName, config, params, otherParams) {
return new Promise((resolve) => {
if(!params.url || params.url==''){
resolve(false)
return
}
- let data = {
+ let data = Object.assign({},{
table_config:config,
page:1,
pageSize:this.pageSize
- }
+ },otherParams);
http.post(params.url, data).then(res=>{
if(res.code == 200 && res.data.column){
resolve(true)
diff --git a/src/views/order/dataConfirm/index.vue b/src/views/order/dataConfirm/index.vue
index 0e9e61b..fa77fc7 100644
--- a/src/views/order/dataConfirm/index.vue
+++ b/src/views/order/dataConfirm/index.vue
@@ -66,7 +66,7 @@
重置
-
+
@@ -96,7 +96,7 @@
{{scope.row[item.prop]?'已确认':'未确认'}}
- scope.row[item.prop]
+ {{ scope.row[item.prop] }}
@@ -312,7 +312,7 @@ export default {
const emailHeight = this.$refs.emailMain;
const remainingDistance = scrollbar.$el.scrollHeight + event.scrollTop + 100;
if (remainingDistance > emailHeight.clientHeight) {
- this.loadMore();
+ this.loadMore();
}
})
},
@@ -327,7 +327,9 @@ export default {
emailChange(item,isChange) {
this.emailId = isChange?item.id:this.emailId>0?this.emailId:item.id;
this.searchData = {};
- this.$refs.scSearch.reload();
+ if(this.$refs.scSearch){
+ this.$refs.scSearch.reload();
+ }
this.getEmailData();
},
async getEmailData() {
@@ -345,6 +347,10 @@ export default {
this.userColumn = res.data.columnConfig;
res.data.mail_info[0].text = this.stripHtmlTags(res.data.mail_info[0].summary)
this.emailParams = res.data.mail_info[0];
+
+ if(res.data.tableConfig && res.data.tableConfig.size){
+ this.config = res.data.tableConfig;
+ }
}
this.loading = false;
},
@@ -490,7 +496,8 @@ export default {
async columnSettingSave(userColumn){
this.$refs.columnSetting.isSave = true
try {
- await config.columnSettingSave(this.tableName, userColumn,this.apiObj);
+ let apiObj = this.$API.orders.order.mail.detail;
+ await config.columnSettingSave('', userColumn, apiObj, {mail_data_id:this.emailId});
this.$message.success('保存成功')
}catch(error){
this.$message.error('保存失败')
@@ -502,7 +509,8 @@ export default {
async columnSettingBack(userColumn){
this.$refs.columnSetting.isSave = true
try {
- const column = await config.columnSettingReset(this.tableName, userColumn,this.apiObj)
+ let apiObj = this.$API.orders.order.mail.detail;
+ const column = await config.columnSettingReset('', userColumn, apiObj, {mail_data_id:this.emailId})
if(column){
this.userColumn = column
this.$refs.columnSetting.usercolumn = JSON.parse(JSON.stringify(this.userColumn||[]))
@@ -515,7 +523,8 @@ export default {
},
async configSizeChange() {
try {
- await config.columnSettingConfigSave(this.tableName, this.config, this.apiObj);
+ let apiObj = this.$API.orders.order.mail.detail;
+ await config.columnSettingConfigSave('', this.config, apiObj, {mail_data_id:this.emailId});
this.$message.success('保存成功')
} catch (error) {
this.$message.error('保存失败')