|
|
@@ -1082,85 +1082,96 @@ export default {
|
|
|
|
|
|
// 提交
|
|
|
submit() {
|
|
|
- this.$nextTick(() => {
|
|
|
- // for(var i =0;i<this.selectedRows.length;i++){
|
|
|
- // var selectRow = this.selectedRows[i]
|
|
|
- // if(selectRow.elementsId===''||!selectRow.elementsId){
|
|
|
- // this.$message.error('勾选的第'+(i+1)+'行数据报关要素未填写,不可提交!')
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- var grouyIdList = []
|
|
|
- this.loading = true
|
|
|
- this.shipmentListData.map(item =>{
|
|
|
- this.selectedRowKeys.map(e=>{
|
|
|
- if(item.itemIds == e){
|
|
|
- grouyIdList.push(item.groupId)
|
|
|
+ if(this.selectedRowKeys.length==0){
|
|
|
+ this.$message.error('请勾选数据');
|
|
|
+ }else{
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // for(var i =0;i<this.selectedRows.length;i++){
|
|
|
+ // var selectRow = this.selectedRows[i]
|
|
|
+ // if(selectRow.elementsId===''||!selectRow.elementsId){
|
|
|
+ // this.$message.error('勾选的第'+(i+1)+'行数据报关要素未填写,不可提交!')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ var grouyIdList = []
|
|
|
+ this.loading = true
|
|
|
+ this.shipmentListData.map(item =>{
|
|
|
+ this.selectedRowKeys.map(e=>{
|
|
|
+ if(item.itemIds == e){
|
|
|
+ grouyIdList.push(item.groupId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ submitShipment({ submitListId: this.selectedRowKeys, type: '1' ,grouyIdList:grouyIdList}).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.success) {
|
|
|
+ // this.shipmentListData.submitStatus = '1'
|
|
|
+ this.shipmentListData.map(item =>{
|
|
|
+ this.selectedRowKeys.map(e=>{
|
|
|
+ if(item.itemIds == e){
|
|
|
+ item.submitStatus = '1'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.selectedRowKeys =[]
|
|
|
+ this.checkboxOption.selectedRowKeys = []
|
|
|
+ // this.judageAdd()
|
|
|
+ // 渲染 发运明细列表
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ }else {
|
|
|
+ this.judageAdd()
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
+ this.searchQuery();
|
|
|
})
|
|
|
})
|
|
|
- submitShipment({ submitListId: this.selectedRowKeys, type: '1' ,grouyIdList:grouyIdList}).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.success) {
|
|
|
- // this.shipmentListData.submitStatus = '1'
|
|
|
- this.shipmentListData.map(item =>{
|
|
|
- this.selectedRowKeys.map(e=>{
|
|
|
- if(item.itemIds == e){
|
|
|
- item.submitStatus = '1'
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- this.selectedRowKeys =[]
|
|
|
- this.checkboxOption.selectedRowKeys = []
|
|
|
- // this.judageAdd()
|
|
|
- // 渲染 发运明细列表
|
|
|
- this.$message.success('提交成功')
|
|
|
- }else {
|
|
|
- this.judageAdd()
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- this.searchQuery();
|
|
|
- })
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
// 取消提交
|
|
|
cancelSubmit(record) {
|
|
|
- console.log('取消订单id:', record.id)
|
|
|
- this.$nextTick(() => {
|
|
|
- var grouyIdList = []
|
|
|
- this.loading = true
|
|
|
- this.shipmentListData.map(item =>{
|
|
|
- this.selectedRowKeys.map(e=>{
|
|
|
- if(item.itemIds == e){
|
|
|
- grouyIdList.push(item.groupId)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- cancelSubmitShipment({ submitListId: this.selectedRowKeys, type: '2',grouyIdList:grouyIdList }).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.success) {
|
|
|
- // this.shipmentListData.submitStatus = '0'
|
|
|
- this.shipmentListData.map(item =>{
|
|
|
- this.selectedRowKeys.map(e=>{
|
|
|
- if(item.itemIds == e){
|
|
|
- item.submitStatus = '0'
|
|
|
+ if(this.selectedRowKeys.length==0){
|
|
|
+ this.$message.error('请勾选数据');
|
|
|
+ }else{
|
|
|
+ console.log('取消订单id:', record.id)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ var grouyIdList = []
|
|
|
+ this.loading = true
|
|
|
+ this.shipmentListData.map(item =>{
|
|
|
+ this.selectedRowKeys.map(e=>{
|
|
|
+ if(item.itemIds == e){
|
|
|
+ grouyIdList.push(item.groupId)
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ cancelSubmitShipment({ submitListId: this.selectedRowKeys, type: '2',grouyIdList:grouyIdList }).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.success) {
|
|
|
+ // this.shipmentListData.submitStatus = '0'
|
|
|
+ this.shipmentListData.map(item =>{
|
|
|
+ this.selectedRowKeys.map(e=>{
|
|
|
+ if(item.itemIds == e){
|
|
|
+ item.submitStatus = '0'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.selectedRowKeys = []
|
|
|
+ // this.judageAdd()
|
|
|
+ this.$message.success('取消提交成功')
|
|
|
+ }else {
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ this.searchQuery();
|
|
|
})
|
|
|
- this.selectedRowKeys = []
|
|
|
- // this.judageAdd()
|
|
|
- this.$message.success('取消提交成功')
|
|
|
- }else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- this.searchQuery();
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
//批量删除
|
|
|
batchDelete(){
|
|
|
- this.$nextTick(() => {
|
|
|
+ if(this.selectedRowKeys.length==0){
|
|
|
+ this.$message.error('请勾选数据');
|
|
|
+ }else{
|
|
|
+ this.$nextTick(() => {
|
|
|
var itemId = [],
|
|
|
ids = []
|
|
|
this.loading = true
|
|
|
@@ -1173,21 +1184,22 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
deleteBatch({ ids: ids ,itemId:itemId}).then(res => {
|
|
|
- this.loading = false
|
|
|
+ this.loading = false
|
|
|
if (res.success) {
|
|
|
// console.log('提交成功,单据状态改为【已提交】')
|
|
|
// this.shipmentListData.submitStatus = '1'
|
|
|
this.selectedRowKeys =[]
|
|
|
this.checkboxOption.selectedRowKeys = []
|
|
|
- this.judageAdd()
|
|
|
- // 渲染 发运明细列表
|
|
|
+ this.judageAdd()
|
|
|
+ // 渲染 发运明细列表
|
|
|
this.$message.success('批量成功')
|
|
|
}else {
|
|
|
this.judageAdd()
|
|
|
- this.$message.error(res.message)
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
sortChange(params) {
|
|
|
this.shipmentListData.sort((a, b) => {
|