|
|
@@ -80,9 +80,9 @@
|
|
|
|
|
|
<div v-if='isEdit'
|
|
|
style="display: flex;justify-content: space-between; padding: 30px 30px; position: fixed; bottom: 0; width: 100%; height: 80px;">
|
|
|
- <van-button style="width:48%" type="primary" @click="handleAudit(1)">提交
|
|
|
+ <van-button style="width:48%" type="primary" :loading="loading" @click="handleAudit(1)">提交
|
|
|
</van-button>
|
|
|
- <van-button style="width:48%" type="danger" @click="onClickLeft">取消
|
|
|
+ <van-button style="width:48%" type="danger" :loading="loading" @click="onClickLeft">取消
|
|
|
</van-button>
|
|
|
</div>
|
|
|
|
|
|
@@ -104,6 +104,7 @@
|
|
|
Vue.createApp({
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
isFlag: false,
|
|
|
isEdit: true,
|
|
|
title: '',
|
|
|
@@ -272,8 +273,13 @@
|
|
|
});
|
|
|
},
|
|
|
async handleAudit(status) {
|
|
|
-
|
|
|
- this.form.valueJson = await this.generateFormValid();
|
|
|
+ this.loading = true;
|
|
|
+ try {
|
|
|
+ this.form.valueJson = await this.generateFormValid();
|
|
|
+ } catch (error) {
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log(this.form.valueJson)
|
|
|
this.form.processType = '1';
|
|
|
let API = this.APIUrl + '/bpm/process-instance/create'
|
|
|
@@ -285,6 +291,7 @@
|
|
|
...this.form,
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
+ this.loading = false;
|
|
|
if (res.data.code != '-1') {
|
|
|
vant.showNotify({
|
|
|
type: 'success',
|
|
|
@@ -294,7 +301,20 @@
|
|
|
setTimeout(() => {
|
|
|
this.onClickLeft()
|
|
|
}, 1000)
|
|
|
+ } else {
|
|
|
+ vant.showNotify({
|
|
|
+ type: 'danger',
|
|
|
+ message: `提交失败!${res.data.message}`,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
}
|
|
|
+ }).catch((err) => {
|
|
|
+ vant.showNotify({
|
|
|
+ type: 'danger',
|
|
|
+ message: `提交失败!${err.message}`,
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
onClickLeft() {
|