Commit b6b42e19 authored by 我在何方's avatar 我在何方
parents fbead5ec ba72f0ab
...@@ -42,7 +42,13 @@ export function getChannelPage(query) { ...@@ -42,7 +42,13 @@ export function getChannelPage(query) {
params: query params: query
}) })
} }
//启用-禁用渠道
export function channelSwitch(id){
return request({
url:`/ecw/channel/switch/${id}`,
method:'put'
})
}
// 获得渠道列表 TODO // 获得渠道列表 TODO
export function getChannelList(query) { export function getChannelList(query) {
return request({ return request({
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button> <el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button>
<div style="height: 36px; display: flex; align-items: center"> <div style="height: 36px; display: flex; align-items: center">
<el-checkbox :label="$t('全选') + `(${$t('{total}个', {total})})`" @change="toggleAll" :disabled="isAllProduct || loading"></el-checkbox> <el-checkbox :label="$t('全选') + `(${$t('{total}个', {total})})`" @change="toggleAll" v-model="isCheckedAll" :disabled="isAllProduct || loading"></el-checkbox>
</div> </div>
</div> </div>
<div class="list"> <div class="list">
...@@ -102,7 +102,9 @@ export default { ...@@ -102,7 +102,9 @@ export default {
// 右侧页码 // 右侧页码
rightPage: 1, rightPage: 1,
// 页大小 // 页大小
pageSize: 100 pageSize: 100,
// 是否选中全选
isCheckedAll: false
} }
}, },
computed: { computed: {
...@@ -229,6 +231,8 @@ export default { ...@@ -229,6 +231,8 @@ export default {
let res = await getSimpleProductList(this.queryParams) let res = await getSimpleProductList(this.queryParams)
this.loading = false this.loading = false
this.list = res.data this.list = res.data
this.choosedList = []
this.isCheckedAll = false
}, },
// 获得指定条件的商品的全部ID // 获得指定条件的商品的全部ID
getFilteredIds(){ getFilteredIds(){
...@@ -257,6 +261,7 @@ export default { ...@@ -257,6 +261,7 @@ export default {
async clearAll() { async clearAll() {
await this.$confirm(this.$t('确定要全部清除么?')) await this.$confirm(this.$t('确定要全部清除么?'))
this.choosedList = [] this.choosedList = []
this.isCheckedAll = false
} }
} }
} }
......
...@@ -315,7 +315,7 @@ export default { ...@@ -315,7 +315,7 @@ export default {
if(this.getSelectedIndex(router) > -1) return if(this.getSelectedIndex(router) > -1) return
this.selectedRoutes.push({ this.selectedRoutes.push({
lineId: router.id, lineId: router.id,
channelId: router.channel.channelId, shippingChannelId: router.channel.channelId,
transportId: router.transportType transportId: router.transportType
}) })
}else{ }else{
...@@ -328,7 +328,7 @@ export default { ...@@ -328,7 +328,7 @@ export default {
}, },
getSelectedIndex(router){ getSelectedIndex(router){
return this.selectedRoutes.findIndex(item => { return this.selectedRoutes.findIndex(item => {
return item.lineId == router.id && item.channelId == router.channel.channelId return item.lineId == router.id && item.shippingChannelId == router.channel.channelId
}) })
}, },
SpanMethod({ row, column, rowIndex, columnIndex }){ SpanMethod({ row, column, rowIndex, columnIndex }){
......
<template> <template>
<el-select <el-select
v-model="index" v-model="valueSync"
filterable filterable
:clearable="clearable" :clearable="clearable"
remote remote
reserve-keyword reserve-keyword
:placeholder="placeholder ? placeholder : $t('请选择')" :placeholder="placeholder ? placeholder : $t('请选择')"
:loading="loading"> :loading="loading">
<el-option
v-if="prepend"
:label="`${prepend.nickname}`"
:value="prepend.id">
</el-option>
<el-option <el-option
v-for="(item, index) in list" v-for="(item, index) in list"
:key="item.id" :key="item.id"
:label="`${item.nickname}`" :label="`${item.nickname}`"
:value="index"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
...@@ -26,26 +31,23 @@ export default { ...@@ -26,26 +31,23 @@ export default {
manage:{ manage:{
type:Boolean, type:Boolean,
default:false default:false
} },
prepend: Object
}, },
data(){ data(){
return { return {
index: null,
list:[], list:[],
loading: false, loading: false,
size: 20 size: 20,
valueSync: this.value
} }
}, },
watch:{ watch:{
index(val){
this.$emit('input', val !== null && val !== undefined && val != '' ? this.list[val].id : null)
this.$emit('change', val !== null && val !== undefined && val != '' ? this.list[val]: null)
},
value(val){ value(val){
this.resetIndex() this.valueSync = this.value
}, },
list(){ valueSync(val){
this.resetIndex() this.$emit('input', val)
} }
}, },
created(){ created(){
...@@ -60,39 +62,9 @@ export default { ...@@ -60,39 +62,9 @@ export default {
this.list = res.data this.list = res.data
}) })
} }
if(this.value){
// this.init() this.valueSync = this.value
},
methods:{
resetIndex(){
let index = this.list.findIndex(item => item.id == this.value)
if(index < 0) this.index = null
else this.index = index
}
/* init(){
console.log('初始化联系人选择', this.value)
if(!this.value) return
let index = this.list.findIndex(item => item.customerContactsId == this.value)
if(index < 0){
getCustomerContactsSelect({ids: this.value}).then(res => {
if(!res.data || !res.data.length){
return this.$message.error('联系人信息获取失败')
}
this.list.unshift(res.data[0])
this.index = 0
})
}
}, */
/* remoteMethod(keyword){
let params = {
size: this.size
} }
params.searchKey = keyword
this.loading = true
getCustomerContactsSelect(params)
.then(res => this.list = res.data)
.finally(() => this.loading = false)
} */
} }
} }
</script> </script>
...@@ -19,6 +19,13 @@ const service = axios.create({ ...@@ -19,6 +19,13 @@ const service = axios.create({
// 超时 // 超时
timeout: 1000 * 30 timeout: 1000 * 30
}) })
// 如果是生产环境则打印提示
if (process.env.NODE_ENV === 'development' && service.defaults.baseURL === 'https://api2.groupage.cn/admin-api/') {
console.log('%c请注意,当前为生产环境请谨慎操作!!', 'background-color: red; font-size: 3em; color:yellow');
console.log('%c接口地址:' + service.defaults.baseURL, 'background-color: black; font-size: 1.5em; color:yellow !important');
}
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
config.headers['locale'] = getLocale() config.headers['locale'] = getLocale()
......
...@@ -65,11 +65,11 @@ ...@@ -65,11 +65,11 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('出仓箱数')" prop="realNum"> <el-form-item :label="$t('出仓箱数')" prop="realNum">
<el-input-number v-model="airCheckoutObj.realNum" :controls="false" :precision="0" /> <el-input-number v-model="airCheckoutObj.realNum" :controls="false" :precision="0" disabled />
</el-form-item> </el-form-item>
<el-form-item :label="$t('出仓影像')"> <el-form-item :label="$t('出仓影像')">
<ImageUpload :limit="1" :isShowTip=false v-model="airCheckoutObj.checkoutFiles" /> <ImageUpload :limit="1" :isShowTip=false v-model="airCheckoutObj.checkoutFiles" @input="saveImage" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
...@@ -81,19 +81,20 @@ ...@@ -81,19 +81,20 @@
<!-- 开始出仓 --> <!-- 开始出仓 -->
<el-dialog :title="$t('开始出仓')" :visible.sync="dialogVisible" fullscreen :modal-append-to-body=false append-to-body> <el-dialog :title="$t('开始出仓')" :visible.sync="dialogVisible" fullscreen :modal-append-to-body=false append-to-body>
<startCheckout v-bind="$attrs" v-if="dialogVisible" v-on="$listeners" @closeDialog1="closeDialog1" /> <startCheckout v-bind="$attrs" v-if="dialogVisible" v-on="$listeners" @closeDialog1="closeDialog1" @reload="reload" />
</el-dialog> </el-dialog>
<el-row class="operate-button"> <el-row class="operate-button">
<el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button> <el-button type="primary" @click="onSubmit(1)">{{$t('保存')}}</el-button>
<el-button :disabled="$attrs.shipmentObj.approvaling" type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button> <el-button :disabled="$attrs.shipmentObj.approvaling" type="success" @click="onSubmit(2)">{{$t('提交')}}</el-button>
<el-button @click="cancel">{{$t('关闭')}}</el-button> <el-button @click="cancel">{{$t('关闭')}}</el-button>
<el-button @click="startCheckout">{{$t('确认出仓')}}</el-button> <el-button type="danger" @click="startCheckout">{{$t('确认出仓')}}</el-button>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { getbox } from "@/api/ecw/box";
import { airCheckoutCreate } from "@/api/ecw/boxSea"; import { airCheckoutCreate } from "@/api/ecw/boxSea";
import startCheckout from "./checkout/startCheckout.vue"; import startCheckout from "./checkout/startCheckout.vue";
import userSelect from "./common/userSelect.vue"; import userSelect from "./common/userSelect.vue";
...@@ -158,6 +159,12 @@ export default { ...@@ -158,6 +159,12 @@ export default {
} }
}); });
}, },
reload() {
getbox(this.$attrs.shipmentObj.id).then((res)=>{
this.$set(this.airCheckoutObj, 'planNum', res.data.planNum)
this.$set(this.airCheckoutObj, 'realNum', res.data.realNum)
})
},
/** 取消 */ /** 取消 */
cancel(type) { cancel(type) {
this.$emit("closeDialog", type); this.$emit("closeDialog", type);
...@@ -169,6 +176,27 @@ export default { ...@@ -169,6 +176,27 @@ export default {
closeDialog1() { closeDialog1() {
this.dialogVisible = false; this.dialogVisible = false;
}, },
//自动保存图片
saveImage() {
const { ldPictures } = this.airCheckoutObj;
let pictures = ldPictures?.split(",") ?? [];
let newPictures = [];
for (const item of pictures) {
if (item) {
newPictures.push({
type: "image",
url: item,
});
}
}
airCheckoutCreate({
...this.airCheckoutObj,
shipmentId: this.$attrs.shipmentObj.id,
operateType: 1,
}).then(()=>{
this.$emit("getBoxInfo");
})
}
}, },
}; };
</script> </script>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div><dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="shipmentObj.transportType" />{{importCityName(shipmentObj.startWarehouseId)}}{{importCityName(shipmentObj.destWarehouseId)}}{{getShipChannelName(shipmentObj.channelRespVO.channelId)}}</div> <div><dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="shipmentObj.transportType" />{{importCityName(shipmentObj.startWarehouseId)}}{{importCityName(shipmentObj.destWarehouseId)}}{{getShipChannelName(shipmentObj.channelRespVO.channelId)}}</div>
<div> <div>
<template> <template>
<el-input v-model="qrCode" :placeholder="$t('请输入二维码/条码编号')" clearable></el-input> <el-input style="width: 270px;" v-model="qrCode" :placeholder="$t('请输入二维码/条码编号/合包箱号标签')" clearable></el-input>
<el-button type="primary" @click="handlerBatchCreate('single')">{{$t('确定')}}</el-button> <el-button type="primary" @click="handlerBatchCreate('single')">{{$t('确定')}}</el-button>
<el-button type="primary" @click="handlerClick('batchInput',$t('批量输入'))">{{$t('批量输入')}}</el-button> <el-button type="primary" @click="handlerClick('batchInput',$t('批量输入'))">{{$t('批量输入')}}</el-button>
<el-button type="primary" @click="handlerClick('correction',$t('出仓纠错'))">{{$t('出仓纠错')}}</el-button> <el-button type="primary" @click="handlerClick('correction',$t('出仓纠错'))">{{$t('出仓纠错')}}</el-button>
...@@ -21,12 +21,10 @@ ...@@ -21,12 +21,10 @@
<el-table-column :label="$t('序号')" align="center" width="50" prop="tidanNum" /> <el-table-column :label="$t('序号')" align="center" width="50" prop="tidanNum" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"> <el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <router-link :to="{path: '/order/detail',query: {orderId: scope.row.orderId}}" class="link-type">
<a href="javascript:void(0);" class="order-href" @click="orderClick(scope.row)">{{ scope.row.orderNo }}</a> <span>{{ scope.row.orderNo }}</span>
</div> </router-link>
<div style="color:blue;fontWeight:bold;">
{{ scope.row.isExternalWarehouse === 1 ? '(' + $t('外部仓') + ')' : ''}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货物信息')" align="center" prop="goodsList"> <el-table-column :label="$t('货物信息')" align="center" prop="goodsList">
...@@ -50,12 +48,22 @@ ...@@ -50,12 +48,22 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('计划箱数')" align="center" prop="num"> <el-table-column :label="$t('计划箱数')" align="center" prop="num">
<template slot-scope="scope"> <template slot-scope="scope">
{{getTotlContent(scope.row,['num'])}} <div>
<a href="javascript:void(0);" class="order-href" @click="orderClick(scope.row)">{{getTotlContent(scope.row,['num'])}}</a>
</div>
<div style="color:blue;fontWeight:bold;">
{{ scope.row.isExternalWarehouse === 1 ? '(' + $t('外部仓') + ')' : ''}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('实装箱数')" align="center" prop="installNum"> <el-table-column :label="$t('出仓箱数')" align="center" prop="installNum">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.installNum }}{{$t('')}} <div>
<a href="javascript:void(0);" class="order-href" @click="orderClick(scope.row)">{{ scope.row.installNum }}{{$t('')}}</a>
</div>
<div style="color:blue;fontWeight:bold;">
{{ scope.row.isExternalWarehouse === 1 ? '(' + $t('外部仓') + ')' : ''}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('体积')" align="center" prop="volume"> <el-table-column :label="$t('体积')" align="center" prop="volume">
...@@ -68,6 +76,11 @@ ...@@ -68,6 +76,11 @@
{{getTotlContent(scope.row,['weight'])}} {{getTotlContent(scope.row,['weight'])}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('合包箱号')" align="center" prop="pkgNum">
<template slot-scope="scope">
{{scope.row.pkgNum}}
</template>
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
</el-card> </el-card>
...@@ -87,7 +100,7 @@ ...@@ -87,7 +100,7 @@
</el-row> </el-row>
<el-row style="margin-top: 20px;"> <el-row style="margin-top: 20px;">
<el-button type="primary" @click="submitCheckout">{{$t('确认出仓')}}</el-button> <el-button type="primary" @click="submitCheckout">{{$t('确认出仓')}}</el-button>
<el-button @click="$emit('closeDialog1')">{{$t('取消')}}</el-button> <el-button @click="closeReload">{{$t('取消')}}</el-button>
</el-row> </el-row>
...@@ -104,7 +117,7 @@ ...@@ -104,7 +117,7 @@
<template v-if="dialogConfig.type === 'correction' && dialogConfig.dialogVisible"> <template v-if="dialogConfig.type === 'correction' && dialogConfig.dialogVisible">
<el-form ref="correctionForm" :rules="rules" :model="correctionObj" label-position="top"> <el-form ref="correctionForm" :rules="rules" :model="correctionObj" label-position="top">
<el-form-item :label="$t('出仓纠错(二维码/条形码编号)')" prop="qrCode"> <el-form-item :label="$t('出仓纠错(二维码/条形码编号)')" prop="qrCode">
<el-input v-model="correctionObj.qrCode" :placeholder="$t('请输入二维码/条形码编号')" clearable /> <el-input v-model="correctionObj.qrCode" :placeholder="$t('请输入二维码/条形码编号/合包箱号标签')" clearable />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="operate-button"> <el-row class="operate-button">
...@@ -528,9 +541,13 @@ export default { ...@@ -528,9 +541,13 @@ export default {
submitCheckout(){ submitCheckout(){
confirmAirCheckout({shipmentId: this.shipmentObj.id}).then((res) => { confirmAirCheckout({shipmentId: this.shipmentObj.id}).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.$emit('closeDialog1') this.closeReload()
}); });
}); });
},
closeReload(){
this.$emit('closeDialog1')
this.$emit('reload')
} }
}, },
computed: { computed: {
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
<el-table-column align="center" :label="$t('序号')" width="50" type="index" /> <el-table-column align="center" :label="$t('序号')" width="50" type="index" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"> <el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" @click.native="orderClick(scope.row)"> <router-link :to="{path: '/order/detail',query: {orderId: scope.row.orderId}}" class="link-type">
{{ scope.row.orderNo }} <span>{{ scope.row.orderNo }}</span>
</el-link> </router-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('商品信息')" width="250px" align="center"> <el-table-column :label="$t('商品信息')" width="250px" align="center">
...@@ -41,7 +42,9 @@ ...@@ -41,7 +42,9 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('计划/已装')" align="center" prop="sumNum"> <el-table-column :label="$t('计划/已装')" align="center" prop="sumNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" @click.native="orderClick(scope.row)">
{{ scope.row.sumNum }}/{{ scope.row.installNum }} {{ scope.row.sumNum }}/{{ scope.row.installNum }}
</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('纸箱尺寸')" align="center"> <el-table-column :label="$t('纸箱尺寸')" align="center">
...@@ -314,6 +317,7 @@ export default { ...@@ -314,6 +317,7 @@ export default {
getPkgPageByPkgId(queryParams).then((res) => { getPkgPageByPkgId(queryParams).then((res) => {
this.pagList = res.data.list this.pagList = res.data.list
this.total = res.data.total this.total = res.data.total
console.log(this.pagList,'222');
}) })
}, },
// 格式化日期 // 格式化日期
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>tallyClick('batch')">{{$t('批量理货')}}</el-button> <el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>tallyClick('batch')">{{$t('批量理货')}}</el-button>
<el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>removeClick('batch')">{{$t('批量移出')}}</el-button> <el-button :disabled="shipmentObj.approvaling" size="small" type="primary" @click="()=>removeClick('batch')">{{$t('批量移出')}}</el-button>
</div> </div>
<div v-if="false"> <div>
<template> <template>
<el-input v-model="qrCode" :placeholder="$t('请输入二维码/条码编号')" clearable></el-input> <el-input v-model="qrCode" :placeholder="$t('请输入二维码/条码编号')" clearable></el-input>
<el-button type="primary" @click="handlerBatchCreate()">{{$t('确定')}}</el-button> <el-button type="primary" @click="handlerBatchCreate()">{{$t('确定')}}</el-button>
...@@ -476,13 +476,15 @@ export default { ...@@ -476,13 +476,15 @@ export default {
// 理货完成 // 理货完成
tallyFinish() { tallyFinish() {
let flag = false let flag = false
let orderNo = ''
this.checkOrderList.forEach(item=>{ this.checkOrderList.forEach(item=>{
if(item.installNum != item.num){ if(item.installNum != item.num){
flag = true flag = true
orderNo = orderNo + '' + item.orderNo + ''
} }
}) })
if(flag){ if(flag){
this.$message.error(this.$t("仍有订单未理货,请完成所有订单箱号标签扫码后完成理货")); this.$message.error(this.$t(`订单号${orderNo}未完成理货,请完成全部订单理货后重试`));
return; return;
} }
tallyCommit({ shipmentId: this.shipmentObj.id }).then((res) => { tallyCommit({ shipmentId: this.shipmentObj.id }).then((res) => {
......
...@@ -186,10 +186,6 @@ export default { ...@@ -186,10 +186,6 @@ export default {
break; break;
// 清关 // 清关
case "cusClearance": case "cusClearance":
if(!this.shipmentObj.sapStatus || this.shipmentObj.sapStatus <= 151){
this.$message.error(this.$t("请先完成到港操作"));
return;
}
this.$set(this.dialogConfig, "width", "700px"); this.$set(this.dialogConfig, "width", "700px");
break; break;
// AGENT // AGENT
...@@ -224,10 +220,6 @@ export default { ...@@ -224,10 +220,6 @@ export default {
break; break;
// 卸柜 // 卸柜
case "unloading": case "unloading":
if(!this.shipmentObj.sapStatus || this.shipmentObj.sapStatus <= 151){
this.$message.error(this.$t("请先完成到港操作"));
return;
}
// 卸柜反审 // 卸柜反审
const unStatus = this.shipmentObj[node.keyName]; const unStatus = this.shipmentObj[node.keyName];
if ([186].includes(unStatus)) { if ([186].includes(unStatus)) {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form :disabled="isView" ref="form" :model="form" :rules="rules" label-width="120px">
<el-card shadow="never"> <el-card shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ $t('渠道信息') }}</span> <span>{{ $t('渠道信息') }}</span>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('快递')" prop="expressId"> <el-form-item :label="$t('快递')" prop="expressId">
<!-- <el-input v-model="form.expressId" placeholder="请输入快递ID" /> --> <!-- <el-input v-model="form.expressId" placeholder="请输入快递ID" /> -->
<el-select v-model="form.expressId"> <el-select v-model="form.expressId" style="width: 100%">
<el-option v-for="item in expressList" :value="item.id+''" :label="item.companyName" :key="item.id"/> <el-option v-for="item in expressList" :value="item.id+''" :label="item.companyName" :key="item.id"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="$t('所属目的国家')" prop="country"> <el-form-item :label="$t('所属目的国家')" prop="countryId">
<el-select filterable clearable v-model="form.countryId" :placeholder="$t('请选择国家')"> <el-select style="width: 100%" filterable clearable v-model="form.countryId" :placeholder="$t('请选择国家')">
<el-option v-for="dict in countryList" <el-option v-for="dict in countryList"
:key="dict.id" :label="$l(dict,'title')" :value="parseInt(dict.id)"/> :key="dict.id" :label="$l(dict,'title')" :value="parseInt(dict.id)"/>
</el-select> </el-select>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="可出商品特性" prop="attrId"> <el-form-item label="可出商品特性" prop="attrId">
<el-select multiple v-model="form.attrId"> <el-select style="width: 100%" multiple v-model="form.attrId">
<el-option v-for="(item, index) in attrList" :value="item.id" :label="$l(item, 'attrName')"></el-option> <el-option v-for="(item, index) in attrList" :value="item.id" :label="$l(item, 'attrName')"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="渠道泡重比例" prop="attrId"> <el-form-item label="渠道泡重比例" prop="attrId">
<el-input v-model.number="form.bubbleWeightRatio" style="width: 200px"> <el-input v-model.number="form.bubbleWeightRatio" style="width: 100%">
<template #suffix> <template #suffix>
<span>%</span> <span>%</span>
</template> </template>
...@@ -135,18 +135,25 @@ ...@@ -135,18 +135,25 @@
<!-- </packaging-type>--> <!-- </packaging-type>-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-row>--> <!-- </el-row>-->
<el-form-item :label="$t('备注-中文')" prop="remarksZh"> <el-row :gutter="20">
<el-col :span="12"> <el-form-item :label="$t('备注-中文')" prop="remarksZh">
<el-input <el-input
v-model="form.remarksZh" v-model="form.remarksZh"
:placeholder="$t('请输入备注-中文')" :placeholder="$t('请输入备注-中文')"
/> />
</el-form-item> </el-form-item></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item :label="$t('备注-英文')" prop="remarksEn"> <el-form-item :label="$t('备注-英文')" prop="remarksEn">
<el-input <el-input
v-model="form.remarksEn" v-model="form.remarksEn"
:placeholder="$t('请输入备注-英文')" :placeholder="$t('请输入备注-英文')"
/> />
</el-form-item> </el-form-item></el-col>
</el-row>
<!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status"> <!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status">
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio label="1">{{ $t('请选择字典生成') }}</el-radio> <el-radio label="1">{{ $t('请选择字典生成') }}</el-radio>
...@@ -171,7 +178,7 @@ ...@@ -171,7 +178,7 @@
<!-- </el-card>--> <!-- </el-card>-->
</el-form> </el-form>
<div> <div>
<el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button> <el-button v-if="!isView" type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
<el-button @click="$router.back()">{{ $t('返回列表') }}</el-button> <el-button @click="$router.back()">{{ $t('返回列表') }}</el-button>
</div> </div>
<el-dialog <el-dialog
...@@ -222,7 +229,8 @@ export default { ...@@ -222,7 +229,8 @@ export default {
internalNameEn: {required: true, message: '请输入内部英文名称', trigger: 'blur'}, internalNameEn: {required: true, message: '请输入内部英文名称', trigger: 'blur'},
typeNumber: {required: true, message: '请输入编码类型', trigger: 'blur'}, typeNumber: {required: true, message: '请输入编码类型', trigger: 'blur'},
code: {required: true, message: '请输入简码', trigger: 'blur'}, code: {required: true, message: '请输入简码', trigger: 'blur'},
attrId: {required: true, message: '请选择可出商品特性', trigger: 'blur'} attrId: {required: true, message: '请选择可出商品特性', trigger: 'blur'},
countryId: {required: true, message: '请选择国家', trigger: 'blur'}
}, },
expressList: [], expressList: [],
warehouseList: [], warehouseList: [],
...@@ -241,6 +249,7 @@ export default { ...@@ -241,6 +249,7 @@ export default {
} */ } */
}, },
mounted() { mounted() {
console.log(this.$route,'rotue')
getTradeCountryList().then(r => { getTradeCountryList().then(r => {
this.countryList = r.data this.countryList = r.data
}) })
...@@ -288,6 +297,9 @@ export default { ...@@ -288,6 +297,9 @@ export default {
}, },
computed: { computed: {
isView(){
return this.$route.path.includes('view_channel')
},
DICT_TYPE() { DICT_TYPE() {
return DICT_TYPE return DICT_TYPE
}, },
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<!-- <el-form-item label="内部名称-英文" prop="internalNameEn"> <!-- <el-form-item label="内部名称-英文" prop="internalNameEn">
<el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.internalNameEn" placeholder="请输入内部名称-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('类型编码')" prop="typeNumber"> <el-form-item :label="$t('码')" prop="typeNumber">
<el-input v-model="queryParams.typeNumber" :placeholder="$t('请输入类型编码')" clearable <el-input v-model="queryParams.code" :placeholder="$t('请输入简码')" clearable
@keyup.enter.native="handleQuery"/> @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="仓库ID字符串" prop="warehouseIds"> <!-- <el-form-item label="仓库ID字符串" prop="warehouseIds">
...@@ -34,18 +34,6 @@ ...@@ -34,18 +34,6 @@
</el-select> </el-select>
<!-- <el-input v-model="queryParams.countryId" :placeholder="$t('请输入所属国家')" clearable @keyup.enter.native="handleQuery"/>--> <!-- <el-input v-model="queryParams.countryId" :placeholder="$t('请输入所属国家')" clearable @keyup.enter.native="handleQuery"/>-->
</el-form-item> </el-form-item>
<el-form-item :label="$t('预计时间')">
<el-input v-model="queryParams.etaTime" :placeholder="$t('预计到达天数')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('渠道代理')" prop="channelAgent">
<el-input v-model="queryParams.channelAgent" :placeholder="$t('请输入渠道代理')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('备注')" prop="remarksZh">
<el-input v-model="queryParams.remarksZh" :placeholder="$t('请输入备注-中文')" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<!-- <el-form-item label="备注-英文" prop="remarksEn"> <!-- <el-form-item label="备注-英文" prop="remarksEn">
<el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.remarksEn" placeholder="请输入备注-英文" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> --> </el-form-item> -->
...@@ -129,12 +117,21 @@ ...@@ -129,12 +117,21 @@
<span>{{ parseTime(scope.row.updateTime) }}</span> <span>{{ parseTime(scope.row.updateTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('跟新人')" prop="updaterName"> <el-table-column :label="$t('更新人')" prop="updaterName">
</el-table-column>
<el-table-column :label="$t('状态')" prop="updaterName">
<template v-slot="{row}">
<el-switch @change="(e)=>{changeSwitch(e,row)}" :validate-event="false" :active-value="true"
v-model="row.status"></el-switch>
</template>
</el-table-column> </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">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:channel:update']">{{ $t('修改') }} v-hasPermi="['ecw:channel:update']">{{ $t('修改') }}
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row,2)"
v-hasPermi="['ecw:channel:view']">{{ $t('查看') }}
</el-button> </el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:channel:delete']">{{ $t('删除') }} v-hasPermi="['ecw:channel:delete']">{{ $t('删除') }}
...@@ -156,7 +153,7 @@ import { ...@@ -156,7 +153,7 @@ import {
deleteChannel, deleteChannel,
getChannel, getChannel,
getChannelPage, getChannelPage,
exportChannelExcel exportChannelExcel, channelSwitch
} from "@/api/ecw/channel"; } from "@/api/ecw/channel";
import {getCountryListAll} from "@/api/ecw/country"; import {getCountryListAll} from "@/api/ecw/country";
import {getTradeCountryList} from "@/api/ecw/region"; import {getTradeCountryList} from "@/api/ecw/region";
...@@ -204,7 +201,22 @@ export default { ...@@ -204,7 +201,22 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
changeSwitch(val, row) {
let title = '是否要' + (val ? '打开' : '关闭') + "" + this.$l(row, 'name') + ''
this.$confirm(title, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
channelSwitch(row.channelId).then(r => {
this.$message.success('修改成功')
console.log(r)
})
}).catch(() => {
row.status = !val
});
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -235,8 +247,12 @@ export default { ...@@ -235,8 +247,12 @@ export default {
return this.$router.push('create_channel') return this.$router.push('create_channel')
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row, type = 1) {
if (type === 1) {
return this.$router.push('edit_channel?id=' + row.channelId) return this.$router.push('edit_channel?id=' + row.channelId)
} else {
return this.$router.push('view_channel?id=' + row.channelId)
}
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
......
...@@ -58,6 +58,12 @@ ...@@ -58,6 +58,12 @@
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业绩类型">
<el-select clearable v-model="queryParams.achieveType">
<el-option :value="1" label="新客户"></el-option>
<el-option :value="0" label="旧客户"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button @click="resetQuery">{{$t('重置')}}</el-button> <el-button @click="resetQuery">{{$t('重置')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportDetail" :loading="exportLoading" v-hasPermi="['ecw:achievement:export']">{{ $t('导出明细') }}</el-button> <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExportDetail" :loading="exportLoading" v-hasPermi="['ecw:achievement:export']">{{ $t('导出明细') }}</el-button>
......
...@@ -7,19 +7,21 @@ ...@@ -7,19 +7,21 @@
<el-input v-model="queryParams.key" :placeholder="$t('请输入关键字查找')" clearable/> <el-input v-model="queryParams.key" :placeholder="$t('请输入关键字查找')" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportType"> <el-form-item :label="$t('运输方式')" prop="transportType">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" clearable/> <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number"
clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('唛头')" prop="marks"> <el-form-item :label="$t('唛头')" prop="marks">
<el-input v-model="queryParams.marks" :placeholder="$t('请输入关键字查找')" clearable /> <el-input v-model="queryParams.marks" :placeholder="$t('请输入关键字查找')" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('资源类型')" prop="customerType"> <el-form-item :label="$t('资源类型')" prop="customerType">
<!-- <el-select clearable v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable size="small"> <!-- <el-select clearable v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_ESOURCE_TYPE)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_ESOURCE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> --> </el-select> -->
<dict-selector :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable ></dict-selector> <dict-selector :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" v-model="queryParams.customerType"
:placeholder="$t('请选择资源类型')" clearable></dict-selector>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('客户经理')" prop="customerService"> <!-- <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small"> <el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<el-option v-for="dict in customerServiceList" <el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id"/> :key="dict.id" :label="dict.nickname" :value="dict.id"/>
...@@ -32,12 +34,14 @@ ...@@ -32,12 +34,14 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item prop="dateFilter"> <el-form-item prop="dateFilter">
<el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-"
<!-- <el-date-picker v-model="queryParams.beginStartTime" :placeholder="$t('请选择开始时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')"
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<!-- <el-date-picker v-model="queryParams.beginStartTime" :placeholder="$t('请选择开始时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('结束时间')" prop="endStartTime">--> <!-- <el-form-item :label="$t('结束时间')" prop="endStartTime">-->
<!-- <el-date-picker v-model="queryParams.endStartTime" :placeholder="$t('请选择结束时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> <!-- <el-date-picker v-model="queryParams.endStartTime" :placeholder="$t('请选择结束时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-form-item :label="$t('报价单号')" prop="key"> <el-form-item :label="$t('报价单号')" prop="key">
<el-input v-model="queryParams.number" :placeholder="$t('请输入报价单号')" clearable/> <el-input v-model="queryParams.number" :placeholder="$t('请输入报价单号')" clearable/>
...@@ -56,17 +60,26 @@ ...@@ -56,17 +60,26 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发仓')" prop="startWarehouseId"> <el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable> <el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id"
:key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseIdArr"> <el-form-item :label="$t('目的仓')" prop="destWarehouseIdArr">
<el-select :multiple="true" v-model="queryParams.destWarehouseIdArr" multiple :placeholder="$t('请选择目的仓')" clearable> <el-select :multiple="true" v-model="queryParams.destWarehouseIdArr" multiple
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> :placeholder="$t('请选择目的仓')" clearable>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id"
:key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-form-item label="业绩类型">
<el-button type="primary" icon="el-icon-search" @click="resetQuery">{{$t('重置')}}</el-button> <el-select clearable v-model="queryParams.achieveType">
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-option :value="1" label="新客户"></el-option>
<el-option :value="0" label="旧客户"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button>
<el-button type="primary" icon="el-icon-search" @click="resetQuery">{{ $t('重置') }}</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
>{{$t('导出')}}</el-button> --> >{{$t('导出')}}</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -86,10 +99,10 @@ ...@@ -86,10 +99,10 @@
<el-table-column :label="$t('业绩类型')" align="center" prop="achieveType"/> <el-table-column :label="$t('业绩类型')" align="center" prop="achieveType"/>
<el-table-column :label="$t('报价单号')" align="center" width="180"> <el-table-column :label="$t('报价单号')" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.number}}</span> <span>{{ scope.row.number }}</span>
</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">
<dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="scope.row.offerStatus"/> <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="scope.row.offerStatus"/>
</template> </template>
...@@ -101,7 +114,7 @@ ...@@ -101,7 +114,7 @@
<el-table-column :label="$t('订单状态')" align="center" prop="statusMsg"/> <el-table-column :label="$t('订单状态')" align="center" prop="statusMsg"/>
<el-table-column :label="$t('是否控货')" align="center" prop="isCargoControl"> <el-table-column :label="$t('是否控货')" align="center" prop="isCargoControl">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.isCargoControl?$t(''):$t('')}} {{ scope.row.isCargoControl ? $t('') : $t('') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('重量')" align="center" prop="completeWeight"/> <el-table-column :label="$t('重量')" align="center" prop="completeWeight"/>
...@@ -118,7 +131,7 @@ ...@@ -118,7 +131,7 @@
</template> </template>
<script> <script>
import { import {
createDeptTarget, createDeptTarget,
updateDeptTarget, updateDeptTarget,
deleteDeptTarget, deleteDeptTarget,
...@@ -128,15 +141,15 @@ ...@@ -128,15 +141,15 @@
getCreateInitData, getCreateInitData,
getPersonTargetPage, getPersonTargetPage,
myAchievementByPage myAchievementByPage
} from "@/api/ecw/deptTarget"; } from "@/api/ecw/deptTarget";
import {listSimpleDepts} from "@/api/system/dept"; import {listSimpleDepts} from "@/api/system/dept";
import {getChannelList} from '@/api/ecw/channel'; import {getChannelList} from '@/api/ecw/channel';
import dayjs from "dayjs"; import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user"; import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import Total_num from "@/views/ecw/deptTarget/total_num.vue"; import Total_num from "@/views/ecw/deptTarget/total_num.vue";
export default { export default {
name: "EcwDepttargetMyachievement", name: "EcwDepttargetMyachievement",
components: {Total_num}, components: {Total_num},
data() { data() {
...@@ -155,7 +168,7 @@ ...@@ -155,7 +168,7 @@
tableList: [], tableList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
dateFilter:[], dateFilter: [],
detail: { detail: {
deptName: null, deptName: null,
targetType: null, targetType: null,
...@@ -180,7 +193,7 @@ ...@@ -180,7 +193,7 @@
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
beginStartTime:null, beginStartTime: null,
transportType: null, transportType: null,
shippingChannel: null, shippingChannel: null,
endStartTime: null, endStartTime: null,
...@@ -192,26 +205,26 @@ ...@@ -192,26 +205,26 @@
}, },
// 表单参数 // 表单参数
form: {}, form: {},
customerServiceList:[], customerServiceList: [],
// 表单校验 // 表单校验
rules: { rules: {
deptId: [{required: true, message: this.$t("部门ID不能为空"), trigger: "blur"}], deptId: [{required: true, message: this.$t("部门ID不能为空"), trigger: "blur"}],
targetType: [{required: true, message: this.$t("目标类型不能为空"), trigger: "change"}], targetType: [{required: true, message: this.$t("目标类型不能为空"), trigger: "change"}],
cubeNum: [{required: true, message: this.$t("立方数不能为空"), trigger: "blur"}], cubeNum: [{required: true, message: this.$t("立方数不能为空"), trigger: "blur"}],
}, },
totalData:{ totalData: {
companyWeight:0, companyWeight: 0,
companyVolume:0, companyVolume: 0,
companyNum:0, companyNum: 0,
developWeight:0, developWeight: 0,
developVolume:0, developVolume: 0,
developNum:0, developNum: 0,
sumWeight:0, sumWeight: 0,
sumVolume:0, sumVolume: 0,
sumNum:0, sumNum: 0,
}, },
myAchievementData:{}, myAchievementData: {},
warehouseList:[] warehouseList: []
}; };
}, },
computed: { computed: {
...@@ -226,11 +239,11 @@ ...@@ -226,11 +239,11 @@
return '/' return '/'
} }
}, },
exportWarehouseList(){ exportWarehouseList() {
/* tradeType 1 进口,2出口,3进出口 */ /* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3) return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
}, },
importWarehouseList(){ importWarehouseList() {
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3) return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
}, },
}, },
...@@ -241,7 +254,7 @@ ...@@ -241,7 +254,7 @@
created() { created() {
this.getChannelList(); this.getChannelList();
this.getList(); this.getList();
listServiceUser().then(r=>{ listServiceUser().then(r => {
this.customerServiceList = r.data; this.customerServiceList = r.data;
}) })
getWarehouseList().then(res => { getWarehouseList().then(res => {
...@@ -275,11 +288,11 @@ ...@@ -275,11 +288,11 @@
} }
}) })
}, },
customerServiceFn(val){ customerServiceFn(val) {
if(this.customerServiceList.length > 0){ if (this.customerServiceList.length > 0) {
let index =this.customerServiceList.findIndex(item => item.id === val.userId); let index = this.customerServiceList.findIndex(item => item.id === val.userId);
return index !== -1 ? this.customerServiceList[index]?.nickname :'' return index !== -1 ? this.customerServiceList[index]?.nickname : ''
}else { } else {
return '' return ''
} }
}, },
...@@ -287,7 +300,7 @@ ...@@ -287,7 +300,7 @@
getList() { getList() {
this.loading = true; this.loading = true;
const params = {...this.queryParams} const params = {...this.queryParams}
if(params.destWarehouseIdArr?.length){ if (params.destWarehouseIdArr?.length) {
params.destWarehouseIds = params.destWarehouseIdArr.join(',') params.destWarehouseIds = params.destWarehouseIdArr.join(',')
} }
// 执行查询 // 执行查询
...@@ -295,21 +308,21 @@ ...@@ -295,21 +308,21 @@
this.list = response.data.myAchievementDtos.list; this.list = response.data.myAchievementDtos.list;
this.total = response.data.myAchievementDtos.total; this.total = response.data.myAchievementDtos.total;
this.myAchievementData = response.data this.myAchievementData = response.data
this.totalData.sumWeight =this.myAchievementData.totalWeight this.totalData.sumWeight = this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume this.totalData.sumVolume = this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum this.totalData.sumNum = this.myAchievementData.totalNum
this.totalData.companyWeight =this.myAchievementData.companyTotalWeight this.totalData.companyWeight = this.myAchievementData.companyTotalWeight
this.totalData.companyVolume =this.myAchievementData.companyTotalVolume this.totalData.companyVolume = this.myAchievementData.companyTotalVolume
this.totalData.companyNum =this.myAchievementData.companyTotalNum this.totalData.companyNum = this.myAchievementData.companyTotalNum
this.totalData.developWeight =this.myAchievementData.devTotalWeight this.totalData.developWeight = this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume this.totalData.developVolume = this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum this.totalData.developNum = this.myAchievementData.devTotalNum
this.$set(this.totalData,'newTotalNum',this.myAchievementData.newTotalNum ) this.$set(this.totalData, 'newTotalNum', this.myAchievementData.newTotalNum)
this.$set(this.totalData,'newTotalVolume',this.myAchievementData.newTotalVolume) this.$set(this.totalData, 'newTotalVolume', this.myAchievementData.newTotalVolume)
this.$set(this.totalData,'newTotalWeight',this.myAchievementData.newTotalWeight) this.$set(this.totalData, 'newTotalWeight', this.myAchievementData.newTotalWeight)
this.$set(this.totalData,'oldTotalNum',this.myAchievementData.oldTotalNum) this.$set(this.totalData, 'oldTotalNum', this.myAchievementData.oldTotalNum)
this.$set(this.totalData,'oldTotalVolume',this.myAchievementData.oldTotalVolume) this.$set(this.totalData, 'oldTotalVolume', this.myAchievementData.oldTotalVolume)
this.$set(this.totalData,'oldTotalWeight',this.myAchievementData.oldTotalWeight) this.$set(this.totalData, 'oldTotalWeight', this.myAchievementData.oldTotalWeight)
this.loading = false; this.loading = false;
}); });
}, },
...@@ -336,19 +349,21 @@ ...@@ -336,19 +349,21 @@
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.beginStartTime=this.dateFilter[0]; this.queryParams.beginStartTime = this.dateFilter[0];
this.queryParams.endStartTime=this.dateFilter[1]; this.queryParams.endStartTime = this.dateFilter[1];
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateFilter = [] this.queryParams = {page: 1,pageSize:10}
this.dateRangeCreateTime = []; // this.dateFilter = []
this.dateRangeStartTime = []; // this.dateRangeCreateTime = [];
this.dateRangeEndTime = []; // this.dateRangeStartTime = [];
this.resetForm("queryForm"); // this.dateRangeEndTime = [];
this.handleQuery(); // this.resetForm("queryForm");
// this.handleQuery();
this.getList()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -421,25 +436,25 @@ ...@@ -421,25 +436,25 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handleSelectionChange(val){ handleSelectionChange(val) {
if(val&&val.length>0){ if (val && val.length > 0) {
var data={ var data = {
companyWeight:0, companyWeight: 0,
companyVolume:0, companyVolume: 0,
companyNum:0, companyNum: 0,
developWeight:0, developWeight: 0,
developVolume:0, developVolume: 0,
developNum:0, developNum: 0,
sumWeight:0, sumWeight: 0,
sumVolume:0, sumVolume: 0,
sumNum:0, sumNum: 0,
} }
val.forEach(item=>{ val.forEach(item => {
if(item.customerType==1){ if (item.customerType == 1) {
data.developWeight += item.completeWeight data.developWeight += item.completeWeight
data.developVolume += item.completeVolume data.developVolume += item.completeVolume
data.developNum += item.sumNum data.developNum += item.sumNum
}else{ } else {
data.companyWeight += item.completeWeight data.companyWeight += item.completeWeight
data.companyVolume += item.completeVolume data.companyVolume += item.completeVolume
data.companyNum += item.sumNum data.companyNum += item.sumNum
...@@ -451,17 +466,17 @@ ...@@ -451,17 +466,17 @@
data.developVolume = data.developVolume.toFixed(2); data.developVolume = data.developVolume.toFixed(2);
data.companyVolume = data.companyVolume.toFixed(2); data.companyVolume = data.companyVolume.toFixed(2);
data.sumVolume = data.sumVolume.toFixed(2); data.sumVolume = data.sumVolume.toFixed(2);
this.$set(this,'totalData',data) this.$set(this, 'totalData', data)
}else{ } else {
this.totalData.sumWeight =this.myAchievementData.totalWeight this.totalData.sumWeight = this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume this.totalData.sumVolume = this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum this.totalData.sumNum = this.myAchievementData.totalNum
this.totalData.companyWeight =this.myAchievementData.companyTotalWeight this.totalData.companyWeight = this.myAchievementData.companyTotalWeight
this.totalData.companyVolume =this.myAchievementData.companyTotalVolume this.totalData.companyVolume = this.myAchievementData.companyTotalVolume
this.totalData.companyNum =this.myAchievementData.companyTotalNum this.totalData.companyNum = this.myAchievementData.companyTotalNum
this.totalData.developWeight =this.myAchievementData.devTotalWeight this.totalData.developWeight = this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume this.totalData.developVolume = this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum this.totalData.developNum = this.myAchievementData.devTotalNum
} }
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
...@@ -485,19 +500,20 @@ ...@@ -485,19 +500,20 @@
}); });
} }
} }
}; };
</script> </script>
<style scoped > <style scoped>
.total_num{ .total_num {
display:flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin:20px 0; margin: 20px 0;
font-size:15px; font-size: 15px;
} }
.total_num span{
.total_num span {
margin: 0 8px; margin: 0 8px;
} }
</style> </style>
...@@ -4,22 +4,23 @@ ...@@ -4,22 +4,23 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('关键字')" prop="key"> <el-form-item :label="$t('关键字')" prop="key">
<el-input v-model="queryParams.key" :placeholder="$t('请输入关键字查找')" /> <el-input v-model="queryParams.key" :placeholder="$t('请输入关键字查找')"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportType"> <el-form-item :label="$t('运输方式')" prop="transportType">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number"/> <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('唛头')" prop="marks"> <el-form-item :label="$t('唛头')" prop="marks">
<el-input v-model="queryParams.marks" :placeholder="$t('请输入关键字查找')" /> <el-input v-model="queryParams.marks" :placeholder="$t('请输入关键字查找')"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('资源类型')" prop="customerType"> <el-form-item :label="$t('资源类型')" prop="customerType">
<!-- <el-select clearable v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable size="small"> <!-- <el-select clearable v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_ESOURCE_TYPE)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_ESOURCE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> --> </el-select> -->
<dict-selector :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" v-model="queryParams.customerType" :placeholder="$t('请选择资源类型')" clearable ></dict-selector> <dict-selector :type="DICT_TYPE.CUSTOMER_ESOURCE_TYPE" v-model="queryParams.customerType"
:placeholder="$t('请选择资源类型')" clearable></dict-selector>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('客户经理')" prop="customerService"> <!-- <el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small"> <el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<el-option v-for="dict in customerServiceList" <el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id"/> :key="dict.id" :label="dict.nickname" :value="dict.id"/>
...@@ -32,12 +33,13 @@ ...@@ -32,12 +33,13 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-date-picker v-model="dateFilter" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="dateFilter" type="daterange" range-separator="-" :start-placeholder="$t('开始日期')"
<!-- <el-date-picker v-model="queryParams.beginStartTime" :placeholder="$t('请选择开始时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> :end-placeholder="$t('结束日期')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
<!-- <el-date-picker v-model="queryParams.beginStartTime" :placeholder="$t('请选择开始时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('结束时间')" prop="endStartTime">--> <!-- <el-form-item :label="$t('结束时间')" prop="endStartTime">-->
<!-- <el-date-picker v-model="queryParams.endStartTime" :placeholder="$t('请选择结束时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> <!-- <el-date-picker v-model="queryParams.endStartTime" :placeholder="$t('请选择结束时间')" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-form-item :label="$t('报价单号')" prop="key"> <el-form-item :label="$t('报价单号')" prop="key">
<el-input v-model="queryParams.number" :placeholder="$t('请输入报价单号')" clearable/> <el-input v-model="queryParams.number" :placeholder="$t('请输入报价单号')" clearable/>
...@@ -56,20 +58,30 @@ ...@@ -56,20 +58,30 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发仓')" prop="startWarehouseId"> <el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable> <el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id"
:key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseIdArr"> <el-form-item :label="$t('目的仓')" prop="destWarehouseIdArr">
<el-select :multiple="true" v-model="queryParams.destWarehouseIdArr" multiple :placeholder="$t('请选择目的仓')" clearable> <el-select :multiple="true" v-model="queryParams.destWarehouseIdArr" multiple
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> :placeholder="$t('请选择目的仓')" clearable>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id"
:key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button> <el-form-item label="业绩类型">
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-select clearable v-model="queryParams.achieveType">
<el-option :value="1" label="新客户"></el-option>
<el-option :value="0" label="旧客户"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button>
<el-button type="primary" icon="el-icon-search" @click="resetQuery">{{ $t('重置') }}</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
>{{$t('导出')}}</el-button> --> >{{$t('导出')}}</el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<total_num :total-data="totalData" ></total_num> <total_num :total-data="totalData"></total_num>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> --> <!-- <el-table-column :label="$t('序号')" align="center" type="index"></el-table-column> -->
...@@ -85,10 +97,10 @@ ...@@ -85,10 +97,10 @@
<el-table-column :label="$t('业绩类型')" align="center" prop="achieveType"/> <el-table-column :label="$t('业绩类型')" align="center" prop="achieveType"/>
<el-table-column :label="$t('报价单号')" align="center" width="180"> <el-table-column :label="$t('报价单号')" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.number}}</span> <span>{{ scope.row.number }}</span>
</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">
<dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="scope.row.offerStatus"/> <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="scope.row.offerStatus"/>
</template> </template>
...@@ -100,7 +112,7 @@ ...@@ -100,7 +112,7 @@
<el-table-column :label="$t('订单状态')" align="center" prop="statusMsg"/> <el-table-column :label="$t('订单状态')" align="center" prop="statusMsg"/>
<el-table-column :label="$t('是否控货')" align="center" prop="isCargoControl"> <el-table-column :label="$t('是否控货')" align="center" prop="isCargoControl">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.isCargoControl?$t(''):$t('')}} {{ scope.row.isCargoControl ? $t('') : $t('') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('重量')" align="center" prop="completeWeight"/> <el-table-column :label="$t('重量')" align="center" prop="completeWeight"/>
...@@ -117,7 +129,7 @@ ...@@ -117,7 +129,7 @@
</template> </template>
<script> <script>
import { import {
createDeptTarget, createDeptTarget,
updateDeptTarget, updateDeptTarget,
deleteDeptTarget, deleteDeptTarget,
...@@ -128,15 +140,15 @@ ...@@ -128,15 +140,15 @@
getPersonTargetPage, getPersonTargetPage,
myAchievementByPage, myAchievementByPage,
myDeptAchievementByPage myDeptAchievementByPage
} from "@/api/ecw/deptTarget"; } from "@/api/ecw/deptTarget";
import {listSimpleDepts} from "@/api/system/dept"; import {listSimpleDepts} from "@/api/system/dept";
import {getChannelList} from '@/api/ecw/channel'; import {getChannelList} from '@/api/ecw/channel';
import dayjs from "dayjs"; import dayjs from "dayjs";
import {listServiceUser} from "@/api/system/user"; import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import Total_num from "@/views/ecw/deptTarget/total_num.vue"; import Total_num from "@/views/ecw/deptTarget/total_num.vue";
export default { export default {
name: "EcwDepttargetMydeptachievement", name: "EcwDepttargetMydeptachievement",
components: {Total_num}, components: {Total_num},
data() { data() {
...@@ -155,7 +167,7 @@ ...@@ -155,7 +167,7 @@
tableList: [], tableList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
dateFilter:[], dateFilter: [],
detail: { detail: {
deptName: null, deptName: null,
targetType: null, targetType: null,
...@@ -180,11 +192,11 @@ ...@@ -180,11 +192,11 @@
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
beginStartTime:null, beginStartTime: null,
transportType: null, transportType: null,
shippingChannel: null, shippingChannel: null,
endStartTime: null, endStartTime: null,
destWarehouseIdArr:[] destWarehouseIdArr: []
}, },
tableQueryParams: { tableQueryParams: {
pageNo: 1, pageNo: 1,
...@@ -193,26 +205,26 @@ ...@@ -193,26 +205,26 @@
}, },
// 表单参数 // 表单参数
form: {}, form: {},
customerServiceList:[], customerServiceList: [],
// 表单校验 // 表单校验
rules: { rules: {
deptId: [{required: true, message: this.$t("部门ID不能为空"), trigger: "blur"}], deptId: [{required: true, message: this.$t("部门ID不能为空"), trigger: "blur"}],
targetType: [{required: true, message: this.$t("目标类型不能为空"), trigger: "change"}], targetType: [{required: true, message: this.$t("目标类型不能为空"), trigger: "change"}],
cubeNum: [{required: true, message: this.$t("立方数不能为空"), trigger: "blur"}], cubeNum: [{required: true, message: this.$t("立方数不能为空"), trigger: "blur"}],
}, },
totalData:{ totalData: {
companyWeight:0, companyWeight: 0,
companyVolume:0, companyVolume: 0,
companyNum:0, companyNum: 0,
developWeight:0, developWeight: 0,
developVolume:0, developVolume: 0,
developNum:0, developNum: 0,
sumWeight:0, sumWeight: 0,
sumVolume:0, sumVolume: 0,
sumNum:0, sumNum: 0,
}, },
myAchievementData:{}, myAchievementData: {},
warehouseList:[] warehouseList: []
}; };
}, },
computed: { computed: {
...@@ -227,18 +239,18 @@ ...@@ -227,18 +239,18 @@
return '/' return '/'
} }
}, },
exportWarehouseList(){ exportWarehouseList() {
/* tradeType 1 进口,2出口,3进出口 */ /* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3) return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
}, },
importWarehouseList(){ importWarehouseList() {
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3) return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
}, },
}, },
created() { created() {
this.getChannelList(); this.getChannelList();
this.getList(); this.getList();
listServiceUser().then(r=>{ listServiceUser().then(r => {
this.customerServiceList = r.data; this.customerServiceList = r.data;
}) })
getWarehouseList().then(res => { getWarehouseList().then(res => {
...@@ -272,11 +284,11 @@ ...@@ -272,11 +284,11 @@
} }
}) })
}, },
customerServiceFn(val){ customerServiceFn(val) {
if(this.customerServiceList.length > 0){ if (this.customerServiceList.length > 0) {
let index =this.customerServiceList.findIndex(item => item.id === val.userId); let index = this.customerServiceList.findIndex(item => item.id === val.userId);
return index !== -1 ? this.customerServiceList[index]?.nickname :'' return index !== -1 ? this.customerServiceList[index]?.nickname : ''
}else { } else {
return '' return ''
} }
}, },
...@@ -284,7 +296,7 @@ ...@@ -284,7 +296,7 @@
getList() { getList() {
this.loading = true; this.loading = true;
const params = {...this.queryParams} const params = {...this.queryParams}
if(params.destWarehouseIdArr?.length){ if (params.destWarehouseIdArr?.length) {
params.destWarehouseIds = params.destWarehouseIdArr.join(',') params.destWarehouseIds = params.destWarehouseIdArr.join(',')
} }
// 执行查询 // 执行查询
...@@ -292,21 +304,21 @@ ...@@ -292,21 +304,21 @@
this.list = response.data.myAchievementDtos.list; this.list = response.data.myAchievementDtos.list;
this.total = response.data.myAchievementDtos.total; this.total = response.data.myAchievementDtos.total;
this.myAchievementData = response.data this.myAchievementData = response.data
this.totalData.sumWeight =this.myAchievementData.totalWeight this.totalData.sumWeight = this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume this.totalData.sumVolume = this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum this.totalData.sumNum = this.myAchievementData.totalNum
this.totalData.companyWeight =this.myAchievementData.companyTotalWeight this.totalData.companyWeight = this.myAchievementData.companyTotalWeight
this.totalData.companyVolume =this.myAchievementData.companyTotalVolume this.totalData.companyVolume = this.myAchievementData.companyTotalVolume
this.totalData.companyNum =this.myAchievementData.companyTotalNum this.totalData.companyNum = this.myAchievementData.companyTotalNum
this.totalData.developWeight =this.myAchievementData.devTotalWeight this.totalData.developWeight = this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume this.totalData.developVolume = this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum this.totalData.developNum = this.myAchievementData.devTotalNum
this.$set(this.totalData,'newTotalNum',this.myAchievementData.newTotalNum ) this.$set(this.totalData, 'newTotalNum', this.myAchievementData.newTotalNum)
this.$set(this.totalData,'newTotalVolume',this.myAchievementData.newTotalVolume) this.$set(this.totalData, 'newTotalVolume', this.myAchievementData.newTotalVolume)
this.$set(this.totalData,'newTotalWeight',this.myAchievementData.newTotalWeight) this.$set(this.totalData, 'newTotalWeight', this.myAchievementData.newTotalWeight)
this.$set(this.totalData,'oldTotalNum',this.myAchievementData.oldTotalNum) this.$set(this.totalData, 'oldTotalNum', this.myAchievementData.oldTotalNum)
this.$set(this.totalData,'oldTotalVolume',this.myAchievementData.oldTotalVolume) this.$set(this.totalData, 'oldTotalVolume', this.myAchievementData.oldTotalVolume)
this.$set(this.totalData,'oldTotalWeight',this.myAchievementData.oldTotalWeight) this.$set(this.totalData, 'oldTotalWeight', this.myAchievementData.oldTotalWeight)
this.loading = false; this.loading = false;
}); });
}, },
...@@ -327,23 +339,21 @@ ...@@ -327,23 +339,21 @@
transportType: undefined, transportType: undefined,
shippingChannel: undefined, shippingChannel: undefined,
cubeNum: undefined, cubeNum: undefined,
achieveType: undefined
}; };
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.beginStartTime=this.dateFilter[0]; this.queryParams.beginStartTime = this.dateFilter[0];
this.queryParams.endStartTime=this.dateFilter[1]; this.queryParams.endStartTime = this.dateFilter[1];
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.queryParams = {pageNo: 1, pageSize: 10,}
this.dateRangeStartTime = []; this.getList()
this.dateRangeEndTime = [];
this.resetForm("queryForm");
this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -416,25 +426,25 @@ ...@@ -416,25 +426,25 @@
}).catch(() => { }).catch(() => {
}); });
}, },
handleSelectionChange(val){ handleSelectionChange(val) {
if(val&&val.length>0){ if (val && val.length > 0) {
var data={ var data = {
companyWeight:0, companyWeight: 0,
companyVolume:0, companyVolume: 0,
companyNum:0, companyNum: 0,
developWeight:0, developWeight: 0,
developVolume:0, developVolume: 0,
developNum:0, developNum: 0,
sumWeight:0, sumWeight: 0,
sumVolume:0, sumVolume: 0,
sumNum:0, sumNum: 0,
} }
val.forEach(item=>{ val.forEach(item => {
if(item.customerType==1){ if (item.customerType == 1) {
data.developWeight += item.completeWeight data.developWeight += item.completeWeight
data.developVolume += item.completeVolume data.developVolume += item.completeVolume
data.developNum += item.sumNum data.developNum += item.sumNum
}else{ } else {
data.companyWeight += item.completeWeight data.companyWeight += item.completeWeight
data.companyVolume += item.completeVolume data.companyVolume += item.completeVolume
data.companyNum += item.sumNum data.companyNum += item.sumNum
...@@ -446,17 +456,17 @@ ...@@ -446,17 +456,17 @@
data.developVolume = data.developVolume.toFixed(2); data.developVolume = data.developVolume.toFixed(2);
data.companyVolume = data.companyVolume.toFixed(2); data.companyVolume = data.companyVolume.toFixed(2);
data.sumVolume = data.sumVolume.toFixed(2); data.sumVolume = data.sumVolume.toFixed(2);
this.$set(this,'totalData',data) this.$set(this, 'totalData', data)
}else{ } else {
this.totalData.sumWeight =this.myAchievementData.totalWeight this.totalData.sumWeight = this.myAchievementData.totalWeight
this.totalData.sumVolume =this.myAchievementData.totalVolume this.totalData.sumVolume = this.myAchievementData.totalVolume
this.totalData.sumNum =this.myAchievementData.totalNum this.totalData.sumNum = this.myAchievementData.totalNum
this.totalData.companyWeight =this.myAchievementData.companyTotalWeight this.totalData.companyWeight = this.myAchievementData.companyTotalWeight
this.totalData.companyVolume =this.myAchievementData.companyTotalVolume this.totalData.companyVolume = this.myAchievementData.companyTotalVolume
this.totalData.companyNum =this.myAchievementData.companyTotalNum this.totalData.companyNum = this.myAchievementData.companyTotalNum
this.totalData.developWeight =this.myAchievementData.devTotalWeight this.totalData.developWeight = this.myAchievementData.devTotalWeight
this.totalData.developVolume =this.myAchievementData.devTotalVolume this.totalData.developVolume = this.myAchievementData.devTotalVolume
this.totalData.developNum =this.myAchievementData.devTotalNum this.totalData.developNum = this.myAchievementData.devTotalNum
} }
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
...@@ -480,10 +490,10 @@ ...@@ -480,10 +490,10 @@
}); });
} }
} }
}; };
</script> </script>
<style scoped > <style scoped>
</style> </style>
...@@ -23,11 +23,17 @@ ...@@ -23,11 +23,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('出货渠道')" prop="shippingChannel"> <el-form-item :label="$t('出货渠道')" prop="shippingChannel">
<el-select v-model="queryParams.shippingChannel" :placeholder="$t('请选择出货渠道')" clearable> <el-select v-model="queryParams.channelId" :placeholder="$t('请选择出货渠道')" clearable>
<el-option v-for="item in channelList" :label="item.nameZh" :value="item.channelId" <el-option v-for="item in channelList" :label="item.nameZh" :value="item.channelId"
:key="item.channelId"></el-option> :key="item.channelId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label-width="200" label="目的仓国家">
<el-select style="width: 100%" filterable clearable v-model="queryParams.destCountryId" :placeholder="$t('请选择国家')">
<el-option v-for="dict in countryList"
:key="dict.id" :label="$l(dict,'title')" :value="parseInt(dict.id)"/>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -49,6 +55,11 @@ ...@@ -49,6 +55,11 @@
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType"></dict-tag> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportType"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('目的仓国家')" align="center">
<template slot-scope="{row}">
{{$l(row, 'destCountryName')}}
</template>
</el-table-column>
<el-table-column :label="$t('出货渠道')" align="center"> <el-table-column :label="$t('出货渠道')" align="center">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{ row.channelIds ? $l(row, 'channelNames') : '/' }} {{ row.channelIds ? $l(row, 'channelNames') : '/' }}
...@@ -61,6 +72,7 @@ ...@@ -61,6 +72,7 @@
query:{ query:{
startWarehouseTitle:$l(row,'startWarehouseTitle'), startWarehouseTitle:$l(row,'startWarehouseTitle'),
destWarehouseTitle: $l(row, 'destWarehouseTitle'), destWarehouseTitle: $l(row, 'destWarehouseTitle'),
destCountryName:$l(row,'destCountryName')
} }
})">空运渠道包装清关费 })">空运渠道包装清关费
</el-button> </el-button>
...@@ -92,12 +104,14 @@ import {listServiceUser} from "@/api/system/user"; ...@@ -92,12 +104,14 @@ import {listServiceUser} from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import {DICT_TYPE} from "@/utils/dict"; import {DICT_TYPE} from "@/utils/dict";
import {warehouseLinePage} from "@/api/ecw/customerContacts"; import {warehouseLinePage} from "@/api/ecw/customerContacts";
import {getTradeCountryList} from "@/api/ecw/region";
export default { export default {
name: "all-routes-list", name: "EcwOfferAll-routes-list",
components: {}, components: {},
data() { data() {
return { return {
countryList:[],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 总条数 // 总条数
...@@ -135,6 +149,9 @@ export default { ...@@ -135,6 +149,9 @@ export default {
this.getList(); this.getList();
}, },
created() { created() {
getTradeCountryList().then(r => {
this.countryList = r.data
})
this.getChannelList(); this.getChannelList();
this.getList(); this.getList();
listServiceUser().then(r => { listServiceUser().then(r => {
......
...@@ -39,13 +39,13 @@ export default { ...@@ -39,13 +39,13 @@ export default {
return DICT_TYPE return DICT_TYPE
}, },
deletePackagingTypes() { deletePackagingTypes() {
return (index) => {
let a = [] let a = []
this.form.channelList.forEach(item => { this.form.channelList[index].packagingCreateReqVOList.forEach(i => {
item.packagingCreateReqVOList.forEach(i => {
a.push(...i.packagingTypes) a.push(...i.packagingTypes)
}) })
})
return a return a
}
}, },
channelIdBlackList() { channelIdBlackList() {
let arr = [] let arr = []
...@@ -244,6 +244,7 @@ export default { ...@@ -244,6 +244,7 @@ export default {
<template> <template>
<div style="padding: 20px"> <div style="padding: 20px">
<div style="margin-bottom: 15px"> <div style="margin-bottom: 15px">
<span>目的国:{{ $route.query.destCountryName }}</span>
<span>路线:{{ $route.query.startWarehouseTitle }}{{ $route.query.destWarehouseTitle }}</span> <span>路线:{{ $route.query.startWarehouseTitle }}{{ $route.query.destWarehouseTitle }}</span>
<span style="margin-left: 30px;">运输方式:空运专线</span> <span style="margin-left: 30px;">运输方式:空运专线</span>
</div> </div>
...@@ -264,7 +265,8 @@ export default { ...@@ -264,7 +265,8 @@ export default {
<el-button size="mini" type="primary" @click="newChannelsAdd(index)">新增渠道</el-button> <el-button size="mini" type="primary" @click="newChannelsAdd(index)">新增渠道</el-button>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-button size="mini" type="danger" :disabled="form.channelList.length === 1" @click="channelsDelete(index)"> <el-button size="mini" type="danger" :disabled="form.channelList.length === 1"
@click="channelsDelete(index)">
删除当前渠道 删除当前渠道
</el-button> </el-button>
</el-col> </el-col>
...@@ -290,7 +292,7 @@ export default { ...@@ -290,7 +292,7 @@ export default {
<el-col :span="5"> <el-col :span="5">
<el-select multiple v-model="itemm.packagingTypes"> <el-select multiple v-model="itemm.packagingTypes">
<el-option <el-option
:disabled="deletePackagingTypes.includes(item.value) && (!itemm.packagingTypes.includes(item.value))" :disabled="deletePackagingTypes(index).includes(item.value) && (!itemm.packagingTypes.includes(item.value))"
v-for="item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)" :value="item.value" :key="item.value" v-for="item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)" :value="item.value" :key="item.value"
:label="$l(item, 'label')"></el-option> :label="$l(item, 'label')"></el-option>
</el-select> </el-select>
......
...@@ -795,7 +795,9 @@ export default { ...@@ -795,7 +795,9 @@ export default {
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
// 目的地 // 目的地
'form.objectiveId'(){ async 'form.objectiveId'(){
await this.$nextTick()
await this.getChannelList()
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
'form.transportId'(transportId, oldTransportId){ 'form.transportId'(transportId, oldTransportId){
...@@ -818,20 +820,22 @@ export default { ...@@ -818,20 +820,22 @@ export default {
this.$set(this.form, 'lineId', undefined) this.$set(this.form, 'lineId', undefined)
} }
}, },
'form.channelId'(){ async 'form.channelId'(){
await this.getTradeCity()
this.getOpenedRouterList() this.getOpenedRouterList()
this.calculationPrice('form.channelId') this.calculationPrice('form.channelId')
}, },
'form.lineId'(lineId){ async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId) let router = this.routerList.find(item => item.id == lineId)
if(router){ if(router){
this.$set(this.form, 'departureId', router.startCityId) this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId) this.$set(this.form, 'objectiveId', router.destCityId)
} }
this.$nextTick(() => { await this.$nextTick()
this.calculationPrice('form.lineId') await this.getChannelList()
}) await this.getTradeCity()
await this.calculationPrice('form.lineId')
}, },
'form.transportVO.packageTypeArr'(val){ 'form.transportVO.packageTypeArr'(val){
this.$set(this.form.transportVO, 'packageType', (val || []).join(',')) this.$set(this.form.transportVO, 'packageType', (val || []).join(','))
...@@ -851,10 +855,10 @@ export default { ...@@ -851,10 +855,10 @@ export default {
this.getOffer() this.getOffer()
} }
}, },
created() { async created() {
await this.getChannelList()
await this.getTradeCity()
getProductAttrList().then(res => this.productAttrList = res.data) getProductAttrList().then(res => this.productAttrList = res.data)
getChannelList().then(res => this.channelList = res.data)
getTradeCityList().then(res => this.tradeCityList = res.data)
getCurrencyList().then(res => this.currencyList = res.data) getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data) getUnitList().then(res => this.unitList = res.data)
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE) this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
...@@ -864,6 +868,20 @@ export default { ...@@ -864,6 +868,20 @@ export default {
}else this.addProduct() }else this.addProduct()
}, },
methods: { methods: {
async getChannelList(){
let query = {
cityId: this.form.objectiveId,
lineId: this.form.lineId
}
this.channelList = (await getChannelList(query)).data || []
},
async getTradeCity(){
let query = {}
if(this.form.channelId){
query.channelId = this.form.channelId
}
this.tradeCityList = (await getTradeCityList(query)).data || []
},
getOffer(){ getOffer(){
getOffer(this.$route.query.id).then(res => { getOffer(this.$route.query.id).then(res => {
let formData = res.data let formData = res.data
......
...@@ -165,6 +165,10 @@ export default { ...@@ -165,6 +165,10 @@ export default {
}) })
}) })
}) })
// 按照入仓时间inTime排序
arr.sort((a, b) => {
return new Date(a.inTime).getTime() - new Date(b.inTime).getTime()
})
return arr return arr
}, },
calcTotal(){ calcTotal(){
......
...@@ -85,7 +85,8 @@ ...@@ -85,7 +85,8 @@
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('运输方式')" prop="transportId"> <el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" formatter="number" :disabled2="inWarehouse"/> <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" formatter="number"
clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('出货渠道')" prop="channelId" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'"> <el-form-item :label="$t('出货渠道')" prop="channelId" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'">
...@@ -96,18 +97,19 @@ ...@@ -96,18 +97,19 @@
:options="channelList" :options="channelList"
value-field="channelId" value-field="channelId"
:label-field="$l(null, 'name')" :label-field="$l(null, 'name')"
clearable
></selector> ></selector>
</el-form> </el-form>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('始发城市')" prop="departureId" :disabled="false"> <el-form-item :label="$t('始发城市')" prop="departureId" :disabled="false">
<el-select v-model="form.departureId" :placeholder="$t('请选择始发地')" :disabled="false"> <el-select v-model="form.departureId" :placeholder="$t('请选择始发地')" :disabled="false" clearable>
<el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')" :disabled2="inWarehouse"> <el-select v-model="form.objectiveId" :placeholder="$t('请选择目的地')" :disabled2="inWarehouse" clearable>
<el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in importCityList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -952,7 +954,7 @@ export default { ...@@ -952,7 +954,7 @@ export default {
// 更新目的城市备选 // 更新目的城市备选
await this.getTradeCity() await this.getTradeCity()
// 如果已选择城市,在切换后不可用则重置 // 如果已选择城市,在切换后不可用则重置
if(this.form.objectiveId && !this.importList.find(item => item.id == this.form.objectiveId)){ if(this.form.objectiveId && !this.importCityList.find(item => item.id == this.form.objectiveId)){
this.$set(this.form, 'objectiveId', null) this.$set(this.form, 'objectiveId', null)
} }
// 更新线路备选 // 更新线路备选
...@@ -975,7 +977,7 @@ export default { ...@@ -975,7 +977,7 @@ export default {
'form.consignorPhone'(){ 'form.consignorPhone'(){
if(this.form.lineId) this.getOfferData() if(this.form.lineId) this.getOfferData()
}, },
'form.lineId'(lineId){ async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId) let router = this.routerList.find(item => item.id == lineId)
if(!router){ if(!router){
return return
...@@ -983,7 +985,7 @@ export default { ...@@ -983,7 +985,7 @@ export default {
this.$set(this.form, 'departureId', router.startCityId) this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId) this.$set(this.form, 'objectiveId', router.destCityId)
this.$set(this.form, 'transportId', router.transportType) this.$set(this.form, 'transportId', router.transportType)
await this.getChannelList()
this.calculationPrice() this.calculationPrice()
this.$nextTick(() => { this.$nextTick(() => {
// 如果开启了默认送货上门,则默认选择送货上门,2是送货上门,10是默认送货上门 // 如果开启了默认送货上门,则默认选择送货上门,2是送货上门,10是默认送货上门
...@@ -1142,7 +1144,8 @@ export default { ...@@ -1142,7 +1144,8 @@ export default {
}, },
async getChannelList(){ async getChannelList(){
let query = { let query = {
cityId: this.form.objectiveId cityId: this.form.objectiveId,
lineId: this.form.lineId
} }
this.channelList = (await getChannelList(query)).data this.channelList = (await getChannelList(query)).data
}, },
......
...@@ -72,7 +72,8 @@ ...@@ -72,7 +72,8 @@
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/> <dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" > <el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"/> <user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理')}"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/> <dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" > <el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"/> <user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理')}"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
......
...@@ -81,7 +81,13 @@ export default { ...@@ -81,7 +81,13 @@ export default {
let arr = [] let arr = []
this.orderItemDetails.forEach(item => { this.orderItemDetails.forEach(item => {
item.orderWarehouseInCommonAttrVOList?.forEach((vo, index) => { item.orderWarehouseInCommonAttrVOList?.forEach((vo, index) => {
arr.push({...item, ...vo, index, span: index === 0 ? item.orderWarehouseInCommonAttrVOList?.length : 0}) arr.push({
...item,
...vo,
index,
span: index === 0 ? item.orderWarehouseInCommonAttrVOList?.length : 0,
warehouseInId: item.id
})
}) })
}) })
return arr return arr
...@@ -112,6 +118,26 @@ export default { ...@@ -112,6 +118,26 @@ export default {
} }
}) })
// 如果某条入仓记录下的箱明细被全部选中了,则需要将他的快递单号和影像带过去
const expressNos = []
const pictureUrls = []
this.orderItemDetails.forEach(warehouseIn => {
// 本条入仓记录被选中的明细数
const selectedCount = arr.filter(item => item.warehouseInId == warehouseIn.id).length
if(selectedCount == warehouseIn.orderWarehouseInCommonAttrVOList?.length){
if(warehouseIn.expressNo){
expressNos.push(warehouseIn.expressNo)
}
if(warehouseIn.pictureUrls?.length){
pictureUrls.push(...warehouseIn.pictureUrls)
}
}
})
// 根据warehouseInId 给对应的入仓记录追加快递单号和影像
// 存到全局变量,在调用对应finishPack接口的时候判断追加
window.ChooseOrderProductsExpressNos = expressNos
window.ChooseOrderProductsPictureUrls = pictureUrls
this.$emit("success", arr) this.$emit("success", arr)
}, },
handleClose() { handleClose() {
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
</script> </script>
<template> <template>
<el-dialog :visible.sync="show" :before-close="onBeforeClose" append-to-body title="$t('查看影像')"> <el-dialog :visible.sync="show" :before-close="onBeforeClose" append-to-body :title="$t('查看影像')">
<image-and-video-upload v-model="pictureUrls" readonly></image-and-video-upload> <image-and-video-upload v-model="pictureUrls" readonly></image-and-video-upload>
</el-dialog> </el-dialog>
</template> </template>
...@@ -201,6 +201,7 @@ ...@@ -201,6 +201,7 @@
show-choose-order-item show-choose-order-item
:order-id="order.orderId" :order-id="order.orderId"
:warehouse-in-id="row.id" :warehouse-in-id="row.id"
@close="checkAppendExpressAndPictures(row)"
/> />
<el-popconfirm <el-popconfirm
v-if="$index >= protectRowCount" v-if="$index >= protectRowCount"
...@@ -720,6 +721,26 @@ export default { ...@@ -720,6 +721,26 @@ export default {
titleZh: undefined, titleZh: undefined,
titleEn: undefined titleEn: undefined
} }
},
// 检查并追加快递单号和入仓影像
checkAppendExpressAndPictures(row){
if(window.ChooseOrderProductsExpressNos?.length){
// 去重追加
window.ChooseOrderProductsExpressNos?.forEach(no => {
if(row.expressNo.indexOf(no) === -1){
row.expressNo += "," + no
}
})
}
if(window.ChooseOrderProductsPictureUrls?.length){
this.pictureUrls = this.pictureUrls.concat(window.ChooseOrderProductsPictureUrls)
// 去重
this.pictureUrls = Array.from(new Set(this.pictureUrls))
}
// 清掉
window.ChooseOrderProductsExpressNos = null
window.ChooseOrderProductsPictureUrls = null
} }
} }
} }
......
...@@ -69,10 +69,11 @@ ...@@ -69,10 +69,11 @@
<template v-slot="{row}"> <template v-slot="{row}">
<WarehouseRecordDetail <WarehouseRecordDetail
v-model="row.orderWarehouseInDetailsVOList" v-model="row.orderWarehouseInDetailsVOList"
@input="saveDetail(props.row)" @input="saveDetail(props.row, row.id)"
show-choose-order-item show-choose-order-item
:order-id="orderId" :order-id="orderId"
:warehouse-in-id="row.id" :warehouse-in-id="row.id"
@close="clearAppendExpressNoAndPictures"
/> />
<el-button class="pl-5 pr-5" size="mini" type="primary" @click="package(props.row, $t('修改打包'))">{{$t('修改')}}</el-button> <el-button class="pl-5 pr-5" size="mini" type="primary" @click="package(props.row, $t('修改打包'))">{{$t('修改')}}</el-button>
<el-button class="pl-5 pr-5" size="mini" type="danger" @click="package(props.row, $t('修改打包'))">{{$t('删除')}}</el-button> <el-button class="pl-5 pr-5" size="mini" type="danger" @click="package(props.row, $t('修改打包'))">{{$t('删除')}}</el-button>
...@@ -482,18 +483,35 @@ export default { ...@@ -482,18 +483,35 @@ export default {
this.curPictrues = wareItem.pictureUrls || [] this.curPictrues = wareItem.pictureUrls || []
}, },
// 保存箱明细 // 保存箱明细
saveDetail(row){ saveDetail(row, warehouseInId){
const wareItem = this.wareItem(row.orderItemId) const wareItem = this.wareItem(row.orderItemId)
const orderWarehouseInItemDtoList = wareItem.orderWarehouseInBackItemDoList const orderWarehouseInItemDtoList = wareItem.orderWarehouseInBackItemDoList
orderWarehouseInItemDtoList.map(item =>{ orderWarehouseInItemDtoList.map(item =>{
item.orderLocationCreateReqVOList = item.orderLocationBackVOList || [] item.orderLocationCreateReqVOList = item.orderLocationBackVOList || []
return item return item
}) })
let pictures = wareItem.pictureUrls || []
if(window.ChooseOrderProductsPictureUrls?.length){
pictures.push(...window.ChooseOrderProductsPictureUrls)
// 去重
pictures = Array.from(new Set(pictures))
}
if(window.ChooseOrderProductsExpressNos?.length){
const warehouseInItem = orderWarehouseInItemDtoList.find(item => item.id === warehouseInId)
if(!warehouseInItem.expressNo)warehouseInItem.expressNo = ""
window.ChooseOrderProductsExpressNos?.forEach(item => {
if(warehouseInItem.expressNo.indexOf(item) === -1){
if(warehouseInItem.expressNo?.length) warehouseInItem.expressNo += ","
warehouseInItem.expressNo += item
}
})
}
const data = { const data = {
orderId: row.orderId, orderId: row.orderId,
orderItemId: row.orderItemId, orderItemId: row.orderItemId,
orderWarehouseInItemDtoList: orderWarehouseInItemDtoList, orderWarehouseInItemDtoList: orderWarehouseInItemDtoList,
pictureUrls: wareItem.pictureUrls || [] pictureUrls: pictures
} }
finishPacked(data).then(res => { finishPacked(data).then(res => {
this.$message.success(this.$t('操作成功')) this.$message.success(this.$t('操作成功'))
...@@ -514,6 +532,13 @@ export default { ...@@ -514,6 +532,13 @@ export default {
}, },
printTag(){ printTag(){
this.showPrintTagDialog = true this.showPrintTagDialog = true
},
// 箱明细关闭后清理快递单号和影像临时数据
clearAppendExpressNoAndPictures(){
setTimeout(() => {
window.ChooseOrderProductsExpressNos = null
window.ChooseOrderProductsPictureUrls = null
}, 100)
} }
}, },
watch: { watch: {
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/> <dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('客户经理')" > <el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"/> <user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理')}"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
......
<template> <template>
<div style="display: inline-block"> <div style="display: inline-block">
<template v-if="text"> <template v-if="text">
<el-button size="mini" type="text" style="margin-right: 10px" @click="handleOpen">{{ num }}混箱</el-button> <el-button size="mini" type="text" style="margin-right: 10px" @click="handleOpen">{{ num }}{{$t('混箱')}}}</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button size="mini" type="primary" style="margin-right: 10px" @click="handleOpen">{{ title }}</el-button> <el-button size="mini" type="primary" style="margin-right: 10px" @click="handleOpen">{{ title }}</el-button>
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
:before-close="handleClose"> :before-close="handleClose">
<template v-slot:title> <template v-slot:title>
<div class="flex flex-items-center"> <div class="flex flex-items-center">
<div class="title flex-1 flex flex-items-center">{{$t('选择订单商品')}}</div> <div class="title flex-1 flex flex-items-center">{{title}}</div>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">选择订单商品</el-button> <el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">{{$t('选择订单商品')}}</el-button>
<div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div> <div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div>
</div> </div>
</template> </template>
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
/> />
</el-form> </el-form>
<el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">添加一条明细</el-button> <el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">{{$t('添加一条明细')}}</el-button>
<span v-show="!readonly" slot="footer" class="dialog-footer"> <span v-show="!readonly" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="handleSave">确 定</el-button> <el-button type="primary" @click="handleSave">{{$t('确定')}}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<choose-order-products <choose-order-products
...@@ -92,7 +92,13 @@ export default { ...@@ -92,7 +92,13 @@ export default {
showChooseDialog: false showChooseDialog: false
}; };
}, },
watch:{
dialogVisible(v){
if(!v){
this.$emit("close")
}
}
},
mounted() { mounted() {
this.getAttrList() this.getAttrList()
}, },
...@@ -165,13 +171,19 @@ export default { ...@@ -165,13 +171,19 @@ export default {
for (let i = 0; i < this.dataList.length; i++) { for (let i = 0; i < this.dataList.length; i++) {
if (!this.dataList[i].prodId) { if (!this.dataList[i].prodId) {
return this.$notify({ return this.$notify({
title: '明细' + (i + 1) + ': ' + '请选择品名', title: this.$t("填写第{n}条明细的品名", {n: i=1}),
type: "warning" type: "warning"
}) })
} }
if (!this.dataList[i].brand) { if (!this.dataList[i].brand) {
return this.$notify({ return this.$notify({
title: '明细' + (i + 1) + ': ' + '请选择品牌', title: this.$t("填写第{n}条明细的品牌", {n: i=1}),
type: "warning"
})
}
if(!this.dataList[i].quantityAll){
return this.$notify({
title: this.$t("填写第{n}条明细的数量", {n: i=1}),
type: "warning" type: "warning"
}) })
} }
...@@ -218,9 +230,9 @@ export default { ...@@ -218,9 +230,9 @@ export default {
computed: { computed: {
title() { title() {
if (this.readonly) { if (this.readonly) {
return '查看箱明细' return this.$t('查看箱明细')
} }
return !this.value || this.value.length === 0 ? '添加箱明细' : '编辑箱明细' return !this.value || this.value.length === 0 ? this.$t('添加箱明细') : this.$t('编辑箱明细')
} }
} }
} }
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</el-form-item> </el-form-item>
</el-col>--> </el-col>-->
<el-col :span="4"> <el-col :span="4">
<el-form-item :label="$t('数量')"> <el-form-item :label="$t('数量')" required>
<el-input v-model="value.quantityAll" type="number" :disabled="readonly" /> <el-input v-model="value.quantityAll" type="number" :disabled="readonly" />
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -93,16 +93,51 @@ ...@@ -93,16 +93,51 @@
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<template v-else-if="form.priceType === 1">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="all"
:price-name="$t('全包价')"
packaging-field="fullPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else> <template v-else>
<el-row :gutter="20">
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="transport"
:price-name="$t('运费')"
packaging-field="freightPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
<el-col :span="12">
<sea-price <sea-price
ref="seaPrice" ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
:value="form" :value="form"
field-prefix="clearance"
:price-name="$t('清关费')"
packaging-field="clearancePricePackagingList"
@changeUnit="handleFormUnitChange($event)" @changeUnit="handleFormUnitChange($event)"
></sea-price> ></sea-price>
</el-col>
</el-row>
</template> </template>
<el-form-item :label="$t('价格有效期')">
<el-date-picker v-model="form.validateStartDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
-
<el-date-picker v-model="form.validateEndDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-card> </el-card>
...@@ -435,7 +470,7 @@ export default { ...@@ -435,7 +470,7 @@ export default {
}, },
// 获得用语提交的阶梯价副本 // 获得用语提交的阶梯价副本
getPriceList(stepList){ getPriceList(stepList, prefix){
if(!stepList?.length) return [] if(!stepList?.length) return []
let stepPriceList = JSON.parse(JSON.stringify(stepList)) let stepPriceList = JSON.parse(JSON.stringify(stepList))
stepPriceList.forEach((item, index) => { stepPriceList.forEach((item, index) => {
...@@ -446,7 +481,10 @@ export default { ...@@ -446,7 +481,10 @@ export default {
return p return p
}) })
}) })
return stepPriceList // 240121应老王要求,未设置价格的不提交
return stepPriceList.filter(item => {
return !!item[`${prefix}Price`]
})
}, },
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
...@@ -461,6 +499,26 @@ export default { ...@@ -461,6 +499,26 @@ export default {
p[data.field] = data.value p[data.field] = data.value
}) })
} }
// 同步包装的单位
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
}
this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){
item['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
item['packagingVolumeUnit'] = data.value
}
})
}, },
initStepPrice(){ initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){ if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
...@@ -502,6 +560,7 @@ export default { ...@@ -502,6 +560,7 @@ export default {
} }
// 阶梯价校验 // 阶梯价校验
/* 根据甲方要求不做校验,所有字段均可留空,https://zentao.test.jdshangmen.com/bug-view-5915.html
if(this.$refs.stepPrice){ if(this.$refs.stepPrice){
let isValid = true let isValid = true
for (let stepPrice of this.$refs.stepPrice){ for (let stepPrice of this.$refs.stepPrice){
...@@ -511,16 +570,16 @@ export default { ...@@ -511,16 +570,16 @@ export default {
} }
} }
if(!isValid)return if(!isValid)return
} } */
// 全包价 // 全包价
if(this.form.priceType == 1) { if(this.form.priceType == 1) {
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList) data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList, 'all')
delete data.clearancePriceStepList delete data.clearancePriceStepList
delete data.freightPriceStepList delete data.freightPriceStepList
}else{ }else{
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList) data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList, 'clearance')
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList) data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList, 'transport')
delete data.fullPriceStepList delete data.fullPriceStepList
} }
...@@ -534,6 +593,7 @@ export default { ...@@ -534,6 +593,7 @@ export default {
product: this.isAllProduct ? this.$refs.productSelector.allTotal : data.productIdList.length product: this.isAllProduct ? this.$refs.productSelector.allTotal : data.productIdList.length
})) }))
this.loading = true this.loading = true
console.log('提交批量修改', data)
batchUpdateProductPrice(data).then(response => { batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("修改成功")); this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.replace('/lineProject/product-price?' + (new URLSearchParams(this.$route.query)).toString()) this.$router.replace('/lineProject/product-price?' + (new URLSearchParams(this.$route.query)).toString())
......
...@@ -336,7 +336,10 @@ export default { ...@@ -336,7 +336,10 @@ export default {
return p return p
}) })
}) })
return stepPriceList // 240121应老王要求,未设置价格的不提交
return stepPriceList.filter(item => {
return !!item[`${prefix}Price`]
})
}, },
submitForm() { submitForm() {
...@@ -376,10 +379,13 @@ export default { ...@@ -376,10 +379,13 @@ export default {
// 全包价 // 全包价
if(this.form.priceType == 1) { if(this.form.priceType == 1) {
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList) data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList, 'all')
delete data.clearancePriceStepList
delete data.freightPriceStepList
}else{ }else{
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList) data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList, 'clearance')
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList) data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList, 'transport')
delete data.fullPriceStepList
} }
if(data.lineChannelList.length < 1){ if(data.lineChannelList.length < 1){
......
...@@ -81,15 +81,46 @@ ...@@ -81,15 +81,46 @@
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<template v-else-if="form.priceType === 1">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
:readonly="readonly"
field-prefix="all"
:price-name="$t('全包价')"
packaging-field="fullPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else> <template v-else>
<el-row :gutter="20">
<el-col :span="12">
<sea-price <sea-price
ref="seaPrice" ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
:value="form" :value="form"
field-prefix="transport"
:price-name="$t('运费')"
packaging-field="freightPricePackagingList"
@changeUnit="handleFormUnitChange($event)" @changeUnit="handleFormUnitChange($event)"
></sea-price> ></sea-price>
</el-col>
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="clearance"
:price-name="$t('清关费')"
packaging-field="clearancePricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
</el-row>
</template> </template>
</div> </div>
...@@ -114,6 +145,7 @@ import Decimal from 'decimal.js' ...@@ -114,6 +145,7 @@ import Decimal from 'decimal.js'
import SeaPrice from "@/views/ecw/productPrice/components/SeaPrice.vue"; import SeaPrice from "@/views/ecw/productPrice/components/SeaPrice.vue";
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
import PriceStep from "@/views/ecw/productPrice/components/PriceStep.vue"; import PriceStep from "@/views/ecw/productPrice/components/PriceStep.vue";
import { getFormData } from '@/views/ecw/productPrice/util'
const DEFAULT_PRICE_UNIT = 1 const DEFAULT_PRICE_UNIT = 1
const DEFAULT_VOLUME_UNIT = 7 const DEFAULT_VOLUME_UNIT = 7
...@@ -186,10 +218,6 @@ export default { ...@@ -186,10 +218,6 @@ export default {
this.currencyList = (await getCurrencyList())?.data || [] this.currencyList = (await getCurrencyList())?.data || []
this.unitList = (await getUnitList())?.data || [] this.unitList = (await getUnitList())?.data || []
this.$nextTick(async() => {
this.setDefaultVolumeUnit(this.type == 'air' ? 6 : 7)
})
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => { this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
// 没有的才push,已有的可能是从复制模板携带过来的数据 // 没有的才push,已有的可能是从复制模板携带过来的数据
if(!this.form.specialList.find(special => special.specialDictType == item.value)) { if(!this.form.specialList.find(special => special.specialDictType == item.value)) {
...@@ -257,28 +285,57 @@ export default { ...@@ -257,28 +285,57 @@ export default {
}) })
}, },
// 获得用提交的阶梯价副本 // 获得用提交的阶梯价副本
getPriceList(stepList){ getPriceList(stepList){
if(!stepList?.length) return [] if(!stepList?.length) return []
let stepPriceList = JSON.parse(JSON.stringify(stepList)) let stepPriceList = JSON.parse(JSON.stringify(stepList))
stepPriceList.forEach((item, index) => { stepPriceList.forEach((item, index) => {
item.rankNum = index + 1 item.rankNum = index + 1
item.packagingList = item.packagingList.filter(p => !!p.packagingTypes?.length) item.packagingList = this.getPackagingPrice(item.packagingList)
item.packagingList = item.packagingList.map( p => {
p.packagingTypes = p.packagingTypes.join(",")
return p
})
}) })
// 过滤掉空的阶梯 // 过滤掉空的阶梯
return stepPriceList.filter(this.isStepPriceValid) return stepPriceList.filter(this.isStepPriceValid)
}, },
// 获取包装类型价
getPackagingPrice(packagingList){
const list = JSON.parse(JSON.stringify(packagingList))
return list.filter(p => !!p.packagingTypes?.length).map( p => {
p.packagingTypes = p.packagingTypes.join(",")
return p
})
},
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
if(this.form.specialList?.length){ if(this.form.specialList?.length){
this.form.specialList.forEach(p => { this.form.specialList.forEach(p => {
p[data.field] = data.value p[data.field] = data.value
}) })
} }
// 同步包装的单位
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
}
this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){
item['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
item['packagingVolumeUnit'] = data.value
}
})
}, },
initStepPrice(){ initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){ if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
...@@ -293,68 +350,80 @@ export default { ...@@ -293,68 +350,80 @@ export default {
} }
} }
}, },
// 检查包装类型价格是否有效
validatePackagingPrice(packagingList, priceName){
if(!packagingList?.length) return true
let valid = true
for(const index in packagingList){
const item = packagingList[index]
if(!item.packagingPrice){
valid = false
const no = parseInt(index) + 1
this.$message.error(this.$t("请设置{priceName}的第{no}包装费", {priceName, no}))
break;
}
}
return valid
},
submitForm() { submitForm() {
this.$refs["form"].validate(async (valid) => { this.$refs["form"].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
// 只有新增的时候做判断 let data = JSON.parse(JSON.stringify(this.form))
if (!this.$route.query.ids && (!this.selectedRoutes || !this.selectedRoutes.length)) {
this.$message.error(this.$t('请选择线路'));
return;
}
let data = Object.assign({}, this.form, { data.isAllProduct = this.isAllProduct ? 1:0
// lineChannelList: this.selectedRoutes, data.lineChannelList = this.selectedRoutes
// specialList: this.specialProducts,
isAllProduct: this.isAllProduct ? 1:0
})
// 如果是勾選了全部篩選商品,則獲取商品ID if(!data.lineChannelList?.length){
if(this.isAllFilteredProduct){ return this.$message.error(this.$t('请选择需要修改的路线'))
data.productIdList = await this.$refs.productSelector.getFilteredIds()
} }
if(!data.isAllProduct && (!data.productIdList || !data.productIdList.length)){ if(!data.productIdList?.length){
return this.$message.error(this.$t('请选择商品') + "!") return this.$message.error(this.$t('请选择商品') + "!")
} }
data.lineChannelList = this.selectedRoutes // 如果是阶梯价,需要把阶梯价的数据转换成提交的格式
delete data.freightPriceStepList
if(data.lineChannelList.length < 1){ delete data.clearancePriceStepList
return this.$message.error(this.$t('请选择需要修改的路线')) delete data.fullPriceStepList
delete data.clearancePricePackagingList
delete data.freightPricePackagingList
delete data.fullPricePackagingList
// 阶梯价
if(data.stepPrice){
delete data.specialList
if(data.priceType === 1){
data.fullPriceStepList = this.getPriceList(this.form.fullPriceStepList)
}else{
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList)
data.clearancePriceStepList = this.getPriceList(this.form.clearancePriceStepList)
} }
}else{
data.fullPriceStepList= this.getPriceList(data.fullPriceStepList)
data.freightPriceStepList= this.getPriceList(data.freightPriceStepList)
data.clearancePriceStepList= this.getPriceList(data.clearancePriceStepList)
// 检查被忽略的阶梯价
let msgArr = [];
if(data.priceType){ if(data.priceType){
const ignoreAll = data.fullPriceStepList.length != this.form.fullPriceStepList.length data.fullPricePackagingList = this.getPackagingPrice(this.form.fullPricePackagingList)
if(ignoreAll){ if(!this.validatePackagingPrice(data.fullPricePackagingList, "全包价")){
msgArr.push(this.$t("{n}个全包阶梯价", {n: ignoreAll})) return false
} }
}else{ }else{
const ignoreFreight = this.form.freightPriceStepList.length - data.freightPriceStepList.length data.clearancePricePackagingList = this.getPackagingPrice(this.form.clearancePricePackagingList)
const ignoreClearance = this.form.clearancePriceStepList.length - data.clearancePriceStepList.length data.freightPricePackagingList = this.getPackagingPrice(this.form.freightPricePackagingList)
if(
if(ignoreFreight){ !this.validatePackagingPrice(data.freightPricePackagingList, this.$t("运费")) ||
msgArr.push(this.$t("{n}个运费阶梯价", {n: ignoreFreight})) !this.validatePackagingPrice(data.clearancePricePackagingList, this.$t("清关费"))
){
return false
} }
if(ignoreClearance){
msgArr.push(this.$t("{n}个清关费阶梯价", {n: ignoreClearance}))
} }
data.specialList = data.specialList.filter(item => {
return item.transportPrice || item.clearancePrice
})
} }
let msg = this.$t('已选择{route}条路线,{product}个商品', { let msg = this.$t('已选择{route}条路线,{product}个商品', {
route: data.lineChannelList.length, route: data.lineChannelList.length,
product: this.isAllProduct ? this.$refs.productSelector.allTotal : data.productIdList.length product: this.isAllProduct ? this.$refs.productSelector.allTotal : data.productIdList.length
}) })
console.log(msgArr)
if(msgArr.length){
msg += ";" + msgArr.join(",") + "被忽略"
}
await this.$confirm(msg + this.$t(';确认提交修改?', )) await this.$confirm(msg + this.$t(';确认提交修改?', ))
this.loading = true this.loading = true
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
// 判断阶梯价是否有效 // 判断阶梯价是否有效
isStepPriceValid(){ isStepPriceValid(){
return stepPrice => { return stepPrice => {
return stepPrice.startNum && stepPrice.endNum return (stepPrice.startNum || stepPrice.startNum === 0) && stepPrice.endNum
} }
}, },
}, },
...@@ -275,10 +275,13 @@ export default { ...@@ -275,10 +275,13 @@ export default {
// 检查被忽略的阶梯价 // 检查被忽略的阶梯价
let msgArr = []; let msgArr = [];
if(data.priceType){ if(data.priceType){
const ignoreAll = data.fullPriceStepList.length != this.form.fullPriceStepList.length const ignoreAll = this.form.fullPriceStepList.length - data.fullPriceStepList.length
if(ignoreAll){ if(ignoreAll){
msgArr.push(this.$t("{n}个全包阶梯价", {n: ignoreAll})) msgArr.push(this.$t("{n}个全包阶梯价", {n: ignoreAll}))
} }
if(!data.fullPriceStepList?.length){
return this.$message.error(this.$t('请设置全包价'))
}
}else{ }else{
const ignoreFreight = this.form.freightPriceStepList.length - data.freightPriceStepList.length const ignoreFreight = this.form.freightPriceStepList.length - data.freightPriceStepList.length
const ignoreClearance = this.form.clearancePriceStepList.length - data.clearancePriceStepList.length const ignoreClearance = this.form.clearancePriceStepList.length - data.clearancePriceStepList.length
...@@ -289,6 +292,10 @@ export default { ...@@ -289,6 +292,10 @@ export default {
if(ignoreClearance){ if(ignoreClearance){
msgArr.push(this.$t("{n}个清关费阶梯价", {n: ignoreClearance})) msgArr.push(this.$t("{n}个清关费阶梯价", {n: ignoreClearance}))
} }
if(!data.freightPriceStepList?.length && !data.clearancePriceStepList?.length){
return this.$message.error(this.$t('请设置运费或清关费'))
}
} }
let msg = this.$t('已选择{route}条路线,{product}个商品', { let msg = this.$t('已选择{route}条路线,{product}个商品', {
route: data.lineChannelList.length, route: data.lineChannelList.length,
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
components: {Template, Inputor, Selector}, components: {Template, Inputor, Selector},
props:{ props:{
index: Number, index: Number,
type: String,
priceName: String, priceName: String,
fieldPrefix: String, fieldPrefix: String,
unitList:{ unitList:{
...@@ -154,7 +155,7 @@ export default { ...@@ -154,7 +155,7 @@ export default {
<template> <template>
<div> <div>
<div class="bold text-lg">{{$t('空运{type}设置', {type: priceName})}}</div> <div class="bold text-lg">{{$t('{type}{priceName}价格设置', {type, priceName})}}</div>
<div style="font-size:14px; margin:10px 0"> <div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}} {{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="showAdd"> <template v-if="showAdd">
...@@ -212,7 +213,7 @@ export default { ...@@ -212,7 +213,7 @@ export default {
<!--特性加价--> <!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList"> <template v-for="(special, specialIndex) in value.specialList">
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName + $t('加价')"
:key="specialIndex + 'transport'" :key="specialIndex + 'transport'"
> >
<el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
...@@ -224,9 +225,9 @@ export default { ...@@ -224,9 +225,9 @@ export default {
<!--包装类型价格--> <!--包装类型价格-->
<template v-for="(item, i) in value.packagingList"> <template v-for="(item, i) in value.packagingList">
<el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i"> <el-form-item :label="$t('包装类型加价') + (i+1)" :key="i">
<template #label> <template #label>
<div class="el-form-item__label" style="width: 150px;">{{$t('包装类型') + priceName + (i+1)}}</div> <div class="el-form-item__label" style="width: 150px;">{{$t('包装类型{name}加价', {name: priceName}) + (i+1)}}</div>
<div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div> <div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div>
</template> </template>
<el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block"> <el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block">
......
...@@ -3,12 +3,16 @@ import Selector from "@/components/Selector/index.vue"; ...@@ -3,12 +3,16 @@ import Selector from "@/components/Selector/index.vue";
import Inputor from "@/components/Inputor/index.vue"; import Inputor from "@/components/Inputor/index.vue";
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {DICT_TYPE, getDictDatas} from "@/utils/dict";
export default { export default {
name: "SeaPrice", name: "SeaPrice",
components: {Template, Inputor, Selector}, components: {Inputor, Selector},
props:{ props:{
priceType: Number, // 1全包价,0清关费+运费 // 字段前缀
fieldPrefix: String,
// 价格名称
priceName: String,
// 包装类型字段
packagingField: String,
unitList:{ unitList:{
type: Array, type: Array,
default: [] default: []
...@@ -21,14 +25,27 @@ export default { ...@@ -21,14 +25,27 @@ export default {
value:{ value:{
type: Object, type: Object,
default: () => { default: () => {
return { return {}
} }
} }
},
computed:{
packagingList(){
const dicts = JSON.parse(JSON.stringify(getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)))
return dicts.map(dict => {
dict.enable = true
this.value[this.packagingField]?.forEach(item => {
if(item.packagingTypes?.length && item.packagingTypes.indexOf(dict.value) > -1){
dict.enable = false
}
})
return dict
})
} }
}, },
created() { created() {
this.initSpecialPrice() this.initSpecialPrice()
this.initPackingPrice()
}, },
data(){ data(){
return { return {
...@@ -37,6 +54,21 @@ export default { ...@@ -37,6 +54,21 @@ export default {
}, },
methods:{ methods:{
getDictDatas, getDictDatas,
// 包装类型初始化
initPackingPrice(){
// 已有包装类型则处理字段,没有则初始化一个
if(this.value[this.packagingField]?.length){
this.value[this.packagingField].forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
return
}
this.addPackage()
},
// 初始化特需加价 // 初始化特需加价
initSpecialPrice(){ initSpecialPrice(){
if(!this.value.specialList){ if(!this.value.specialList){
...@@ -59,24 +91,39 @@ export default { ...@@ -59,24 +91,39 @@ export default {
} }
}) })
}, },
// 添加包装类型运费
addPackage(){
if(!this.value[this.packagingField]){
this.$set(this.value, this.packagingField, [])
}
this.value[this.packagingField]?.push({
packagingPrice: undefined,
packagingPriceUnit : this.value[`${this.fieldPrefix}PriceUnit`],
packagingVolumeUnit : this.value[`${this.fieldPrefix}VolumeUnit`],
})
},
// 删除包装类型运费
deletePackage(index){
this.value[this.packagingField]?.splice(index, 1)
},
// 校验 // 校验
validate(){ validate(){
let valid = true let valid = true
// 价格检查 // 价格检查
if(this.priceType){ if(!this.validatePrice(this.value[`${this.fieldPrefix}Price`])){
if(!this.validatePrice(this.value[`allPrice`])){
valid = false valid = false
this.$message.error(`请设置全包价`) this.$message.error(this.$t("请设置{name}", {name: this.priceName}))
} }
}else{
if(!this.validatePrice(this.value[`transportPrice`])){ // 检查包装费
valid = false if(this.value[this.packagingField]?.length){
this.$message.error(`请设置运费`) this.value[this.packagingField]?.forEach((item, index) => {
} if(!item.packagingTypes?.length) return
if(!this.validatePrice(this.value[`clearancePrice`])){ if(!this.validatePrice(item.packagingPrice)){
valid = false valid = false
this.$message.error(`请设置清关费`) this.$message.error(this.$t("请设置{name}的包装费{index}", {name: this.priceName, index: index+1}))
} }
})
} }
return valid return valid
...@@ -93,133 +140,78 @@ export default { ...@@ -93,133 +140,78 @@ export default {
</script> </script>
<template> <template>
<el-row> <div>
<el-col :span="12"> <div class="page-title">{{$t('{name}价格设置', {name: this.priceName})}}</div>
<div class="page-title">{{$t('海运运费价格设置')}}</div> <el-form-item :label="$t('默认{name}', {name: this.priceName})">
<el-form-item :label="$t('默认运费')" v-if="!priceType"> <el-input-number v-model="value[`${fieldPrefix}Price`]" :placeholder="$t('整数或者两位小数')" :controls="false":disabled="readonly" class="w-100 mr-10"/>
<el-input-number v-model="value[`transportPrice`]" :placeholder="$t('整数或者两位小数')" :controls="false":disabled="readonly" class="w-100 mr-10"/>
<selector <selector
:disabled="readonly" :disabled="readonly"
v-model="value[`transportPriceUnit`]" v-model="value[`${fieldPrefix}PriceUnit`]"
:options="currencyList" :options="currencyList"
:label-field="$l(null, 'title')" :label-field="$l(null, 'title')"
@input="$emit('changeUnit', { @input="$emit('changeUnit', {
value: $event, value: $event,
field: `transportPriceUnit` field: `${fieldPrefix}PriceUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
/ /
<selector <selector
:disabled="readonly" :disabled="readonly"
v-model="value[`transportVolumeUnit`]" v-model="value[`${fieldPrefix}VolumeUnit`]"
:options="unitList" :options="unitList"
:label-field="$l(null, 'title')" :label-field="$l(null, 'title')"
@input="$emit('changeUnit', { @input="$emit('changeUnit', {
value: $event, value: $event,
field: `transportVolumeUnit` field: `${fieldPrefix}VolumeUnit`
})" })"
value-field="id" value-field="id"
class="w-100" /> class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="priceType">
<el-input-number v-model="value[`allPrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/>
<selector
:disabled="readonly"
v-model="value[`allPriceUnit`]"
:options="currencyList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event,
field: `allPriceUnit`
})"
value-field="id"
class="w-100" />
/
<selector
:disabled="readonly"
v-model="value[`allVolumeUnit`]"
:options="unitList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event,
field: `allVolumeUnit`
})"
value-field="id"
class="w-100" />
</el-form-item>
<!--特性加价--> <!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList"> <template v-for="(special, specialIndex) in value.specialList">
<div :key="specialIndex + 'transport'"> <div :key="specialIndex + 'transport'">
<el-form-item <el-form-item
v-if="!priceType" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName + $t('加价')"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
> >
<el-input-number v-model.number="special[`transportPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`transportPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector disabled v-model="special[`${fieldPrefix}PriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
<selector disabled v-model="special[`transportVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector disabled v-model="special[`${fieldPrefix}VolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" class="w-100" />
</el-form-item>
<el-form-item
v-if="priceType"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
>
<el-input-number v-model.number="special[`allPrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`allPriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<span class="mr-10">/</span>
<selector disabled v-model="special[`allVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
</el-col>
<el-col :span="12" v-if="!priceType">
<div class="page-title">{{$t('海运清关费价格设置')}}</div>
<el-form-item :label="$t('默认清关费')">
<el-input-number v-model="value[`clearancePrice`]" :placeholder="$t('整数或者两位小数')" :disabled="readonly" :controls="false" class="w-100 mr-10"/>
<selector
:disabled="readonly"
v-model="value[`clearancePriceUnit`]"
:options="currencyList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event,
field: `clearancePriceUnit`
})"
value-field="id"
class="w-100" />
/
<selector
:disabled="readonly"
v-model="value[`clearanceVolumeUnit`]"
:options="unitList"
:label-field="$l(null, 'title')"
@input="$emit('changeUnit', {
value: $event,
field: `clearanceVolumeUnit`
})"
value-field="id"
class="w-100" />
</el-form-item>
<!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList">
<div :key="specialIndex + 'transport'">
<el-form-item <!--包装类型价格-->
v-if="!priceType" <template v-for="(item, i) in value[packagingField]">
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')" <el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i">
<template #label>
<div class="el-form-item__label" style="width: 150px;">{{$t('包装类型{name}加价', {name: priceName}) + (i+1)}}</div>
<div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div>
</template>
<el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block">
<el-option
v-for="item in packagingList"
:key="item.value"
:label="$l(item, 'label')"
:value="item.value"
:disabled="!item.enable"
> >
<el-input-number v-model.number="special[`clearancePrice`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> </el-option>
<selector disabled v-model="special[`clearancePriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> </el-select>
<el-input-number v-model="item.packagingPrice" :controls="false" :min="0" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="item.packagingPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
<selector disabled v-model="special[`clearanceVolumeUnit`]" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector disabled v-model="item.packagingVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<template v-if="i == value[packagingField].length -1 && !readonly">
<el-link type="primary" @click.native="addPackage" class="ml-5">{{$t('添加')}}</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click.native="deletePackage(i)">{{$t('删除')}}</el-link>
</template>
</el-form-item> </el-form-item>
</div>
</template> </template>
</div>
</el-col>
</el-row>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -43,9 +43,9 @@ export default { ...@@ -43,9 +43,9 @@ export default {
{{$t("第{no}阶段", {no: index + 1})}} {{priceName}} {{$t("第{no}阶段", {no: index + 1})}} {{priceName}}
{{value.startNum}} - {{value.endNum}} {{unitMap[value.weightUnit]}} {{value.startNum}} - {{value.endNum}} {{unitMap[value.weightUnit]}}
</div> </div>
<div class="pl-10" > <div>
{{$t('默认') + priceName}} {{$t('默认') + priceName}}
{{value.transportPrice}} {{currencyMap[value[`${fieldPrefix}PriceUnit`]]}} / {{unitMap[value[`${fieldPrefix}VolumeUnit`]]}} {{value[`${fieldPrefix}Price`]}} {{currencyMap[value[`${fieldPrefix}PriceUnit`]]}} / {{unitMap[value[`${fieldPrefix}VolumeUnit`]]}}
</div> </div>
<!--特需加价--> <!--特需加价-->
<div v-for="(special, specialIndex) in value.specialList"> <div v-for="(special, specialIndex) in value.specialList">
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="all" field-prefix="all"
:type="$t('海运')"
:price-name="$t('全包价')" :price-name="$t('全包价')"
:show-add="index === form.fullPriceStepList.length -1 && !readonly" :show-add="index === form.fullPriceStepList.length -1 && !readonly"
:value="item" :value="item"
...@@ -131,6 +132,7 @@ ...@@ -131,6 +132,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="transport" field-prefix="transport"
:type="$t('海运')"
:price-name="$t('运费')" :price-name="$t('运费')"
:show-add="index === form.freightPriceStepList.length -1 && !readonly" :show-add="index === form.freightPriceStepList.length -1 && !readonly"
:value="item" :value="item"
...@@ -149,6 +151,7 @@ ...@@ -149,6 +151,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="clearance" field-prefix="clearance"
:type="$t('海运')"
:price-name="$t('清关费')" :price-name="$t('清关费')"
:show-add="index === form.clearancePriceStepList.length -1 && !readonly" :show-add="index === form.clearancePriceStepList.length -1 && !readonly"
:value="item" :value="item"
...@@ -161,16 +164,48 @@ ...@@ -161,16 +164,48 @@
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<template v-else-if="form.priceType === 1">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
:readonly="readonly"
field-prefix="all"
:price-name="$t('全包价')"
packaging-field="fullPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else> <template v-else>
<el-row :gutter="20">
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
:readonly="readonly"
field-prefix="transport"
:price-name="$t('运费')"
packaging-field="freightPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
<el-col :span="12">
<sea-price <sea-price
ref="seaPrice" ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
:value="form" :value="form"
:readonly="readonly" :readonly="readonly"
field-prefix="clearance"
:price-name="$t('清关费')"
packaging-field="clearancePricePackagingList"
@changeUnit="handleFormUnitChange($event)" @changeUnit="handleFormUnitChange($event)"
></sea-price> ></sea-price>
</el-col>
</el-row>
</template> </template>
<el-form-item :label="$t('价格有效期')"> <el-form-item :label="$t('价格有效期')">
...@@ -419,6 +454,27 @@ export default { ...@@ -419,6 +454,27 @@ export default {
} }
this.lineList = [res.data] this.lineList = [res.data]
// 如果不是阶梯价,需要初始化包装类型
if(this.form.stepPrice != 1){
if(this.form.freightPricePackagingList?.length){
this.form.freightPricePackagingList.forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
}else this.form.freightPricePackagingList = [{}]
if(this.form.clearancePricePackagingList?.length){
this.form.clearancePricePackagingList.forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
}else this.form.clearancePricePackagingList = [{}]
}
} }
// action=batchUpdate且ids不为空 // action=batchUpdate且ids不为空
...@@ -455,7 +511,9 @@ export default { ...@@ -455,7 +511,9 @@ export default {
advanceStatus: 0, advanceStatus: 0,
needBook: 0, needBook: 0,
specialList: [], specialList: [],
priceStepList: this.type === 'air' ? [{},{}] : [], clearancePricePackagingList: [{}],
freightPricePackagingList: [{}],
fullPricePackagingList: [{}],
// dayLimit: 10000, // dayLimit: 10000,
validateEndDate: undefined, validateEndDate: undefined,
validateStartDate: undefined, validateStartDate: undefined,
...@@ -608,6 +666,15 @@ export default { ...@@ -608,6 +666,15 @@ export default {
}) })
return stepPriceList return stepPriceList
}, },
// 格式化包装类型费用
getPackingPrice(packging){
if(!packging?.length) return
packging = JSON.parse(JSON.stringify(packging))
return packging.filter(item => !!item.packagingTypes).map(item => {
item.packagingTypes = item.packagingTypes?.join(",") || ""
return item
})
},
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位 // 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
...@@ -621,7 +688,25 @@ export default { ...@@ -621,7 +688,25 @@ export default {
}) })
} }
// TODO 等加了包装之后还需要同步包装的单位 // 同步包装的单位
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
}
this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){
item['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
item['packagingVolumeUnit'] = data.value
}
})
}, },
initStepPrice(){ initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){ if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
...@@ -638,7 +723,6 @@ export default { ...@@ -638,7 +723,6 @@ export default {
}, },
// force 为是否强制提交,在价格过期的时候需要确认后强制提交 // force 为是否强制提交,在价格过期的时候需要确认后强制提交
submitForm(force = false) { submitForm(force = false) {
console.log("this.$refs[\"form\"]", this.$refs["form"])
this.$refs["form"].validate(async (valid) => { this.$refs["form"].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
...@@ -658,7 +742,8 @@ export default { ...@@ -658,7 +742,8 @@ export default {
// specialList: this.specialProducts, // specialList: this.specialProducts,
isAllProduct: 0 isAllProduct: 0
}) })
if(this.$refs.stepPrice){ // 阶梯价
if(this.form.stepPrice){
let isValid = true let isValid = true
for (let stepPrice of this.$refs.stepPrice){ for (let stepPrice of this.$refs.stepPrice){
if(!stepPrice.validate()){ if(!stepPrice.validate()){
...@@ -667,8 +752,6 @@ export default { ...@@ -667,8 +752,6 @@ export default {
} }
} }
if(!isValid)return if(!isValid)return
}
// 全包价 // 全包价
if(this.form.priceType == 1) { if(this.form.priceType == 1) {
...@@ -680,6 +763,42 @@ export default { ...@@ -680,6 +763,42 @@ export default {
data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList) data.freightPriceStepList = this.getPriceList(this.form.freightPriceStepList)
delete data.fullPriceStepList delete data.fullPriceStepList
} }
}
//海运非阶梯价校验
else{
// 有多个组件则表示清关费 + 运费
if(this.$refs.seaPrice?.length){
let isValid = true
for (let seaPrice of this.$refs.seaPrice){
if(!seaPrice.validate()){
isValid = false
break
}
}
if(!isValid)return
}
// 只有一个海运费组件,全包价
else if(this.$refs.seaPrice && !this.$refs.seaPrice.validate()){
return
}
// 格式化
if(this.form.priceType === 1){
data.fullPricePackagingList = this.getPackingPrice(data.fullPricePackagingList)
delete data.freightPricePackagingList
delete data.clearancePricePackagingList
}else{
data.freightPricePackagingList = this.getPackingPrice(data.freightPricePackagingList)
data.clearancePricePackagingList = this.getPackingPrice(data.clearancePricePackagingList)
delete data.fullPricePackagingList
}
// 删除阶梯价字段
delete data.freightPriceStepList
delete data.fullPriceStepList
delete data.clearancePriceStepList
}
// 设置了有效期,且已过期则给提示 // 设置了有效期,且已过期则给提示
if(this.form.validateEndDate && force !== true){ if(this.form.validateEndDate && force !== true){
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="all" field-prefix="all"
:type="$t('空运')"
:price-name="$t('全包价')" :price-name="$t('全包价')"
:show-add="index === form.fullPriceStepList.length -1 && !readonly" :show-add="index === form.fullPriceStepList.length -1 && !readonly"
:value="item" :value="item"
...@@ -118,6 +119,7 @@ ...@@ -118,6 +119,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="transport" field-prefix="transport"
:type="$t('空运')"
:price-name="$t('运费')" :price-name="$t('运费')"
:show-add="index === form.freightPriceStepList.length -1 && !readonly" :show-add="index === form.freightPriceStepList.length -1 && !readonly"
:value="item" :value="item"
...@@ -136,6 +138,7 @@ ...@@ -136,6 +138,7 @@
:currency-list="currencyList" :currency-list="currencyList"
:unit-list="unitList" :unit-list="unitList"
field-prefix="clearance" field-prefix="clearance"
:type="$t('空运')"
:price-name="$t('清关费')" :price-name="$t('清关费')"
:show-add="index === form.clearancePriceStepList.length -1 && !readonly" :show-add="index === form.clearancePriceStepList.length -1 && !readonly"
:value="item" :value="item"
......
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