|
@@ -102,6 +102,8 @@
|
|
|
</a-upload>
|
|
|
|
|
|
<a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
|
|
|
+ <a-button type="primary" @click="batchSubmit" icon="plus">批量提交</a-button>
|
|
|
+ <a-button type="primary" @click="batchPush" icon="plus">批量推送</a-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- table rowKey="id" -->
|
|
@@ -174,7 +176,7 @@
|
|
|
</a-menu-item>
|
|
|
|
|
|
<a-menu-item>
|
|
|
- <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="rePush(record)">
|
|
|
+ <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
|
|
|
<a href="javascript:void(0);" style="color:green;">重新推送</a>
|
|
|
</a-popconfirm>
|
|
|
</a-menu-item>
|
|
@@ -236,7 +238,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} from '@api/document/advance-packingList.js'
|
|
|
+import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push} from '@api/document/advance-packingList.js'
|
|
|
|
|
|
export default {
|
|
|
productName: 'AdPaListClothes', // 预装箱单-成衣
|
|
@@ -634,6 +636,80 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //批量提交
|
|
|
+ batchSubmit(){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ for(var i =0;i<this.selectedRows.length;i++){
|
|
|
+ var tickRow = this.selectedRows[i]
|
|
|
+ if(tickRow.status === '1'){
|
|
|
+ var clo = i+1
|
|
|
+ this.$message.error("勾选的第"+clo+"行数据是已提交!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var ids = this.selectedRowKeys.toString()
|
|
|
+ batchSubmit({ id: ids }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.selectedRows.map(item=>{
|
|
|
+ item.status = 1
|
|
|
+ })
|
|
|
+ this.$message.success('批量提交成功');
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //批量推送
|
|
|
+ batchPush(){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ for(var i =0;i<this.selectedRows.length;i++){
|
|
|
+ var tickRow = this.selectedRows[i]
|
|
|
+ var clo = i+1
|
|
|
+ if(tickRow.status == '0'){
|
|
|
+ this.$message.error("勾选的第"+clo+"行数据未提交,不能推送!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(tickRow.status === '1' && tickRow.pushStatus === '1'){
|
|
|
+ this.$message.error("勾选的第"+clo+"行数据是已推送!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var ids = this.selectedRowKeys.toString()
|
|
|
+ batchPush({ id: ids }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.selectedRows.map(item=>{
|
|
|
+ item.pushStatus = 1
|
|
|
+ })
|
|
|
+ this.$message.success('批量推送成功');
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ this.selectedRows.map(item=>{
|
|
|
+ item.pushStatus = 2
|
|
|
+ })
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //推送
|
|
|
+ push(record){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ push({ id: record.id }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ record.pushStatus=1;
|
|
|
+ this.$message.success('推送成功');
|
|
|
+ }else{
|
|
|
+ record.pushStatus = 2
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 选中行
|
|
|
onSelectChange(keys, rows) {
|
|
|
this.selectedRowKeys = keys
|