Commit 7dae4275 authored by dragondean@qq.com's avatar dragondean@qq.com

批量费用申请和审核

parent 6d2fc9c9
......@@ -87,6 +87,44 @@ export function feeApplicationListByOrderId(query){
data:data,
})
}
// 批量申请费用
export function feeApplicationCreateBatch(data){
return request({
url:'order/fee-application/create/batch',
method:'post',
data:data,
})
}
// 根据订单ID获取是否有正在申请的费用申请
export function getFeeApplicationApproveByOrderId(orderId){
return request({
url:'/order/fee-application/get/isApprove',
method:'get',
params: {id: orderId}
})
}
// 根据流程主键ID得到批量申请费用
export function getBatchFeeByBusinessId(businessId){
return request({
url:'/order/fee-application/getBatchFeeByBusinessId',
method:'get',
params: {businessId}
})
}
// 查询批量申请费用
export function feeApplicationGetBatch(params){
return request({
url:'/order/fee-application/get/batch',
method:'get',
params
})
}
//费用申请修改
export function applicationUpdate(data){
return request({
......
......@@ -181,11 +181,18 @@ export default {
id: this.processInstance.businessKey,
type: 2
},
// 原来的费用申请
free_apply: {
component: "warehouseDetails",
processId: this.processInstance.businessKey,
type: 2
},
// 2.0空运加的批量申请
batch_free_apply: {
component: () => import('@/views/ecw/order/components/BatchFeeApplication'),
businessId: this.processInstance.businessKey,
processInstanceId: this.$route.query.id
},
retired_warehouse: {
component: "warehouseDetails",
processId: this.processInstance.businessKey,
......
<template>
<div>
<h1>{{ $t('申请信息【订单信息】') }}</h1>
<el-descriptions :column="4" border>
<el-descriptions-item :label="$t('订单号')">{{ order.orderNo }}</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式')">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId"></dict-tag>
</el-descriptions-item>
<el-descriptions-item :label="$t('出货方式')">
{{ order.channelName }}
</el-descriptions-item>
<el-descriptions-item :label="$t('订单状态')">
{{ order.statusMsg }}
</el-descriptions-item>
<el-descriptions-item :label="$t('唛头')">
{{ order.marks }}
</el-descriptions-item>
<el-descriptions-item :label="$t('始发仓')">{{ order.logisticsInfoDto.startTitleZh }}</el-descriptions-item>
<el-descriptions-item :label="$t('目的仓')">{{ order.logisticsInfoDto.destTitleZh }}</el-descriptions-item>
</el-descriptions>
<div style="font-size: 14px">
<p>{{ $t('申请理由') }}</p>
<div v-for="(item, index) in feeList" :key="item.id">
{{index + 1}}、【<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="item.feeType" />】,
<dict-tag :value="item.payType" :type="DICT_TYPE.PAYMENT_TYPE" ></dict-tag>
{{ item.applicationFee }}{{ currencyName(item.applicationFeeCurrency) }}
{{$t('备注')}}{{ item.remarks || $t('')}}
</div>
</div>
</div>
</template>
<script>
import {
warehouseApprovalGetByFormId,
warehouseApprovalGetById,
warehouseAreaPositionList
} from "@/api/ecw/batchSingleApplication";
import {
applicationGetOrderByProcessId,
feeApplicationGet, feeApplicationGetBatch, getBatchFeeByBusinessId, getBatchFeeByProcessId,
getOrder,
getOrderPage,
getWarehouseUpdateApprovalInfo, qetBatchFeeByBusinessId
} from '@/api/ecw/order'
import { getChannelList } from '@/api/ecw/channel';
import Template from "@/views/cms/template";
import {getSupplierPage} from "@/api/ecw/supplier";
import { DICT_TYPE } from "@/utils/dict";
import { getCurrencyList } from "@/api/ecw/currency";
import {arrryToKeyedObjectBy} from '@/utils/index'
export default {
components: {Template},
props:{
businessId: [Number, String],
processInstanceId: String
},
name: "BatchFeeApplicationDetail",
data(){
return{
order: null,
feeList: [],
currencyList:[]
}
},
computed:{
currencyMap(){
return arrryToKeyedObjectBy(this.currencyList, 'id')
},
currencyName(){
return id => {
let obj = this.currencyMap[id]
if(obj) return this.$l(obj, 'title')
return this.$t('未知')
}
}
},
created() {
getCurrencyList().then(res => {
this.currencyList = res.data
})
getBatchFeeByBusinessId(this.businessId).then(res => {
console.log({res})
this.feeList = res.data
return getOrder(res.data[0].orderId)
}).then(res => {
this.order = res.data
})
},
methods:{
}
}
</script>
......@@ -12,35 +12,35 @@
</div></el-form-item>
<el-form-item :label="$t('发货人')+':'"><div class="content">{{orderDetails.consignorVO ? orderDetails.consignorVO.name :''}}</div></el-form-item>
<el-form-item :label="$t('唛头')"><div class="content">{{orderDetails.marks}}</div></el-form-item>
<el-form-item> <el-button @click="addCost">{{$t('添加申请')}}</el-button></el-form-item>
<el-form-item> <el-button :disabled="!!processInstanceId" @click="addCost">{{$t('添加申请')}}</el-button></el-form-item>
</el-form>
<el-table :data="list">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('费用类型')">
<template v-slot:default = "scope">
<dict-selector :disabled="isModify[forbidden(scope.row)]" :type="DICT_TYPE.FEE_TYPE" v-model="scope.row.feeType" />
<dict-selector :disabled="!!processInstanceId" :type="DICT_TYPE.FEE_TYPE" v-model="scope.row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('金额')">
<template v-slot:default = 'scope'>
<el-input :disabled="isModify[forbidden(scope.row)]" v-model.number="scope.row.applicationFee" ></el-input>
<el-input :disabled="!!processInstanceId" v-model.number="scope.row.applicationFee" ></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货币类型')">
<template v-slot:default = 'scope'>
<el-select :disabled="isModify[forbidden(scope.row)]" v-model="scope.row.applicationFeeCurrency">
<el-select :disabled="!!processInstanceId" v-model="scope.row.applicationFeeCurrency">
<el-option v-for="item in JSON.parse(currencys)" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('付款类型')">
<template v-slot = {row}>
<dict-selector :disabled="isModify[forbidden(row)]" :type="DICT_TYPE.PAYMENT_TYPE" v-model="row.payType" />
<dict-selector :disabled="!!processInstanceId" :type="DICT_TYPE.PAYMENT_TYPE" v-model="row.payType" />
</template>
</el-table-column>
<el-table-column :label="$t('备注')">
<template v-slot:default="scope">
<el-input :disabled="isModify[forbidden(scope.row)]" v-model="scope.row.remarks" type="textarea"></el-input>
<el-input :disabled="!!processInstanceId" v-model="scope.row.remarks" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('确认收款')">
......@@ -55,9 +55,10 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot:default = 'scope'>
<el-button type="text" v-if="scope.row.status !== 0&&scope.row.status !== 1">{{STATUS[scope.row.status]}}</el-button>
<!--<el-button type="text" v-if="scope.row.status !== 0&&scope.row.status !== 1">{{STATUS[scope.row.status]}}</el-button>
<el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button>
<el-button type="text" v-if="scope.row.status === 2" @click="modify(scope.row)">{{$t('修改')}}</el-button>
<el-button type="text" v-if="scope.row.status === 2" @click="modify(scope.row)">{{$t('修改')}}</el-button>-->
<el-button type="text" :disabled="!!processInstanceId" @click="del(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -65,9 +66,9 @@
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
</div>
<div style="text-align: center;margin-top: 20px;">
<el-button v-if="!IsExamine" style="margin-right: 30px;" @click="submit">{{$t('提交')}}</el-button>
<el-button v-if="IsExamine" style="margin-right: 30px;" @click="examineFn">{{$t('审核中')}}</el-button>
<el-button v-if="IsExamine" style="margin-right: 30px;" @click="cancel">{{$t('取消审核')}}</el-button>
<el-button type="primary" v-if="!processInstanceId" style="margin-right: 30px;" @click="submit">{{$t('提交')}}</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)">{{$t('返回')}}</el-button>
</div>
</div>
......@@ -78,10 +79,14 @@
<script>
import {
getOrder,
feeApplicationCreate,
feeApplicationCreateBatch,
ApplicationListByOrderId,
applicationUpdate,
feeApplicationListByOrderId, feeApplicationCancel
feeApplicationListByOrderId,
feeApplicationCancel,
getFeeApplicationApproveByOrderId,
getBatchFeeByProcessId,
qetBatchFeeByBusinessId, getBatchFeeByBusinessId
} from "@/api/ecw/order";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import Template from "@/views/cms/template";
......@@ -100,7 +105,11 @@ export default {
data(){
return {
orderDetails:{},
// 费用列表
list:[],
// 审核ID,没有则表示不在审核中
processInstanceId: null,
DICT_TYPE,
getDictDatas,
STATUS:{},
......@@ -114,24 +123,28 @@ export default {
this.STATUS[e.value] = e.label
})
},
computed:{
forbidden(){
return (row)=>{
return this.list.findIndex(e => e.id === row.id)
}
},
IsExamine(){
return this.list.some(e => e.status === 1)
getOrder(this.orderId).then(res => {
this.orderDetails = res.data
})
// 查询是否有审核中的费用申请
getFeeApplicationApproveByOrderId(this.orderId).then(res => {
if(res.data.formId){
this.processInstanceId = res.data.formId
getBatchFeeByBusinessId(res.data.orderApprovalId).then(res => {
this.list = res.data
})
}
})
},
methods:{
del(index){
this.$confirm(this.$t("确定要删除此条费用申请么?")).then(() => {
this.list.splice(index, 1)
})
},
addCost(){
if(this.list.some(e => e.status === 0 || e.status === 1)){
return this.$message.success(this.$t('当前有申请费用为审核中或未提交,请审核后在申请'));
}
this.list.push(
{
this.list.push({
orderId:this.orderId,
feeType:undefined,//费用申请类型
applicationFee:undefined,//金额
......@@ -140,54 +153,24 @@ export default {
receiveFlag:0,
applicationAuthor:undefined,
status:0,
}
)
this.isModify.push(false)
this.isModifyIf = false;
})
},
submit(){
if(this.isModifyIf){
applicationUpdate({...this.list[this.isModify.findIndex(e => e === false)],status:1}).then(r => {
if(r.code === 0){
this.$emit('update:dialogVisible',false)
this.$message.success(this.$t('修改成功'));
}
})
}else {
if(this.list[this.list.length - 1].status === 0){
feeApplicationCreate( {...this.list[this.list.length - 1],status:1,copyUserId:this.selectedUsers}).then(r=>{
feeApplicationCreateBatch( {
orderFeeApplicationCreateReqVOList: this.list,
copyUserId:this.selectedUsers,
orderId: this.orderId
}).then(r=>{
if(r.code === 0){
this.$emit('update:dialogVisible',false)
this.$message.success(this.$t('添加成功'));
this.selectedUsers = [];
}
})
}else {
this.$message.success(this.$t('当前有申请费用为审核中或未提交,请审核后在申请'));
}
}
},
getOrderList(){
ApplicationListByOrderId({orderId: this.orderId}).then(r => {
if(r.code === 0){
this.list = r.data;
this.list.forEach(()=>this.isModify.push(true))
let p = this.list.find(e => e.status === 1)
}
})
},
modify(row){
if(this.list.some(i => i.status === 0 || i.status === 1))return this.$message.warning(this.$t('当前有未提交的数据或审核中的数据不能修改'))
this.isModifyIf = true;
this.isModify.forEach((item,index)=>{
this.$set(this.isModify, index, true )
})
this.$set(this.isModify, this.list.findIndex(e => e.id === row.id), false )
},
examineFn(){
let item = this.list.find(e => e.status === 1);
console.log(item)
this.$router.push({path:'/bpm/process-instance/detail',query:{id:item.bpmProcessId}})
goProcessDetail(){
this.$emit('update:dialogVisible',false)
this.$router.push('/bpm/process-instance/detail?id=' + this.processInstanceId)
},
cancel(){
this.$prompt(this.$t('请输入取消原因'), this.$t('提示'), {
......@@ -195,7 +178,7 @@ export default {
cancelButtonText: this.$t('取消'),
}).then(({ value }) => {
let item = this.list.find(e => e.status === 1);
feeApplicationCancel({huifu:value,bpmProcessId:item.bpmProcessId}).then(r => {
feeApplicationCancel({huifu:value,bpmProcessId: this.processInstanceId}).then(r => {
this.$message({
type: 'success',
message:this.$t('取消成功')
......
......@@ -4,7 +4,11 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item :label="$t('编号')" prop="orderNo">
<el-input v-model="queryParams.numberKey" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="noParam.value" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_NO_FIELD" defaultable v-model="noParam.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<!-- <el-form-item :label="$t('唛头')" prop="marks">
<el-input v-model="queryParams.marks" :placeholder="$t('唛头')" clearable @keyup.enter.native="handleQuery" />
......@@ -54,7 +58,11 @@
</el-form-item> -->
<el-form-item :label="$t('商品')" prop="tidanNo">
<el-input v-model="queryParams.prodKey" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery">
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_PROD_FIELD" defaultable v-model="prodParam.key" class="w-50" />
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl">
......@@ -112,6 +120,10 @@
<el-option :label="$t('海外仓')" :value="2"></el-option>
</el-select>
</el-form-item>
<!--空运多一个出货渠道筛选-->
<el-form-item :label="$t('出货渠道')" prop="channelId" v-if="channelList.length">
<selector :options="channelList" :label-field="$l('name')" value-field="channelId" v-model="queryParams.channelId"></selector>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" :loading="loading">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -120,7 +132,7 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-col :span="1.5" v-if="transportId">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:order:create']">{{$t('新增')}}</el-button>
</el-col>
......@@ -326,6 +338,9 @@
<template v-if="scope.row.parentOrderId && scope.row.status < 11">
<el-dropdown-item @click.native="splitRevoke(scope.row)" v-hasPermi="['ecw:order:split_revoke']">{{$t('撤销拆单')}}</el-dropdown-item>
</template>
<template v-if="scope.row.parentOrderId">
<el-dropdown-item @click.native="$router.push('./detail?orderId=' + scope.row.parentOrderId)">{{$t('查看母订单')}}</el-dropdown-item>
</template>
<!-- 合单日志,提货日志 -->
......@@ -461,8 +476,8 @@
<print-lading-bill v-if="printLadingBillOrderId !== null" :order-id="printLadingBillOrderId" @close="printLadingBillOrderId=null" />
<batch-pickup v-if="showBatchPickup" @close="onBatchClose" @success="onBatchClose"/>
<withdrawal v-if="show" :dialog-visible="show" :orderId="orderId" ></withdrawal>
<batch-single-application :order-list="orderId" :dialog-visible.sync="warehouseBol"></batch-single-application>
<fee-application :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
<batch-single-application @getList="getList" :order-list="orderId" :dialog-visible.sync="warehouseBol"></batch-single-application>
<fee-application v-if="feeApplicationBol" :order-id="orderId" :currencys="JSON.stringify(currencyList)" :dialog-visible.sync="feeApplicationBol"></fee-application>
<merge-log :order-no="showMergedLogOrderNo" v-if="showMergedLogOrderNo !== null" @close="showMergedLogOrderNo=null" />
<pickup-log v-if="showPickupLogOrderNo" :order-no="showPickupLogOrderNo" @close="showPickupLogOrderNo=null" @delete="getList" />
<SplitRevoke v-if="splitRevokeOrderId" :order-id="splitRevokeOrderId" @close="splitRevokeOrderId=null;getList()"></SplitRevoke>
......@@ -500,7 +515,7 @@ import {
exportCustomsDatas,
exportShippingDatas,
exportShipFee,
exportUnload, splitCancelApply, orderSplitRevoke
exportUnload, splitCancelApply, orderSplitRevoke, setCanShipment
} from "@/api/ecw/order";
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
import PrintTag from './components/PrintTag'
......@@ -591,6 +606,18 @@ export default {
statistics: null ,// 统计数据
splitRevokeOrderId: null, // 撤销拆单的订单ID
// 渠道列表,空运需要渠道筛选
channelList:[],
// 编号搜索条件
noParam: {
key: 'numberKey',
value: ''
},
// 商品搜索条件
prodParam: {
key: 'prodKey',
value: ''
}
};
},
watch:{
......@@ -637,11 +664,17 @@ export default {
if(this.transportId){
queryParams.transportId = this.transportId
}
if(this.noParam.value){
queryParams[this.noParam.key] = this.noParam.value
}
if(this.prodParam.value){
queryParams[this.prodParam.key] = this.prodParam.value
}
return queryParams
},
batchWarehouseAdjustment(){
/*batchWarehouseAdjustment(){
return this.multipleSelection.length > 0 && this.multipleSelection.every(e => e.status === 5)
},
},*/
include(){
return (state, arr) => {
return arr.indexOf(state) > -1
......@@ -822,16 +855,22 @@ export default {
page: 1,
rows: 10
}
this.noParam.value = ''
this.prodParam.value = ''
this.dateFilter = []
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('create')
this.$router.push('create?transportType=' + this.transportId)
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push('edit?id=' + row.orderId)
/** 修改按钮操作, updateChannel表示变更出货渠道 */
handleUpdate(row, updateChannel = false) {
let url = 'edit?id=' + row.orderId
if(updateChannel){
url += "&updateChannel=1"
}
this.$router.push(url)
},
/** 导出按钮操作 */
......
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