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) {
params: {orderId}
})
}
// 获取拆单订单的总货值与箱数拆分记录
export function splitItemWorthCheck(orderId, orderSplitItemId) {
return request({
url: '/order/split-item/worth/check',
method: 'get',
params: {orderId, orderSplitItemId}
})
}
......@@ -141,30 +141,34 @@
</el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" >
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('收费体积')" align="center" >
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('货值')" align="center">
......@@ -231,7 +235,7 @@
<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.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}</span>
<span class="mr-10">{{ $t('剩余可拆货值') }}:{{ leftWorth}}{{ $t('元') }}</span>
</div>
<div class="page-title">{{$t('可拆入仓记录')}}</div>
<el-table
......@@ -291,7 +295,7 @@
<el-table-column :label="$t('操作')">
<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-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>
</el-table-column>
</el-table>
......@@ -299,7 +303,7 @@
<div class="page-title" style="margin: 0">
{{$t('已放入入仓记录')}}
</div>
<el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button>
<el-button type="danger" size="mini" @click="clearAll">{{$t('清空放入数据')}}</el-button>
</div>
<el-table
......@@ -348,12 +352,12 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<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>
</el-table-column>
</el-table>
<div class="page-title">放入数据</div>
<div class="page-title">{{$t('放入数据')}}</div>
<div class="pl-20 mb-10">
<span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
......@@ -368,7 +372,7 @@
</el-form-item>
<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>
</el-input-number>
</el-form-item>
......@@ -400,7 +404,7 @@ import {
getSplitList,
// quantitycheck,
createSplitItem,
deleteSplitItem,
deleteSplitItem, splitItemWorthCheck,
} from "@/api/ecw/orderHandle";
import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
......@@ -472,7 +476,9 @@ export default {
// 当前选择的入仓记录ID
selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
currentPutIn: null,
/*// 订单剩余数据
orderLeftData: null*/
};
},
created() {
......@@ -515,11 +521,17 @@ export default {
'shopForm.orderItemId'(){
// 默认取以前放入的品名
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 => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
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: {
......@@ -641,7 +653,23 @@ export default {
num -= item.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: {
/*检查并提交字段(体积,重量)修改*/
......@@ -817,6 +845,10 @@ export default {
if(this.isQuantity){
params.quantity = this.putin.quantity
}
// 货值不能超过剩余货值
if(params.worth > this.leftWorth){
return this.$message.error(this.$t("货值不能超过剩余货值"));
}
createSplitItem(params).then((res) => {
this.$message.success(this.$t("放入成功"));
this.querySplitGoods();
......@@ -952,9 +984,18 @@ export default {
const chargeWeight = orderItem.itemType === 3 ? (orderItem.chargeWeight*rate).toFixed(2) : this.putin.weight
this.$set(this.shopForm, 'chargeVolume', chargeVolume)
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>
......
......@@ -29,7 +29,7 @@ export default {
},
computed:{
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
else return [...this.customerList,...this.recommended]
}
......@@ -50,7 +50,6 @@ export default {
},
watch:{
value(val){
console.log(val,'val')
this.customer = val;
if(!(this.customerList.some(i => i.id === val)) && val !== undefined){
getCustomerList({ids:val}).then(r => {
......
......@@ -60,7 +60,7 @@
<!-- </el-form-item>-->
<el-form-item :label="$t('常用提货网点')" prop="remarks">
<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-form-item>
</el-col>
......@@ -98,13 +98,13 @@
<el-form-item :label="$t('主营类别')" prop="productType">
<el-row :gutter="10">
<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-select>
</el-col>
<el-col :span="11">
<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-col>
</el-row>
......@@ -592,19 +592,12 @@ export default {
this.getCustomer(this.customerId).then(() => {
getCustomerContactsListByCustomer({customerId: customerId}).then(r => {
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){
getCustomerList({ids:this.form.promoter}).then(r => {
this.recommended = r.data;
})
}
})
// 打开重泡货开关
if(this.form.weightUnit){
this.showZhong = true
......@@ -634,14 +627,12 @@ export default {
}
getNodeList().then(r => {
this.nodeList = r.data
this.getNodeLists = r.data
})
getProductTypeList().then(r => {
this.productTypeList = r.data
})
getProductList().then(r => {
this.productList = r.data
})
getTradeCityList({type: 1}).then(r => {
this.importCityList = r.data.filter(item => item.type === '1')
})
......@@ -657,13 +648,10 @@ export default {
getCountryListAll().then(r => {
this.countryList = r.data
})
// 获取服务网点
getServiceNetwork().then(r =>{
this.serviceNetworkList = r.data
})
},
data(){
return {
getNodeLists:[],
isCustomerServiceConfirmed:false,
getDictDatas,
DICT_TYPE,
......@@ -718,6 +706,15 @@ export default {
},
methods: {
change(val){
this.form.productId = '';
this.getProductListFn(val);
},
getProductListFn(val){
getProductList({typeId:val}).then(r => {
this.productList = r.data
})
},
deleteBankData(index){
this.form.customerBanks.splice(index, 1);
},
......@@ -949,6 +946,11 @@ export default {
return getCustomer(id).then(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 };
if(this.form.productType){
console.log('1231',this.form.productType)
this.getProductListFn(this.form.productType)
}
this.open = true;
this.title = this.$t('修改客户');
this.getZhongPao()
......
......@@ -7,8 +7,8 @@
<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 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-customer-complaint']" type="primary" size="small" @click="$refs['customerComplaint'].handleAdd()">{{$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="customerFollowFn('complain')">{{$t('客诉')}}</el-button>
<el-button v-hasPermi="['ecw:customer:query-delete']" type="danger" size="small" @click="deleteCustomerFn()">{{$t('删除')}}</el-button>
</div>
</div>
......@@ -29,7 +29,7 @@
<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 ? 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('客户来源')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_SOURCE, customer.source) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户类别')">
......@@ -37,17 +37,19 @@
</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('客户经理')">{{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.companyEn }}</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('创建人')">{{ 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('主营类别')">{{ productType }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ pickupPoint }}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_STATUS, customer.status)}}</el-descriptions-item>
<el-descriptions-item :label="$t('主营类别')">{{ $l(customer,'productTypeName') }}</el-descriptions-item>
<el-descriptions-item :label="$t('常提货网点')">{{ $l(customer,'pickupPointName') }}</el-descriptions-item>
<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 :label="$t('备注')">{{ customer.remarks }}</el-descriptions-item>
<el-descriptions-item :label="$t('业绩类型')">{{ customer.isNew ?$t('新客户') : $t('老客户') }}</el-descriptions-item>
......@@ -92,7 +94,7 @@
:label="$t('联系方式')"
>
<template v-slot="{row}">
{{ row.areaCode + row.phoneNew }}
+{{ row.areaCode}} {{row.phoneNew}}
</template>
</el-table-column>
<el-table-column
......@@ -303,10 +305,10 @@
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-tab-pane>
<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 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 name="bill" :label="$t('账单')">
<el-table style="width: 100%" :data="infoListReceiptList">
......@@ -529,38 +531,31 @@ export default {
getCreditRulePage({page:1,rows:999,type:2}).then(r => {
this.creditTypeList = r.data.list
})
getNodeList().then(r => {
this.nodeList = r.data
})
// getNodeList().then(r => {
// this.nodeList = r.data
// })
getCustomer(this.id).then(response => {
this.customer = { ...this.customer, ...response.data }
console.log( this.customer,'this.customer')
getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
this.customerContacts = r.data
let list = this.customerContacts.map(r => r.userid)
memberUserList({ids:list.join(',')}).then(r => {
let list = this.customerContacts.filter(r => r.userid)
if(list.length > 0){
memberUserList({ids:list.map(i=>i.userid).join(',')}).then(r => {
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 => {
this.customerSelect = r.data.list
})
// getCustomerSelect({pageSize:1000,pageNo:1}).then(r => {
// this.customerSelect = r.data.list
// })
listServiceUser().then(r => {
this.serviceUserList = r.data
})
// this.getBrankByCustomerList()//品牌授权
this.getCustomerGrade()
// this.getCustomerGrade()
// this.creditLogPage()//等级日志
this.getorderList()//订单
// this.getInfoListOfferPage()//报价
......@@ -716,22 +711,16 @@ export default {
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
productType(){
const productType = this.productTypeList.find(p => p.id === parseInt(this.customer.productType))
return productType ? productType.titleZh : ''
},
pickupPoint(){
const pickupPoint = this.nodeList.find(p => p.id === parseInt(this.customer.pickupPoint))
return pickupPoint ? pickupPoint.titleZh : ''
},
promoter() {
return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
},
customerService() {
return this.serviceUserList.find(e => e.id === this.customer.customerService)?.nickname || ''
},
// promoter() {
// return this.customerSelect.find(e => e.id === this.customer.promoter)?.name || ''
// },
id() {
return this.customerId ? parseInt(this.customerId) : undefined
return parseInt(this.$route.params.customerId)
},
creditScoreCalculation(){
return (val)=>{
......@@ -745,6 +734,16 @@ export default {
}
},
methods:{
customerFollowFn(val){
this.activeName = val
this.$nextTick(()=>{
if(val === 'follow'){
this.$refs['customerFollow'].customerFollow.dialogVisible = true;
}else {
this.$refs['customerComplaint'].handleAdd()
}
})
},
checkPermi,
userIdFormatter(row, column, cellValue){
const member = this.memberList.find(e => e.id === cellValue)
......
......@@ -416,9 +416,13 @@ export default {
this.list = response.data.list;
this.total = response.data.total;
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
})
}
});
},
/** 取消按钮 */
......
......@@ -71,6 +71,12 @@
{{getOperator(row.updater)}}
</template>
</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('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......
......@@ -9,11 +9,11 @@
inline
class="card"
>
<el-form-item :label="$t('自编号')">
<el-form-item :label="$t('自编号')" prop="selfNo">
<el-input v-model="queryParams.selfNo" clearable></el-input>
</el-form-item>
<el-form-item :label="$t('始发仓')">
<el-select v-model="queryParams.startWarehouseIdList" :placeholder="$t('请选择')" clearable>
<el-form-item :label="$t('始发仓')" :rules="{required: true, message: $t('请选择始发仓')}" prop="startWarehouseIdList">
<el-select v-model="queryParams.startWarehouseIdList" multiple :placeholder="$t('请选择')" clearable>
<el-option
v-for="item in exportWarehouseList"
:key="item.id"
......@@ -22,7 +22,7 @@
/>
</el-select>
</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-option
v-for="item in countryList"
......@@ -32,8 +32,8 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')">
<el-select v-model="queryParams.destWarehouseId" :placeholder="queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')" clearable>
<el-form-item :label="$t('目的仓')" prop="destWarehouseIdList">
<el-select v-model="queryParams.destWarehouseIdList" multiple :placeholder="queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')" clearable>
<el-option
v-for="item in importWarehouseList"
:key="item.id"
......@@ -42,10 +42,10 @@
/>
</el-select>
</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>
</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="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
......@@ -54,7 +54,7 @@
>
</el-date-picker>
</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>
</el-form-item>
<el-form-item>
......@@ -81,20 +81,56 @@
</template>
</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="$t('运费')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup"></el-table-column>
<el-table-column :label="$t('清关费')" prop="summaryInfo.netReceiptsCollectClearanceFeeGroup"></el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsCollectOtherFeeGroup"></el-table-column>
<el-table-column :label="'received in ' + (dstCountryName || $t('目的国')) + `(${$t('目的地实收')})`" align="center" prop="">
<el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup">
<template slot-scope="{row}">
{{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 :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.netReceiptsAdvanceClearanceFeeGroup"></el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.netReceiptsAdvanceOtherFeeGroup"></el-table-column>
<el-table-column :label="$t('运费')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup">
<template slot-scope="{row}">
{{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 :label="$t('Discounts 折扣')" align="center" prop="">
<el-table-column :label="$t('运费')" prop="summaryInfo.discountFreightFeeGroup"></el-table-column>
<el-table-column :label="$t('清关费')" prop="summaryInfo.discountClearanceFeeGroup"></el-table-column>
<el-table-column :label="$t('额外费用')" prop="summaryInfo.discountOtherFeeGroup"></el-table-column>
<el-table-column :label="$t('运费')" prop="summaryInfo.discountFreightFeeGroup">
<template slot-scope="{row}">
{{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 :label="$t('操作')" v-if="permissions.indexOf('selfno:report:detail') > -1">
<template slot-scope="scope">
......@@ -120,8 +156,10 @@ import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box";
import {DICT_TYPE} from "@/utils/dict";
import {getCountryListAll} from "@/api/ecw/country";
import {getListTree} from "@/api/ecw/region";
import Template from "@/views/cms/template/index.vue";
export default {
components: {Template},
data() {
return {
loading: false, // 是否加载中
......@@ -131,6 +169,8 @@ export default {
queryParams: {
page: 1,
rows: 10,
startWarehouseIdList:[],
destWarehouseIdList: []
},
// tradeCityList: [],
currencyList:[],
......@@ -146,7 +186,7 @@ export default {
created() {
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
// getTradeCityList().then((res) => (this.tradeCityList = res.data));
this.getList();
// 默认不查询,必须选择目的国以后才可以查询 this.getList();
getWarehouseList().then(res => this.warehouseList = res.data)
getListTree({treeType: 1}).then(r => {
this.countryList = r.data
......@@ -182,6 +222,13 @@ export default {
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: {
getCurrencyLabel(id){
......@@ -192,7 +239,11 @@ export default {
/** 查询列表 */
getList() {
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);
// 执行查询
boxSettlementPage(params).then((response) => {
......@@ -204,11 +255,19 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
this.$refs.queryForm.validate((valid) => {
console.log({valid})
if(!valid) return
this.queryParams.page = 1;
if(!this.queryParams.destCountryId){
return this.$message.error(this.$t('请选择目的国'))
}
if(!this.queryParams.startWarehouseIdList || !this.queryParams.startWarehouseIdList.length){
return this.$message.error(this.$t('请选择始发仓'))
}
this.getList();
})
},
handleReset(){
this.$refs['queryForm'].resetFields()
......
......@@ -53,11 +53,16 @@
<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="operator"></el-table-column>
<el-table-column :label="$t('日期')" prop="createTime">
<el-table-column :label="$t('放货日期')" prop="createTime">
<template slot-scope="{row}">
{{row.createTime|parseTime}}
</template>
</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">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_RELEASE_STATUS" :value="row.status" />
......
......@@ -32,11 +32,20 @@
</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" />
</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-dialog :visible="!!videoUrl" :before-close="closeVideoPlayer">
<video v-if="!!videoUrl" :src="videoUrl" style="width: 500px; height: 500px" controls></video>
</el-dialog>
</div>
</template>
<script>
......@@ -44,7 +53,9 @@ import {getPickUpdateApproveInfo} from '@/api/ecw/orderCargoControl'
import {getOrder} from '@/api/ecw/order'
import {getChannelListByIds} from '@/api/ecw/channel'
import {parseTime} from '@/utils/ruoyi'
import Template from "@/views/cms/template/index.vue";
export default {
components: {Template},
filters: {parseTime},
props:{
id: [String, Number],
......@@ -55,7 +66,8 @@ export default {
detail: null,
order: null,
channels: [],
channelName: '/'
channelName: '/',
videoUrl: null
}
},
watch:{
......@@ -74,6 +86,23 @@ export default {
let channel = this.channels.find(item => item.channelId == id)
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(){
......@@ -97,6 +126,15 @@ export default {
this.channelName = this.$l(res.data, 'name')
})
},
// 播放视频
playVideo(url){
console.log('play video', url)
this.videoUrl = url
},
// 关闭视频播放器
closeVideoPlayer(){
this.videoUrl = null
}
}
}
</script>
......
......@@ -3,7 +3,7 @@
</template>
<script>
import {sendSmsCode} from '@/api/ecw/orderCargoControl'
const timeout = null
let timeout = null
export default {
props:{
orderId: [String, Number],
......
......@@ -397,6 +397,9 @@ export default {
if(this.splitTotal('weight') > this.leftData('weight')){
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('volume') !== this.warehouseRecord.volume){
......
......@@ -172,9 +172,10 @@
</el-table-column>
<el-table-column :label="$t('收费体积')" align="center" >
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
......@@ -184,16 +185,18 @@
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('货值')" align="center">
<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>
</el-input>
</el-input>-->
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num">
......@@ -256,12 +259,12 @@
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" inline>
<el-form-item :label="$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-form-item>
<el-form-item :label="$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-form-item>
<el-card>
......@@ -273,7 +276,7 @@
<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.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>
</el-card>
......@@ -413,8 +416,8 @@
<el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
</el-form-item>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth">
<el-form-item :label="$t('放入货值')" v-if="orderData.costVO">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="orderData.costVO.totalWorth">
<template slot="append">{{ $t('') }}</template>
</el-input-number>
</el-form-item>
......@@ -488,7 +491,7 @@ import {
createSplitItem,
deleteSplitItem,
deleteSplit,
deleteAllSplit
deleteAllSplit, splitItemWorthCheck
} from "@/api/ecw/orderHandle"
import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel'
......@@ -563,7 +566,9 @@ export default {
// 当前选择的入仓记录ID
// selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
currentPutIn: null,
// 订单剩余数据,sumNum,splitNum,splitResidueNum,totalWorth,splitWorth,splitResidueWorth
orderLeftData: null
};
},
async created() {
......@@ -610,6 +615,9 @@ export default {
shopOpen(show){
if(!show){
this.shopForm = {}
}else{
// 打开弹层查询剩余数据
this.getOrderLeftData()
}
},
// 切换品名需要重置已放入的记录
......@@ -617,14 +625,32 @@ export default {
// 默认取以前放入的品名
let split = this.splitData.find(item => item.id == this.splitData[this.splitIndex].id)
this.shopForm.specsRecordVOList = []
let splitItemId = undefined
let splitItem = undefined
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 => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
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:{
getDictData(){
......@@ -716,9 +742,30 @@ export default {
const list = this.warehouseInList.find(item => item.orderItemId == orderItemId)?.orderWarehouseInBackItemDoList || []
return list.map(item => {
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.boxGauge2 = boxGauge2
item.boxGauge3 = boxGauge3
item.text = labelArr.join(',')
return item
})
}
......@@ -899,7 +946,7 @@ export default {
}
this.open = true
},
// 查询数量是否必填
/*// 查询数量是否必填
numcheck(){
quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data
......@@ -907,16 +954,16 @@ export default {
},
// 输入方数箱数后,按照平均值计算数量和体积重量数据
numChange(){
/*var sum = parseInt(this.quantitySum/this.shopForm.num)
this.$set(this.shopForm,'quantity',sum)*/
/!*var sum = parseInt(this.quantitySum/this.shopForm.num)
this.$set(this.shopForm,'quantity',sum)*!/
let rate = this.shopForm.num/this.mainOrderItem.num
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, 'chargeVolume', (this.mainOrderItem.chargeVolume * 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, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
},
// this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
},*/
/*changeProdTitleEn(){
var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.prodTitleEn == this.shopForm.prodTitleEn)
......@@ -982,6 +1029,11 @@ export default {
specsRecordVOList:this.shopForm.specsRecordVOList
}
// 货值不能超过可拆货值
if(params.worth > this.orderLeftData.splitResidueWorth){
return this.$message.error(this.$t('货值不能超过可拆货值'))
}
// 体积重量不能为0
const fields = {
'volume': this.$t('体积'),
......@@ -1121,10 +1173,11 @@ export default {
this.$set(this.shopForm, 'chargeVolume', chargeVolume)
this.$set(this.shopForm, 'chargeWeight', chargeWeight)
// 如果品名全拆,则货值直接给剩余数据,否则按照比例计算
let worth = (orderItem.worth*rate).toFixed(2)
if(this.leftData.num.toNumber() === this.putin.num){
worth = this.leftData.worth
// 货值按照订单的总货值比例计算,所以需要判断是否是最后一次放入
let worth = (this.orderLeftData.totalWorth * this.putin.num / this.orderLeftData.sumNum).toFixed(2)
// 如果是最后放入,或者超过了剩余货值,则直接取剩余货值
if(this.orderLeftData.splitResidueNum == this.putin.num || worth > this.orderLeftData.splitResidueWorth){
worth = this.orderLeftData.splitResidueWorth
}
this.$set(this.shopForm, 'worth', worth)
},
......@@ -1138,6 +1191,12 @@ export default {
async cancel(){
await this.reset()
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