Commit f48df4d7 by chenwq

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

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