|
@@ -146,34 +146,68 @@ export default {
|
|
// this.loading = false;
|
|
// this.loading = false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 删除操作
|
|
|
|
- handleDeleteList(row) {
|
|
|
|
- try {
|
|
|
|
- this.loading = true;
|
|
|
|
|
|
|
|
- this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
|
|
|
|
|
|
+ // 操作提示弹窗
|
|
|
|
+ handleConfirmTips(success){
|
|
|
|
+
|
|
|
|
+ this.$confirm('是否继续此操作?', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
- }).then( async() => {
|
|
|
|
|
|
+ }).then(() => {
|
|
|
|
+
|
|
|
|
+ success();
|
|
|
|
+
|
|
|
|
+ }).catch(() => {
|
|
|
|
+
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: '已取消操作!'
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 删除操作
|
|
|
|
+ handleDeleteList(row) {
|
|
|
|
+ try {
|
|
|
|
+ this.loading = true;
|
|
|
|
+
|
|
|
|
+ this.handleConfirmTips(async()=>{
|
|
|
|
|
|
const { id } = row;
|
|
const { id } = row;
|
|
|
|
|
|
const { code } = await orderApi.remove(id);
|
|
const { code } = await orderApi.remove(id);
|
|
-
|
|
|
|
|
|
+
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
|
|
|
this.fetchList(this.params, this.page);
|
|
this.fetchList(this.params, this.page);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ })
|
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
|
+ // this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
|
|
|
|
+ // confirmButtonText: '确定',
|
|
|
|
+ // cancelButtonText: '取消',
|
|
|
|
+ // type: 'warning'
|
|
|
|
+ // }).then( async() => {
|
|
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: '已取消删除'
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ // const { id } = row;
|
|
|
|
+
|
|
|
|
+ // const { code } = await orderApi.remove(id);
|
|
|
|
+
|
|
|
|
+ // if (code === 200) {
|
|
|
|
+
|
|
|
|
+ // this.fetchList(this.params, this.page);
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // }).catch(() => {
|
|
|
|
+
|
|
|
|
+ // this.$message({
|
|
|
|
+ // type: 'info',
|
|
|
|
+ // message: '已取消删除'
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
//
|
|
//
|
|
@@ -182,17 +216,21 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 提交
|
|
// 提交
|
|
- async handleSubmit(row) {
|
|
|
|
- try {
|
|
|
|
-
|
|
|
|
- let { code } = await orderApi.submit({ puOrderId: row.id });
|
|
|
|
|
|
+ handleSubmit(row) {
|
|
|
|
|
|
- if (code == 200) {
|
|
|
|
|
|
+ try {
|
|
|
|
|
|
- this.fetchList(this.params, this.page);
|
|
|
|
|
|
+ this.handleConfirmTips(async()=>{
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ let { code } = await orderApi.submit({ puOrderId: row.id });
|
|
|
|
+
|
|
|
|
+ if (code == 200) {
|
|
|
|
+
|
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ })
|
|
} catch (error) {
|
|
} catch (error) {
|
|
} finally {
|
|
} finally {
|
|
}
|
|
}
|
|
@@ -256,28 +294,27 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
// 整单关闭
|
|
// 整单关闭
|
|
- async handleAllClose() {
|
|
|
|
|
|
+ handleAllClose() {
|
|
// 未审批状态下整单关闭
|
|
// 未审批状态下整单关闭
|
|
try {
|
|
try {
|
|
|
|
|
|
- let puOrderIds = this.checkedList.map(order => {
|
|
|
|
-
|
|
|
|
- return order.id;
|
|
|
|
|
|
+ this.handleDeleteList(async() =>{
|
|
|
|
|
|
- })
|
|
|
|
|
|
+ let puOrderIds = this.checkedList.map(order => {
|
|
|
|
|
|
- let { code } = await orderApi.close({ puOrderIds });
|
|
|
|
|
|
+ return order.id;
|
|
|
|
|
|
- if (code === 200) {
|
|
|
|
|
|
+ })
|
|
|
|
|
|
- this.fetchList(this.params, this.page);
|
|
|
|
|
|
+ let { code } = await orderApi.close({ puOrderIds });
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ if (code === 200) {
|
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
|
+ this.fetchList(this.params, this.page);
|
|
|
|
|
|
- } finally {
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } catch (error) { }
|
|
},
|
|
},
|
|
// 付款协议
|
|
// 付款协议
|
|
async handlePaymentRequest(){
|
|
async handlePaymentRequest(){
|
|
@@ -285,6 +322,8 @@ export default {
|
|
try {
|
|
try {
|
|
// let {name} = this.$store.state.user;
|
|
// let {name} = this.$store.state.user;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
let {code,msg} = await orderApi.payRequest();
|
|
let {code,msg} = await orderApi.payRequest();
|
|
|
|
|
|
if(code == 200){
|
|
if(code == 200){
|