Commit 44f7867e authored by zhengyi's avatar zhengyi

复制订单逻辑修改,补充按钮权限

parent c615a221
......@@ -1388,7 +1388,74 @@ export default {
getUpdateInfo(this.$route.query.id).then(async (res) => {
this.form = Object.assign({}, {...res.data}, {orderItemVOList: []})
this.getOfferData()
if (this.$route.query.copy && this.$route.query.copy == 1) {
// 复制订单,需要将数据初始化
this.form.orderId = null
this.form.orderNo = null
this.form.containerNumber = null
this.form.tidanNo = null
this.form.parentOrderId = null
this.form.parentNumber = null
this.form.number = null
this.form.initialParentOrderId = null
this.form.initialParentOrderNo = null
this.form.noChargeRecord = null
this.form.oldNumbers = null
this.form.userId = 0
this.form.sumNum = null
this.form.sumQuantity = null
this.form.sumVolume = null
this.form.sumWeight = null
this.form.pickleType = null
this.form.pickRatio = null
this.form.pickNum = null
this.form.releaseRatio = null
this.form.cost = null
this.form.packingListUrl = null
this.form.commissionPayable = null
this.form.specialVWeight = null
this.form.handlerChannelAttrException = null
this.form.weightBeforePack = null
this.form.weightAfterPack = null
this.form.stockOverWeightLimit = null
this.form.firstStockedTime = null
this.form.isLimitUpdateConsignee = null
this.form.lockConsigneeDay = null
this.form.lockConsigneeTime = null
this.form.firstStockedTime = null
// 状态重置
this.form.status = 0
this.form.cargoControlStatus = 0
this.form.abnormalState = 0
this.form.inWarehouseState = 0
this.form.shipmentState = 0
this.form.auditType = 0
this.form.auditResult = null
this.form.airShipment = null
this.form.splitSeparateOrder = null
this.form.pickState = null
this.form.guanLianOrderStatus = null
this.form.oldInWarehouseState = null
this.form.oldStatus = null
this.form.oldShipmentState = null
// 时间重置
this.form.takeTime = null
this.form.unloadTime = null
this.form.rucangTime = null
this.form.loadTime = null
this.form.preLoadTime = null
this.form.deliveryDate = null
this.form.daogangTime = null
this.form.qingguanTime = null
this.form.splitTime = null
this.form.isException = null
this.form.exceptionReason = null
this.form.externalWarehouseJson = null
this.form.hasExitAndEntry = null
this.form.hasSendRucangSms = null
this.form.hasSendWarehouseInNotice = null
}
// 可能是来自于activated切换其他订单获取数据,需要重新获取城市确保路线的时候能有效过滤
await this.getTradeCity()
await this.getOpenedRouterList()
......@@ -1411,6 +1478,10 @@ export default {
this.hasConsignee = !!res.data.consigneeVO
// 每次编辑订单详情需要实时获取发货人当前信息
if (res.data.consignorVO) {
if (this.$route.query.copy && this.$route.query.copy == 1) {
res.data.consignorVO.id = null
res.data.consignorVO.orderId = null
}
this.$set(this.form, 'consignorCompany', res.data.consignorVO.company)
this.$set(this.form, 'consignorCompanyEn', res.data.consignorVO.companyEn)
this.$set(this.form, 'consignorContactsId', res.data.consignorVO.customerContactsId)
......@@ -1424,6 +1495,10 @@ export default {
}
if (res.data.consigneeVO) {
if (this.$route.query.copy && this.$route.query.copy == 1) {
res.data.consigneeVO.id = null
res.data.consigneeVO.orderId = null
}
this.$set(this.form, 'consigneeCompany', res.data.consigneeVO.company)
this.$set(this.form, 'consigneeCompanyEn', res.data.consigneeVO.companyEn)
this.$set(this.form, 'consigneeContactsId', res.data.consigneeVO.customerContactsId)
......@@ -1449,7 +1524,10 @@ export default {
if (this.form.applyStaus == 1) {
this.showWorkFlow = true
}
if (this.$route.query.copy && this.$route.query.copy == 1) {
// 复制订单逻辑不管审批业务
this.showWorkFlow = false
}
// 如果是自定义付款人,则需要同步具体发货人信息
if (this.form.drawee == 3) {
console.log('同步自定义付款人信息', JSON.stringify(this.customDraweeList))
......@@ -1464,8 +1542,27 @@ export default {
this.$nextTick(() => {
console.log('nextTick 订单渲染完成')
res.data.orderItemVOList.forEach(item => {
item.prodAttrArr = item.prodAttrIds?.split(',').filter(item => item != '').map(attrId => +attrId) || []
this.form.orderItemVOList.push({...item})
let newItem = {}
if (this.$route.query.copy && this.$route.query.copy == 1) {
newItem.link = item.link
newItem.prodId = item.prodId
newItem.prodTitleEn = item.prodTitleEn
newItem.prodTitleZh = item.prodTitleZh
newItem.prodAttrIds = item.prodAttrIds
newItem.prodType = item.prodType
newItem.volume = item.volume
newItem.weight = item.weight
newItem.quantity = item.quantity
newItem.num = item.num
newItem.worth = item.worth
newItem.boxGauge = item.boxGauge
newItem.brand = item.brand
newItem.brandType = item.brandType
}else {
newItem = item
}
newItem.prodAttrArr = newItem.prodAttrIds?.split(',').filter(item => item != '').map(attrId => +attrId) || []
this.form.orderItemVOList.push({...newItem})
})
// 已入仓后,必填字段修改则需要显示审批流
......@@ -1707,9 +1804,9 @@ export default {
});
}
},
checkBillOfLading(){
checkBillOfLading() {
return checkBillOfLadingService(this.form.orderId).then((res) => {
console.log("检查提单制作状态" , res.data)
console.log("检查提单制作状态", res.data)
return res.data
})
},
......@@ -2033,22 +2130,22 @@ export default {
}
},
// 去掉唛头首尾空格
trimMarks(){
trimMarks() {
this.form.marks = this.form.marks.trim()
},
// 更新默认付款人
// 1发货人,2收货人,3自定义
setDefaultDrawee(){
setDefaultDrawee() {
// 优先级为:发货人默认付款,发货人付款>收货人默认付款,收货人付款>订单控货,收货人付款
if(this.form.consignorDefaultPay){
if (this.form.consignorDefaultPay) {
this.form.drawee = 1
return
}
if(this.form.consigneeDefaultPay){
if (this.form.consigneeDefaultPay) {
this.form.drawee = 2
return
}
if(this.form.isCargoControl){
if (this.form.isCargoControl) {
this.form.drawee = 2
}
}
......@@ -2059,9 +2156,11 @@ export default {
.w-380 {
width: 380px;
}
.justify-end{
.justify-end {
justify-content: flex-end;
}
.card-title {
font-size: 18px;
display: flex;
......
......@@ -653,8 +653,7 @@
<el-dropdown-item @click.native="printLadingBillOrderId = scope.row.orderId" :disabled="!scope.row.tidanNo" v-hasPermi="['ecw:order:landing_bill']">{{ $t("打印提单") }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" @click="handleCopyOrder(scope.row.orderId)">{{ $t("复制") }}</el-button>
<el-button type="text" @click="handleCopyOrder(scope.row.orderId)" v-hasPermi="['ecw:order:copy']">{{ $t("复制") }}</el-button>
</template>
</template>
</el-table-column>
......@@ -1472,9 +1471,10 @@ export default {
},
// 复制订单
handleCopyOrder(orderId) {
copyOrder(orderId).then((res) => {
this.$router.push({ path: "/order/edit", query: { id: res.data, copy: "1" } })
})
this.$router.push({ path: "/order/edit", query: { id: orderId, copy: "1" } })
// copyOrder(orderId).then((res) => {
// this.$router.push({ path: "/order/edit", query: { id: res.data, copy: "1" } })
// })
},
// 查看异常
openException(order) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment