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