Commit f48df4d7 by chenwq

refactor(ui): 优化对话框按钮布局和表格加载逻辑

- 调整对话框按钮顺序并新增插槽位置
- 修改表格组件支持禁用加载状态
- 统一客户管理页面加载状态处理
- 更新字段标签描述更准确
1 parent d5a5c134
...@@ -18,15 +18,16 @@ ...@@ -18,15 +18,16 @@
<slot /> <slot />
<div slot="footer"> <div slot="footer">
<slot name="btn-start" /> <slot name="btn-start" />
<el-button v-if="!noCancel"
@click="handleClose"> 取消 </el-button>
<slot name="btn-middle" />
<el-button type="primary" <el-button type="primary"
v-if="isShowFooter" v-if="isShowFooter"
@click="handleConfirm" @click="handleConfirm"
:loading="$store.state.d2admin.loading.value"> :loading="$store.state.d2admin.loading.value">
{{ btnOkLabel }} {{ btnOkLabel }}
</el-button> </el-button>
<el-button v-if="!noCancel" <slot name="btn-end" />
@click="handleClose"> 取消 </el-button>
<slot name="btn-middle" />
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
......
...@@ -228,6 +228,11 @@ export default { ...@@ -228,6 +228,11 @@ export default {
type: Function, type: Function,
default: null default: null
}, },
// 是否需要表格loading,默认需要
noLoading: {
type: Boolean,
default: false
},
// 搜索前操作 // 搜索前操作
beforeSearchFn: { beforeSearchFn: {
type: Function, type: Function,
...@@ -386,7 +391,9 @@ export default { ...@@ -386,7 +391,9 @@ export default {
// console.log(res) // console.log(res)
// 清空多选 // 清空多选
clearMuti && this.clearMutiSelect() clearMuti && this.clearMutiSelect()
if (!this.noLoading) {
this.loading = true this.loading = true
}
resetCurrentPage && (this.page.currentPage = 1) resetCurrentPage && (this.page.currentPage = 1)
var params = { var params = {
...this.page, ...this.page,
...@@ -514,6 +521,8 @@ export default { ...@@ -514,6 +521,8 @@ export default {
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
}).finally(() => {
this.$emit("apiFinish", this.data)
}) })
}) })
}, },
......
<!-- 下载对账单 --> <!-- 下载对账单 -->
<template> <template>
<d2-dialog title="下载对账单" :is-visible="accountVisible" class="accountDailog" width="688px" btn-ok-label="下载" @closeDialog="handleClose" @confirmDialog="handleAddConfirm"> <d2-dialog title="下载对账单" :is-visible="accountVisible" class="accountDailog" width="688px" btn-ok-label="下载" @closeDialog="handleClose" @confirmDialog="handleAddConfirm">
<el-button v-if="isTmpl" slot="btn-start" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button> <el-button v-if="isTmpl" slot="btn-end" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button>
<el-form ref="accountForm" :model="infoForm" :rules="formRules" label-width="120px" v-loading="loading"> <el-form ref="accountForm" :model="infoForm" :rules="formRules" label-width="120px" v-loading="loading">
<el-form-item label="商户类型:" prop="merchantType"> <el-form-item label="商户类型:" prop="merchantType">
<el-radio-group v-model="infoForm.merchantType" @change="changeType"> <el-radio-group v-model="infoForm.merchantType" @change="changeType">
......
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
return this.baseData.cooperModeOpt.find(opt => opt.confId == cellValue.cooperationMode)?.confLabel || '-' return this.baseData.cooperModeOpt.find(opt => opt.confId == cellValue.cooperationMode)?.confLabel || '-'
} }
}, { }, {
label: '直营品牌', label: '主营品牌',
name: 'salePotentialCustomerBrandDTOList', name: 'salePotentialCustomerBrandDTOList',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content" v-loading="tableLoading">
<div style="position: relative; margin-bottom: 10px;" v-loading="tableLoading"> <div style="position: relative; margin-bottom: 10px;">
<el-tabs v-model="activeName" @tab-click="handleSearch"> <el-tabs v-model="activeName" @tab-click="handleSearch">
<el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index"> <el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
</el-tab-pane> </el-tab-pane>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<auth-button category="Button" /> <auth-button category="Button" />
</div> </div>
</div> </div>
<d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :noLoading="noLoading" :before-search-fn="beforeSearchFn" @apiFinish="apiFinish">
<div slot="brandList" slot-scope="scope"> <div slot="brandList" slot-scope="scope">
<el-tooltip v-if="scope.scope.brandList && scope.scope.brandList.length" effect="dark" placement="top"> <el-tooltip v-if="scope.scope.brandList && scope.scope.brandList.length" effect="dark" placement="top">
<div slot="content" class="tooltip-content-max"> <div slot="content" class="tooltip-content-max">
...@@ -217,6 +217,7 @@ export default { ...@@ -217,6 +217,7 @@ export default {
isClear: true isClear: true
}], }],
getListApi: potentialCustomersPage, getListApi: potentialCustomersPage,
noLoading: true,
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'list',
...@@ -468,7 +469,7 @@ export default { ...@@ -468,7 +469,7 @@ export default {
resolve() resolve()
}) })
}, },
setTableFinishFun() { apiFinish() {
this.tableLoading = false this.tableLoading = false
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!