|
@@ -93,6 +93,7 @@
|
|
|
<a-button type="primary" icon="import">导入</a-button>
|
|
|
</a-upload>
|
|
|
<a-button type="primary" @click="batchSubmit" icon="plus">批量提交</a-button>
|
|
|
+ <a-button type="primary" @click="batchCanelSubmit" icon="plus">批量取消提交</a-button>
|
|
|
<a-button type="primary" @click="batchPush" icon="plus">批量推送</a-button>
|
|
|
</div>
|
|
|
|
|
@@ -139,11 +140,11 @@
|
|
|
<a @click="edit(record)">编辑</a>
|
|
|
</a-menu-item>
|
|
|
|
|
|
- <a-menu-item>
|
|
|
+ <!-- <a-menu-item>
|
|
|
<a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
|
|
|
<a href="javascript:void(0);" style="color:green;">提交</a>
|
|
|
</a-popconfirm>
|
|
|
- </a-menu-item>
|
|
|
+ </a-menu-item> -->
|
|
|
|
|
|
<a-menu-item>
|
|
|
<a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
|
|
@@ -178,11 +179,11 @@
|
|
|
<a @click="details(record)">详情</a>
|
|
|
</a-menu-item>
|
|
|
|
|
|
- <a-menu-item>
|
|
|
+ <!-- <a-menu-item>
|
|
|
<a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
|
|
|
<a href="javascript:void(0);" style="color:red;">取消提交</a>
|
|
|
</a-popconfirm>
|
|
|
- </a-menu-item>
|
|
|
+ </a-menu-item> -->
|
|
|
|
|
|
<a-menu-item>
|
|
|
<a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
|
|
@@ -229,7 +230,7 @@ import moment from 'moment'
|
|
|
import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
|
|
|
import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
|
|
|
|
|
|
-import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push} from '@api/document/advance-packingList.js'
|
|
|
+import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push,batchCanelSubmit} from '@api/document/advance-packingList.js'
|
|
|
|
|
|
export default {
|
|
|
productName: 'AdPaListClothes', // 预装箱单-成衣
|
|
@@ -645,20 +646,25 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- // 取消提交
|
|
|
- cancelSubmit(record){
|
|
|
- var that = this;
|
|
|
- this.$nextTick(() => {
|
|
|
- cancelSubmit({ id: record.id }).then(res => {
|
|
|
- if (res.success) {
|
|
|
- record.status=0;
|
|
|
- that.$message.success('取消提交成功');
|
|
|
- }else{
|
|
|
- that.$message.error(res.message);
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
+ // // 取消提交
|
|
|
+ // cancelSubmit(record){
|
|
|
+ // var that = this;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // if(record.isReference == 2){
|
|
|
+ // that.$message.error('不可取消提交!');
|
|
|
+ // }else {
|
|
|
+ // cancelSubmit({ id: record.id }).then(res => {
|
|
|
+ // if (res.success) {
|
|
|
+ // record.status=0;
|
|
|
+ // that.$message.success('取消提交成功');
|
|
|
+ // }else{
|
|
|
+ // that.$message.error(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // },
|
|
|
|
|
|
//批量提交
|
|
|
batchSubmit(){
|
|
@@ -667,25 +673,51 @@ export default {
|
|
|
var tickRow = this.selectedRows[i]
|
|
|
if(tickRow.status === '1'){
|
|
|
var clo = i+1
|
|
|
- this.$message.error("勾选的第"+clo+"行数据是已提交!");
|
|
|
+ this.$message.error("部分数据是已提交,请勿重复提交!");
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
var ids = this.selectedRowKeys.toString()
|
|
|
batchSubmit({ id: ids }).then(res => {
|
|
|
if (res.success) {
|
|
|
- this.selectedRows.map(item=>{
|
|
|
- item.status = 1
|
|
|
- })
|
|
|
+ this.getadPaListClothes()
|
|
|
this.$message.success('批量提交成功');
|
|
|
+ this.selectedRowKeys = []
|
|
|
}else {
|
|
|
this.$message.error(res.message);
|
|
|
}
|
|
|
})
|
|
|
- this.selectedRowKeys = []
|
|
|
})
|
|
|
},
|
|
|
+ //批量取消提交
|
|
|
+ batchCanelSubmit(){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ for(var i =0;i<this.selectedRows.length;i++){
|
|
|
+ var tickRow = this.selectedRows[i]
|
|
|
+ if(tickRow.status === '0'){
|
|
|
+ this.$message.error("含有未提交数据,请重新选择!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ batchCanelSubmit({ ids:ids }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.getadPaListClothes()
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ this.$message.success('批量提交成功');
|
|
|
+ }else if(res.code == 111){
|
|
|
+ for(var i=0;i<this.selectedRows.length;i++){
|
|
|
+ if(res.result.indexOf(this.selectedRows[i].id) !== -1){
|
|
|
+ this.$message.error(res.message+'(所选第'+(i+1) +'行数据)');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
+ },
|
|
|
//批量推送
|
|
|
batchPush(){
|
|
|
this.$nextTick(() => {
|