Commit 7484b2e7 authored by 我在何方's avatar 我在何方

Merge branch 'release' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into release

parents 6ed51a40 b63f7a0b
...@@ -59,7 +59,6 @@ export function deleteSplit(id) { ...@@ -59,7 +59,6 @@ export function deleteSplit(id) {
}) })
} }
//取消申请拆单 //取消申请拆单
export function cancelApply(data) { export function cancelApply(data) {
return request({ return request({
url: '/order/split/cancel-apply', url: '/order/split/cancel-apply',
...@@ -137,3 +136,12 @@ export function quantitycheck(query) { ...@@ -137,3 +136,12 @@ export function quantitycheck(query) {
params: query params: query
}) })
} }
// 重置拆单
export function deleteAllSplit(orderId) {
return request({
url: '/order/split/delete/all',
method: 'delete',
params: {orderId}
})
}
...@@ -134,4 +134,10 @@ export function serviceConfig(data) { ...@@ -134,4 +134,10 @@ export function serviceConfig(data) {
}) })
} }
// 数量是否必填
export function quantityRequired(lineId) {
return request({
url: '/ecw/warehouse/quantity/required/' + lineId,
method: 'get'
})
}
...@@ -87,6 +87,7 @@ service.interceptors.response.use(res => { ...@@ -87,6 +87,7 @@ service.interceptors.response.use(res => {
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) { } else if (code === 500) {
Message({ Message({
dangerouslyUseHTMLString: true,
message: msg, message: msg,
type: 'error' type: 'error'
}) })
......
...@@ -271,10 +271,11 @@ ...@@ -271,10 +271,11 @@
<script> <script>
import { import {
getSplitList, getSplitList,
quantitycheck, // quantitycheck,
createSplitItem, createSplitItem,
deleteSplitItem, deleteSplitItem,
} from "@/api/ecw/orderHandle"; } from "@/api/ecw/orderHandle";
import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import WorkFlow from "@/components/WorkFlow"; import WorkFlow from "@/components/WorkFlow";
import {getOrder, splitItemUpdate} from "@/api/ecw/order"; import {getOrder, splitItemUpdate} from "@/api/ecw/order";
...@@ -614,10 +615,7 @@ export default { ...@@ -614,10 +615,7 @@ export default {
return data; return data;
},*/ },*/
async getSelectData(item) { async getSelectData(item) {
await quantitycheck({ await quantityRequired(this.orderData.lineId).then((res) => {
seaFreightVolume: item.seaFreightVolume,
clearanceFreightVolume: item.clearanceFreightVolume,
}).then((res) => {
if (res.data) { if (res.data) {
this.isQuantity = true; this.isQuantity = true;
this.shopRules.putQuantity = [ this.shopRules.putQuantity = [
......
...@@ -538,7 +538,10 @@ export default { ...@@ -538,7 +538,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
remove({ ...params, deleteType: 2 }).then((res) => { remove({ ...params, deleteType: 2 }).then((res) => {
...@@ -547,12 +550,14 @@ export default { ...@@ -547,12 +550,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
remove({ ...params, deleteType: 1 }).then((res) => { remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getLoadSecGoodsList(); this.getLoadSecGoodsList();
}); });
}); });
}
}); });
} }
}); });
......
...@@ -246,6 +246,31 @@ export default { ...@@ -246,6 +246,31 @@ export default {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getSecGoods(); this.getSecGoods();
}); });
}).catch((res) => {
if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
})
.then((_) => {
remove({ ...params, deleteType: 2 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getSecGoods();
});
});
})
.catch(action => {
if(action =='cancel'){
remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getSecGoods();
});
});
}
});
}
}); });
}, },
/** 预装 */ /** 预装 */
...@@ -262,10 +287,63 @@ export default { ...@@ -262,10 +287,63 @@ export default {
} else { } else {
params.orderItemIdList = [item.orderItemId]; params.orderItemIdList = [item.orderItemId];
} }
createGoods(params).then((res) => { createGoods(params)
.then((res) => {
const { data } = res;
if (data.relationMsg) {
const msg = data.relationMsg.replaceAll(",", "");
this.$confirm(msg, this.$t("提示"), {
type: "warning",
})
.then((_) => {
loadRelationOrder(data).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
} else {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.queryAllData(); this.queryAllData();
}); });
}
})
.catch((res) => {
if (res.code === 555) {
const msg = res.msg && res.msg.replaceAll(",", "");
this.$confirm(msg, this.$t("提示"), {
type: "warning",
})
.then((_) => {
createGoods({ ...params, relationStatus: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
}
if (res.code === 566) {
this.$confirm(res.msg+this.$t('是否需要一起预装?'), this.$t("提示"), {
type: "warning",
})
.then((_) => {
createGoods({ ...params, relationStatus: 2 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
}
}); });
}, },
/* 增加部分 */ /* 增加部分 */
......
...@@ -747,7 +747,10 @@ export default { ...@@ -747,7 +747,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
deleteGoods({ ...param, deleteType: 2 }).then((res) => { deleteGoods({ ...param, deleteType: 2 }).then((res) => {
...@@ -756,12 +759,14 @@ export default { ...@@ -756,12 +759,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
deleteGoods({ ...param, deleteType: 1 }).then((res) => { deleteGoods({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.queryAllData(); this.queryAllData();
}); });
}); });
}
}); });
} }
}); });
......
...@@ -251,7 +251,10 @@ export default { ...@@ -251,7 +251,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
tallyRemove({ ...param, deleteType: 2 }).then((res) => { tallyRemove({ ...param, deleteType: 2 }).then((res) => {
...@@ -260,12 +263,14 @@ export default { ...@@ -260,12 +263,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
tallyRemove({ ...param, deleteType: 1 }).then((res) => { tallyRemove({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getList(); this.getList();
}); });
}); });
}
}); });
} }
}); });
......
...@@ -520,6 +520,16 @@ import QuickCreateCustomer from '@/components/QuickCreateCustomer' ...@@ -520,6 +520,16 @@ import QuickCreateCustomer from '@/components/QuickCreateCustomer'
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts' import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
window.Decimal= Decimal window.Decimal= Decimal
const createDefaultForm = () => {
return {
sendstatus:0,
type: [],
control: false,
isCargoControl: false,
prodCreateReqVOList:[],
transportVO: {}
}
}
export default { export default {
name: "EcwOfferEdit", name: "EcwOfferEdit",
components: { components: {
...@@ -542,14 +552,7 @@ export default { ...@@ -542,14 +552,7 @@ export default {
// couponList: [], // couponList: [],
fee: {}, // 费用 fee: {}, // 费用
// 表单参数 // 表单参数
form: { form: {...createDefaultForm()},
sendstatus:0,
type: [],
control: false,
isCargoControl: false,
prodCreateReqVOList:[],
transportVO: {}
},
// 表单校验 // 表单校验
labelStyle: 'width:120px', labelStyle: 'width:120px',
...@@ -846,7 +849,7 @@ export default { ...@@ -846,7 +849,7 @@ export default {
}) })
}, },
'form.transportVO.packageTypeArr'(val){ 'form.transportVO.packageTypeArr'(val){
this.$set(this.form.transportVO, 'packageType', val.join(',')) this.$set(this.form.transportVO, 'packageType', (val || []).join(','))
}, },
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择 // 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val){ selectedRouter(val){
...@@ -982,6 +985,8 @@ export default { ...@@ -982,6 +985,8 @@ export default {
if(this.form.channelId){ if(this.form.channelId){
params.channelId = this.form.channelId params.channelId = this.form.channelId
} }
// 如果没有任何条件,不请求接口
if(!params.startCityId && !params.destCityId && !params.transportType && !params.channelId) return false
getOpenedRouterList(params).then(res => this.routerList = res.data) getOpenedRouterList(params).then(res => this.routerList = res.data)
}, },
// 计算体积 // 计算体积
...@@ -1035,6 +1040,14 @@ export default { ...@@ -1035,6 +1040,14 @@ export default {
}) })
// 添加的提交 // 添加的提交
createOffer(data).then(response => { createOffer(data).then(response => {
// 重置表单内容
this.$set(this, 'form', {...createDefaultForm()})
this.routerList = []
this.$nextTick(() => {
console.log('清理表单校验和路线')
this.addProduct()
this.$refs.form.clearValidate()
})
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"));
this.$redirect('index') this.$redirect('index')
}); });
......
...@@ -96,7 +96,8 @@ ...@@ -96,7 +96,8 @@
</el-row> </el-row>
<el-row v-if="scope.row.warehouseInInfoVO"> <el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('品牌')}} <span>{{$t('品牌')}}
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" /> <template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</span> </span>
<span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span> <span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span> <span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span>
...@@ -137,8 +138,8 @@ ...@@ -137,8 +138,8 @@
<div> <div>
<el-button v-if="index==0" disabled type="primary" @click="addShop(index)">{{$t('放入')}}</el-button> <el-button v-if="index==0" disabled type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button v-if="index!=0" type="primary" @click="addShop(index)">{{$t('放入')}}</el-button> <el-button v-if="index!=0" type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button v-if="index==0" disabled type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button> <!--<el-button v-if="index==0" disabled type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>-->
<el-button v-if="index!=0" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button> <el-button :disabled="index < splitData.length - 1" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>
</div> </div>
</div> </div>
<el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList"> <el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList">
...@@ -151,7 +152,8 @@ ...@@ -151,7 +152,8 @@
<el-table-column :label="$t('英文名')" align="center" prop="prodTitleEn" /> <el-table-column :label="$t('英文名')" align="center" prop="prodTitleEn" />
<el-table-column :label="$t('品牌')" align="center"> <el-table-column :label="$t('品牌')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" /> <template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" > <el-table-column :label="$t('入仓体积')" align="center" >
...@@ -242,7 +244,7 @@ ...@@ -242,7 +244,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label2="$t('剩余箱数')" v-if="mainOrderItem.orderItemId"> <el-form-item :label2="$t('剩余箱数')" v-if="mainOrderItem.orderItemId">
剩余箱数{{ shopForm.sum || 0 }}<!--,可放入箱数:{{ mainOrderItem.num - 1 }}--> {{$t('剩余箱数')}}{{ shopForm.sum || 0 }}<!--,可放入箱数:{{ mainOrderItem.num - 1 }}-->
</el-form-item> </el-form-item>
<el-form-item :label="$t('放入箱数')"> <el-form-item :label="$t('放入箱数')">
<el-input-number v-model="shopForm.num" @change="numChange" controls-position="right" :min="1" :max="mainOrderItem.num"></el-input-number> <el-input-number v-model="shopForm.num" @change="numChange" controls-position="right" :min="1" :max="mainOrderItem.num"></el-input-number>
...@@ -302,8 +304,17 @@ ...@@ -302,8 +304,17 @@
<script> <script>
import {getDictData, getDictDatas,DICT_TYPE} from '@/utils/dict' import {getDictData, getDictDatas,DICT_TYPE} from '@/utils/dict'
import {getSplitList,splitApply,createSplit,cancelApply,createSplitItem,deleteSplitItem,deleteSplit,quantitycheck} from "@/api/ecw/orderHandle" import {
import {getWarehouseList} from '@/api/ecw/warehouse' getSplitList,
splitApply,
createSplit,
cancelApply,
createSplitItem,
deleteSplitItem,
deleteSplit,
deleteAllSplit
} from "@/api/ecw/orderHandle"
import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow' import WorkFlow from '@/components/WorkFlow'
import {getOrder, splitItemUpdate} from '@/api/ecw/order' import {getOrder, splitItemUpdate} from '@/api/ecw/order'
...@@ -359,7 +370,7 @@ export default { ...@@ -359,7 +370,7 @@ export default {
quantitySum:0 quantitySum:0
}; };
}, },
created() { async created() {
this.getChannel() this.getChannel()
getWarehouseList().then(res => { getWarehouseList().then(res => {
this.tradeCityList = res.data this.tradeCityList = res.data
...@@ -368,8 +379,18 @@ export default { ...@@ -368,8 +379,18 @@ export default {
if (this.$route.query.orderId) { if (this.$route.query.orderId) {
this.queryParams.orderId = this.$route.query.orderId this.queryParams.orderId = this.$route.query.orderId
} }
Promise.all([this.getList(), this.getOrder()]).then(res => {
console.log("拆单数据", this.splitData, this.splitData.length)
if(this.orderData.inWarehouseState != 207 && this.splitData.length){
this.$confirm(this.$t('已有拆单数据,是否要重置?')).then(res => {
return deleteAllSplit(this.queryParams.orderId)
}).then(res => {
this.getList() this.getList()
this.getOrder() this.$message.success("重置成功")
})
}
})
}, },
watch: { watch: {
//监听table这个对象 //监听table这个对象
...@@ -448,7 +469,7 @@ export default { ...@@ -448,7 +469,7 @@ export default {
}, },
getOrder(){ getOrder(){
this.loading = true; this.loading = true;
getOrder(this.queryParams.orderId).then(response => { return getOrder(this.queryParams.orderId).then(response => {
this.orderData = response.data this.orderData = response.data
this.query.destWarehouseId = response.data.logisticsInfoDto.startWarehouseId this.query.destWarehouseId = response.data.logisticsInfoDto.startWarehouseId
this.loading = false this.loading = false
...@@ -459,7 +480,7 @@ export default { ...@@ -459,7 +480,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
// 执行查询 // 执行查询
getSplitList(this.queryParams).then(response => { return getSplitList(this.queryParams).then(response => {
this.splitData = response.data.orderSplitBackVOList this.splitData = response.data.orderSplitBackVOList
this.orderApprovalBackVO = response.data this.orderApprovalBackVO = response.data
...@@ -540,8 +561,13 @@ export default { ...@@ -540,8 +561,13 @@ export default {
// 挂在到window测试 // 挂在到window测试
window.orderData = this.orderData window.orderData = this.orderData
this.orderData.orderItemVOList.forEach(item => { this.orderData.orderItemVOList.forEach(item => {
// 未入仓的不检查
if(!item.warehouseInInfoVO){
return
}
// 没拆单的不检查
if(!item.splitSum){ if(!item.splitSum){
prods.push(this.$l(item, 'prodTitle')) // prods.push(this.$l(item, 'prodTitle'))
return return
} }
if(item.splitSum.volume.toNumber() != item.warehouseInInfoVO.volume || item.splitSum.weight.toNumber() != item.warehouseInInfoVO.weight){ if(item.splitSum.volume.toNumber() != item.warehouseInInfoVO.volume || item.splitSum.weight.toNumber() != item.warehouseInInfoVO.weight){
...@@ -588,15 +614,15 @@ export default { ...@@ -588,15 +614,15 @@ export default {
this.shopForm.prodTitleEn = list[0].prodTitleEn this.shopForm.prodTitleEn = list[0].prodTitleEn
this.shopForm.prodTitleZh = list[0].prodTitleZh this.shopForm.prodTitleZh = list[0].prodTitleZh
var orderItemData = this.orderData.orderItemVOList.find(item=>item.orderItemId==this.shopForm.orderItemId) var orderItemData = this.orderData.orderItemVOList.find(item=>item.orderItemId==this.shopForm.orderItemId)
var params = { /*var params = {
'seaFreightVolume':orderItemData.seaFreightVolume, 'seaFreightVolume':orderItemData.seaFreightVolume,
'clearanceFreightVolume':orderItemData.clearanceFreightVolume 'clearanceFreightVolume':orderItemData.clearanceFreightVolume
} }
console.log(orderItemData) console.log(orderItemData)*/
this.numcheck(params) this.numcheck()
}, },
numcheck(params){ numcheck(){
quantitycheck(params).then(res=>{ quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data this.quantityshow = res.data
}) })
}, },
......
...@@ -943,9 +943,10 @@ export default { ...@@ -943,9 +943,10 @@ export default {
const form = val === 1 ? this.form1 : this.form const form = val === 1 ? this.form1 : this.form
const formLength = form.table.length const formLength = form.table.length
let orderLocationBackVOList = [] let orderLocationBackVOList = []
/* // 不默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3344.html
if (formLength > 0) { if (formLength > 0) {
orderLocationBackVOList = JSON.parse(JSON.stringify(form.table[formLength - 1].orderLocationBackVOList)) orderLocationBackVOList = JSON.parse(JSON.stringify(form.table[formLength - 1].orderLocationBackVOList))
} }*/
form.table.push({ form.table.push({
"boxGauge1": this.isJiyun ? 0 : '', "boxGauge1": this.isJiyun ? 0 : '',
"boxGauge2": this.isJiyun ? 0 : '', "boxGauge2": this.isJiyun ? 0 : '',
......
...@@ -735,7 +735,7 @@ export default { ...@@ -735,7 +735,7 @@ export default {
this.form.priceStepList.forEach(item => { this.form.priceStepList.forEach(item => {
let notEmptyFields = ['startNum', 'endNum', 'weightUnit'] let notEmptyFields = ['startNum', 'endNum', 'weightUnit']
notEmptyFields.forEach(field => { notEmptyFields.forEach(field => {
if(item[field].toString().trim() == ''){ if(!item[field] || item[field].toString().trim() == ''){
stepPriceEmpty = true stepPriceEmpty = true
} }
}) })
...@@ -744,7 +744,7 @@ export default { ...@@ -744,7 +744,7 @@ export default {
} }
}) })
if(stepPriceEmpty){ if(stepPriceEmpty){
return this.$message.error(this.$t('阶梯价格设置不能留空')) return this.$message.error(this.$t('阶梯价格设置不能留空'))
} }
} }
......
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