订舱详情删除 + 列表删除修复

szh_zidingyibiaoti
lilu 2 years ago
parent 49072733aa
commit c35810a947

@ -22,6 +22,7 @@
@changePage="changePageFun"
@copy="copyBookingFun"
@addSedList="addSedList"
@removeOrder="removeOrderFun"
></operationArea>
<ul class="parent-tabs-box">
@ -151,7 +152,8 @@ import {
BookingOrderGet,
BookingOrderSave,
getDjyTenantConfig,
GetAllData
GetAllData,
DeleteBookingOrder
} from '@/api/modular/main/BookingLedger'
import { mapActions, mapGetters } from 'vuex'
import rules from './rules'
@ -1518,6 +1520,25 @@ export default {
if (type === 'kindpkgs') {
this.bookingDetails.kindpkgs = val
}
},
removeOrderFun () {
DeleteBookingOrder([this.bookingDetails.id].toString())
.then(res => {
if (res.success) {
this.$message.success('删除成功')
const $data = this.needSavePages
delete $data[this.$route.fullPath]
this.setNeedSavePages($data)
const removeIcon = document.getElementsByClassName('ant-tabs-tab-active')[0].getElementsByTagName('i')[0]
removeIcon.click()
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch(err => {
console.log(err)
})
}
}
}

@ -61,11 +61,19 @@
</button>
</div>
<div
v-if="!details.hbList || details.hbList.length === 0"
class="btn-list single-view-1"
:style="{ width: '110px' }"
>
<button @click="addChild()"><span class="iconfont icon-zhizhishu"></span>添加分单</button>
<a-popconfirm
title="确定删除当前订舱?"
ok-text="是"
cancel-text="否"
@confirm="removeOrder"
@cancel="cancelRemove"
>
<button><span class="iconfont icon-shanchu1"></span>删除</button>
</a-popconfirm>
<button @click="addChild()" v-if="!details.hbList || details.hbList.length === 0"><span class="iconfont icon-zhizhishu"></span></button>
</div>
</a-card>
@ -1654,6 +1662,12 @@ export default {
},
closedocdateChange(date, dateString) {
this.initCabinFrom.closeDocTime = dateString
},
removeOrder () {
this.$emit('removeOrder')
},
cancelRemove () {
console.log('== 取消删除 ==')
}
}
}

@ -46,7 +46,6 @@
</span>
<a class="senior-search" @click="toggleAdvanced" v-if="formData.length > 4">
{{ advanced ? '收起查询' : '更多查询' }}
<!-- <a-icon :type="advanced ? 'up' : 'down'" /> -->
<i class="iconfont" :class="advanced ? 'icon-shouqi' : 'icon-zhankai'"></i>
</a>
</template>
@ -107,7 +106,7 @@
@confirm="excuteShippingOrderCompareBatch"
@cancel="cancelRemove"
>
<div class="nav"><i class="iconfont icon-shanchu2"></i>下货纸比对</div>
<div class="nav"><i class="iconfont icon-duibi"></i>下货纸比对</div>
</a-popconfirm>
<a-popconfirm
title="确定删除当前选中订舱?"
@ -896,10 +895,6 @@ export default {
pageSize: this.gridOptions.pagerConfig.pageSize,
pageSizes: [10, 20, 50, 100, 200, 500]
}
// this.tableOrderLabel = ''
// this.tableOrderType = ''
// this.$refs.xGrid.clearSort()
// debugger
this.gridOptions.data = []
this.getList(queryParam)
},
@ -1377,8 +1372,7 @@ export default {
return item
})
this.$set(this.gridOptions.pagerConfig, 'columns', JSON.parse(JSON.stringify(initData.columns)))
// debugger
// this.$set(this.gridOptions, 'data', [..._data])
this.$set(this.gridOptions, 'data', [..._data])
this.$refs.xGrid.reloadData(_data).then(() => {
this.$set(this.gridOptions, 'loading', false)
})
@ -1775,8 +1769,10 @@ export default {
.then(res => {
if (res.success) {
this.$message.success('删除成功')
this.gridOptions.data = this.gridOptions.data.filter(item => !arr.includes(item.id))
this.gridOptions.pagerConfig.total = this.gridOptions.pagerConfig.total - arr.length
const _data = this.gridOptions.data.filter(item => !arr.includes(item.id))
this.$refs.xGrid.reloadData(_data).then(() => {
this.gridOptions.pagerConfig.total = this.gridOptions.pagerConfig.total - arr.length
})
this.$forceUpdate()
} else {
this.$message.error(res.message)

Loading…
Cancel
Save