Commit c801dd6f authored by dragondean@qq.com's avatar dragondean@qq.com

完善批量加价

parent cb97a97d
......@@ -403,6 +403,12 @@ export default {
id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath
},
// 出货批量加价审核
box_batch_markup:{
component: () => import('@/views/ecw/box/components/batchMakeUpDetail.vue'),
processId: this.processInstance.businessKey,
type: this.processInstance.processDefinition?.formCustomViewPath
}
}
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
return map[this.processInstance.processDefinition.formCustomViewPath.trim()]
......
<!--批量加价-->
<template>
<div class="app-container">
<div class="page-title">批量加价</div>
<div class="page-title">{{$t('批量加价')}}</div>
<div>
运费或全包加价
{{$t('运费或全包加价')}}
<!--货币-->
<selector v-model="form.reduceCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<selector v-model="form.freightCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<!--金额-->
<el-input type="number" v-model="form.cashCondition" @keyup.native="checkPositive(form, 'cashCondition')" class="w-100 ml-10" />
<el-input type="number" v-model="form.freightFee" @keyup.native="checkPositive(form, 'cashCondition')" class="w-100 ml-10" />
<!--单位-->
<selector v-model="form.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<selector v-model="form.freightUnitId" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
</div>
<div class="mt-10">
清关费加价价
{{$t('清关费加价价')}}
<!--货币-->
<selector v-model="form.reduceCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<selector v-model="form.clearanceCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<!--金额-->
<el-input type="number" v-model="form.cashCondition" @keyup.native="checkPositive(form, 'cashCondition')" class="w-100 ml-10" />
<el-input type="number" v-model="form.clearanceFee" @keyup.native="checkPositive(form, 'cashCondition')" class="w-100 ml-10" />
<!--单位-->
<selector v-model="form.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<selector v-model="form.clearanceUnitId" :options="unitList" label-field="titleZh" value-field="id" defaultable class="w-100 ml-10" />
<span>*若线路价格为全包价,输入清关费不生效</span>
</div>
<el-card class="mt-20" v-if="shipmentObj">
......@@ -55,12 +56,12 @@
<el-card class="mt-20">
<div slot="header">
明细
{{$t('明细')}}
</div>
<div>
当前部分
{{$t('当前部分')}}
<el-select :placeholder="$t('请选择')" v-model="sectionId" @change="sectionChange">
<el-option key="0" :label="$t('全部')" value="0"></el-option>
<el-option key="0" :label="$t('全部')" :value="0"></el-option>
<el-option v-for="item in sectionList" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</div>
......@@ -109,11 +110,11 @@
</el-table>
</el-card>
<el-card class="mt-20">
<work-flow xmlkey="todo"></work-flow>
<work-flow xmlkey="shipment_batch_add_price" v-model="form.copyUserId"></work-flow>
</el-card>
<div class="mt-20">
<el-button type="primary" @click="$alert('TODO')">提交审核</el-button>
<el-button type="primary" @click="submit">提交审核</el-button>
<el-button type="primary" @click="$alert('TODO')">审核中</el-button>
<el-button type="default" @click="$alert('TODO')">取消审核</el-button>
</div>
......@@ -128,7 +129,7 @@ import {getChannelList} from "@/api/ecw/channel";
import {getCabinetPage} from "@/api/ecw/cabinet";
import {getWarehouseList} from "@/api/ecw/warehouse";
import {getSupplierPage} from "@/api/ecw/supplier";
import {boxGoodsDetail, getSectionList} from "@/api/ecw/boxSea";
import {boxGoodsDetail, createApproval, getSectionList} from "@/api/ecw/boxSea";
import {getAbnormalList, getbox, getLogList} from "@/api/ecw/box";
import {getTotlContent} from "@/views/ecw/box/shippingSea/utils";
import WorkFlow from "@/components/WorkFlow";
......@@ -140,8 +141,9 @@ export default {
return {
unitList:[],
currencyList:[],
form:{},
orderList:[],
form:{
copyUserId:[]
},
// 表格多选
multipleSelection: [],
// 选择的id
......@@ -158,6 +160,16 @@ export default {
}
},
computed:{
// 订单
orderList(){
let arr = []
this.sectionList.forEach(item => {
if(!this.sectionId || this.sectionId == item.id){
arr = arr.concat(item.orderList)
}
})
return arr
},
/* 渠道 */
getShipChannelName() {
return (shippingChannelId) => {
......@@ -182,14 +194,15 @@ export default {
weight: boxStatistics.weight ?? 0,
});
}
return;
return 0;
};
},
/* 获取仓库 */
getCityName() {
return (id) => {
let arr = this.warehouseList.filter((item) => item.id == id);
return arr.length > 0 ? this.$l(arr[0], "title") : this.$t("");
if(!this.warehouseList || !this.warehouseList.length) return ''
let warehouse = this.warehouseList.find((item) => item.id == id);
return warehouse ? this.$l(warehouse, "title") : this.$t("");
};
},
// 部分信息
......@@ -287,6 +300,23 @@ export default {
this.sectionObj = res.data;
});
},
// 提交审核
submit(){
if(!this.form.freightFee && !this.form.clearanceFee){
return this.$message.error(this.$t('运费和清关费不能同时为空'))
}
let data = {
approvalType: 18, // 批量加价
copyUserId: this.form.copyUserId,
details: JSON.stringify(this.form),
shipmentId: this.shipmentId,
orderIds: this.ids
}
createApproval(data).then(() => {
this.$message.success(this.$t('提交成功'))
this.$store.dispatch('tagsView/delCurrentView')
})
}
}
}
</script>
......
<template>
<div class="app-approvalShipping">
<h1>{{$t('申请信息')}}{{$t('出货信息')}}</h1>
<el-descriptions :column="6" border>
<el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式')">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" />
</el-descriptions-item>
<el-descriptions-item :label="$t('出货渠道')">
{{getShipChannelName(boxBackVO.shippingChannelId)}}
</el-descriptions-item>
<el-descriptions-item :label="$t('柜型')">
{{cabinetLabel}}
</el-descriptions-item>
<el-descriptions-item :label="$t('体积/重量')">
{{getVolumeWeight(loadDetail.totalStatistics)}}
</el-descriptions-item>
<el-descriptions-item :label="$t('货柜状态')">
{{boxBackVO.shipmentStatusText}}
</el-descriptions-item>
</el-descriptions>
<div v-if="approvalInfo.applyReason">
<h1>{{$t('申请原因')}}</h1>
<div>
{{approvalInfo.applyReason}}
</div>
</div>
<el-table :data="loadDetail.sectionOrderList" border class="mt-10">
<el-table-column prop="orderNo" :label="$t('订单号')" align="center">
<template v-slot="{row}">
<el-button type="text" @click="jumpOrderDetail(row)">{{row.orderNo}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('货物信息')" align="center" width="500px">
<template v-slot="{row}">
<section>
<div v-for="(item, index) in row.goodsList" :key="index">
<div>{{index+1}}{{item.prodTitleZh}}</div>
<div>{{index+1}}{{item.prodTitleEn}}</div>
</div>
</section>
</template>
</el-table-column>
<el-table-column :label="$t('收费箱数')" align="center" prop="num"></el-table-column>
<el-table-colume :label="$t('收费体积')" align="center" prop="chargeVolume"></el-table-colume>
<el-table-column :label="$t('收费重量')" align="center" prop="chargeWeight"></el-table-column>
<el-table-column :label="$t('原成交单价')" align="center">
<template>
// TODO
</template>
</el-table-column>
<el-table-column :label="$t('新成交单价')" align="center">
<template>
// TODO
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { approvalDetail } from "@/api/ecw/box";
import { getSeaStatus, getTotlContent } from "../shippingSea/utils";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getChannelList } from "@/api/ecw/channel";
import Decimal from "decimal.js";
import Template from "@/views/cms/template/index.vue";
/**
* 批量加价审核详情
*/
export default {
name: "BatchMakeUpDetail",
components: {Template},
props: {
processId: {
type: [Number, String],
},
type: String,
},
data() {
return {
approvalInfo: {},
boxBackVO: {},
loadDetail: {},
// 柜型
cabinetLabel: "",
//渠道
channelList: [],
// 弹出配置
dialogConfig: {
title: "",
visible: false,
},
srcStrs: [],
};
},
created() {
getChannelList().then((res) => (this.channelList = res.data));
},
methods: {
getTotlContent,
/* 获取详情 */
getApprovalDetail(processId) {
approvalDetail({ approvalId: processId }).then((res) => {
this.approvalInfo = res.data.approvalInfo;
this.boxBackVO = res.data.boxBackVO;
this.loadDetail = res.data.loadDetail;
});
},
/* 获取柜型 */
getCabinetLabel(cabinetId) {
getCabinetPage(null).then((response) => {
const cabinetList = response.data.list;
for (const cabinetItem of cabinetList) {
if (cabinetItem.id == cabinetId) {
this.cabinetLabel = cabinetItem.name;
break;
}
}
});
},
/* 合计 */
calcSum(goodsList) {
let sum = 0;
goodsList.forEach((element) => {
sum = Decimal.add(sum, element.num).toNumber();
});
return sum;
},
/* 跳转订单详情 */
jumpOrderDetail(row) {
this.$router.push("/order/detail?orderId=" + row.orderId);
},
},
watch: {
processId: {
immediate: true,
handler(val) {
this.getApprovalDetail(val);
},
},
boxBackVO(val) {
// 柜型
this.getCabinetLabel(val.cabinetId);
},
},
computed: {
/* 渠道 */
getShipChannelName() {
return (shippingChannelId) => {
for (const channelItem of this.channelList) {
if (channelItem.channelId == shippingChannelId) {
return this.$l(channelItem, "name");
}
}
};
},
/* 体积重量 */
getVolumeWeight() {
return (total) => {
return this.getTotlContent(total);
};
},
/* 是否显示卸柜箱数 */
isShowColumn() {
return (shippingVO) => {
return getSeaStatus(shippingVO) >= 182 ? true : false;
};
},
},
};
</script>
<style lang="scss" scoped>
.el-image {
border-radius: 5px;
background-color: #ebeef5;
box-shadow: 0 0 5px 1px #ccc;
::v-deep .el-image__inner {
transition: all 0.3s;
cursor: pointer;
&:hover {
transform: scale(1.2);
}
}
::v-deep .image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #909399;
font-size: 30px;
}
}
</style>
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