|
@@ -304,19 +304,49 @@ export default {
|
|
|
},
|
|
|
fetchSubmit(puOrderIds){
|
|
|
|
|
|
+ let _this = this;
|
|
|
+
|
|
|
this.handleConfirmTips(async()=>{
|
|
|
|
|
|
try {
|
|
|
|
|
|
+ _this.loading = true;
|
|
|
|
|
|
- this.loading = true;
|
|
|
-
|
|
|
- let { code } = await orderApi.submit({ puOrderIds});
|
|
|
-
|
|
|
+ let { code,msg } = await orderApi.submit({ puOrderIds,checkAmount:true});
|
|
|
+ console.log(code,'code');
|
|
|
if (code == 200) {
|
|
|
|
|
|
- this.handleRefreshList();
|
|
|
-
|
|
|
+ _this.handleRefreshList();
|
|
|
+
|
|
|
+ }else if(code == 10000){
|
|
|
+
|
|
|
+ _this.$alert(msg, '提示', {
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '置为0并提交',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ beforeClose: async(action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ try {
|
|
|
+ instance.confirmButtonLoading = true;
|
|
|
+ instance.confirmButtonText = '执行中...';
|
|
|
+ let { code,msg } = await orderApi.submit({ puOrderIds,checkAmount:false});
|
|
|
+ if(code == 200){
|
|
|
+ done();
|
|
|
+ _this.handleRefreshList();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }finally{
|
|
|
+ instance.confirmButtonLoading = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ done();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
} catch (error) {}
|