Commit 65037cf5 authored by 我在何方's avatar 我在何方

Merge branch 'release2.2' of...

Merge branch 'release2.2' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into release2.2
parents 07b28f54 c2fae766
...@@ -145,3 +145,12 @@ export function deleteAllSplit(orderId) { ...@@ -145,3 +145,12 @@ export function deleteAllSplit(orderId) {
params: {orderId} params: {orderId}
}) })
} }
// 获取拆单订单的总货值与箱数拆分记录
export function splitItemWorthCheck(orderId, orderSplitItemId) {
return request({
url: '/order/split-item/worth/check',
method: 'get',
params: {orderId, orderSplitItemId}
})
}
...@@ -141,30 +141,34 @@ ...@@ -141,30 +141,34 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" > <el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" disabled> {{scope.row.volume}}
<!--<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" disabled>
<span slot="append"></span> <span slot="append"></span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费体积')" align="center" > <el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled> {{scope.row.chargeVolume}}
<!--<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled>
<span slot="append"></span> <span slot="append"></span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓重量')" align="center"> <el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" disabled> {{scope.row.weight}}kg
<!--<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" disabled>
<span slot="append">kg</span> <span slot="append">kg</span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费重量')" align="center"> <el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled> {{scope.row.chargeWeight}}kg
<!--<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled>
<span slot="append">kg</span> <span slot="append">kg</span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货值')" align="center"> <el-table-column :label="$t('货值')" align="center">
...@@ -231,7 +235,7 @@ ...@@ -231,7 +235,7 @@
<span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span> <span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span>
<span class="mr-10">{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg</span> <span class="mr-10">{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}</span> <span class="mr-10">{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}</span> <span class="mr-10">{{ $t('剩余可拆货值') }}:{{ leftWorth}}{{ $t('元') }}</span>
</div> </div>
<div class="page-title">{{$t('可拆入仓记录')}}</div> <div class="page-title">{{$t('可拆入仓记录')}}</div>
<el-table <el-table
...@@ -291,7 +295,7 @@ ...@@ -291,7 +295,7 @@
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}"> <template v-slot="{ row, column, $index}">
<el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag> <el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-button v-else size="mini" type="primary" @click="putInRecord(row)" :disabled="leftSplitNum <= 0">放入</el-button> <el-button v-else size="mini" type="primary" @click="putInRecord(row)" :disabled="leftSplitNum <= 0">{{$t('放入')}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -299,7 +303,7 @@ ...@@ -299,7 +303,7 @@
<div class="page-title" style="margin: 0"> <div class="page-title" style="margin: 0">
{{$t('已放入入仓记录')}} {{$t('已放入入仓记录')}}
</div> </div>
<el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button> <el-button type="danger" size="mini" @click="clearAll">{{$t('清空放入数据')}}</el-button>
</div> </div>
<el-table <el-table
...@@ -348,12 +352,12 @@ ...@@ -348,12 +352,12 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}"> <template v-slot="{ row, column, $index}">
<el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button> <el-button size="mini" type="primary" @click="deleteRow($index)">{{$t('删除')}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="page-title">放入数据</div> <div class="page-title">{{$t('放入数据')}}</div>
<div class="pl-20 mb-10"> <div class="pl-20 mb-10">
<span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span> <span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span> <span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
...@@ -368,7 +372,7 @@ ...@@ -368,7 +372,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('放入货值')"> <el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"> <el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="leftWorth">
<template slot="append">{{ $t('') }}</template> <template slot="append">{{ $t('') }}</template>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
...@@ -400,7 +404,7 @@ import { ...@@ -400,7 +404,7 @@ import {
getSplitList, getSplitList,
// quantitycheck, // quantitycheck,
createSplitItem, createSplitItem,
deleteSplitItem, deleteSplitItem, splitItemWorthCheck,
} from "@/api/ecw/orderHandle"; } from "@/api/ecw/orderHandle";
import {quantityRequired} from "@/api/ecw/warehouse"; import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
...@@ -472,7 +476,9 @@ export default { ...@@ -472,7 +476,9 @@ export default {
// 当前选择的入仓记录ID // 当前选择的入仓记录ID
selectedWarehouseInId: null, selectedWarehouseInId: null,
// 当前正在放入的入仓记录 // 当前正在放入的入仓记录
currentPutIn: null currentPutIn: null,
/*// 订单剩余数据
orderLeftData: null*/
}; };
}, },
created() { created() {
...@@ -515,11 +521,17 @@ export default { ...@@ -515,11 +521,17 @@ export default {
'shopForm.orderItemId'(){ 'shopForm.orderItemId'(){
// 默认取以前放入的品名 // 默认取以前放入的品名
this.shopForm.specsRecordVOList = [] this.shopForm.specsRecordVOList = []
let specsRecordVOList = this.splitData.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || [] const splitItem = this.splitData.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
let specsRecordVOList = splitItem?.specsRecordVOList || []
specsRecordVOList.forEach(item => { specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*') const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3}) this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
}) })
// 显示原来默认的收费数据
this.$set(this.shopForm, 'chargeVolume', splitItem.chargeVolume)
this.$set(this.shopForm, 'chargeWeight', splitItem.chargeWeight)
this.$set(this.shopForm, 'worth', splitItem.worth)
} }
}, },
computed: { computed: {
...@@ -641,7 +653,23 @@ export default { ...@@ -641,7 +653,23 @@ export default {
num -= item.num num -= item.num
})*/ })*/
return num return num
},
// 订单剩余可拆货值
leftWorth(){
if(!this.orderData?.costVO?.totalWorth)return 0;
let worth = new Decimal(this.orderData.costVO.totalWorth)
this.splitData.orderSplitItemBackVOList.forEach(item =>{
worth = worth.minus(item.worth || 0)
})
// 包当前选择的品名之前填写的货值包含进去
if(this.shopForm.orderItemId){
let splitItem = this.splitData.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
if(splitItem){
worth = worth.plus(splitItem.worth || 0)
} }
}
return worth.toNumber()
},
}, },
methods: { methods: {
/*检查并提交字段(体积,重量)修改*/ /*检查并提交字段(体积,重量)修改*/
...@@ -817,6 +845,10 @@ export default { ...@@ -817,6 +845,10 @@ export default {
if(this.isQuantity){ if(this.isQuantity){
params.quantity = this.putin.quantity params.quantity = this.putin.quantity
} }
// 货值不能超过剩余货值
if(params.worth > this.leftWorth){
return this.$message.error(this.$t("货值不能超过剩余货值"));
}
createSplitItem(params).then((res) => { createSplitItem(params).then((res) => {
this.$message.success(this.$t("放入成功")); this.$message.success(this.$t("放入成功"));
this.querySplitGoods(); this.querySplitGoods();
...@@ -952,9 +984,18 @@ export default { ...@@ -952,9 +984,18 @@ export default {
const chargeWeight = orderItem.itemType === 3 ? (orderItem.chargeWeight*rate).toFixed(2) : this.putin.weight const chargeWeight = orderItem.itemType === 3 ? (orderItem.chargeWeight*rate).toFixed(2) : this.putin.weight
this.$set(this.shopForm, 'chargeVolume', chargeVolume) this.$set(this.shopForm, 'chargeVolume', chargeVolume)
this.$set(this.shopForm, 'chargeWeight', chargeWeight) this.$set(this.shopForm, 'chargeWeight', chargeWeight)
this.$set(this.shopForm, 'worth', (orderItem.worth*rate).toFixed(2))
} // 货值按照主单的总货值*订单的箱数比例
let worth = (this.orderData.costVO.totalWorth * this.putin.num / this.orderData.sumNum).toFixed(2)
this.$set(this.shopForm, 'worth', worth)
}, },
// 查询订单剩余数据
/*getOrderLeftData(){
splitItemWorthCheck(this.orderData.orderId).then(res => {
this.orderLeftData = res.data
})
}*/
}
}; };
</script> </script>
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
}, },
computed:{ computed:{
getCustomerList(){ getCustomerList(){
let index = this.customerList.findIndex(item => item.id !== this.recommended[0]) let index = this.customerList.findIndex(item => item.id === this.recommended[0]?.id)
if(index > -1) return this.customerList if(index > -1) return this.customerList
else return [...this.customerList,...this.recommended] else return [...this.customerList,...this.recommended]
} }
...@@ -50,7 +50,6 @@ export default { ...@@ -50,7 +50,6 @@ export default {
}, },
watch:{ watch:{
value(val){ value(val){
console.log(val,'val')
this.customer = val; this.customer = val;
if(!(this.customerList.some(i => i.id === val)) && val !== undefined){ if(!(this.customerList.some(i => i.id === val)) && val !== undefined){
getCustomerList({ids:val}).then(r => { getCustomerList({ids:val}).then(r => {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item :label="$t('常用提货网点')" prop="remarks"> <el-form-item :label="$t('常用提货网点')" prop="remarks">
<el-select v-model="form.pickupPoint"> <el-select v-model="form.pickupPoint">
<el-option v-for="item in serviceNetworkList " :value="item.id" :label="isChinese ? item.titleZh : item.titleEn "></el-option> <el-option v-for="item in getNodeLists " :value="item.id" :label="isChinese ? item.titleZh : item.titleEn "></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -98,13 +98,13 @@ ...@@ -98,13 +98,13 @@
<el-form-item :label="$t('主营类别')" prop="productType"> <el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="11"> <el-col :span="11">
<el-select v-model="form.productType" :placeholder="$t('请选择产品类别')" @change="form.productId = ''"> <el-select @change="change" v-model="form.productType" :placeholder="$t('请选择产品类别')">
<el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/> <el-option :label="item.titleZh" :value="item.id" v-for="(item) in productTypeList" :key="item.id"/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
<el-select v-model="form.productId" :placeholder="$t('请选择')"> <el-select v-model="form.productId" :placeholder="$t('请选择')">
<el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productListFilter" :key="item.id"/> <el-option :label="item.titleZh" :value="parseInt(item.id)" v-for="(item) in productList" :key="item.id"/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -592,19 +592,12 @@ export default { ...@@ -592,19 +592,12 @@ export default {
this.getCustomer(this.customerId).then(() => { this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: customerId}).then(r => { getCustomerContactsListByCustomer({customerId: customerId}).then(r => {
this.form.customerContacts = r.data this.form.customerContacts = r.data
let list = this.form.customerContacts.map(item => item.userid);
if(list.length >0){
memberUserList({ids:list.join(',')}).then(r=>{
this.selectMemberList = r.data
}) })
}
if(this.form.promoter){ if(this.form.promoter){
getCustomerList({ids:this.form.promoter}).then(r => { getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data; this.recommended = r.data;
}) })
} }
})
// 打开重泡货开关 // 打开重泡货开关
if(this.form.weightUnit){ if(this.form.weightUnit){
this.showZhong = true this.showZhong = true
...@@ -634,14 +627,12 @@ export default { ...@@ -634,14 +627,12 @@ export default {
} }
getNodeList().then(r => { getNodeList().then(r => {
this.nodeList = r.data this.getNodeLists = r.data
}) })
getProductTypeList().then(r => { getProductTypeList().then(r => {
this.productTypeList = r.data this.productTypeList = r.data
}) })
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => { getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1') this.importCityList = r.data.filter(item => item.type === '1')
}) })
...@@ -657,13 +648,10 @@ export default { ...@@ -657,13 +648,10 @@ export default {
getCountryListAll().then(r => { getCountryListAll().then(r => {
this.countryList = r.data this.countryList = r.data
}) })
// 获取服务网点
getServiceNetwork().then(r =>{
this.serviceNetworkList = r.data
})
}, },
data(){ data(){
return { return {
getNodeLists:[],
isCustomerServiceConfirmed:false, isCustomerServiceConfirmed:false,
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
...@@ -718,6 +706,15 @@ export default { ...@@ -718,6 +706,15 @@ export default {
}, },
methods: { methods: {
change(val){
this.form.productId = '';
this.getProductListFn(val);
},
getProductListFn(val){
getProductList({typeId:val}).then(r => {
this.productList = r.data
})
},
deleteBankData(index){ deleteBankData(index){
this.form.customerBanks.splice(index, 1); this.form.customerBanks.splice(index, 1);
}, },
...@@ -949,6 +946,11 @@ export default { ...@@ -949,6 +946,11 @@ export default {
return getCustomer(id).then(response => { return getCustomer(id).then(response => {
console.log(response,'response') console.log(response,'response')
this.form = { ...this.form, ...response.data, id: this.customerId,transportType: response.data.transportType && response.data.transportType !== '' ? response.data.transportType.split(',') : [],customerBanks:response.data.customerBankBackVOList }; this.form = { ...this.form, ...response.data, id: this.customerId,transportType: response.data.transportType && response.data.transportType !== '' ? response.data.transportType.split(',') : [],customerBanks:response.data.customerBankBackVOList };
if(this.form.productType){
console.log('1231',this.form.productType)
this.getProductListFn(this.form.productType)
}
this.open = true; this.open = true;
this.title = this.$t('修改客户'); this.title = this.$t('修改客户');
this.getZhongPao() this.getZhongPao()
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div> <div>
<el-button type="primary" size="small" v-has-permi="['ecw:customer:query-edit']" @click="$router.push('/customer/edit/' + id)">{{$t('编辑')}}</el-button> <el-button type="primary" size="small" v-has-permi="['ecw:customer:query-edit']" @click="$router.push('/customer/edit/' + id)">{{$t('编辑')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-quoted-price']" @click="$router.push('/offer/create')" type="primary" size="small">{{$t('报价')}}</el-button> <el-button v-has-permi="['ecw:customer:query-quoted-price']" @click="$router.push('/offer/create')" type="primary" size="small">{{$t('报价')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="$refs['customerFollow'].customerFollow.dialogVisible = true">{{$t('跟进')}}</el-button> <el-button v-has-permi="['ecw:customer:query-follow-up']" type="primary" size="small" @click="customerFollowFn('follow')">{{$t('跟进')}}</el-button>
<el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="$refs['customerComplaint'].handleAdd()">{{$t('客诉')}}</el-button> <el-button v-has-permi="['ecw:customer:query-customer-complaint']" type="primary" size="small" @click="customerFollowFn('complain')">{{$t('客诉')}}</el-button>
<el-button v-hasPermi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$t('删除')}}</el-button> <el-button v-hasPermi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$t('删除')}}</el-button>
</div> </div>
</div> </div>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-descriptions-item :label="$t('客户等级')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item> <el-descriptions-item :label="$t('客户等级')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_LEVEL, customer.level) }}</el-descriptions-item>
<el-descriptions-item :label="$t('信用等级')">{{isChinese ? customer.creditLevelNameZh :customer.creditLevelNameEn }}</el-descriptions-item> <el-descriptions-item :label="$t('信用等级')">{{isChinese ? customer.creditLevelNameZh :customer.creditLevelNameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('国家')">{{ isChinese ? country.nameZh : country.nameEn }}</el-descriptions-item> <el-descriptions-item :label="$t('国家')">{{$l(customer,'countryName')}}{{customer.countryName}}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('业务员')">{{ customer }}</el-descriptions-item>--> <!-- <el-descriptions-item :label="$t('业务员')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item> <el-descriptions-item :label="$t('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户类别')"> <el-descriptions-item :label="$t('客户类别')">
...@@ -37,17 +37,19 @@ ...@@ -37,17 +37,19 @@
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item :label="$t('联系方式')">{{ customer }}</el-descriptions-item>--> <!-- <el-descriptions-item :label="$t('联系方式')">{{ customer }}</el-descriptions-item>-->
<el-descriptions-item :label="$t('推介人')">{{ customer.promoterName }}</el-descriptions-item> <el-descriptions-item :label="$t('推介人')">{{ customer.promoterName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户经理')">{{customerService }}</el-descriptions-item> <el-descriptions-item :label="$t('客户经理')">{{customer.customerServiceName }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item> <el-descriptions-item :label="$t('公司名称')">{{ customer.company }}</el-descriptions-item>
<el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</el-descriptions-item> <el-descriptions-item :label="$t('公司英文名称')">{{ customer.companyEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item> <el-descriptions-item :label="$t('联系地址')">{{ customer.address }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item> <el-descriptions-item :label="$t('创建时间')">{{ parseTime(customer.createTime) }}</el-descriptions-item>
<el-descriptions-item :label="$t('创建人')">{{ customer.founderName }}</el-descriptions-item> <el-descriptions-item :label="$t('创建人')">{{ customer.founderName }}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status) }}</el-descriptions-item> <el-descriptions-item :label="$t('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status)}}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ productType }}</el-descriptions-item> <el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ pickupPoint }}</el-descriptions-item> <el-descriptions-item :label="$t('常提货网点')">{{ $l(customer,'pickupPointName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('图片')"> <el-descriptions-item :label="$t('图片')">
<el-image v-show="!!customer.picture" :src="customer.picture" style="width: 100px;height: 100px"></el-image> <el-image v-if="customer.picture" :src="customer.picture" style="width: 100px;height: 100px">
<span slot="error">加载失败</span>
</el-image>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item> <el-descriptions-item :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
<el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ?$t('新客户') : $t('老客户') }}</el-descriptions-item> <el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ?$t('新客户') : $t('老客户') }}</el-descriptions-item>
...@@ -92,7 +94,7 @@ ...@@ -92,7 +94,7 @@
:label="$t('联系方式')" :label="$t('联系方式')"
> >
<template v-slot="{row}"> <template v-slot="{row}">
{{ row.areaCode + row.phoneNew }} +{{ row.areaCode}} {{row.phoneNew}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -303,10 +305,10 @@ ...@@ -303,10 +305,10 @@
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination> <pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="follow" :label="$t('跟进')"> <el-tab-pane name="follow" :label="$t('跟进')">
<customer-follow customerQuery ref="customerFollow" :id="id" :customer-id="id"></customer-follow> <customer-follow v-if="activeName === 'follow'" customerQuery ref="customerFollow" :id="id" :customer-id="id"></customer-follow>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="complain" :label="$t('客户投诉')"> <el-tab-pane name="complain" :label="$t('客户投诉')">
<customer-complaint ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint> <customer-complaint v-if="activeName === 'complain'" ref="customerComplaint" :customer-id="id" hidden-search></customer-complaint>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="bill" :label="$t('账单')"> <el-tab-pane name="bill" :label="$t('账单')">
<el-table style="width: 100%" :data="infoListReceiptList"> <el-table style="width: 100%" :data="infoListReceiptList">
...@@ -529,38 +531,31 @@ export default { ...@@ -529,38 +531,31 @@ export default {
getCreditRulePage({page:1,rows:999,type:2}).then(r => { getCreditRulePage({page:1,rows:999,type:2}).then(r => {
this.creditTypeList = r.data.list this.creditTypeList = r.data.list
}) })
getNodeList().then(r => { // getNodeList().then(r => {
this.nodeList = r.data // this.nodeList = r.data
}) // })
getCustomer(this.id).then(response => { getCustomer(this.id).then(response => {
this.customer = { ...this.customer, ...response.data } this.customer = { ...this.customer, ...response.data }
console.log( this.customer,'this.customer') console.log( this.customer,'this.customer')
getCustomerContactsListByCustomer({customerId: this.id}).then(r => { getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
this.customerContacts = r.data this.customerContacts = r.data
let list = this.customerContacts.map(r => r.userid) let list = this.customerContacts.filter(r => r.userid)
memberUserList({ids:list.join(',')}).then(r => { if(list.length > 0){
memberUserList({ids:list.map(i=>i.userid).join(',')}).then(r => {
this.memberList = r.data this.memberList = r.data
}) })
}
}) })
getCountry(this.customer.country ? this.customer.country : 0 ).then(r => {
this.country = r.data
})
})
getProductTypeList().then(r => {
this.productTypeList = r.data
}) })
getCustomerSelect({pageSize:1000,pageNo:1}).then(r => { // getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
this.customerSelect = r.data.list // this.customerSelect = r.data.list
}) // })
listServiceUser().then(r => {
this.serviceUserList = r.data
})
// this.getBrankByCustomerList()//品牌授权 // this.getBrankByCustomerList()//品牌授权
this.getCustomerGrade() // this.getCustomerGrade()
// this.creditLogPage()//等级日志 // this.creditLogPage()//等级日志
this.getorderList()//订单 this.getorderList()//订单
// this.getInfoListOfferPage()//报价 // this.getInfoListOfferPage()//报价
...@@ -716,22 +711,16 @@ export default { ...@@ -716,22 +711,16 @@ export default {
isChinese(){ isChinese(){
return this.$i18n.locale === 'zh_CN' return this.$i18n.locale === 'zh_CN'
}, },
productType(){
const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
return productType ? productType.titleZh : ''
},
pickupPoint(){ pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint)) const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : '' return pickupPoint ? pickupPoint.titleZh : ''
}, },
promoter() { // promoter() {
return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || '' // return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
}, // },
customerService() {
return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
},
id() { id() {
return this.customerId ? parseInt(this.customerId) : undefined return parseInt(this.$route.params.customerId)
}, },
creditScoreCalculation(){ creditScoreCalculation(){
return (val)=>{ return (val)=>{
...@@ -745,6 +734,16 @@ export default { ...@@ -745,6 +734,16 @@ export default {
} }
}, },
methods:{ methods:{
customerFollowFn(val){
this.activeName = val
this.$nextTick(()=>{
if(val === 'follow'){
this.$refs['customerFollow'].customerFollow.dialogVisible = true;
}else {
this.$refs['customerComplaint'].handleAdd()
}
})
},
checkPermi, checkPermi,
userIdFormatter(row, column, cellValue){ userIdFormatter(row, column, cellValue){
const member = this.memberList.find(e => e.id === cellValue) const member = this.memberList.find(e => e.id === cellValue)
......
...@@ -416,9 +416,13 @@ export default { ...@@ -416,9 +416,13 @@ export default {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
getCustomerList({ids:this.list.map(i => i.customerId).join(',')}).then(r => { let list = []
list = this.list.filter(i => i.customerId)
if(list.length > 0){
getCustomerList({ids:list.map(i => i.customerId).join(',')}).then(r => {
this.customerSelect = r.data this.customerSelect = r.data
}) })
}
}); });
}, },
/** 取消按钮 */ /** 取消按钮 */
......
...@@ -71,6 +71,12 @@ ...@@ -71,6 +71,12 @@
{{getOperator(row.updater)}} {{getOperator(row.updater)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效期" v-slot="{row}" >
{{parseTime(row.expireDate)}}
</el-table-column>
<el-table-column label="状态" v-slot="{row}" >
{{new Date(row.expireDate).getTime() >= new Date().getTime() ? '正常' : '已过期'}}
</el-table-column>
<el-table-column :label="$t('备注')" prop="note"></el-table-column> <el-table-column :label="$t('备注')" prop="note"></el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
inline inline
class="card" class="card"
> >
<el-form-item :label="$t('自编号')"> <el-form-item :label="$t('自编号')" prop="selfNo">
<el-input v-model="queryParams.selfNo" clearable></el-input> <el-input v-model="queryParams.selfNo" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发仓')"> <el-form-item :label="$t('始发仓')" :rules="{required: true, message: $t('请选择始发仓')}" prop="startWarehouseIdList">
<el-select v-model="queryParams.startWarehouseIdList" :placeholder="$t('请选择')" clearable> <el-select v-model="queryParams.startWarehouseIdList" multiple :placeholder="$t('请选择')" clearable>
<el-option <el-option
v-for="item in exportWarehouseList" v-for="item in exportWarehouseList"
:key="item.id" :key="item.id"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的国')" :rules="{required: true}"> <el-form-item :label="$t('目的国')" :rules="{required: true, message: $t('请选择目的国')}" prop="destCountryId">
<el-select v-model="queryParams.destCountryId" :placeholder="$t('请选择')" filterable default-first-option> <el-select v-model="queryParams.destCountryId" :placeholder="$t('请选择')" filterable default-first-option>
<el-option <el-option
v-for="item in countryList" v-for="item in countryList"
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')"> <el-form-item :label="$t('目的仓')" prop="destWarehouseIdList">
<el-select v-model="queryParams.destWarehouseId" :placeholder="queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')" clearable> <el-select v-model="queryParams.destWarehouseIdList" multiple :placeholder="queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')" clearable>
<el-option <el-option
v-for="item in importWarehouseList" v-for="item in importWarehouseList"
:key="item.id" :key="item.id"
...@@ -42,10 +42,10 @@ ...@@ -42,10 +42,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('自编号状态')"> <el-form-item :label="$t('自编号状态')" prop="status">
<dict-selector :type="DICT_TYPE.BOX_ORDER_SHIPMENT_STATE" v-model="queryParams.status" clearable></dict-selector> <dict-selector :type="DICT_TYPE.BOX_ORDER_SHIPMENT_STATE" v-model="queryParams.status" clearable></dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('结算时间')" > <el-form-item :label="$t('结算时间')" prop="dateFilter">
<el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-" <el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-"
:start-placeholder="$t('开始日期')" :start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')" :end-placeholder="$t('结束日期')"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('是否结算')"> <el-form-item :label="$t('是否结算')" prop="slStatus">
<dict-selector :type="DICT_TYPE.SETTLEMENT_STATUS" v-model="queryParams.slStatus" clearable></dict-selector> <dict-selector :type="DICT_TYPE.SETTLEMENT_STATUS" v-model="queryParams.slStatus" clearable></dict-selector>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -81,20 +81,56 @@ ...@@ -81,20 +81,56 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('应收款(Accounts receivable)')" align="center" prop="summaryInfo.receivableTotalFeeGroup"></el-table-column> <el-table-column :label="$t('应收款(Accounts receivable)')" align="center" prop="summaryInfo.receivableTotalFeeGroup"></el-table-column>
<el-table-column :label="$t('received in + 目的国国家(目的地实收)')" align="center" prop=""> <el-table-column :label="'received in ' + (dstCountryName || $t('目的国')) + `(${$t('目的地实收')})`" align="center" prop="">
<el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup"></el-table-column> <el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup">
<el-table-column :label="$t('清关费')" prop="summaryInfo.netReceiptsCollectClearanceFeeGroup"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsCollectOtherFeeGroup"></el-table-column> {{row.summaryInfo.totalNetReceiptsCollectFreightFee}}{{row.summaryInfo.netReceiptsCollectFreightFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('清关费')" prop="summaryInfo.netReceiptsCollectClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsCollectClearanceFee}}{{row.summaryInfo.netReceiptsCollectClearanceFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsCollectOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsCollectOtherFee}}{{row.summaryInfo.netReceiptsCollectOtherFeeCurrency}}
</template>
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column :label="$t('received in China(中国实收)')" align="center" prop="" > <el-table-column :label="$t('received in China(中国实收)')" align="center" prop="" >
<el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup"></el-table-column> <el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup">
<el-table-column :label="$t('清关费')" prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsAdvanceOtherFeeGroup"></el-table-column> {{row.summaryInfo.netReceiptsAdvanceFreightFeeCurrency}}{{row.summaryInfo.netReceiptsAdvanceClearanceFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('清关费')" prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsAdvanceClearanceFee}}{{row.summaryInfo.netReceiptsAdvanceClearanceFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsAdvanceOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsAdvanceOtherFee}}{{row.summaryInfo.netReceiptsAdvanceOtherFeeCurrency}}
</template>
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column :label="$t('Discounts 折扣')" align="center" prop=""> <el-table-column :label="$t('Discounts 折扣')" align="center" prop="">
<el-table-column :label="$t('运费')" prop="summaryInfo.discountFreightFeeGroup"></el-table-column> <el-table-column :label="$t('运费')" prop="summaryInfo.discountFreightFeeGroup">
<el-table-column :label="$t('清关费')" prop="summaryInfo.discountClearanceFeeGroup"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('额外费用')" prop="summaryInfo.discountOtherFeeGroup"></el-table-column> {{row.summaryInfo.discountFreightFee}}{{row.summaryInfo.netReceiptsCollectFreightFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('清关费')" prop="summaryInfo.discountClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.discountClearanceFee}}{{row.summaryInfo.netReceiptsCollectClearanceFeeCurrency}}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.discountOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.discountOtherFee}}{{row.summaryInfo.netReceiptsCollectOtherFeeCurrency}}
</template>
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" v-if="permissions.indexOf('selfno:report:detail') > -1"> <el-table-column :label="$t('操作')" v-if="permissions.indexOf('selfno:report:detail') > -1">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -120,8 +156,10 @@ import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box"; ...@@ -120,8 +156,10 @@ import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box";
import {DICT_TYPE} from "@/utils/dict"; import {DICT_TYPE} from "@/utils/dict";
import {getCountryListAll} from "@/api/ecw/country"; import {getCountryListAll} from "@/api/ecw/country";
import {getListTree} from "@/api/ecw/region"; import {getListTree} from "@/api/ecw/region";
import Template from "@/views/cms/template/index.vue";
export default { export default {
components: {Template},
data() { data() {
return { return {
loading: false, // 是否加载中 loading: false, // 是否加载中
...@@ -131,6 +169,8 @@ export default { ...@@ -131,6 +169,8 @@ export default {
queryParams: { queryParams: {
page: 1, page: 1,
rows: 10, rows: 10,
startWarehouseIdList:[],
destWarehouseIdList: []
}, },
// tradeCityList: [], // tradeCityList: [],
currencyList:[], currencyList:[],
...@@ -146,7 +186,7 @@ export default { ...@@ -146,7 +186,7 @@ export default {
created() { created() {
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
// getTradeCityList().then((res) => (this.tradeCityList = res.data)); // getTradeCityList().then((res) => (this.tradeCityList = res.data));
this.getList(); // 默认不查询,必须选择目的国以后才可以查询 this.getList();
getWarehouseList().then(res => this.warehouseList = res.data) getWarehouseList().then(res => this.warehouseList = res.data)
getListTree({treeType: 1}).then(r => { getListTree({treeType: 1}).then(r => {
this.countryList = r.data this.countryList = r.data
...@@ -182,6 +222,13 @@ export default { ...@@ -182,6 +222,13 @@ export default {
return this.queryParams.destCountryId === item.guojia && ( +item.tradeType === 1 || +item.tradeType === 3) return this.queryParams.destCountryId === item.guojia && ( +item.tradeType === 1 || +item.tradeType === 3)
}) })
}, },
// 目的国名称
dstCountryName(){
if(!this.queryParams.destCountryId) return null
const country = this.countryList.find(item => item.id == this.queryParams.destCountryId)
if(!country) return null
return this.$l(country, 'title')
}
}, },
methods: { methods: {
getCurrencyLabel(id){ getCurrencyLabel(id){
...@@ -192,7 +239,11 @@ export default { ...@@ -192,7 +239,11 @@ export default {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
let params = {...this.queryParams} let params = {
...this.queryParams,
startWarehouseIdList: this.queryParams.startWarehouseIdList.join(','),
destWarehouseIdList: this.queryParams.destWarehouseIdList.join(',')
}
this.addBeginAndEndTime(params, this.dateFilter, "JsDate", false); this.addBeginAndEndTime(params, this.dateFilter, "JsDate", false);
// 执行查询 // 执行查询
boxSettlementPage(params).then((response) => { boxSettlementPage(params).then((response) => {
...@@ -204,11 +255,19 @@ export default { ...@@ -204,11 +255,19 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.$refs.queryForm.validate((valid) => {
console.log({valid})
if(!valid) return
this.queryParams.page = 1; this.queryParams.page = 1;
if(!this.queryParams.destCountryId){ if(!this.queryParams.destCountryId){
return this.$message.error(this.$t('请选择目的国')) return this.$message.error(this.$t('请选择目的国'))
} }
if(!this.queryParams.startWarehouseIdList || !this.queryParams.startWarehouseIdList.length){
return this.$message.error(this.$t('请选择始发仓'))
}
this.getList(); this.getList();
})
}, },
handleReset(){ handleReset(){
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
......
...@@ -53,11 +53,16 @@ ...@@ -53,11 +53,16 @@
<el-table-column :label="$t('提单号')" prop="tidanNo"></el-table-column> <el-table-column :label="$t('提单号')" prop="tidanNo"></el-table-column>
<el-table-column :label="$t('备注')" prop="remarks"></el-table-column> <el-table-column :label="$t('备注')" prop="remarks"></el-table-column>
<el-table-column :label="$t('操作人')" prop="operator"></el-table-column> <el-table-column :label="$t('操作人')" prop="operator"></el-table-column>
<el-table-column :label="$t('日期')" prop="createTime"> <el-table-column :label="$t('放货日期')" prop="createTime">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{row.createTime|parseTime}} {{row.createTime|parseTime}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('复核日期')" prop="createTime">
<template slot-scope="{row}">
{{row.checkTime|parseTime}}
</template>
</el-table-column>
<el-table-column :label="$t('状态')" prop="status"> <el-table-column :label="$t('状态')" prop="status">
<template slot-scope="{row}"> <template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_RELEASE_STATUS" :value="row.status" /> <dict-tag :type="DICT_TYPE.ECW_RELEASE_STATUS" :value="row.status" />
......
...@@ -32,11 +32,20 @@ ...@@ -32,11 +32,20 @@
</el-descriptions-item> </el-descriptions-item>
<!-- 取消放货 --> <!-- 取消放货 -->
<el-descriptions-item :label="$t('申请原因')" v-if="applyType == 10"> <el-descriptions-item :label="$t('申请原因')" v-if="applyType == 10" :span="2">
<dict-tag :type="DICT_TYPE.ECW_CANCEL_PICK_TYPE" :value="detail.cancelPickType" /> <dict-tag :type="DICT_TYPE.ECW_CANCEL_PICK_TYPE" :value="detail.cancelPickType" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="voucherList.length" :label="$t('凭证')" :span="3">
<div v-for="(item, index) in voucherList" :key="index" style="padding:5px">
<video v-if="isVideo(item)" :src="item" @click="playVideo(item)" style="width: 100px; height: 100px;"></video>
<el-image v-else :src="item" style="width: 100px; height: 100px;" :preview-src-list="voucherImages"></el-image>
</div>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-dialog :visible="!!videoUrl" :before-close="closeVideoPlayer">
<video v-if="!!videoUrl" :src="videoUrl" style="width: 500px; height: 500px" controls></video>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -44,7 +53,9 @@ import {getPickUpdateApproveInfo} from '@/api/ecw/orderCargoControl' ...@@ -44,7 +53,9 @@ import {getPickUpdateApproveInfo} from '@/api/ecw/orderCargoControl'
import {getOrder} from '@/api/ecw/order' import {getOrder} from '@/api/ecw/order'
import {getChannelListByIds} from '@/api/ecw/channel' import {getChannelListByIds} from '@/api/ecw/channel'
import {parseTime} from '@/utils/ruoyi' import {parseTime} from '@/utils/ruoyi'
import Template from "@/views/cms/template/index.vue";
export default { export default {
components: {Template},
filters: {parseTime}, filters: {parseTime},
props:{ props:{
id: [String, Number], id: [String, Number],
...@@ -55,7 +66,8 @@ export default { ...@@ -55,7 +66,8 @@ export default {
detail: null, detail: null,
order: null, order: null,
channels: [], channels: [],
channelName: '/' channelName: '/',
videoUrl: null
} }
}, },
watch:{ watch:{
...@@ -74,6 +86,23 @@ export default { ...@@ -74,6 +86,23 @@ export default {
let channel = this.channels.find(item => item.channelId == id) let channel = this.channels.find(item => item.channelId == id)
return channel ? channel.nameZh : '/' return channel ? channel.nameZh : '/'
} }
},
// 凭证
voucherList(){
if(!this.detail || !this.detail.voucher) return []
return this.detail.voucher.split(',')
},
// 图片类型的凭证
voucherImages(){
return this.voucherList.filter(item => {
return !this.isVideo(item)
})
},
// 判断是否是视频链接
isVideo(){
return (url) => {
return ['mp4'].indexOf(url.split('.').pop().toLowerCase()) > -1
}
} }
}, },
created(){ created(){
...@@ -97,6 +126,15 @@ export default { ...@@ -97,6 +126,15 @@ export default {
this.channelName = this.$l(res.data, 'name') this.channelName = this.$l(res.data, 'name')
}) })
}, },
// 播放视频
playVideo(url){
console.log('play video', url)
this.videoUrl = url
},
// 关闭视频播放器
closeVideoPlayer(){
this.videoUrl = null
}
} }
} }
</script> </script>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</template> </template>
<script> <script>
import {sendSmsCode} from '@/api/ecw/orderCargoControl' import {sendSmsCode} from '@/api/ecw/orderCargoControl'
const timeout = null let timeout = null
export default { export default {
props:{ props:{
orderId: [String, Number], orderId: [String, Number],
......
...@@ -397,6 +397,9 @@ export default { ...@@ -397,6 +397,9 @@ export default {
if(this.splitTotal('weight') > this.leftData('weight')){ if(this.splitTotal('weight') > this.leftData('weight')){
return this.$message.error("拆出重量不能大于剩余重量") return this.$message.error("拆出重量不能大于剩余重量")
} }
if(this.splitTotal('quantity') > this.leftData('quantity')){
return this.$message.error("拆出数量不能大于剩余数量")
}
// 如果全拆(拆出箱数 == 原入仓箱数),则体积重量也需要全拆 // 如果全拆(拆出箱数 == 原入仓箱数),则体积重量也需要全拆
if(this.splitTotal('num') === this.warehouseRecord.cartonsNum){ if(this.splitTotal('num') === this.warehouseRecord.cartonsNum){
if(this.splitTotal('volume') !== this.warehouseRecord.volume){ if(this.splitTotal('volume') !== this.warehouseRecord.volume){
......
...@@ -172,9 +172,10 @@ ...@@ -172,9 +172,10 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费体积')" align="center" > <el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled> {{scope.row.chargeVolume}}
<!--<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled>
<span slot="append"></span> <span slot="append"></span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓重量')" align="center"> <el-table-column :label="$t('入仓重量')" align="center">
...@@ -184,16 +185,18 @@ ...@@ -184,16 +185,18 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费重量')" align="center"> <el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled> {{scope.row.chargeWeight}}kg
<!--<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled>
<span slot="append">kg</span> <span slot="append">kg</span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货值')" align="center"> <el-table-column :label="$t('货值')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" disabled> {{scope.row.worth}}{{ $t('') }}
<!--<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" disabled>
<span slot="append">{{ $t('') }}</span> <span slot="append">{{ $t('') }}</span>
</el-input> </el-input>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num"> <el-table-column :label="$t('箱数')" align="center" prop="num">
...@@ -256,12 +259,12 @@ ...@@ -256,12 +259,12 @@
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" inline> <el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" inline>
<el-form-item :label="$t('中文品名')"> <el-form-item :label="$t('中文品名')">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.prodTitleZh" ></el-option> <el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.orderItemId" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('英文品名')"> <el-form-item :label="$t('英文品名')">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.prodTitleEn" ></el-option> <el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.orderItemId" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-card> <el-card>
...@@ -273,7 +276,7 @@ ...@@ -273,7 +276,7 @@
<span class="mr-10">{{ $t('入仓重量') }}:{{ leftData.weight || 0 }}kg</span> <span class="mr-10">{{ $t('入仓重量') }}:{{ leftData.weight || 0 }}kg</span>
<span class="mr-10">{{ $t('收费重量') }}:{{ leftData.chargeWeight || 0 }}kg</span> <span class="mr-10">{{ $t('收费重量') }}:{{ leftData.chargeWeight || 0 }}kg</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ leftData.quantity || 0 }}</span> <span class="mr-10">{{ $t('数量(个)') }}:{{ leftData.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ leftData.worth || 0 }}{{ $t('元') }}</span> <span class="mr-10" v-if="orderLeftData">{{ $t('剩余订单货值') }}:{{ orderLeftData.splitResidueWorth || 0 }}{{ $t('元') }}</span>
</div> </div>
</el-card> </el-card>
...@@ -413,8 +416,8 @@ ...@@ -413,8 +416,8 @@
<el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg <el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
</el-form-item> </el-form-item>
<el-form-item :label="$t('放入货值')"> <el-form-item :label="$t('放入货值')" v-if="orderData.costVO">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"> <el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="orderData.costVO.totalWorth">
<template slot="append">{{ $t('') }}</template> <template slot="append">{{ $t('') }}</template>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
...@@ -488,7 +491,7 @@ import { ...@@ -488,7 +491,7 @@ import {
createSplitItem, createSplitItem,
deleteSplitItem, deleteSplitItem,
deleteSplit, deleteSplit,
deleteAllSplit deleteAllSplit, splitItemWorthCheck
} from "@/api/ecw/orderHandle" } from "@/api/ecw/orderHandle"
import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse' import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
...@@ -563,7 +566,9 @@ export default { ...@@ -563,7 +566,9 @@ export default {
// 当前选择的入仓记录ID // 当前选择的入仓记录ID
// selectedWarehouseInId: null, // selectedWarehouseInId: null,
// 当前正在放入的入仓记录 // 当前正在放入的入仓记录
currentPutIn: null currentPutIn: null,
// 订单剩余数据,sumNum,splitNum,splitResidueNum,totalWorth,splitWorth,splitResidueWorth
orderLeftData: null
}; };
}, },
async created() { async created() {
...@@ -610,6 +615,9 @@ export default { ...@@ -610,6 +615,9 @@ export default {
shopOpen(show){ shopOpen(show){
if(!show){ if(!show){
this.shopForm = {} this.shopForm = {}
}else{
// 打开弹层查询剩余数据
this.getOrderLeftData()
} }
}, },
// 切换品名需要重置已放入的记录 // 切换品名需要重置已放入的记录
...@@ -617,14 +625,32 @@ export default { ...@@ -617,14 +625,32 @@ export default {
// 默认取以前放入的品名 // 默认取以前放入的品名
let split = this.splitData.find(item => item.id == this.splitData[this.splitIndex].id) let split = this.splitData.find(item => item.id == this.splitData[this.splitIndex].id)
this.shopForm.specsRecordVOList = [] this.shopForm.specsRecordVOList = []
let splitItemId = undefined
let splitItem = undefined
if(split) { if(split) {
let specsRecordVOList = split.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || [] splitItem = split.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
if(splitItem){
let specsRecordVOList = splitItem.specsRecordVOList || []
specsRecordVOList.forEach(item => { specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*') const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3}) this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
}) })
splitItemId = splitItem.id
} }
} }
// 填充原来的收费数据和货值
this.$set(this.shopForm, 'chargeVolume', splitItem?.chargeVolume || 0)
this.$set(this.shopForm, 'chargeWeight', splitItem?.chargeWeight || 0)
this.$set(this.shopForm, 'worth', splitItem?.worth || 0)
// 获取剩余货值,排除当前品名已放入数据
this.getOrderLeftData(splitItemId)
},
'shopForm.worth'(val, oldVal){
console.log('worth change from', oldVal, 'to', val)
}
}, },
computed:{ computed:{
getDictData(){ getDictData(){
...@@ -716,9 +742,30 @@ export default { ...@@ -716,9 +742,30 @@ export default {
const list = this.warehouseInList.find(item => item.orderItemId == orderItemId)?.orderWarehouseInBackItemDoList || [] const list = this.warehouseInList.find(item => item.orderItemId == orderItemId)?.orderWarehouseInBackItemDoList || []
return list.map(item => { return list.map(item => {
let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*') let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
let labelArr = [
this.$t('{num}箱', {num: item.cartonsNum}),
this.$l(this.getDictDatas(this.DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE).find(dict => dict.value == item.specificationType), 'label'),
this.$t('长{boxGauge1}cm', {boxGauge1}),
this.$t('宽{boxGauge2}cm', {boxGauge2}),
this.$t('高{boxGauge3}cm', {boxGauge3}),
this.$t('方数{volume}m³', {volume: item.volume}),
this.$t('重量{weight}kg', {weight: item.weight})
]
if (item.quantityAll) {
labelArr.push(this.$t('数量{n}', {n: item.quantityAll}))
}
if (item.expressNo) {
labelArr.push(this.$t('快递{expressNo}', {expressNo: item.expressNo}))
}
if (item.orderLocationBackVOList && item.orderLocationBackVOList.length) {
labelArr.push(this.$t('储位{location}', {
location: item.orderLocationBackVOList.map(v => v.code || v.areaName + (v.locationName || '')).join(',')
}))
}
item.boxGauge1 = boxGauge1 item.boxGauge1 = boxGauge1
item.boxGauge2 = boxGauge2 item.boxGauge2 = boxGauge2
item.boxGauge3 = boxGauge3 item.boxGauge3 = boxGauge3
item.text = labelArr.join(',')
return item return item
}) })
} }
...@@ -899,7 +946,7 @@ export default { ...@@ -899,7 +946,7 @@ export default {
} }
this.open = true this.open = true
}, },
// 查询数量是否必填 /*// 查询数量是否必填
numcheck(){ numcheck(){
quantityRequired(this.orderData.lineId).then(res=>{ quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data this.quantityshow = res.data
...@@ -907,16 +954,16 @@ export default { ...@@ -907,16 +954,16 @@ export default {
}, },
// 输入方数箱数后,按照平均值计算数量和体积重量数据 // 输入方数箱数后,按照平均值计算数量和体积重量数据
numChange(){ numChange(){
/*var sum = parseInt(this.quantitySum/this.shopForm.num) /!*var sum = parseInt(this.quantitySum/this.shopForm.num)
this.$set(this.shopForm,'quantity',sum)*/ this.$set(this.shopForm,'quantity',sum)*!/
let rate = this.shopForm.num/this.mainOrderItem.num let rate = this.shopForm.num/this.mainOrderItem.num
this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity * rate)) this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity * rate))
this.$set(this.shopForm, 'volume', (this.mainOrderItem.volume * rate).toFixed(2)) this.$set(this.shopForm, 'volume', (this.mainOrderItem.volume * rate).toFixed(2))
this.$set(this.shopForm, 'chargeVolume', (this.mainOrderItem.chargeVolume * rate).toFixed(2)) this.$set(this.shopForm, 'chargeVolume', (this.mainOrderItem.chargeVolume * rate).toFixed(2))
this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2)) this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2)) this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2))
this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2)) // this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
}, },*/
/*changeProdTitleEn(){ /*changeProdTitleEn(){
var list = [] var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.prodTitleEn == this.shopForm.prodTitleEn) list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.prodTitleEn == this.shopForm.prodTitleEn)
...@@ -982,6 +1029,11 @@ export default { ...@@ -982,6 +1029,11 @@ export default {
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList
} }
// 货值不能超过可拆货值
if(params.worth > this.orderLeftData.splitResidueWorth){
return this.$message.error(this.$t('货值不能超过可拆货值'))
}
// 体积重量不能为0 // 体积重量不能为0
const fields = { const fields = {
'volume': this.$t('体积'), 'volume': this.$t('体积'),
...@@ -1121,10 +1173,11 @@ export default { ...@@ -1121,10 +1173,11 @@ export default {
this.$set(this.shopForm, 'chargeVolume', chargeVolume) this.$set(this.shopForm, 'chargeVolume', chargeVolume)
this.$set(this.shopForm, 'chargeWeight', chargeWeight) this.$set(this.shopForm, 'chargeWeight', chargeWeight)
// 如果品名全拆,则货值直接给剩余数据,否则按照比例计算 // 货值按照订单的总货值比例计算,所以需要判断是否是最后一次放入
let worth = (orderItem.worth*rate).toFixed(2) let worth = (this.orderLeftData.totalWorth * this.putin.num / this.orderLeftData.sumNum).toFixed(2)
if(this.leftData.num.toNumber() === this.putin.num){ // 如果是最后放入,或者超过了剩余货值,则直接取剩余货值
worth = this.leftData.worth if(this.orderLeftData.splitResidueNum == this.putin.num || worth > this.orderLeftData.splitResidueWorth){
worth = this.orderLeftData.splitResidueWorth
} }
this.$set(this.shopForm, 'worth', worth) this.$set(this.shopForm, 'worth', worth)
}, },
...@@ -1138,6 +1191,12 @@ export default { ...@@ -1138,6 +1191,12 @@ export default {
async cancel(){ async cancel(){
await this.reset() await this.reset()
this.$store.dispatch('tagsView/delCurrentView') this.$store.dispatch('tagsView/delCurrentView')
},
// 查询订单剩余数据
getOrderLeftData(orderSplitItemId){
splitItemWorthCheck(this.queryParams.orderId, orderSplitItemId).then(res => {
this.orderLeftData = res.data
})
} }
} }
} }
......
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