|
@@ -216,26 +216,73 @@ export default {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
+ // 批量提交
|
|
|
+ handleBatchSubmit(){
|
|
|
+
|
|
|
+ let inconformity = this.checkedList.filter(row => !(row.status == '0' || row.status == '3'));
|
|
|
+
|
|
|
+ console.log(inconformity,'inconformity--------');
|
|
|
+
|
|
|
+ if(!inconformity.length && this.checkedList.length){
|
|
|
+
|
|
|
+ let puOrderIds = this.checkedList.map( item => Number(item.id));
|
|
|
+
|
|
|
+ this.fetchSubmit(puOrderIds);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '当前选中存在不满足提交条件的数据!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
// 提交
|
|
|
handleSubmit(row) {
|
|
|
|
|
|
- try {
|
|
|
+ let puOrderIds = [Number(row.id)];
|
|
|
+
|
|
|
+ this.fetchSubmit(puOrderIds);
|
|
|
+
|
|
|
+ // try {
|
|
|
|
|
|
- this.handleConfirmTips(async()=>{
|
|
|
+ // this.handleConfirmTips(async()=>{
|
|
|
|
|
|
- let { code } = await orderApi.submit({ puOrderId: row.id });
|
|
|
+ // let { code } = await orderApi.submit({ puOrderId: row.id });
|
|
|
|
|
|
- if (code == 200) {
|
|
|
+ // if (code == 200) {
|
|
|
|
|
|
- this.handleRefreshList();
|
|
|
+ // this.handleRefreshList();
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // } catch (error) {
|
|
|
+ // } finally {
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ fetchSubmit(puOrderIds){
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ this.handleConfirmTips(async()=>{
|
|
|
+
|
|
|
+ let { code } = await orderApi.submit({ puOrderIds});
|
|
|
|
|
|
- })
|
|
|
+ if (code == 200) {
|
|
|
+
|
|
|
+ this.handleRefreshList();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
} finally {
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
// 判断“整单退回”按钮
|
|
|
judgeIsAllReturn() {
|
|
|
if (this.checkedList.length == 1) {
|
|
@@ -528,6 +575,7 @@ export default {
|
|
|
|
|
|
<el-button-group style="margin-left: 10px">
|
|
|
<el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
|
|
|
+ <el-button size="mini" @click="handleBatchSubmit">批量提交</el-button>
|
|
|
</el-button-group>
|
|
|
|
|
|
<el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
|