Commit 9f44d5ed authored by dragondean@qq.com's avatar dragondean@qq.com

优化提货错误太长的提示

parent 030d38d3
......@@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode'
import Cookies from "js-cookie";
import {getTenantEnable} from "@/utils/ruoyi";
import { getLocale } from '@/utils/db';
import i18n from "@/i18n";
// 是否显示重新登录
export let isRelogin = { show: false };
......@@ -114,9 +115,15 @@ service.interceptors.response.use(res => {
// 额外情况
return Promise.reject(res.data)
} else if (code !== 200) {
Notification.error({
title: msg
})
// 如果内容很长则用alert提示,不然可能显示不全,自动隐藏也会导致看不完整就消失了
if(msg.length > 300){
MessageBox.alert(msg, i18n.t('错误提示'), i18n.t('确定'))
}else{
Notification.error({
title: msg
})
}
return Promise.reject(msg || 'error')
} else {
return res.data
......
......@@ -33,7 +33,7 @@
</el-tab-pane>
</el-tabs>
<el-form-item label="">
<el-button type="primary" @click="submit">{{$t('提交')}}</el-button>
<el-button type="primary" @click="submit" :loading="loading">{{$t('提交')}}</el-button>
</el-form-item>
</el-form>
</el-dialog>
......@@ -47,6 +47,8 @@ export default {
},
data(){
return {
// 提交中状态
loading: false,
current: 'createBatch',
show: false,
form:{
......@@ -94,10 +96,12 @@ export default {
})
}
}
this.loading = true;
({createBatch, createSplitBatch}[this.current])(data).then(res => {
this.$message.success(this.$t("操作成功"));
this.$emit('success')
}).finally(() => {
this.loading = false
})
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment