Commit dc28124c by 前端

Merge branch 'xuyl_v2.8.0' into 'v2.8.0'

给发送请求添加loading

See merge request !34
2 parents 4fee9379 5345081c
......@@ -315,33 +315,26 @@ export default {
merchantId: this.merchantId,
file: this.fileBaseUrl,
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
customerApi.addCustomerList(params).then(
(res) => {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
loading.close()
if (res.code == '0') {
loading.close()
this.dialogVisible = true
this.uploadStatus = 'success'
this.uploadSuccessMsg = res.data
} else {
loading.close()
this.dialogVisible = true
this.uploadStatus = 'fail'
this.uploadErrorMsg = res.message
}
},
(err) => {
let loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
loading.close()
this.dialogVisible = true
this.uploadStatus = 'fail'
......
......@@ -47,7 +47,7 @@
</el-form-item>
</el-form>
<d2-table
class="my-row-height"
class="my-row-height"
ref="merchantTable"
:hasNum="true"
:tableParams="merchantTableParams"
......@@ -147,7 +147,7 @@ export default {
},
{
label: '批次号',
prop: 'batchNo'
prop: 'batchNo',
},
{
label: '状态',
......@@ -211,8 +211,15 @@ export default {
async comfirmDialog(type) {
if (type == 'cogradient') {
// 合并
const loading = this.$loading({
lock: true,
text: '同步中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
await customerApi.synchroCustomerList({ id: this.optionsId }).then(
(res) => {
loading.close()
if (res.code == '0') {
this.$message.success('同步成功')
} else {
......@@ -220,6 +227,7 @@ export default {
}
},
(err) => {
loading.close()
this.$message.error(err)
}
)
......@@ -228,8 +236,15 @@ export default {
}
// 删除
if (type == 'delete') {
const loadingDel = this.$loading({
lock: true,
text: '删除中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
customerApi.deleteCustomerList({ id: this.optionsId }).then(
(res) => {
loadingDel.close()
if (res.code == '0') {
this.$message.success('删除成功')
this.$refs.merchantTable.refreshTable()
......@@ -238,6 +253,7 @@ export default {
}
},
(err) => {
loadingDel.close()
this.$message.error(err)
}
)
......@@ -258,6 +274,6 @@ export default {
padding-right: 5px;
}
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
height: 48px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!