Commit 4b10e7d5 authored by Smile's avatar Smile

需求160 后台-批量费用申请

parent 20b47d3f
...@@ -103,6 +103,14 @@ export function getConsPage(query) { ...@@ -103,6 +103,14 @@ export function getConsPage(query) {
params: query params: query
}) })
} }
// 获得集运包裹列表
export function getConsList(query) {
return request({
url: "/ecw/cons/list",
method: "get",
params: query
})
}
// 导出集运包裹主 Excel // 导出集运包裹主 Excel
export function exportConsExcel(query) { export function exportConsExcel(query) {
......
...@@ -51,6 +51,14 @@ export function createFeeBatchApplication(data) { ...@@ -51,6 +51,14 @@ export function createFeeBatchApplication(data) {
data: data data: data
}) })
} }
// 批量申请批量费用
export function createBatchFeeApplication(data) {
return request({
url: "/ecw/cons-fee/batch/create",
method: "post",
data: data
})
}
// 导出包裹费用 Excel // 导出包裹费用 Excel
export function exportConsFeeExcel(query) { export function exportConsFeeExcel(query) {
......
...@@ -129,6 +129,7 @@ import MergeDetail from "@/views/ecw/order/components/MergeDetail" ...@@ -129,6 +129,7 @@ import MergeDetail from "@/views/ecw/order/components/MergeDetail"
import CargoControlDetail from "@/views/ecw/order/components/CargoControlDetail" import CargoControlDetail from "@/views/ecw/order/components/CargoControlDetail"
import BoxSplitDetail from "@/views/ecw/order/components/BoxSplitDetail" import BoxSplitDetail from "@/views/ecw/order/components/BoxSplitDetail"
import UpdateFeeApproval from "@/views/ecw/cons/components/UpdateFeeApproval" import UpdateFeeApproval from "@/views/ecw/cons/components/UpdateFeeApproval"
import BatchUpdateFeeApproval from "@/views/ecw/cons/components/BatchUpdateFeeApproval"
import retiredWarehouseApproval from "@/views/ecw/cons/retiredWarehouseApproval" import retiredWarehouseApproval from "@/views/ecw/cons/retiredWarehouseApproval"
import consExitApproval from "@/views/ecw/cons/consExitApproval" import consExitApproval from "@/views/ecw/cons/consExitApproval"
...@@ -144,6 +145,7 @@ export default { ...@@ -144,6 +145,7 @@ export default {
MergeDetail, MergeDetail,
CargoControlDetail, CargoControlDetail,
UpdateFeeApproval, UpdateFeeApproval,
BatchUpdateFeeApproval,
retiredWarehouseApproval, retiredWarehouseApproval,
consExitApproval, consExitApproval,
BoxSplitDetail BoxSplitDetail
...@@ -499,6 +501,10 @@ export default { ...@@ -499,6 +501,10 @@ export default {
component: "updateFeeApproval", component: "updateFeeApproval",
id: this.processInstance.id id: this.processInstance.id
}, },
ecw_batch_cons_fee_apply: {
component: "batchUpdateFeeApproval",
id: this.processInstance.id
},
ecw_cons_retired_warehouse: { ecw_cons_retired_warehouse: {
component: "retiredWarehouseApproval", component: "retiredWarehouseApproval",
id: this.processInstance.id id: this.processInstance.id
......
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
" "
> >
<div class="fee-application"> <div class="fee-application">
<h1>{{ $t("费用申请") }}-{{ consDetails.consNum }}</h1> <h1>{{ $t("批量费用申请") }}</h1>
<el-divider></el-divider> <el-divider></el-divider>
<el-form label-width="100px" inline> <el-form label-width="100px" inline>
<el-form-item :label="$t('发货人') + ':'"> <h3>{{$t('包裹信息')}}</h3>
<div class="content"> <el-form-item>
{{ consDetails.consignorVO ? consDetails.consignorVO.name : "" }} <div v-for="item in consDetails" class="content">
{{ item.expressNo}}-{{ item.consNum}}-{{ item.customerNumber}}{{ item.customerName? '-'+item.customerName : ''}}
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
:disabled="!!processInstanceId "
@click="addCost" @click="addCost"
>{{ $t("添加申请") }} >{{ $t("添加申请") }}
</el-button> </el-button>
...@@ -103,20 +103,20 @@ ...@@ -103,20 +103,20 @@
<!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button--> <!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button-->
<el-button <el-button
type="text" type="text"
v-if="scope.row.id && modifable(scope.row)" v-if="scope.row.id"
@click="modify(scope.row)" @click="modify(scope.row)"
>{{ $t("修改") }} >{{ $t("修改") }}
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
v-if="scope.row.editMode&& !processInstanceId" v-if="scope.row.editMode"
@click="del(scope.$index)" @click="del(scope.$index)"
>删除 >删除
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
v-if="scope.row.status === 0&& !processInstanceId" v-if="scope.row.status === 0"
@click="del(scope.$index)" @click="del(scope.$index)"
>删除 >删除
</el-button> </el-button>
...@@ -124,34 +124,17 @@ ...@@ -124,34 +124,17 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="padding: 20px"> <div style="padding: 20px">
<work-flow xmlkey="free_apply" v-model="selectedUsers" /> <work-flow xmlkey="ecw_batch_cons_fee_apply" v-model="selectedUsers" />
</div> </div>
<div style="text-align: center; margin-top: 20px"> <div style="text-align: center; margin-top: 20px">
<el-button <el-button
type="primary" type="primary"
v-if="!processInstanceId"
style="margin-right: 30px" style="margin-right: 30px"
:disabled="!feeList.length && !editMode" :disabled="!feeList.length && !editMode"
@click="submit" @click="submit"
>{{ $t("提交") }} >{{ $t("提交") }}
</el-button </el-button
> >
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="goProcessDetail"
>{{ $t("审核中") }}
</el-button
>
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="cancel"
>{{ $t("取消审核") }}
</el-button
>
<el-button @click="$emit('update:dialogVisible', false)">{{ <el-button @click="$emit('update:dialogVisible', false)">{{
$t("返回") $t("返回")
}} }}
...@@ -170,15 +153,21 @@ import { ...@@ -170,15 +153,21 @@ import {
} from "@/api/ecw/order" } from "@/api/ecw/order"
import { getDictDatas, DICT_TYPE } from "@/utils/dict" import { getDictDatas, DICT_TYPE } from "@/utils/dict"
import workFlow from "@/components/WorkFlow" import workFlow from "@/components/WorkFlow"
import { getCons } from "@/api/ecw/cons" import {getCons, getConsList} from "@/api/ecw/cons"
import { createFeeBatchApplication, getConsFeeList } from "@/api/ecw/consFee" import {createBatchFeeApplication, createFeeBatchApplication, getConsFeeList} from "@/api/ecw/consFee"
import { getConsApprovalList } from "@/api/ecw/consApproval" import { getConsApprovalList } from "@/api/ecw/consApproval"
import {getCostList} from "@/api/ecw/box";
export default { export default {
name: "batchFeeApplication", name: "batchFeeApplication",
components: { workFlow }, components: { workFlow },
props: { props: {
consId: [Number, String], consIds: {
type: Array,
default() {
return []
}
},
dialogVisible: { dialogVisible: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -190,6 +179,7 @@ export default { ...@@ -190,6 +179,7 @@ export default {
consDetails: {}, consDetails: {},
// 费用列表 // 费用列表
list: [], list: [],
historyList:[],
// 审核ID,没有则表示不在审核中 // 审核ID,没有则表示不在审核中
processInstanceId: null, processInstanceId: null,
DICT_TYPE, DICT_TYPE,
...@@ -214,37 +204,25 @@ export default { ...@@ -214,37 +204,25 @@ export default {
editMode() { editMode() {
return !!this.currentItem return !!this.currentItem
}, },
modifable() {
return (item) => {
// 审核中不允许修改
if (this.processInstanceId) return false
// 有未提交的不允许修改
// if (this.feeList.length) return false;
// 修改中的不允许修改
if (item.editMode) return false
return true
}
}
}, },
created() { created() {
this.getDictDatas(this.DICT_TYPE.AUDIT_STATUS).forEach((e) => { this.getDictDatas(this.DICT_TYPE.AUDIT_STATUS).forEach((e) => {
this.STATUS[e.value] = e.label this.STATUS[e.value] = e.label
}) })
getCons(this.consId).then((res) => { getConsList({ids:this.consIds.join(',')}).then((res) => {
this.consDetails = res.data this.consDetails = res.data
}) })
// 查询是否有审核中的费用申请 // 查询是否有审核中的费用申请
getConsApprovalList({consId:this.consId,approvalType: 6,status: 1}).then((res) => { getConsApprovalList({consIds:this.consIds.join(','),approvalType: 6,status: 1}).then((res) => {
if (res.data.length!=0) { if (res.data.length!=0) {
this.processInstanceId = res.data[0].formId this.historyList = JSON.parse(res.data[0].approvalDetail)
this.list = JSON.parse(res.data[0].approvalDetail)
} else { } else {
// 查询历史申请 // 查询历史申请
getConsFeeList({ consId: this.consId }).then((res) => { getConsFeeList({ consId: this.consId }).then((res) => {
console.log("历史申请", res.data) console.log("历史申请", res.data)
this.list = res.data this.historyList = res.data
}) })
} }
}) })
...@@ -263,7 +241,7 @@ export default { ...@@ -263,7 +241,7 @@ export default {
addCost() { addCost() {
console.log("添加费用",this.list) console.log("添加费用",this.list)
this.list.push({ this.list.push({
consId: this.consId, consIds: this.consIds,
feeType: undefined, //费用申请类型 feeType: undefined, //费用申请类型
fee: undefined, //金额 fee: undefined, //金额
feeCurrency: undefined, // 费用申请货币类型 feeCurrency: undefined, // 费用申请货币类型
...@@ -311,10 +289,10 @@ export default { ...@@ -311,10 +289,10 @@ export default {
// }); // });
// } // }
createFeeBatchApplication({ createBatchFeeApplication({
consFeeUpdateReqLists: this.feeList, consFeeForBatchUpdateReqList: this.feeList,
copyUserId: this.selectedUsers, copyUserId: this.selectedUsers,
consId: this.consId consIds: this.consIds
}).then((r) => { }).then((r) => {
if (r.code === 0) { if (r.code === 0) {
this.$emit("update:dialogVisible", false) this.$emit("update:dialogVisible", false)
...@@ -377,7 +355,7 @@ export default { ...@@ -377,7 +355,7 @@ export default {
} }
.content { .content {
width: 200px; width: 250px;
} }
} }
......
<template>
<div>
<div class="title-font">
<label>{{ $t("包裹信息") }}</label>
</div>
<div v-for="item in consDetails" class="content">
{{ item.expressNo}}-{{ item.consNum}}-{{ item.customerNumber}}{{ item.customerName? '-'+item.customerName : ''}}
</div>
<div class="title-font">
<label>{{ $t("申请理由") }}</label>
</div>
<div v-for="(item, index) in list" :key="item.id" style="font-size: 14px;">
{{ index + 1 }}、【
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="item.feeType" />
】,
<dict-tag :type="DICT_TYPE.PAYMENT_TYPE" :value="item.payType" />
{{ item.fee }}{{ currencyList.filter(a => a.id == item.feeCurrency)[0].titleZh }}
{{ $t("备注") }}{{ item.remarks }}
</div>
</div>
</template>
<script>
import { getConsApprovalList } from "@/api/ecw/consApproval"
import { getCurrencyList } from "@/api/ecw/currency"
import {getCons, getConsList} from "@/api/ecw/cons"
import { getWarehouseList } from "@/api/ecw/warehouse"
export default {
name: "batchUpdateFeeApproval",
props: {
id: [String]
},
data() {
return {
list: [],
consIds:[],
currencyList: [],
consDetails:[],
warehouseList:[],
}
},
created() {
getWarehouseList().then((r) => {
this.warehouseList = r.data;
});
getCurrencyList().then((res) => (this.currencyList = res.data))
if (this.id) {
getConsApprovalList({ formId: this.id }).then((res) => {
if (res.data.length != 0) {
this.list = JSON.parse(res.data[0].approvalDetail).consFeeUpdateReqLists
this.consIds = JSON.parse(res.data[0].approvalDetail).consIds
getConsList({ids:this.consIds.join(',')}).then(res => {
this.consDetails = res.data
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.title {
padding: 10px 0;
span {
font-size: 14px;
font-weight: bold;
}
}
.bold {
font-weight: bold;
}
.title-font {
font-size: 16px;
font-weight: 600;
margin-top: 10px;
margin-bottom: 10px;
}
</style>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleTransfer">转运</el-button> <el-button type="success" plain icon="el-icon-plus" size="mini" @click="handleTransfer">转运</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-plus" size="mini">批量申请费用</el-button> <el-button type="success" plain icon="el-icon-plus" @click="handleBatchApplyCost" size="mini">批量申请费用</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -560,8 +560,8 @@ ...@@ -560,8 +560,8 @@
:consId="id"></SpecialNeedsConsLook> :consId="id"></SpecialNeedsConsLook>
<fee-application-cons v-if="feeApplicationBol" :consId="id" :currencys="JSON.stringify(currencyList)" <fee-application-cons v-if="feeApplicationBol" :consId="id" :currencys="JSON.stringify(currencyList)"
:dialog-visible.sync="feeApplicationBol " @refresh="getList"></fee-application-cons> :dialog-visible.sync="feeApplicationBol " @refresh="getList"></fee-application-cons>
<batch-fee-application-cons v-if="feeApplicationBol" :consId="id" :currencys="JSON.stringify(currencyList)" <batch-fee-application-cons v-if="batchFeeApplicationBol" :consIds="consIds" :currencys="JSON.stringify(currencyList)"
:dialog-visible.sync="feeApplicationBol " @refresh="getList"></batch-fee-application-cons> :dialog-visible.sync="batchFeeApplicationBol " @refresh="getList"></batch-fee-application-cons>
<ConsFollowupEdit :showConsFollowupEdit.sync="showConsFollowupEdit" :consId="id" <ConsFollowupEdit :showConsFollowupEdit.sync="showConsFollowupEdit" :consId="id"
@determine="getList"></ConsFollowupEdit> @determine="getList"></ConsFollowupEdit>
<batch-sign-off :showConsBatchSignOff.sync="showConsBatchSignOff" @determine="getList" <batch-sign-off :showConsBatchSignOff.sync="showConsBatchSignOff" @determine="getList"
...@@ -720,6 +720,7 @@ export default { ...@@ -720,6 +720,7 @@ export default {
currencyList: [], currencyList: [],
consNum: null, consNum: null,
feeApplicationBol: false, feeApplicationBol: false,
batchFeeApplicationBol: false,
mvShow:false, mvShow:false,
mediaUrl:null mediaUrl:null
}; };
...@@ -1011,6 +1012,23 @@ export default { ...@@ -1011,6 +1012,23 @@ export default {
this.showConsBatchEdit = true; this.showConsBatchEdit = true;
}, },
handleBatchApplyCost(){
if (!this.consIds.length) {
return this.$message.error(this.$t('最少选择一个包裹'))
}
// 查找第一个不符合条件的包裹
const invalidItem = this.consList.find(item =>
// 条件逻辑:允许转运的条件(取反后检测非法项)
!(item.status === 1 && !item.hasReturnStatus && !item.hasExitApproval && !item.hasAddApproval)
);
if (invalidItem) {
return this.$message.error(
this.$t('{consNum}不允许申请,请检查!', { consNum: invalidItem.consNum })
);
}
this.batchFeeApplicationBol = true;
},
handleTransfer() { handleTransfer() {
if (!this.consIds.length) { if (!this.consIds.length) {
return this.$message.error(this.$t('最少选择一个包裹')) return this.$message.error(this.$t('最少选择一个包裹'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment