Commit 4d693a36 authored by lanbaoming's avatar lanbaoming

2024-05-21 提交

parent b5935f6b
...@@ -40,6 +40,24 @@ export function approveTask(data) { ...@@ -40,6 +40,24 @@ export function approveTask(data) {
}) })
} }
//lanbm 2024-05-20 add
export function approveTask2(data) {
return request({
url: '/bpm/task/approve2',
method: 'PUT',
data: data
})
}
//lanbm 2024-05-20 add
export function rejectTask2(data) {
return request({
url: '/bpm/task/reject2',
method: 'PUT',
data: data
})
}
export function rejectTask(data) { export function rejectTask(data) {
return request({ return request({
url: '/bpm/task/reject', url: '/bpm/task/reject',
......
import request from '@/utils/request'
//2024-05-18
export function getPageList(query) {
return request({
url: '/ecw/BankReceiptDetails/list',
method: 'get',
params: query
})
}
//测试功能使用的接口 lanbm 2024-05-20 add
export function test(query) {
return request({
//url: '/my/test/1',
url:"/ecw/BankReceiptDetails/test",
method: 'get',
params: query
})
}
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 审批信息 --> <!-- 审批信息 -->
<el-card class="box-card" v-loading="processInstanceLoading" v-for="(item, index) in runningTasks" :key="index"> <el-card
class="box-card"
v-loading="processInstanceLoading"
v-for="(item, index) in runningTasks"
:key="index"
>
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="el-icon-picture-outline">{{$t('审批任务')}}{{ item.name }}</span> <span class="el-icon-picture-outline"
>{{ $t("审批任务") }}{{ item.name }}</span
>
</div> </div>
<el-col :span="16" :offset="6"> <el-col :span="16" :offset="6">
<el-form :ref="'form' + index" :model="auditForms[index]" :rules="auditRule" label-width="100px"> <el-form
<el-form-item :label="$t('流程名')" v-if="processInstance && processInstance.name"> :ref="'form' + index"
:model="auditForms[index]"
:rules="auditRule"
label-width="100px"
>
<el-form-item
:label="$t('流程名')"
v-if="processInstance && processInstance.name"
>
{{ processInstance.name }} {{ processInstance.name }}
</el-form-item> </el-form-item>
<el-form-item :label="$t('流程发起人')" v-if="processInstance && processInstance.startUser"> <el-form-item
:label="$t('流程发起人')"
v-if="processInstance && processInstance.startUser"
>
{{ processInstance.startUser.nickname }} {{ processInstance.startUser.nickname }}
<el-tag type="info" size="mini">{{ processInstance.startUser.deptName }}</el-tag> <el-tag type="info" size="mini">{{
processInstance.startUser.deptName
}}</el-tag>
</el-form-item> </el-form-item>
<el-form-item :label="$t('抄送人')" prop="copyUserIds"> <el-form-item :label="$t('抄送人')" prop="copyUserIds">
<el-select v-model="auditForms[index].copyUserIds" clearable multiple filterable style="width: 100%"> <el-select
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname" v-model="auditForms[index].copyUserIds"
:value="parseInt(item.id)"/> clearable
multiple
filterable
style="width: 100%"
>
<el-option
v-for="item in userOptions"
:key="parseInt(item.id)"
:label="item.nickname"
:value="parseInt(item.id)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('审批建议')" prop="comment"> <el-form-item :label="$t('审批建议')" prop="comment">
<el-input type="textarea" v-model="auditForms[index].comment" :placeholder="$t('请输入审批建议')"/> <el-input
type="textarea"
v-model="auditForms[index].comment"
:placeholder="$t('请输入审批建议')"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px;"> <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
<el-button :loading="loading" icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(item, true)">{{$t('通过')}} <el-button
:loading="loading"
icon="el-icon-edit-outline"
type="success"
size="mini"
@click="handleAudit(item, true)"
>{{ $t("通过") }}
</el-button> </el-button>
<el-button :loading="loading" icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(item, false)">{{$t('不通过')}} <el-button
:loading="loading"
icon="el-icon-circle-close"
type="danger"
size="mini"
@click="handleAudit(item, false)"
>{{ $t("不通过") }}
</el-button> </el-button>
<el-button :loading="loading" icon="el-icon-edit-outline" type="primary" size="mini" @click="handleUpdateAssignee(item)">{{$t('转办')}} <el-button
:loading="loading"
icon="el-icon-edit-outline"
type="primary"
size="mini"
@click="handleUpdateAssignee(item)"
>{{ $t("转办") }}
</el-button> </el-button>
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate(item)">{{ $t('委派') }}</el-button>--> <!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate(item)">{{ $t('委派') }}</el-button>-->
<!-- <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleBack(item)">{{ $t('退回') }}</el-button>--> <!-- <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleBack(item)">{{ $t('退回') }}</el-button>-->
</div> </div>
</el-col> </el-col>
</el-card> </el-card>
<!-- 申请信息 --> <!-- 申请信息 -->
<el-card class="box-card mt-10" v-loading="processInstanceLoading"> <el-card class="box-card mt-10" v-loading="processInstanceLoading">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="el-icon-document">{{$t('申请信息')}}{{ processInstance.name }}</span> <span class="el-icon-document"
>{{ $t("申请信息") }}{{ processInstance.name }}</span
>
</div> </div>
<el-col v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 10" <el-col
:span="16" :offset="6"> v-if="
this.processInstance.processDefinition &&
this.processInstance.processDefinition.formType === 10
"
:span="16"
:offset="6"
>
<div> <div>
<parser :key="new Date().getTime()" :form-conf="detailForm" @submit="submitForm"/> <parser
:key="new Date().getTime()"
:form-conf="detailForm"
@submit="submitForm"
/>
</div> </div>
</el-col> </el-col>
<div v-if="this.processInstance.processDefinition && this.processInstance.processDefinition.formType === 20"> <div
<component v-if="businessKeyToComponent" :is="businessKeyToComponent.component" v-bind="businessKeyToComponent" /> v-if="
this.processInstance.processDefinition &&
this.processInstance.processDefinition.formType === 20
"
>
<component
v-if="businessKeyToComponent"
:is="businessKeyToComponent.component"
v-bind="businessKeyToComponent"
/>
<div v-else> <div v-else>
<router-link :to="this.processInstance.processDefinition.formCustomViewPath + '?id=' <router-link
+ this.processInstance.businessKey"> :to="
<el-button type="primary">{{$t('点击查看')}}</el-button> this.processInstance.processDefinition.formCustomViewPath +
'?id=' +
this.processInstance.businessKey
"
>
<el-button type="primary">{{ $t("点击查看") }}</el-button>
</router-link> </router-link>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card class="box-card mt-10" v-loading="tasksLoad"> <el-card class="box-card mt-10" v-loading="tasksLoad">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="el-icon-picture-outline">{{$t('审批记录')}}</span> <span class="el-icon-picture-outline">{{ $t("审批记录") }}</span>
</div> </div>
<el-col :span="16" :offset="4"> <el-col :span="16" :offset="4">
<div class="block"> <div class="block">
<el-timeline> <el-timeline>
<el-timeline-item v-for="(item, index) in tasks" :key="index" <el-timeline-item
:icon="getTimelineItemIcon(item)" :type="getTimelineItemType(item)"> v-for="(item, index) in tasks"
<p style="font-weight: 700">{{$t('任务')}}{{ item.name }}</p> :key="index"
:icon="getTimelineItemIcon(item)"
:type="getTimelineItemType(item)"
>
<p style="font-weight: 700">{{ $t("任务") }}{{ item.name }}</p>
<el-card :body-style="{ padding: '10px' }"> <el-card :body-style="{ padding: '10px' }">
<label v-if="item.assigneeUser" style="font-weight: normal; margin-right: 30px;"> <label
{{$t('审批人')}}{{ item.assigneeUser.nickname }} v-if="item.assigneeUser"
<el-tag type="info" size="mini">{{ item.assigneeUser.deptName }}</el-tag> style="font-weight: normal; margin-right: 30px"
>
{{ $t("审批人") }}{{ item.assigneeUser.nickname }}
<el-tag type="info" size="mini">{{
item.assigneeUser.deptName
}}</el-tag>
</label> </label>
<label style="font-weight: normal">{{$t('创建时间')}}</label> <label style="font-weight: normal"
<label style="color:#8a909c; font-weight: normal">{{ parseTime(item.createTime) }}</label> >{{ $t("创建时间") }}</label
<label v-if="item.endTime" style="margin-left: 30px;font-weight: normal">{{$t('审批时间')}}</label> >
<label v-if="item.endTime" style="color:#8a909c;font-weight: normal"> {{ <label style="color: #8a909c; font-weight: normal">{{
parseTime(item.endTime) parseTime(item.createTime)
}}</label> }}</label>
<label v-if="item.durationInMillis" style="margin-left: 30px;font-weight: normal">{{$t('耗时')}}</label> <label
<label v-if="item.durationInMillis" style="color:#8a909c;font-weight: normal"> v-if="item.endTime"
{{ getDateStar(item.durationInMillis) }} </label> style="margin-left: 30px; font-weight: normal"
>{{ $t("审批时间") }}</label
>
<label
v-if="item.endTime"
style="color: #8a909c; font-weight: normal"
>
{{ parseTime(item.endTime) }}</label
>
<label
v-if="item.durationInMillis"
style="margin-left: 30px; font-weight: normal"
>{{ $t("耗时") }}</label
>
<label
v-if="item.durationInMillis"
style="color: #8a909c; font-weight: normal"
>
{{ getDateStar(item.durationInMillis) }}
</label>
<p v-if="item.comment"> <p v-if="item.comment">
<el-tag :type="getTimelineItemType(item)">{{ item.comment }}</el-tag> <el-tag :type="getTimelineItemType(item)">{{
item.comment
}}</el-tag>
</p> </p>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
...@@ -96,48 +203,84 @@ ...@@ -96,48 +203,84 @@
<!-- 高亮流程图 --> <!-- 高亮流程图 -->
<el-card class="box-card mt-10" v-loading="processInstanceLoading"> <el-card class="box-card mt-10" v-loading="processInstanceLoading">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="el-icon-picture-outline">{{$t('流程图')}}</span> <span class="el-icon-picture-outline">{{ $t("流程图") }}</span>
</div> </div>
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" :activityData="activityList" <my-process-viewer
:processInstanceData="processInstance" :taskData="tasks"/> key="designer"
v-model="bpmnXML"
v-bind="bpmnControlForm"
:activityData="activityList"
:processInstanceData="processInstance"
:taskData="tasks"
/>
</el-card> </el-card>
<!-- 对话框(转派审批人) --> <!-- 对话框(转派审批人) -->
<el-dialog :title="$t('转派审批人')" :visible.sync="updateAssignee.open" width="500px" append-to-body> <el-dialog
<el-form ref="updateAssigneeForm" :model="updateAssignee.form" :rules="updateAssignee.rules" label-width="110px"> :title="$t('转派审批人')"
:visible.sync="updateAssignee.open"
width="500px"
append-to-body
>
<el-form
ref="updateAssigneeForm"
:model="updateAssignee.form"
:rules="updateAssignee.rules"
label-width="110px"
>
<el-form-item :label="$t('新审批人')" prop="assigneeUserId"> <el-form-item :label="$t('新审批人')" prop="assigneeUserId">
<el-select v-model="updateAssignee.form.assigneeUserId" clearable style="width: 100%"> <el-select
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname" v-model="updateAssignee.form.assigneeUserId"
:value="parseInt(item.id)"/> clearable
style="width: 100%"
>
<el-option
v-for="item in userOptions"
:key="parseInt(item.id)"
:label="item.nickname"
:value="parseInt(item.id)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitUpdateAssigneeForm">{{$t('确定')}}</el-button> <el-button type="primary" @click="submitUpdateAssigneeForm">{{
<el-button @click="cancelUpdateAssigneeForm">{{$t('取消')}}</el-button> $t("确定")
}}</el-button>
<el-button @click="cancelUpdateAssigneeForm">{{
$t("取消")
}}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {getProcessDefinitionBpmnXML} from "@/api/bpm/definition"; import { getProcessDefinitionBpmnXML } from "@/api/bpm/definition";
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import { DICT_TYPE, getDictDatas } from "@/utils/dict";
import store from "@/store"; import store from "@/store";
import {decodeFields} from "@/utils/formGenerator"; import { decodeFields } from "@/utils/formGenerator";
import Parser from '@/components/parser/Parser' import Parser from "@/components/parser/Parser";
import {createProcessInstance, getProcessInstance} from "@/api/bpm/processInstance"; import {
import {approveTask, getTaskListByProcessInstanceId, rejectTask, updateTaskAssignee} from "@/api/bpm/task"; createProcessInstance,
import {getDate} from "@/utils/dateUtils"; getProcessInstance,
import {listSimpleUsers} from "@/api/system/user"; } from "@/api/bpm/processInstance";
import {getActivityList} from "@/api/bpm/activity"; import {
import OfferSpecialDetail from "@/views/ecw/offer/components/SpecialDetail" approveTask,
getTaskListByProcessInstanceId,
rejectTask,
updateTaskAssignee,
} from "@/api/bpm/task";
import { getDate } from "@/utils/dateUtils";
import { listSimpleUsers } from "@/api/system/user";
import { getActivityList } from "@/api/bpm/activity";
import OfferSpecialDetail from "@/views/ecw/offer/components/SpecialDetail";
import warehouseDetails from "@/views/ecw/order/components/warehouseDetails"; import warehouseDetails from "@/views/ecw/order/components/warehouseDetails";
import shippingDetail from '@/views/ecw/box/shippingDetail' import shippingDetail from "@/views/ecw/box/shippingDetail";
import SplitDetail from '@/views/ecw/order/components/SplitDetail' import SplitDetail from "@/views/ecw/order/components/SplitDetail";
import MergeDetail from '@/views/ecw/order/components/MergeDetail' 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";
// 流程实例的详情页,可用于审批 // 流程实例的详情页,可用于审批
export default { export default {
name: "ProcessInstanceDetail", name: "ProcessInstanceDetail",
...@@ -149,64 +292,68 @@ export default { ...@@ -149,64 +292,68 @@ export default {
SplitDetail, SplitDetail,
MergeDetail, MergeDetail,
CargoControlDetail, CargoControlDetail,
BoxSplitDetail BoxSplitDetail,
}, },
computed:{ computed: {
matterNum(){ matterNum() {
return this.$store.state.user.matterNum return this.$store.state.user.matterNum;
}, },
businessKeyToComponent(){ businessKeyToComponent() {
if(!this.processInstance.processDefinition || !this.processInstance.processDefinition.formCustomViewPath){ if (
return false !this.processInstance.processDefinition ||
!this.processInstance.processDefinition.formCustomViewPath
) {
return false;
} }
const map = { const map = {
"shippingDetail": { shippingDetail: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
}, },
// 报价单特价审核,原来配置的组件名 // 报价单特价审核,原来配置的组件名
"special-discount": { "special-discount": {
component: 'OfferSpecialDetail', component: "OfferSpecialDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
type: 1 type: 1,
}, },
// 报价单特价审核,符合命名规则的组件名 // 报价单特价审核,符合命名规则的组件名
offer_special: { offer_special: {
component: 'OfferSpecialDetail', component: "OfferSpecialDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
type: 1 type: 1,
}, },
offer_commission: { offer_commission: {
component: 'OfferSpecialDetail', component: "OfferSpecialDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
type: 2 type: 2,
}, },
// 原来的费用申请 // 原来的费用申请
free_apply: { free_apply: {
component: "warehouseDetails", component: "warehouseDetails",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 2 type: 2,
}, },
// 2.0空运加的批量申请 // 2.0空运加的批量申请
batch_free_apply: { batch_free_apply: {
component: () => import('@/views/ecw/order/components/BatchFeeApplication'), component: () =>
import("@/views/ecw/order/components/BatchFeeApplication"),
businessId: this.processInstance.businessKey, businessId: this.processInstance.businessKey,
processInstanceId: this.$route.query.id processInstanceId: this.$route.query.id,
}, },
retired_warehouse: { retired_warehouse: {
component: "warehouseDetails", component: "warehouseDetails",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 3 type: 3,
}, },
warehouse_transfer: { warehouse_transfer: {
component: "warehouseDetails", component: "warehouseDetails",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 1 type: 1,
}, },
warehouse_update: { warehouse_update: {
component: "warehouseDetails", component: "warehouseDetails",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 4 type: 4,
}, },
container_modify: { container_modify: {
component: "shippingDetail", component: "shippingDetail",
...@@ -299,183 +446,213 @@ export default { ...@@ -299,183 +446,213 @@ export default {
}, },
// 放货修改 // 放货修改
order_update_release: { order_update_release: {
component: 'CargoControlDetail', component: "CargoControlDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
applyType: 7 applyType: 7,
}, },
// 反复核 // 反复核
order_fallback: { order_fallback: {
component: 'CargoControlDetail', component: "CargoControlDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
applyType: 8 applyType: 8,
}, },
// 调货审核 // 调货审核
order_transfer: { order_transfer: {
component: 'CargoControlDetail', component: "CargoControlDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
applyType: 9 applyType: 9,
}, },
// 取消放货审核 // 取消放货审核
order_cancel_release: { order_cancel_release: {
component: 'CargoControlDetail', component: "CargoControlDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
applyType: 10 applyType: 10,
}, },
// 提单审核 // 提单审核
order_landing_bill:{ order_landing_bill: {
component: () => import('@/views/ecw/order/components/LandingBillDetail'), component: () =>
import("@/views/ecw/order/components/LandingBillDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 订单审核详情 // 订单审核详情
order_approval:{ order_approval: {
component: () => import('@/views/ecw/order/components/ApprovalDetail'), component: () =>
import("@/views/ecw/order/components/ApprovalDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 订单修改审批 // 订单修改审批
order_update:{ order_update: {
component: () => import('@/views/ecw/order/components/UpdateDetail'), component: () => import("@/views/ecw/order/components/UpdateDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 预付异常审核 // 预付异常审核
prepay_excetion:{ prepay_excetion: {
component: () => import('@/views/ecw/order/components/PrepayExceptionDetail'), component: () =>
import("@/views/ecw/order/components/PrepayExceptionDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 客户延期 // 客户延期
customer_delay:{ customer_delay: {
component: () => import('@/views/ecw/customer/components/Delay'), component: () => import("@/views/ecw/customer/components/Delay"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//付款单审核-所有审核流程详情组件 //付款单审核-所有审核流程详情组件
finance_payment_approve:{ finance_payment_approve: {
component: () => import('@/views/ecw/financial/components/PaymentApproval'), component: () =>
import("@/views/ecw/financial/components/PaymentApproval"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单审核 //收款单审核
finance_receipt_approve:{ finance_receipt_approve: {
component: () => import('@/views/ecw/financial/components/CollectionApproval'), component: () =>
import("@/views/ecw/financial/components/CollectionApproval"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单核销 //收款单核销
finance_receipt_write_off:{ finance_receipt_write_off: {
component: () => import('@/views/ecw/financial/components/CollectionWriteoff'), component: () =>
import("@/views/ecw/financial/components/CollectionWriteoff"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单反核销审核 //收款单反核销审核
finance_receipt_write_off_no:{ finance_receipt_write_off_no: {
component: () => import('@/views/ecw/financial/components/CollectionApproval'), component: () =>
import("@/views/ecw/financial/components/CollectionApproval"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单核销反审核 //收款单核销反审核
finance_receipt_approve_no:{ finance_receipt_approve_no: {
component: () => import('@/views/ecw/financial/components/CollectionApproval'), component: () =>
import("@/views/ecw/financial/components/CollectionApproval"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单银行实收明细核销 //收款单银行实收明细核销
finance_receipt_item_write_off:{ finance_receipt_item_write_off: {
component: () => import('@/views/ecw/financial/components/CollectionBankDetail'), component: () =>
import("@/views/ecw/financial/components/CollectionBankDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//收款单银行实收反核销 //收款单银行实收反核销
finance_receipt_item_write_off_no:{ finance_receipt_item_write_off_no: {
component: () => import('@/views/ecw/financial/components/CollectionBankDetail'), component: () =>
import("@/views/ecw/financial/components/CollectionBankDetail"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
//佣金付款单审核详情-关于佣金付款单所有审核详情 //佣金付款单审核详情-关于佣金付款单所有审核详情
commissionPaymentDetails:{ commissionPaymentDetails: {
component: ()=>import('@/views/ecw/financial/components/commissionPaymentDetails.vue'), component: () =>
import(
"@/views/ecw/financial/components/commissionPaymentDetails.vue"
),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
/*撤销拆单*/ /*撤销拆单*/
split_revoke:{ split_revoke: {
component: () => import("@/views/ecw/order/components/SplitRevokeDetail"), component: () =>
id: this.processInstance.businessKey import("@/views/ecw/order/components/SplitRevokeDetail"),
id: this.processInstance.businessKey,
}, },
// 不可出渠道异常审核 // 不可出渠道异常审核
not_shiping_channel:{ not_shiping_channel: {
component: () => import('@/views/ecw/order/components/NotShipingChannel'), component: () =>
import("@/views/ecw/order/components/NotShipingChannel"),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 出货批量加价审核 // 出货批量加价审核
box_batch_markup:{ box_batch_markup: {
component: () => import('@/views/ecw/box/components/batchMakeUpDetail.vue'), component: () =>
import("@/views/ecw/box/components/batchMakeUpDetail.vue"),
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: this.processInstance.processDefinition?.formCustomViewPath type: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 可获移交详情 // 可获移交详情
customer_handover_details:{ customer_handover_details: {
component: () => import('@/views/ecw/customer/components/customer-handover-details.vue'), component: () =>
import(
"@/views/ecw/customer/components/customer-handover-details.vue"
),
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: this.processInstance.processDefinition?.formCustomViewPath type: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 出货审核 // 出货审核
air_shipment: { air_shipment: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 'shipment' type: "shipment",
}, },
//排单分拣审核 //排单分拣审核
shipment_order_sorting: { shipment_order_sorting: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey processId: this.processInstance.businessKey,
}, },
// 出货反审 // 出货反审
shipment_review: { shipment_review: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey processId: this.processInstance.businessKey,
}, },
// 删单退场 // 删单退场
customs_declare_remove: { customs_declare_remove: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 'deleteExit' type: "deleteExit",
}, },
// 空运到仓审核 // 空运到仓审核
air_warehouse: { air_warehouse: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 'air_warehouse' type: "air_warehouse",
}, },
// 空运到仓审核 // 空运到仓审核
air_warehouse_no: { air_warehouse_no: {
component: "shippingDetail", component: "shippingDetail",
processId: this.processInstance.businessKey, processId: this.processInstance.businessKey,
type: 'air_warehouse' type: "air_warehouse",
}, },
revoke_clear:{ revoke_clear: {
component:() => import("@/views/ecw/box/components/RevokeClear"), component: () => import("@/views/ecw/box/components/RevokeClear"),
id: this.processInstance.businessKey id: this.processInstance.businessKey,
}, },
// 重量超限 // 重量超限
over_weight_exception:{ over_weight_exception: {
component: () => import('@/views/ecw/order/exception/components/overweightException'), component: () =>
import(
"@/views/ecw/order/exception/components/overweightException"
),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
}, },
// 线路重量超限 // 线路重量超限
line_weight_exception:{ line_weight_exception: {
component: () => import('@/views/ecw/order/exception/components/overweightException'), component: () =>
import(
"@/views/ecw/order/exception/components/overweightException"
),
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
path: this.processInstance.processDefinition?.formCustomViewPath path: this.processInstance.processDefinition?.formCustomViewPath,
},
};
console.log(
"formCustomViewPath",
this.processInstance.processDefinition.formCustomViewPath.trim()
);
return map[
this.processInstance.processDefinition.formCustomViewPath.trim()
];
}, },
}
console.log('formCustomViewPath', this.processInstance.processDefinition.formCustomViewPath.trim())
return map[this.processInstance.processDefinition.formCustomViewPath.trim()]
}
}, },
data() { data() {
return { return {
...@@ -489,13 +666,13 @@ export default { ...@@ -489,13 +666,13 @@ export default {
// 流程表单详情 // 流程表单详情
detailForm: { detailForm: {
fields: [] fields: [],
}, },
// BPMN 数据 // BPMN 数据
bpmnXML: null, bpmnXML: null,
bpmnControlForm: { bpmnControlForm: {
prefix: "activiti" prefix: "activiti",
}, },
activityList: [], activityList: [],
...@@ -507,7 +684,13 @@ export default { ...@@ -507,7 +684,13 @@ export default {
runningTasks: [], runningTasks: [],
auditForms: [], auditForms: [],
auditRule: { auditRule: {
comment: [{required: true, message: this.$t("审批建议不能为空"), trigger: "blur"}], comment: [
{
required: true,
message: this.$t("审批建议不能为空"),
trigger: "blur",
},
],
}, },
// 转派审批人 // 转派审批人
...@@ -518,8 +701,14 @@ export default { ...@@ -518,8 +701,14 @@ export default {
assigneeUserId: undefined, assigneeUserId: undefined,
}, },
rules: { rules: {
assigneeUserId: [{required: true, message: this.$t("新审批人不能为空"), trigger: "change"}], assigneeUserId: [
} {
required: true,
message: this.$t("新审批人不能为空"),
trigger: "change",
},
],
},
}, },
// 数据字典 // 数据字典
...@@ -529,14 +718,14 @@ export default { ...@@ -529,14 +718,14 @@ export default {
created() { created() {
this.id = this.$route.query.id; this.id = this.$route.query.id;
if (!this.id) { if (!this.id) {
this.$message.error('未传递 id 参数,无法查看流程信息'); this.$message.error("未传递 id 参数,无法查看流程信息");
return; return;
} }
this.getDetail(); this.getDetail();
// 获得用户列表 // 获得用户列表
this.userOptions = []; this.userOptions = [];
listSimpleUsers().then(response => { listSimpleUsers().then((response) => {
this.userOptions.push(...response.data); this.userOptions.push(...response.data);
}); });
}, },
...@@ -545,14 +734,14 @@ export default { ...@@ -545,14 +734,14 @@ export default {
getDetail() { getDetail() {
// 获得流程实例相关 // 获得流程实例相关
this.processInstanceLoading = true; this.processInstanceLoading = true;
getProcessInstance(this.id).then(response => { getProcessInstance(this.id).then((response) => {
if (!response.data) { if (!response.data) {
this.$message.error('查询不到流程信息!'); this.$message.error("查询不到流程信息!");
return; return;
} }
// 设置流程信息 // 设置流程信息
this.processInstance = response.data; this.processInstance = response.data;
console.log(this.processInstance) console.log(this.processInstance);
// 设置表单信息 // 设置表单信息
if (this.processInstance.processDefinition.formType === 10) { if (this.processInstance.processDefinition.formType === 10) {
...@@ -560,25 +749,29 @@ export default { ...@@ -560,25 +749,29 @@ export default {
...JSON.parse(this.processInstance.processDefinition.formConf), ...JSON.parse(this.processInstance.processDefinition.formConf),
disabled: true, // 表单禁用 disabled: true, // 表单禁用
formBtns: false, // 按钮隐藏 formBtns: false, // 按钮隐藏
fields: decodeFields(this.processInstance.processDefinition.formFields) fields: decodeFields(
} this.processInstance.processDefinition.formFields
),
};
// 设置表单的值 // 设置表单的值
this.detailForm.fields.forEach(item => { this.detailForm.fields.forEach((item) => {
const val = this.processInstance.formVariables[item.__vModel__] const val = this.processInstance.formVariables[item.__vModel__];
if (val) { if (val) {
item.__config__.defaultValue = val item.__config__.defaultValue = val;
} }
}); });
} }
// 加载流程图 // 加载流程图
getProcessDefinitionBpmnXML(this.processInstance.processDefinition.id).then(response => { getProcessDefinitionBpmnXML(
this.bpmnXML = response.data this.processInstance.processDefinition.id
).then((response) => {
this.bpmnXML = response.data;
}); });
// 加载活动列表 // 加载活动列表
getActivityList({ getActivityList({
processInstanceId: this.processInstance.id processInstanceId: this.processInstance.id,
}).then(response => { }).then((response) => {
this.activityList = response.data; this.activityList = response.data;
}); });
...@@ -590,7 +783,7 @@ export default { ...@@ -590,7 +783,7 @@ export default {
this.tasksLoad = true; this.tasksLoad = true;
this.runningTasks = []; this.runningTasks = [];
this.auditForms = []; this.auditForms = [];
getTaskListByProcessInstanceId(this.id).then(response => { getTaskListByProcessInstanceId(this.id).then((response) => {
// 审批记录 // 审批记录
this.tasks = response.data; this.tasks = response.data;
// 排序,将未完成的排在前面,已完成的排在后面; // 排序,将未完成的排在前面,已完成的排在后面;
...@@ -610,17 +803,19 @@ export default { ...@@ -610,17 +803,19 @@ export default {
// 需要审核的记录 // 需要审核的记录
const userId = store.getters.userId; const userId = store.getters.userId;
this.tasks.forEach(task => { this.tasks.forEach((task) => {
if (task.result !== 1) { // 只有待处理才需要 if (task.result !== 1) {
// 只有待处理才需要
return; return;
} }
if (!task.assigneeUser || task.assigneeUser.id !== userId) { // 自己不是处理人 if (!task.assigneeUser || task.assigneeUser.id !== userId) {
// 自己不是处理人
return; return;
} }
this.runningTasks.push({...task}); this.runningTasks.push({ ...task });
this.auditForms.push({ this.auditForms.push({
comment: '' comment: "",
}) });
}); });
// 取消加载中 // 取消加载中
...@@ -637,10 +832,10 @@ export default { ...@@ -637,10 +832,10 @@ export default {
// 设置对应的表单 // 设置对应的表单
this.detailForm = { this.detailForm = {
...JSON.parse(row.formConf), ...JSON.parse(row.formConf),
fields: decodeFields(row.formFields) fields: decodeFields(row.formFields),
} };
} else if (row.formCustomCreatePath) { } else if (row.formCustomCreatePath) {
this.$router.push({path: row.formCustomCreatePath}); this.$router.push({ path: row.formCustomCreatePath });
// 这里暂时无需加载流程图,因为跳出到另外个 Tab; // 这里暂时无需加载流程图,因为跳出到另外个 Tab;
} }
}, },
...@@ -658,80 +853,86 @@ export default { ...@@ -658,80 +853,86 @@ export default {
const variables = params.values; const variables = params.values;
createProcessInstance({ createProcessInstance({
processDefinitionId: this.selectProcessInstance.id, processDefinitionId: this.selectProcessInstance.id,
variables: variables variables: variables,
}).then(response => { })
.then((response) => {
this.$modal.msgSuccess("发起流程成功"); this.$modal.msgSuccess("发起流程成功");
// 关闭当前窗口 // 关闭当前窗口
this.$tab.closeOpenPage(); this.$tab.closeOpenPage();
this.$router.go(-1); this.$router.go(-1);
}).catch(() => { })
.catch(() => {
conf.disabled = false; // 表单开启 conf.disabled = false; // 表单开启
conf.formBtns = true; // 按钮展示 conf.formBtns = true; // 按钮展示
}) });
}, },
getDateStar(ms) { getDateStar(ms) {
return getDate(ms); return getDate(ms);
}, },
getTimelineItemIcon(item) { getTimelineItemIcon(item) {
if (item.result === 1) { if (item.result === 1) {
return 'el-icon-time'; return "el-icon-time";
} }
if (item.result === 2) { if (item.result === 2) {
return 'el-icon-check'; return "el-icon-check";
} }
if (item.result === 3) { if (item.result === 3) {
return 'el-icon-close'; return "el-icon-close";
} }
if (item.result === 4) { if (item.result === 4) {
return 'el-icon-remove-outline'; return "el-icon-remove-outline";
} }
return ''; return "";
}, },
getTimelineItemType(item) { getTimelineItemType(item) {
if (item.result === 1) { if (item.result === 1) {
return 'primary'; return "primary";
} }
if (item.result === 2) { if (item.result === 2) {
return 'success'; return "success";
} }
if (item.result === 3) { if (item.result === 3) {
return 'danger'; return "danger";
} }
if (item.result === 4) { if (item.result === 4) {
return 'info'; return "info";
} }
return ''; return "";
}, },
/** 处理审批通过和不通过的操作 */ /** 处理审批通过和不通过的操作 */
handleAudit(task, pass) { handleAudit(task, pass) {
const index = this.runningTasks.indexOf(task); const index = this.runningTasks.indexOf(task);
this.$refs['form' + index][0].validate(valid => { this.$refs["form" + index][0].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
const data = { const data = {
id: task.id, id: task.id,
comment: this.auditForms[index].comment, comment: this.auditForms[index].comment,
copyUserIds: this.auditForms[index].copyUserIds copyUserIds: this.auditForms[index].copyUserIds,
} };
this.loading = true this.loading = true;
if (pass) { if (pass) {
approveTask(data).then(response => { approveTask(data)
let p = this.matterNum .then((response) => {
let p = this.matterNum;
//this.$store.commit('GET_MAATER', --p) //this.$store.commit('GET_MAATER', --p)
this.$modal.msgSuccess("审批通过成功!"); this.$modal.msgSuccess("审批通过成功!");
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
}).finally(() => { })
this.loading = false .finally(() => {
this.loading = false;
}); });
} else { } else {
rejectTask(data).then(response => { rejectTask(data)
let p = this.matterNum .then((response) => {
let p = this.matterNum;
//this.$store.commit('GET_MAATER', --p) //this.$store.commit('GET_MAATER', --p)
this.$modal.msgSuccess("审批不通过成功!"); this.$modal.msgSuccess("审批不通过成功!");
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
}).finally(() => { })
this.loading = false .finally(() => {
this.loading = false;
}); });
} }
}); });
...@@ -746,13 +947,13 @@ export default { ...@@ -746,13 +947,13 @@ export default {
}, },
/** 提交转派审批人 */ /** 提交转派审批人 */
submitUpdateAssigneeForm() { submitUpdateAssigneeForm() {
this.$refs['updateAssigneeForm'].validate(valid => { this.$refs["updateAssigneeForm"].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
updateTaskAssignee(this.updateAssignee.form).then(response => { updateTaskAssignee(this.updateAssignee.form).then((response) => {
this.$modal.msgSuccess("转派任务成功!"); this.$modal.msgSuccess("转派任务成功!");
let p = this.matterNum let p = this.matterNum;
// this.$store.commit('GET_MAATER', --p) // this.$store.commit('GET_MAATER', --p)
this.updateAssignee.open = false; this.updateAssignee.open = false;
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
...@@ -779,8 +980,8 @@ export default { ...@@ -779,8 +980,8 @@ export default {
/** 处理审批退回的操作 */ /** 处理审批退回的操作 */
handleBack(task) { handleBack(task) {
this.$modal.msgError("暂不支持【退回】功能!"); this.$modal.msgError("暂不支持【退回】功能!");
} },
} },
}; };
</script> </script>
......
...@@ -66,11 +66,23 @@ ...@@ -66,11 +66,23 @@
<el-button icon="el-icon-refresh" @click="resetQuery">{{ <el-button icon="el-icon-refresh" @click="resetQuery">{{
$t("重置") $t("重置")
}}</el-button> }}</el-button>
<el-button type="primary" @click="handleQuery2">{{
$t("批量通过")
}}</el-button>
<el-button type="primary" @click="handleQuery3">{{
$t("批量不通过")
}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column <el-table-column
:label="$t('流程编号')" :label="$t('流程编号')"
align="center" align="center"
...@@ -164,12 +176,28 @@ ...@@ -164,12 +176,28 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="审批意见" prop="comment">
<el-input
v-model="form.comment"
style="width: 300px"
placeholder="请输入审批意见"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getTodoTaskPage } from "@/api/bpm/task"; import { getTodoTaskPage } from "@/api/bpm/task";
import { cancelProcessInstance } from "@/api/bpm/processInstance"; import { cancelProcessInstance } from "@/api/bpm/processInstance";
import { approveTask2, rejectTask2 } from "@/api/bpm/task";
export default { export default {
//lanbm 2024-05-08 添加查询条件不清空优化 //lanbm 2024-05-08 添加查询条件不清空优化
name: "BpmTaskTodo", name: "BpmTaskTodo",
...@@ -193,6 +221,31 @@ export default { ...@@ -193,6 +221,31 @@ export default {
businessNo: null, businessNo: null,
category: null, category: null,
}, },
titleType: 1,
title: undefined,
open: false,
// 选中数组
ids: [],
BpmNameList: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 表单参数
form: {
//审批意见
comment: undefined,
},
// 表单校验
rules: {
comment: [
{
required: true,
message: this.$t("审批意见不能为空。"),
trigger: "blur",
},
],
},
}; };
}, },
created() { created() {
...@@ -224,6 +277,101 @@ export default { ...@@ -224,6 +277,101 @@ export default {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
}, },
handleQuery2() {
//批量通过 lanbm 2024-05-20 add
if (this.ids.length == 0) {
this.$message.error(this.$t("请选择需要批量通过的任务。"));
return;
}
let firstName = this.BpmNameList[0];
for (var i = 0; i < this.BpmNameList.length; i++) {
if (firstName != this.BpmNameList[i]) {
this.$message.error(this.$t("您选择的任务不全是同一类流程。"));
return;
}
}
this.form.comment="";
this.title = "批量通过";
this.titleType = 1;
this.open = true;
},
handleQuery3() {
//批量不通过 lanbm 2024-05-20 add
if (this.ids.length == 0) {
//this.modal.msgSuccess
this.$message.error(this.$t("请选择需要批量不通过的任务。"));
return;
}
let firstName = this.BpmNameList[0];
for (var i = 0; i < this.BpmNameList.length; i++) {
if (firstName != this.BpmNameList[i]) {
this.$message.error(this.$t("您选择的任务不全是同一类流程。"));
return;
}
}
this.form.comment="";
this.title = "批量不通过";
this.titleType = 2;
this.open = true;
},
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
//approveTask2
if (this.titleType == 1) {
let p1 = [];
for (var i = 0; i < this.ids.length; i++) {
var obj = {};
obj.id = this.ids[i];
obj.comment = this.form.comment;
p1.push(obj);
}
approveTask2(p1).then((response) => {
if (response.data == true) {
this.open = false;
this.$modal.msgSuccess(this.$t("批量处理成功"));
this.getList();
} else {
this.open = false;
this.$modal.msgSuccess(this.$t("批量处理失败"));
}
});
} else {
let p2 = [];
for (var i = 0; i < this.ids.length; i++) {
var obj = {};
obj.id = this.ids[i];
obj.comment = this.form.comment;
p2.push(obj);
}
rejectTask2(p2).then((response) => {
if (response.data == true) {
this.open = false;
this.$modal.msgSuccess(this.$t("批量处理成功"));
this.getList();
} else {
this.open = false;
this.$modal.msgSuccess(this.$t("批量处理失败"));
}
});
}
});
},
cancel() {
this.title = "";
this.open = false;
},
handleSelectionChange(selection) {
//表格多选函数 lanbm 2024-05-20 add
//row.processInstance.id
this.BpmNameList = selection.map((item) => item.processInstance.name);
this.ids = selection.map((item) => item.processInstance.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.dateRangeCreateTime = [];
......
<template> <template>
<div class="app-costForm shippingSea-dialog"> <div class="app-costForm shippingSea-dialog">
<el-form ref="costForm" :model="costObj" :rules="rules" label-width="80px"> <el-form ref="costForm" :model="costObj" :rules="rules" label-width="120px">
<el-form-item :label="$t('操作步骤')" prop="opStepType"> <el-form-item :label="$t('操作步骤')" prop="opStepType">
<el-select v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')"> <el-select
<el-option v-for="type in getDictDatas(DICT_TYPE[this.process])" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option> v-model="costObj.opStepType"
:placeholder="$t('请选择操作步骤')"
>
<el-option
v-for="type in getDictDatas(DICT_TYPE[this.process])"
:key="type.value"
:label="$l(type, 'label')"
:value="type.value"
></el-option>
</el-select> </el-select>
<!--<el-select v-if="flag=='seaAir'" v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')"> <!--<el-select v-if="flag=='seaAir'" v-model="costObj.opStepType" :placeholder="$t('请选择操作步骤')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option> <el-option v-for="type in this.getDictDatas(DICT_TYPE.BOX_SEA_AIR)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
...@@ -12,36 +19,78 @@ ...@@ -12,36 +19,78 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('费用类型')" prop="costType"> <el-form-item :label="$t('费用类型')" prop="costType">
<el-select v-model="costObj.costType" :placeholder="$t('请选择费用类型')"> <el-select
<el-option v-for="type in this.getDictDatas(DICT_TYPE.FEE_TYPE)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option> v-model="costObj.costType"
:placeholder="$t('请选择费用类型')"
>
<el-option
v-for="type in this.getDictDatas(DICT_TYPE.FEE_TYPE)"
:key="type.value"
:label="$l(type, 'label')"
:value="type.value"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('供应商')" prop="supplierId"> <el-form-item :label="$t('供应商')" prop="supplierId">
<el-select v-model="costObj.supplierId" :placeholder="$t('请选择供应商')"> <el-select
<el-option v-for="supplier in allSupplier" :key="supplier.id" :label="$l(supplier, 'company')" :value="supplier.id"></el-option> v-model="costObj.supplierId"
:placeholder="$t('请选择供应商')"
>
<el-option
v-for="supplier in allSupplier"
:key="supplier.id"
:label="$l(supplier, 'company')"
:value="supplier.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--lanbm 2024-05-17 添加字段-->
<el-form-item :label="$t('费用产生时间')" prop="freecsdate">
<el-date-picker
v-model="costObj.freecsdate"
style="width: 200px"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd"
type="datetime"
placeholder="费用产生时间"
/>
</el-form-item>
<el-row class="two-element-formItem"> <el-row class="two-element-formItem">
<el-form-item :label="$t('金额')" prop="price"> <el-form-item :label="$t('金额')" prop="price">
<el-input-number v-model="costObj.price" controls-position="right" :min="1"></el-input-number> <el-input-number
v-model="costObj.price"
controls-position="right"
:min="1"
></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="" label-width="0px" prop="priceUnit"> <el-form-item label="" label-width="0px" prop="priceUnit">
<el-select v-model="costObj.priceUnit" :placeholder="$t('请选择单位')"> <el-select
<el-option v-for="type in this.currencyList" :key="type.id" :label="$l(type, 'title')" :value="type.id"></el-option> v-model="costObj.priceUnit"
:placeholder="$t('请选择单位')"
>
<el-option
v-for="type in this.currencyList"
:key="type.id"
:label="$l(type, 'title')"
:value="type.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
<el-input v-model="costObj.remarks" type="textarea" rows="2" :placeholder="$t('请输入备注')"></el-input> <el-input
v-model="costObj.remarks"
type="textarea"
rows="2"
:placeholder="$t('请输入备注')"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="operate-button"> <div class="operate-button">
<el-button type="primary" @click="submit">{{$t('确定')}}</el-button> <el-button type="primary" @click="submit">{{ $t("确定") }}</el-button>
<el-button @click="$emit('closeDialog')">{{$t('取消')}}</el-button> <el-button @click="$emit('closeDialog')">{{ $t("取消") }}</el-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -51,7 +100,7 @@ import { getSupplierPage } from "@/api/ecw/supplier"; ...@@ -51,7 +100,7 @@ import { getSupplierPage } from "@/api/ecw/supplier";
import { createCost } from "@/api/ecw/box"; import { createCost } from "@/api/ecw/box";
import { serviceMsg } from "./shippingSea/utils"; import { serviceMsg } from "./shippingSea/utils";
import { getCurrencyList } from "@/api/ecw/currency"; import { getCurrencyList } from "@/api/ecw/currency";
import {getDictDatas} from "@/utils/dict"; import { getDictDatas } from "@/utils/dict";
export default { export default {
name: "costForm", name: "costForm",
...@@ -65,26 +114,59 @@ export default { ...@@ -65,26 +114,59 @@ export default {
currencyList: [], currencyList: [],
rules: { rules: {
opStepType: [{ required: true, message: this.$t("操作步骤不能为空"), trigger: "change" }], opStepType: [
costType: [{ required: true, message: this.$t("费用类型不能为空"), trigger: "change" }], {
supplierId: [{ required: true, message: this.$t("供应商不能为空"), trigger: "blur" }], required: true,
price: [{ required: true, message: this.$t("金额不能为空"), trigger: "blur" }], message: this.$t("操作步骤不能为空"),
priceUnit: [{ required: true, message: this.$t("金额单位不能为空"), trigger: "blur" }] trigger: "change",
},
],
costType: [
{
required: true,
message: this.$t("费用类型不能为空"),
trigger: "change",
},
],
supplierId: [
{
required: true,
message: this.$t("供应商不能为空"),
trigger: "blur",
},
],
price: [
{ required: true, message: this.$t("金额不能为空"), trigger: "blur" },
],
priceUnit: [
{
required: true,
message: this.$t("金额单位不能为空"),
trigger: "blur",
},
],
freeCsDate: [
{
required: true,
message: this.$t("费用产生时间不能为空"),
trigger: "blur",
},
],
}, },
// flag: 'sea' // flag: 'sea'
}; };
}, },
computed:{ computed: {
flag(){ flag() {
return this.$attrs.flag || 'sea' return this.$attrs.flag || "sea";
}, },
process(){ process() {
return { return {
'air': 'BOX_AIR_SHIPMENT_PROCESS', air: "BOX_AIR_SHIPMENT_PROCESS",
'sea': 'BOX_SHIPPING_PROCESS', sea: "BOX_SHIPPING_PROCESS",
'seaAir': 'BOX_SEA_AIR' seaAir: "BOX_SEA_AIR",
}[this.flag] }[this.flag];
} },
}, },
created() { created() {
// 供应商 // 供应商
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<!-- 海运流程图 --> <!-- 海运流程图 在js脚本中写的固定流程环节 lanbm 2024-05-20 添加注释-->
<seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :allLading="allLading" :warehouseList="warehouseList" flag="air" @getBoxInfo="getBoxInfo" /> <seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :allLading="allLading" :warehouseList="warehouseList" flag="air" @getBoxInfo="getBoxInfo" />
<!-- 海运步骤图 --> <!-- 海运步骤图 -->
...@@ -45,7 +45,8 @@ import { getDockPage } from "@/api/ecw/dock"; ...@@ -45,7 +45,8 @@ import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user"; import { listUser } from "@/api/system/user";
import { getLadingShipperPage } from "@/api/ecw/ladingShipper"; import { getLadingShipperPage } from "@/api/ecw/ladingShipper";
// 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,然后再页面上用$l函数调用 // 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,
// 然后再页面上用$l函数调用
import { airBaseData, airOneData, airNextData } from "./utils"; import { airBaseData, airOneData, airNextData } from "./utils";
/** /**
* 海运操作主页面 * 海运操作主页面
...@@ -124,6 +125,9 @@ export default { ...@@ -124,6 +125,9 @@ export default {
const { data } = res; const { data } = res;
this.shipmentObj = data ?? {}; this.shipmentObj = data ?? {};
this.seaBaseData = this.airBaseData() this.seaBaseData = this.airBaseData()
//发货方式:1、多票,2、单票 deliveryType
//目的港清关:1、我司清关 2、合作方清关 3、客户
//lanbm 2024-05-20 梳理提单补料逻辑
if(this.shipmentObj.destinationClearance==3&&this.shipmentObj.deliveryType==2){ if(this.shipmentObj.destinationClearance==3&&this.shipmentObj.deliveryType==2){
this.seaBaseData = this.airOneData() this.seaBaseData = this.airOneData()
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<!-- 海运流程图 --> <!-- 海运流程图 在js脚本中写的固定流程环节 -->
<seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :allLading="allLading" :warehouseList="warehouseList" @getBoxInfo="getBoxInfo" /> <seaProcess :seaBaseData="seaBaseData" :shipmentObj="shipmentObj" :allSupplier="allSupplier" :allDocks="allDocks" :allUsers="allUsers" :allLading="allLading" :warehouseList="warehouseList" @getBoxInfo="getBoxInfo" />
<!-- 海运步骤图 --> <!-- 海运步骤图 -->
...@@ -45,7 +45,8 @@ import { getDockPage } from "@/api/ecw/dock"; ...@@ -45,7 +45,8 @@ import { getDockPage } from "@/api/ecw/dock";
import { listUser } from "@/api/system/user"; import { listUser } from "@/api/system/user";
import { getLadingShipperPage } from "@/api/ecw/ladingShipper"; import { getLadingShipperPage } from "@/api/ecw/ladingShipper";
// 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,然后再页面上用$l函数调用 // 这里引入的数据切换语言后要刷新才生效,优化办法是label同时配备labelEn字段,
//然后再页面上用$l函数调用
import { seaBaseData } from "./utils"; import { seaBaseData } from "./utils";
/** /**
* 海运操作主页面 * 海运操作主页面
......
...@@ -8,16 +8,22 @@ ...@@ -8,16 +8,22 @@
:inline="true" :inline="true"
> >
<el-card> <el-card>
<div v-if="id" slot="header" class="card-title">{{ $t('修改收款单') }}</div> <div v-if="id" slot="header" class="card-title">
<div v-else slot="header" class="card-title">{{ $t('新增收款单') }}</div> {{ $t("修改收款单") }}
</div>
<div v-else slot="header" class="card-title">
{{ $t("新增收款单") }}
</div>
<!-- <el-descriptions :column="3" border>--> <!-- <el-descriptions :column="3" border>-->
<!-- <el-descriptions-item > --> <!-- <el-descriptions-item > -->
<el-form-item <el-form-item
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
prop="customerId" prop="customerId"
:span="4" :span="4"
> >
<span style="margin-right:20px"><span style="color: #ff4949;">*</span>{{$t('客户')}}</span> <span style="margin-right: 20px"
><span style="color: #ff4949">*</span>{{ $t("客户") }}</span
>
<customer-selectorpay <customer-selectorpay
ref="customer" ref="customer"
v-model="form.customerId" v-model="form.customerId"
...@@ -27,11 +33,13 @@ ...@@ -27,11 +33,13 @@
<!-- </el-descriptions-item> <!-- </el-descriptions-item>
<el-descriptions-item > --> <el-descriptions-item > -->
<el-form-item <el-form-item
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
prop="departmentId" prop="departmentId"
:span="4" :span="4"
> >
<span style="margin-right:20px"><span style="color: #ff4949;">*</span>{{$t('部门')}}:</span> <span style="margin-right: 20px"
><span style="color: #ff4949">*</span>{{ $t("部门") }}:</span
>
<el-select <el-select
v-model="form.departmentId" v-model="form.departmentId"
style="width: 300px" style="width: 300px"
...@@ -46,12 +54,24 @@ ...@@ -46,12 +54,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
prop="salesmanId" prop="salesmanId"
:span="4" :span="4"
> >
<span style="margin-right:20px"><span style="color: #ff4949;">*</span>{{$t('业务员')}}:</span> <span style="margin-right: 20px"
<el-select v-model="form.salesmanId" filterable :placeholder="$t('请选择业务员')" @change="v => form.salesmanName = creatorData.find(t => t.id === v).nickname"> ><span style="color: #ff4949">*</span>{{ $t("业务员") }}:</span
>
<el-select
v-model="form.salesmanId"
filterable
:placeholder="$t('请选择业务员')"
@change="
(v) =>
(form.salesmanName = creatorData.find(
(t) => t.id === v
).nickname)
"
>
<el-option <el-option
v-for="item in creatorData" v-for="item in creatorData"
:key="item.id" :key="item.id"
...@@ -62,7 +82,7 @@ ...@@ -62,7 +82,7 @@
</el-form-item> </el-form-item>
<!-- </el-descriptions-item> --> <!-- </el-descriptions-item> -->
<!-- <el-descriptions-item > --> <!-- <el-descriptions-item > -->
<!-- <el-form-item <!-- <el-form-item
:label="$t('手续费(RMB)')" :label="$t('手续费(RMB)')"
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0;margin-top: 20px;"
prop="feeRate" prop="feeRate"
...@@ -73,21 +93,25 @@ ...@@ -73,21 +93,25 @@
:placeholder="$t('请输入手续费')" :placeholder="$t('请输入手续费')"
></el-input> ></el-input>
</el-form-item> --> </el-form-item> -->
<!-- </el-descriptions-item> <!-- </el-descriptions-item>
<el-descriptions-item > --> <el-descriptions-item > -->
<el-form-item <el-form-item
:label="$t('备注')+':'" :label="$t('备注') + ':'"
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
label-width="55px" label-width="55px"
prop="remark" prop="remark"
> >
<el-input style="display:inline-block;" v-model="form.remark" :placeholder="$t('备注')"></el-input> <el-input
style="display: inline-block"
v-model="form.remark"
:placeholder="$t('备注')"
></el-input>
</el-form-item> </el-form-item>
<!-- </el-descriptions-item> --> <!-- </el-descriptions-item> -->
<!-- </el-descriptions> --> <!-- </el-descriptions> -->
</el-card> </el-card>
<el-card class="card amountCard"> <el-card class="card amountCard">
<div slot="header" class="card-title">{{ $t('应收明细') }}</div> <div slot="header" class="card-title">{{ $t("应收明细") }}</div>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -97,25 +121,45 @@ ...@@ -97,25 +121,45 @@
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ecw:voucher:create:add']" v-hasPermi="['ecw:voucher:create:add']"
style="padding: 10px; margin-bottom: 10px" style="padding: 10px; margin-bottom: 10px"
>{{ $t('添加未收客户款项') }}</el-button >{{ $t("添加未收客户款项") }}</el-button
> >
</el-col> </el-col>
<el-table v-loading="loadings" :data="list" border :key="isUpdate"> <el-table v-loading="loadings" :data="list" border :key="isUpdate">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> <el-table-column
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo" /> :label="$t('订单号')"
align="center"
prop="orderNo"
/>
<el-table-column
:label="$t('提单号')"
align="center"
prop="tidanNo"
/>
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title"> <el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.titleZh?(scope.row.titleZh + "(" + scope.row.titleEn + ")"): ''}} {{
scope.row.titleZh
? scope.row.titleZh + "(" + scope.row.titleEn + ")"
: ""
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" /> <el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight"> <el-table-column
:label="$t('体积/重量')"
align="center"
prop="weight"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.volume}}/{{ scope.row.weight}} {{ scope.row.volume }}/{{ scope.row.weight }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType"> <el-table-column
:label="$t('收入类型')"
align="center"
prop="feeType"
>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:type="DICT_TYPE.FEE_TYPE" :type="DICT_TYPE.FEE_TYPE"
...@@ -123,51 +167,105 @@ ...@@ -123,51 +167,105 @@
></dict-tag> ></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice"> <el-table-column
:label="$t('单价金额')"
align="center"
prop="unitPrice"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.unitPrice
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('税率%')" align="center" prop="totalAmount"> <el-table-column
:label="$t('税率%')"
align="center"
prop="totalAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="text" v-model="scope.row.taxPoint" @input="changeTaxRate(scope.row,scope.$index)"></el-input> <el-input
type="text"
v-model="scope.row.taxPoint"
@input="changeTaxRate(scope.row, scope.$index)"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('不含税金额')" align="center" prop="totalAmount"> <el-table-column
:label="$t('不含税金额')"
align="center"
prop="totalAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.totalAmount
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('含税金额')" align="center" prop="taxAmount"> <el-table-column
:label="$t('含税金额')"
align="center"
prop="taxAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.taxAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.taxAmount
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</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">
<span> {{ scope.row.discountTotal ? `${scope.row.discountTotal}`:0}}</span> <span>
{{getCurrencyLabel(scope.row.currencyId)}} {{
scope.row.discountTotal ? `${scope.row.discountTotal}` : 0
}}</span
>
{{ getCurrencyLabel(scope.row.currencyId) }}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
<span v-if="scope.row.discountTotal">{{scope.row.discountRemark?('('+scope.row.discountRemark+')'): '' }}</span> <span v-if="scope.row.discountTotal">{{
scope.row.discountRemark
? "(" + scope.row.discountRemark + ")"
: ""
}}</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">
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:editdiscount']" @click="addDiscount(scope.row, scope.$index)">{{ scope.row.discountTotal ? $t('修改优惠') : $t('新增优惠') }}</el-button> <el-button
<el-button v-if="scope.row.type !== 'total'" type="text" v-hasPermi="['ecw:voucher:create:deldiscount']" @click="deleteListRow(scope.$index)">{{ $t('删除') }}</el-button> v-if="scope.row.type !== 'total'"
type="text"
v-hasPermi="['ecw:voucher:create:editdiscount']"
@click="addDiscount(scope.row, scope.$index)"
>{{
scope.row.discountTotal ? $t("修改优惠") : $t("新增优惠")
}}</el-button
>
<el-button
v-if="scope.row.type !== 'total'"
type="text"
v-hasPermi="['ecw:voucher:create:deldiscount']"
@click="deleteListRow(scope.$index)"
>{{ $t("删除") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <el-descriptions :column="2" border class="card"> <!-- <el-descriptions :column="2" border class="card">
<el-descriptions-item > --> <el-descriptions-item > -->
<el-form-item <el-form-item
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
prop="openInvoice" prop="openInvoice"
> >
<span style="margin-right:20px"><span style="color: #ff4949;">*</span>{{$t('是否需要开票')}}:</span> <span style="margin-right: 20px"
><span style="color: #ff4949">*</span
>{{ $t("是否需要开票") }}:</span
>
<el-select <el-select
v-model="form.openInvoice" v-model="form.openInvoice"
:placeholder="$t('请选择是否需要开票')" :placeholder="$t('请选择是否需要开票')"
...@@ -177,13 +275,13 @@ ...@@ -177,13 +275,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('核销基准币种')+':'" :label="$t('核销基准币种') + ':'"
style="margin-bottom: 0;margin-top: 20px;" style="margin-bottom: 0; margin-top: 20px"
> >
{{getCurrencyLabel(showCurrencyId)}} {{ getCurrencyLabel(showCurrencyId) }}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="showCurrencyId" /> -->
</el-form-item> </el-form-item>
<!-- </el-descriptions-item> <!-- </el-descriptions-item>
<el-descriptions-item :label="$t('核销基准币种')"> <el-descriptions-item :label="$t('核销基准币种')">
</el-descriptions-item> </el-descriptions-item>
...@@ -191,7 +289,7 @@ ...@@ -191,7 +289,7 @@
</el-card> </el-card>
<el-card v-if="showInvoice" class="card"> <el-card v-if="showInvoice" class="card">
<div slot="header" class="card-title">{{ $t('开票资料') }}</div> <div slot="header" class="card-title">{{ $t("开票资料") }}</div>
<el-descriptions :column="3" border> <el-descriptions :column="3" border>
<el-descriptions-item :label="$t('发票抬头')"> <el-descriptions-item :label="$t('发票抬头')">
<el-form-item <el-form-item
...@@ -199,7 +297,11 @@ ...@@ -199,7 +297,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="invoice" prop="invoice"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入发票抬头') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入发票抬头'),
}"
> >
<el-input v-model="form.invoice"></el-input> <el-input v-model="form.invoice"></el-input>
</el-form-item> </el-form-item>
...@@ -210,7 +312,11 @@ ...@@ -210,7 +312,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="taxpayer" prop="taxpayer"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入纳税人识别号') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入纳税人识别号'),
}"
> >
<el-input v-model="form.taxpayer"></el-input> <el-input v-model="form.taxpayer"></el-input>
</el-form-item> </el-form-item>
...@@ -221,7 +327,11 @@ ...@@ -221,7 +327,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="accountBank" prop="accountBank"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入开户行') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开户行'),
}"
> >
<el-input v-model="form.accountBank"></el-input> <el-input v-model="form.accountBank"></el-input>
</el-form-item> </el-form-item>
...@@ -232,7 +342,11 @@ ...@@ -232,7 +342,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="accountName" prop="accountName"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入账号') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入账号'),
}"
> >
<el-input v-model="form.accountName"></el-input> <el-input v-model="form.accountName"></el-input>
</el-form-item> </el-form-item>
...@@ -243,7 +357,11 @@ ...@@ -243,7 +357,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="projectName" prop="projectName"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入项目') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入项目'),
}"
> >
<el-input v-model="form.projectName"></el-input> <el-input v-model="form.projectName"></el-input>
</el-form-item> </el-form-item>
...@@ -254,7 +372,11 @@ ...@@ -254,7 +372,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="taxRate" prop="taxRate"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入税率') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入税率'),
}"
> >
<el-input v-model="form.taxRate"></el-input> <el-input v-model="form.taxRate"></el-input>
</el-form-item> </el-form-item>
...@@ -265,7 +387,11 @@ ...@@ -265,7 +387,11 @@
label-width="0" label-width="0"
style="margin-bottom: 0" style="margin-bottom: 0"
prop="addressPhone" prop="addressPhone"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('请输入开票地址/电话') }" :rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('请输入开票地址/电话'),
}"
> >
<el-input v-model="form.addressPhone"></el-input> <el-input v-model="form.addressPhone"></el-input>
</el-form-item> </el-form-item>
...@@ -273,25 +399,50 @@ ...@@ -273,25 +399,50 @@
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
<div slot="header" class="card-title">{{ $t('收款信息') }}</div> <div slot="header" class="card-title">{{ $t("收款信息") }}</div>
<el-table :data="form.receiptAccountList" border :key="form.receiptAccountList.length"> <el-table
:data="form.receiptAccountList"
border
:key="form.receiptAccountList.length"
>
<el-table-column :label="$t('应收币种')" align="center"> <el-table-column :label="$t('应收币种')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{getCurrencyLabel(scope.row.currencyId)}} {{ getCurrencyLabel(scope.row.currencyId) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('应收金额')" align="center" prop="receivableAmount"> <el-table-column
:label="$t('应收金额')"
align="center"
prop="receivableAmount"
>
<template slot-scope="scope" v-if="scope.row.type !== 'total'"> <template slot-scope="scope" v-if="scope.row.type !== 'total'">
{{ `${NP.minus(scope.row.receivableAmount, scope.row.discountTotal || 0)}${scope.row.discountTotal > 0 ? `(${scope.row.receivableAmount} - ${scope.row.discountTotal})` : ''}` }} {{
`${NP.minus(
scope.row.receivableAmount,
scope.row.discountTotal || 0
)}${
scope.row.discountTotal > 0
? `(${scope.row.receivableAmount} - ${scope.row.discountTotal})`
: ""
}`
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center"> <el-table-column align="center">
<template #header> <template #header>
{{ $t('核销基准币种')+''+getCurrencyLabel(showCurrencyId)+''+ $t('汇率') }} {{
$t("核销基准币种") +
"" +
getCurrencyLabel(showCurrencyId) +
"" +
$t("汇率")
}}
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.type !== 'total'"> <template v-if="scope.row.type !== 'total'">
<span v-if="showCurrencyId === scope.row.currencyId">{{ scope.row.writeOffRate }}</span> <span v-if="showCurrencyId === scope.row.currencyId">{{
scope.row.writeOffRate
}}</span>
<el-form-item <el-form-item
v-else v-else
label="" label=""
...@@ -299,17 +450,30 @@ ...@@ -299,17 +450,30 @@
style="margin-bottom: 0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.writeOffRate`" :prop="`receiptAccountList.${scope.$index}.writeOffRate`"
> >
<el-input v-model="scope.row.writeOffRate" @input="() => writeOffRateChange(scope.row, scope.$index)"></el-input> <el-input
v-model="scope.row.writeOffRate"
@input="() => writeOffRateChange(scope.row, scope.$index)"
></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template v-else> <template v-else>
{{ $t('应核销总金额')+''+getCurrencyLabel(showCurrencyId)+''}} {{
$t("应核销总金额") +
"" +
getCurrencyLabel(showCurrencyId) +
""
}}
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="writeOffAmount"> <el-table-column align="center" prop="writeOffAmount">
<template #header> <template #header>
{{ $t('核销基准金额')+''+getCurrencyLabel(showCurrencyId)+''}} {{
$t("核销基准金额") +
"" +
getCurrencyLabel(showCurrencyId) +
""
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center"> <el-table-column :label="$t('期望收款账户')" align="center">
...@@ -321,7 +485,7 @@ ...@@ -321,7 +485,7 @@
style="margin-bottom: 0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.platformAccountId`" :prop="`receiptAccountList.${scope.$index}.platformAccountId`"
> >
<!-- <el-select <!-- <el-select
v-model="scope.row.platformAccountId" v-model="scope.row.platformAccountId"
:placeholder="$t('请选择收款账户')" :placeholder="$t('请选择收款账户')"
@change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)" @change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)"
...@@ -338,9 +502,13 @@ ...@@ -338,9 +502,13 @@
clear clear
v-model="scope.row.platformAccountId" v-model="scope.row.platformAccountId"
:placeholder="$t('请选择收款账户')" :placeholder="$t('请选择收款账户')"
@change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)" @change="
(platformAccountId) =>
changePlatformAccountId(platformAccountId, scope.$index)
"
v-el-select-loadmore="loadmore" v-el-select-loadmore="loadmore"
:loading="codeLoading"> :loading="codeLoading"
>
<el-option <el-option
v-for="(item, i) in bankData" v-for="(item, i) in bankData"
:key="'opt-code' + i" :key="'opt-code' + i"
...@@ -363,12 +531,16 @@ ...@@ -363,12 +531,16 @@
<el-select <el-select
v-model="scope.row.collectionCurrencyId" v-model="scope.row.collectionCurrencyId"
:placeholder="$t('请选择')" :placeholder="$t('请选择')"
@change="val => currencyIdChange(val, scope.row, scope.$index)" @change="
(val) => currencyIdChange(val, scope.row, scope.$index)
"
> >
<el-option <el-option
v-for="item in currencyList" v-for="item in currencyList"
:key="item.id" :key="item.id"
:label="$i18n.locale=='zh_CN'?item.titleZh:item.titleEn" :label="
$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn
"
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
...@@ -377,7 +549,7 @@ ...@@ -377,7 +549,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款汇率')" align="center"> <el-table-column :label="$t('期望收款汇率')" align="center">
<!--lanbm 2024-05-06 汇率保留小数增加到6位,为了方便显示,加宽此列的显示--> <!--lanbm 2024-05-06 汇率保留小数增加到6位,为了方便显示,加宽此列的显示-->
<template slot-scope="scope" style="width: 200px;"> <template slot-scope="scope" style="width: 200px">
<el-form-item <el-form-item
v-if="scope.row.type !== 'total'" v-if="scope.row.type !== 'total'"
label="" label=""
...@@ -385,17 +557,37 @@ ...@@ -385,17 +557,37 @@
style="margin-bottom: 0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.collectionRate`" :prop="`receiptAccountList.${scope.$index}.collectionRate`"
> >
<el-input v-model="scope.row.collectionRate" @input="() => rateChange(scope.row, scope.$index)"></el-input> <el-input
v-model="scope.row.collectionRate"
@input="() => rateChange(scope.row, scope.$index)"
></el-input>
</el-form-item> </el-form-item>
<span v-else>{{ $t('期望收费金额') }}</span> <span v-else>{{ $t("期望收费金额") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款金额')" align="center" prop="collectionAmount"> <el-table-column
:label="$t('期望收款金额')"
align="center"
prop="collectionAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span> <span v-if="scope.row.type !== 'total'">{{
scope.row.collectionAmount
}}</span>
<div v-else> <div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount&&itemAmount.amount?itemAmount.amount:0}}</div> <div v-for="itemAmount in scope.row.collectionAmount">
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div> {{
$i18n.locale == "zh_CN"
? itemAmount
? itemAmount.currencyNameZh
: ""
: itemAmount
? itemAmount.currencyNameEn
: ""
}}:
{{ itemAmount && itemAmount.amount ? itemAmount.amount : 0 }}
</div>
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div> <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> --> <div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
</div> </div>
...@@ -415,27 +607,56 @@ ...@@ -415,27 +607,56 @@
v-model="form.rateValidateDate" v-model="form.rateValidateDate"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择日期时间')"> :placeholder="$t('选择日期时间')"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
</el-form> </el-form>
<!-- <div slot="footer" style="margin: 20px 0"> <!-- <div slot="footer" style="margin: 20px 0">
<el-button v-if="id==0||form.state==0" type="primary" :loading="saveBtnLoading" @click="submitForm(1)">{{ $t('保存草稿') }}</el-button> <el-button v-if="id==0||form.state==0" type="primary" :loading="saveBtnLoading" @click="submitForm(1)">{{ $t('保存草稿') }}</el-button>
<el-button v-else type="primary" :loading="saveBtnLoading" @click="$store.dispatch('tagsView/delCurrentView')">{{ $t('返回') }}</el-button> <el-button v-else type="primary" :loading="saveBtnLoading" @click="$store.dispatch('tagsView/delCurrentView')">{{ $t('返回') }}</el-button>
<el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button> <el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button>
</div> --> </div> -->
<div slot="header" class="bpm-title">{{ $t('审核流程') }}</div> <div slot="header" class="bpm-title">{{ $t("审核流程") }}</div>
<work-flow xmlkey="merge_order" v-model="form.copyUserList"></work-flow> <work-flow xmlkey="merge_order" v-model="form.copyUserList"></work-flow>
<div slot="footer" style="margin: 20px 0"> <div slot="footer" style="margin: 20px 0">
<el-button type="primary" @click="submitForm(0)" v-hasPermi="['ecw:voucher:create:sumbit']">{{$t('提交申请')}}</el-button> <el-button
<el-button v-if="id==0||form.state==0" type="primary" :loading="saveBtnLoading" v-hasPermi="['ecw:voucher:create:save']" @click="submitForm(1)">{{ $t('保存草稿') }}</el-button> type="primary"
<el-button v-if="orderData.inWarehouseState==207" type="primary" v-hasPermi="['ecw:voucher:create:see']" @click="$router.push(`/bpm/process-instance/detail?id=`+orderApprovalBackVO.applyingFormId)">{{$t('审核中')}}</el-button> @click="submitForm(0)"
v-hasPermi="['ecw:voucher:create:sumbit']"
>{{ $t("提交申请") }}</el-button
>
<el-button
v-if="id == 0 || form.state == 0"
type="primary"
:loading="saveBtnLoading"
v-hasPermi="['ecw:voucher:create:save']"
@click="submitForm(1)"
>{{ $t("保存草稿") }}</el-button
>
<el-button
v-if="orderData.inWarehouseState == 207"
type="primary"
v-hasPermi="['ecw:voucher:create:see']"
@click="
$router.push(
`/bpm/process-instance/detail?id=` +
orderApprovalBackVO.applyingFormId
)
"
>{{ $t("审核中") }}</el-button
>
<!-- <el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button> --> <!-- <el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button> -->
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button> <el-button
plain
type="primary"
@click="$store.dispatch('tagsView/delCurrentView')"
>{{ $t("返回") }}</el-button
>
<!-- <el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button> --> <!-- <el-button type="primary" :loading="saveBtnLoading" @click="submitForm(0)">{{ id&&form.state!=0 ? $t('修改') : $t('新增收款单') }}</el-button> -->
</div> </div>
<el-dialog <el-dialog
...@@ -543,8 +764,11 @@ ...@@ -543,8 +764,11 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" <el-button
>{{$t('查询')}}</el-button type="primary"
icon="el-icon-search"
@click="handleQuery"
>{{ $t("查询") }}</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -557,23 +781,52 @@ ...@@ -557,23 +781,52 @@
row-key="id" row-key="id"
height="calc(100vh - 480px)" height="calc(100vh - 480px)"
> >
<el-table-column type="selection" width="55" :reserve-selection="true"> </el-table-column> <el-table-column
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> type="selection"
<el-table-column :label="$t('提单号')" align="center" prop="tidanNo" /> width="55"
:reserve-selection="true"
>
</el-table-column>
<el-table-column
:label="$t('订单号')"
align="center"
prop="orderNo"
/>
<el-table-column
:label="$t('提单号')"
align="center"
prop="tidanNo"
/>
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title"> <el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.titleZh?(scope.row.titleZh + "(" + scope.row.titleEn + ")"): ''}} {{
scope.row.titleZh
? scope.row.titleZh + "(" + scope.row.titleEn + ")"
: ""
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" /> <el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight"> <el-table-column
:label="$t('体积/重量')"
align="center"
prop="weight"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.volume}}/{{ scope.row.weight}} {{ scope.row.volume }}/{{ scope.row.weight }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('发货人')" align="center" prop="consignorName" /> <el-table-column
<el-table-column :label="$t('收货人')" align="center" prop="consigneeName" /> :label="$t('发货人')"
align="center"
prop="consignorName"
/>
<el-table-column
:label="$t('收货人')"
align="center"
prop="consigneeName"
/>
<el-table-column :label="$t('订单状态')" align="center" prop="status"> <el-table-column :label="$t('订单状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
...@@ -582,7 +835,11 @@ ...@@ -582,7 +835,11 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType"> <el-table-column
:label="$t('收入类型')"
align="center"
prop="feeType"
>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:type="DICT_TYPE.FEE_TYPE" :type="DICT_TYPE.FEE_TYPE"
...@@ -593,13 +850,23 @@ ...@@ -593,13 +850,23 @@
<!-- <el-table-column :label="$t('单价美元')" align="center" prop="unitPrice" /> --> <!-- <el-table-column :label="$t('单价美元')" align="center" prop="unitPrice" /> -->
<el-table-column :label="$t('单价')" align="center" prop="unitPrice"> <el-table-column :label="$t('单价')" align="center" prop="unitPrice">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.unitPrice
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount"> <el-table-column
:label="$t('总金额')"
align="center"
prop="totalAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.totalAmount
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
...@@ -613,31 +880,55 @@ ...@@ -613,31 +880,55 @@
/> />
<!-- </el-card> --> <!-- </el-card> -->
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveSelectList">{{ $t('确认添加') }}</el-button> <el-button type="primary" @click="saveSelectList">{{
<el-button @click="hiddenDialog">{{ $t('取消') }}</el-button> $t("确认添加")
}}</el-button>
<el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog v-if="discountVisible" :visible.sync="discountVisible" :title="$t('优惠信息确认')" width="60%" append-to-body> <el-dialog
v-if="discountVisible"
:visible.sync="discountVisible"
:title="$t('优惠信息确认')"
width="60%"
append-to-body
>
<el-form label-width="120px"> <el-form label-width="120px">
<el-form-item v-if="form.receiptNo" :label="$t('收款单号')"> <el-form-item v-if="form.receiptNo" :label="$t('收款单号')">
{{ form.receiptNo }} {{ form.receiptNo }}
</el-form-item> </el-form-item>
<el-table :data="[selectListRow]" border style="margin-bottom: 22px"> <el-table :data="[selectListRow]" border style="margin-bottom: 22px">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> <el-table-column
:label="$t('订单号')"
align="center"
prop="orderNo"
/>
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title"> <el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.titleZh?(scope.row.titleZh + "(" + scope.row.titleEn + ")"): ''}} {{
scope.row.titleZh
? scope.row.titleZh + "(" + scope.row.titleEn + ")"
: ""
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" /> <el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight"> <el-table-column
:label="$t('体积/重量')"
align="center"
prop="weight"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.volume}}/{{ scope.row.weight}} {{ scope.row.volume }}/{{ scope.row.weight }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType"> <el-table-column
:label="$t('收入类型')"
align="center"
prop="feeType"
>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
:type="DICT_TYPE.FEE_TYPE" :type="DICT_TYPE.FEE_TYPE"
...@@ -645,33 +936,62 @@ ...@@ -645,33 +936,62 @@
></dict-tag> ></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('单价金额')" align="center" prop="unitPrice"> <el-table-column
:label="$t('单价金额')"
align="center"
prop="unitPrice"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.unitPrice }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.unitPrice
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount"> <el-table-column
:label="$t('总金额')"
align="center"
prop="totalAmount"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.taxAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span> <span
>{{ scope.row.taxAmount
}}{{ getCurrencyLabel(scope.row.currencyId) }}</span
>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-form-item :label="$t('总金额')"> <el-form-item :label="$t('总金额')">
{{ selectListRow.taxAmount }}{{getCurrencyLabel(selectListRow.currencyId)}} {{ selectListRow.taxAmount
}}{{ getCurrencyLabel(selectListRow.currencyId) }}
</el-form-item> </el-form-item>
<el-form-item :label="$t('优惠金额')"> <el-form-item :label="$t('优惠金额')">
<el-input v-model="discountForm.discountTotal" type="number" min="0" :max="selectListRow.totalAmount" @input="checkDiscount" style="width: 300px" ></el-input> <el-input
&nbsp;&nbsp;{{getCurrencyLabel(selectListRow.currencyId)}} v-model="discountForm.discountTotal"
type="number"
min="0"
:max="selectListRow.totalAmount"
@input="checkDiscount"
style="width: 300px"
></el-input>
&nbsp;&nbsp;{{ getCurrencyLabel(selectListRow.currencyId) }}
</el-form-item> </el-form-item>
<el-form-item :label="$t('优惠原因')"> <el-form-item :label="$t('优惠原因')">
<el-input v-model="discountForm.discountRemark" type="textarea" style="width: 300px"></el-input> <el-input
v-model="discountForm.discountRemark"
type="textarea"
style="width: 300px"
></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('优惠后')"> <el-form-item :label="$t('优惠后')">
{{ (selectListRow.taxAmount - (discountForm.discountTotal || 0)).toFixed(2)}} {{
{{getCurrencyLabel(selectListRow.currencyId)}} (
selectListRow.taxAmount - (discountForm.discountTotal || 0)
).toFixed(2)
}}
{{ getCurrencyLabel(selectListRow.currencyId) }}
</el-form-item> </el-form-item>
<el-form-item v-if="opnotice" :label="$t('操作人')"> <el-form-item v-if="opnotice" :label="$t('操作人')">
{{ discountForm.author }} {{ discountForm.author }}
...@@ -681,8 +1001,10 @@ ...@@ -681,8 +1001,10 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveDiscount">{{$t('提交') }}</el-button> <el-button type="primary" @click="saveDiscount">{{
<el-button @click="cancelDiscount">{{ $t('取消') }}</el-button> $t("提交")
}}</el-button>
<el-button @click="cancelDiscount">{{ $t("取消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -698,22 +1020,35 @@ import { getBankAccountPage } from "@/api/ecw/bankAccount"; ...@@ -698,22 +1020,35 @@ import { getBankAccountPage } from "@/api/ecw/bankAccount";
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 { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import { createReceipt,getReceivableByOrderId, getReceivableList, getReceivableItemDetail, getReceiptInfoByIds, getReceiptAccountList, getInvoicingItem, updateReceipt, updateReceivableDiscountById, getReceivableDiscountLogById } from "@/api/ecw/financial"; import {
import {getCustomer} from '@/api/ecw/customer' createReceipt,
import NP from 'number-precision' getReceivableByOrderId,
import {getOrder,getDestCountryByOrderId} from '@/api/ecw/order' getReceivableList,
getReceivableItemDetail,
getReceiptInfoByIds,
getReceiptAccountList,
getInvoicingItem,
updateReceipt,
updateReceivableDiscountById,
getReceivableDiscountLogById,
} from "@/api/ecw/financial";
import { getCustomer } from "@/api/ecw/customer";
import NP from "number-precision";
import { getOrder, getDestCountryByOrderId } from "@/api/ecw/order";
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency";
import { getExchangeRatePage } from "@/api/ecw/exchangeRate"; import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import ret from "bluebird/js/release/util"; import ret from "bluebird/js/release/util";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { getUserProfile } from "@/api/system/user"; import { getUserProfile } from "@/api/system/user";
import {getWarehouseList} from '@/api/ecw/warehouse' import { getWarehouseList } from "@/api/ecw/warehouse";
import WorkFlow from '@/components/WorkFlow/' import WorkFlow from "@/components/WorkFlow/";
export default { export default {
name: "EcwFinancialCreatcollection", name: "EcwFinancialCreatcollection",
components: { components: {
CustomerSelector,WorkFlow,CustomerSelectorpay CustomerSelector,
WorkFlow,
CustomerSelectorpay,
}, },
data() { data() {
return { return {
...@@ -723,15 +1058,15 @@ export default { ...@@ -723,15 +1058,15 @@ export default {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址 uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
form: { form: {
receiptAccountList: [], receiptAccountList: [],
departmentId:'', departmentId: "",
salesmanId:'', salesmanId: "",
salesmanName:'' salesmanName: "",
}, },
creatorData: [], creatorData: [],
list: [], list: [],
// fileList: [], // fileList: [],
orderData: [], orderData: [],
opnotice:false, opnotice: false,
dialogTableKey: 0, dialogTableKey: 0,
total: 0, total: 0,
headers: { headers: {
...@@ -760,161 +1095,208 @@ export default { ...@@ -760,161 +1095,208 @@ export default {
saveBtnLoading: false, saveBtnLoading: false,
discountVisible: false, discountVisible: false,
discountForm: { discountForm: {
author:'' author: "",
}, },
selectListRow: {}, selectListRow: {},
selectListIndex: 0, selectListIndex: 0,
flag: false, flag: false,
warehouseList:[], warehouseList: [],
selectedUsers:[], selectedUsers: [],
dialogVisible:false, dialogVisible: false,
isUpdate:false, isUpdate: false,
codeLoading: false, codeLoading: false,
codePage: { codePage: {
pageNo: 1, pageNo: 1,
pageSize: 100 pageSize: 100,
}, },
pages:1, pages: 1,
rateList:[], rateList: [],
userInfo:null userInfo: null,
//订单编号 lanbm 2024-05-20 add
orderId: undefined,
}; };
}, },
async activated(){ async activated() {
let that = this; let that = this;
await getUserProfile().then(res => that.userInfo = res.data) await getUserProfile().then((res) => (that.userInfo = res.data));
if (that.$route.query.id) { if (that.$route.query.id) {
that.flag = true that.flag = true;
that.id = that.$route.query.id; that.id = that.$route.query.id;
that.getReceivableData() that.getReceivableData();
}else{ } else {
that.removeData() that.removeData();
that.$set(that.form,'departmentId',that.userInfo.deptId) that.$set(that.form, "departmentId", that.userInfo.deptId);
that.$set(that.discountForm,'author',that.userInfo.nickname) that.$set(that.discountForm, "author", that.userInfo.nickname);
that.$set(that.form,'salesmanId',that.userInfo.id) that.$set(that.form, "salesmanId", that.userInfo.id);
that.$set(that.form,'salesmanName',that.userInfo.nickname) that.$set(that.form, "salesmanName", that.userInfo.nickname);
} }
if (that.$route.query.receiptId && that.$route.query.receiptId != 0) { if (that.$route.query.receiptId && that.$route.query.receiptId != 0) {
that.receiptId = that.$route.query.receiptId; that.receiptId = that.$route.query.receiptId;
that.getReceivableInfo() that.getReceivableInfo();
}else{ } else {
// that.removeData() // that.removeData()
} }
if (that.$route.query.orderId) { if (that.$route.query.orderId) {
getReceivableByOrderId({orderId:that.$route.query.orderId}).then(response => { getReceivableByOrderId({ orderId: that.$route.query.orderId }).then(
that.list = [...response.data] (response) => {
that.list.map(v=>{ that.list = [...response.data];
if(!v.taxPoint){ that.list.map((v) => {
v.taxAmount = v.totalAmount if (!v.taxPoint) {
v.taxAmount = v.totalAmount;
} }
}) });
that.calculation() that.calculation();
getOrder(that.$route.query.orderId).then(response => { getOrder(that.$route.query.orderId).then((response) => {
// console.log(response.data) // console.log(response.data)
if(response.data.customerId){ if (response.data.customerId) {
that.$set(that.form,'customerId',response.data.customerId) that.$set(that.form, "customerId", response.data.customerId);
}else{ } else {
if(response.data.drawee==1){ if (response.data.drawee == 1) {
that.$set(that.form,'customerId',response.data.consignorVO.customerId) that.$set(
}else if(response.data.drawee==2){ that.form,
that.$set(that.form,'customerId',response.data.consigneeVO.customerId) "customerId",
}else{ response.data.consignorVO.customerId
if(response.data.customDraweeVOList){ );
response.data.customDraweeVOList.map(v=>{ } else if (response.data.drawee == 2) {
if(v.name == 'freight'){ that.$set(
if(v.value==1){ that.form,
that.$set(that.form,'customerId',response.data.consignorVO.customerId) "customerId",
}else{ response.data.consigneeVO.customerId
that.$set(that.form,'customerId',response.data.consigneeVO.customerId) );
} else {
if (response.data.customDraweeVOList) {
response.data.customDraweeVOList.map((v) => {
if (v.name == "freight") {
if (v.value == 1) {
that.$set(
that.form,
"customerId",
response.data.consignorVO.customerId
);
} else {
that.$set(
that.form,
"customerId",
response.data.consigneeVO.customerId
);
} }
} }
}) });
} }
} }
} }
}) });
getDestCountryByOrderId({orderId:that.$route.query.orderId}).then(response => { getDestCountryByOrderId({ orderId: that.$route.query.orderId }).then(
(response) => {
// console.log(response.data) // console.log(response.data)
if(response.data) that.$set(that.queryParams,'destCountry',response.data) if (response.data)
}) that.$set(that.queryParams, "destCountry", response.data);
}) }
);
}
);
} }
}, },
directives: { directives: {
'el-select-loadmore': { "el-select-loadmore": {
bind (el, binding) { bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector( const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap' ".el-select-dropdown .el-select-dropdown__wrap"
) );
SELECTWRAP_DOM.addEventListener('scroll', function () { SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) { if (condition) {
binding.value() binding.value();
}
})
}
} }
});
},
},
}, },
async created() { async created() {
await getUserProfile().then(res => this.userInfo = res.data) await getUserProfile().then((res) => (this.userInfo = res.data));
// 获取汇率 // 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list) (res) => (this.currencyList = res.data.list)
getWarehouseList().then(res => this.warehouseList = res.data) );
await getExchangeRatePage(this.params).then(
(res) => (this.rateList = res.data.list)
);
getWarehouseList().then((res) => (this.warehouseList = res.data));
let that = this; let that = this;
if (that.$route.query.orderId) { if (that.$route.query.orderId) {
await getReceivableByOrderId({orderId:that.$route.query.orderId}).then(response => { //lanbm 2024-05-20 添加订单ID
this.list = [...response.data] this.orderId = that.$route.query.orderId;
this.list.map(v=>{ await getReceivableByOrderId({ orderId: that.$route.query.orderId }).then(
if(!v.taxPoint){ (response) => {
v.taxAmount = v.totalAmount this.list = [...response.data];
this.list.map((v) => {
if (!v.taxPoint) {
v.taxAmount = v.totalAmount;
} }
}) });
this.calculation() this.calculation();
getOrder(that.$route.query.orderId).then(response => { getOrder(that.$route.query.orderId).then((response) => {
if(response.data.customerId){ if (response.data.customerId) {
that.$set(that.form,'customerId',response.data.customerId) that.$set(that.form, "customerId", response.data.customerId);
}else{ } else {
if(response.data.drawee==1){ if (response.data.drawee == 1) {
that.$set(that.form,'customerId',response.data.consignorVO.customerId) that.$set(
}else if(response.data.drawee==2){ that.form,
that.$set(that.form,'customerId',response.data.consigneeVO.customerId) "customerId",
}else{ response.data.consignorVO.customerId
if(response.data.customDraweeVOList){ );
response.data.customDraweeVOList.map(v=>{ } else if (response.data.drawee == 2) {
if(v.name == 'freight'){ that.$set(
if(v.value==1){ that.form,
that.$set(that.form,'customerId',response.data.consignorVO.customerId) "customerId",
}else{ response.data.consigneeVO.customerId
that.$set(that.form,'customerId',response.data.consigneeVO.customerId) );
} else {
if (response.data.customDraweeVOList) {
response.data.customDraweeVOList.map((v) => {
if (v.name == "freight") {
if (v.value == 1) {
that.$set(
that.form,
"customerId",
response.data.consignorVO.customerId
);
} else {
that.$set(
that.form,
"customerId",
response.data.consigneeVO.customerId
);
} }
} }
}) });
} }
} }
} }
}) });
}) }
getDestCountryByOrderId({orderId:this.$route.query.orderId}).then(response => { );
if(response.data) this.$set(this.queryParams,'destCountry',response.data) getDestCountryByOrderId({ orderId: this.$route.query.orderId }).then(
}) (response) => {
if (response.data)
this.$set(this.queryParams, "destCountry", response.data);
}
);
} }
if (that.$route.query.id) { if (that.$route.query.id) {
this.flag = true this.flag = true;
this.id = this.$route.query.id; this.id = this.$route.query.id;
this.getReceivableData() this.getReceivableData();
}else{ } else {
this.discountForm.author = this.userInfo.nickname this.discountForm.author = this.userInfo.nickname;
this.form.departmentId = this.userInfo.deptId this.form.departmentId = this.userInfo.deptId;
this.form.salesmanId = this.userInfo.id this.form.salesmanId = this.userInfo.id;
this.$set(this.form,'salesmanName',this.userInfo.nickname) this.$set(this.form, "salesmanName", this.userInfo.nickname);
} }
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') { if (that.$route.query.receiptId && that.$route.query.receiptId !== "0") {
this.receiptId = this.$route.query.receiptId; this.receiptId = this.$route.query.receiptId;
this.getReceivableInfo() this.getReceivableInfo();
} }
// this.getList(); // this.getList();
...@@ -927,9 +1309,9 @@ export default { ...@@ -927,9 +1309,9 @@ export default {
listSimpleUsers().then((res) => (that.creatorData = res.data)); listSimpleUsers().then((res) => (that.creatorData = res.data));
getChannelList().then((res) => (that.channelList = res.data)); getChannelList().then((res) => (that.channelList = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getCodeList() this.getCodeList();
listSimpleDepts().then((res) => { listSimpleDepts().then((res) => {
that.deptData = res.data that.deptData = res.data;
// res.data.forEach((item) => { // res.data.forEach((item) => {
// if (item.parentId == 0) { // if (item.parentId == 0) {
// that.deptArr.push(item); // that.deptArr.push(item);
...@@ -949,87 +1331,105 @@ export default { ...@@ -949,87 +1331,105 @@ export default {
computed: { computed: {
expoerCityList() { expoerCityList() {
// return this.tradeCityList.filter((item) => item.type == 2); // return this.tradeCityList.filter((item) => item.type == 2);
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3) return this.warehouseList.filter(
(item) => item.tradeType == 2 || item.tradeType == 3
);
}, },
importCityList() { importCityList() {
// return this.tradeCityList.filter((item) => item.type == 1); // return this.tradeCityList.filter((item) => item.type == 1);
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3) return this.warehouseList.filter(
(item) => item.tradeType == 1 || item.tradeType == 3
);
}, },
showCurrencyId() { showCurrencyId() {
let fieldList = []; let fieldList = [];
let groupList=[]; let groupList = [];
this.list.map((element)=>{ this.list.map((element) => {
if(fieldList.indexOf(element['currencyId'])===-1){ if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element['currencyId']) fieldList.push(element["currencyId"]);
} }
}) });
for(let i=0;i<fieldList.length;i++){ for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element)=>{ let arr = this.list.filter((element) => {
return element['currencyId']===fieldList[i]; return element["currencyId"] === fieldList[i];
}) });
groupList.push({ groupList.push({
currencyId:arr[0].currencyId, currencyId: arr[0].currencyId,
list:arr list: arr,
}) });
} }
if (groupList.length === 1) return groupList[0].currencyId if (groupList.length === 1) return groupList[0].currencyId;
else return 1 else return 1;
}, },
showInvoice() { showInvoice() {
return this.form.openInvoice == 1 return this.form.openInvoice == 1;
} },
}, },
methods: { methods: {
// 懒加载 // 懒加载
loadmore () { loadmore() {
this.codePage.pageNo++ this.codePage.pageNo++;
// 大于页码不请求了 // 大于页码不请求了
console.log(111) console.log(111);
if (this.codePage.pageNo > this.pages) { if (this.codePage.pageNo > this.pages) {
return return;
} }
this.getCodeList() this.getCodeList();
}, },
getCodeList (flag) { getCodeList(flag) {
if (flag) { if (flag) {
this.bankData = [] this.bankData = [];
this.codeLoading = true this.codeLoading = true;
} }
setTimeout(() => { setTimeout(() => {
getBankAccountPage(this.codePage).then(res => { getBankAccountPage(this.codePage).then((res) => {
this.codeLoading = false this.codeLoading = false;
this.bankData = this.bankData.concat(res.data.list) this.bankData = this.bankData.concat(res.data.list);
this.pages = (res.data.total/this.codePage.pageSize)+1 this.pages = res.data.total / this.codePage.pageSize + 1;
}) });
}, 200) }, 200);
}, },
getReceivableData(){ getReceivableData() {
getReceiptInfoByIds({ id: this.id }).then(res => { getReceiptInfoByIds({ id: this.id }).then((res) => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss') if (res.data.rateValidateDate)
this.form = Object.assign({}, this.form, res.data) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format(
this.discountForm.author = this.userInfo.nickname "YYYY-MM-DD HH:mm:ss"
if(!this.form.departmentId) this.form.departmentId = this.userInfo.deptId );
if(!this.form.salesmanId) this.form.salesmanId = this.userInfo.id this.form = Object.assign({}, this.form, res.data);
if(!this.form.salesmanName) this.$set(this.form,'salesmanName',this.userInfo.nickname) this.discountForm.author = this.userInfo.nickname;
}) if (!this.form.departmentId)
getInvoicingItem({ id: this.id }).then(res => { this.form.departmentId = this.userInfo.deptId;
this.list = [...res.data] if (!this.form.salesmanId) this.form.salesmanId = this.userInfo.id;
this.list.map(v=>{ if (!this.form.salesmanName)
if(!v.taxPoint){ this.$set(this.form, "salesmanName", this.userInfo.nickname);
v.taxAmount = v.totalAmount });
getInvoicingItem({ id: this.id }).then((res) => {
this.list = [...res.data];
this.list.map((v) => {
if (!v.taxPoint) {
v.taxAmount = v.totalAmount;
} }
}) });
}) });
getReceiptAccountList({ id: this.id }).then(res => { getReceiptAccountList({ id: this.id }).then((res) => {
if (res.data.length > 0) { if (res.data.length > 0) {
// totalAmount // totalAmount
res.data = [...res.data, { res.data = [
type: 'total', ...res.data,
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0).toFixed(2), {
collectionAmount: [] type: "total",
}] writeOffAmount: res.data
.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.writeOffAmount || 0),
0
)
.toFixed(2),
collectionAmount: [],
},
];
} }
this.$set(this.form, 'receiptAccountList', res.data) this.$set(this.form, "receiptAccountList", res.data);
this.$nextTick(() => { this.$nextTick(() => {
// const dollarList = this.list.filter(v => v.currencyId === 1) // const dollarList = this.list.filter(v => v.currencyId === 1)
...@@ -1051,43 +1451,47 @@ export default { ...@@ -1051,43 +1451,47 @@ export default {
// this.rateChange(item, index) // this.rateChange(item, index)
// }); // });
console.log(111) console.log(111);
if(this.form.receiptAccountList.length>0){ if (this.form.receiptAccountList.length > 0) {
this.editReceiptAccountList() this.editReceiptAccountList();
} }
// this.calculation() // this.calculation()
}) });
}) });
}, },
getReceivableInfo(){ getReceivableInfo() {
getReceivableItemDetail({ id: this.receiptId}).then(res => { getReceivableItemDetail({ id: this.receiptId }).then((res) => {
this.list = res.data this.list = res.data;
this.list.map(v=>{ this.list.map((v) => {
if(!v.taxPoint){ if (!v.taxPoint) {
v.taxAmount = v.totalAmount v.taxAmount = v.totalAmount;
} }
}) });
this.calculation() this.calculation();
getOrder(res.data.orderId).then(response => { getOrder(res.data.orderId).then((response) => {
// console.log(response.data) // console.log(response.data)
if(response.data.customerId) this.$set(this.form,'customerId',response.data.customerId) if (response.data.customerId)
}) this.$set(this.form, "customerId", response.data.customerId);
}) });
});
}, },
getCurrencyLabel(id){ getCurrencyLabel(id) {
var label = this.currencyList.filter(item=>item.id == id) var label = this.currencyList.filter((item) => item.id == id);
if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn if (label.length > 0)
return '' return this.$i18n.locale == "zh_CN"
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
checkDiscount(e){ checkDiscount(e) {
if(e>this.selectListRow.totalAmount){ if (e > this.selectListRow.totalAmount) {
this.discountForm.discountTotal = this.selectListRow.totalAmount this.discountForm.discountTotal = this.selectListRow.totalAmount;
} }
}, },
currencyIdChange(val, row, index) { currencyIdChange(val, row, index) {
row.collectionCurrencyId = val row.collectionCurrencyId = val;
if (val == row.currencyId) row.collectionRate = 1 if (val == row.currencyId) row.collectionRate = 1;
else { else {
// if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB() // if (row.currencyId == 1 && val == 3) row.collectionRate = this.UStoRMB()
// if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN() // if (row.currencyId == 1 && val == 2) row.collectionRate = this.UStoNAN()
...@@ -1096,185 +1500,173 @@ export default { ...@@ -1096,185 +1500,173 @@ export default {
// if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS() // if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
// if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB() // if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
// row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6) // row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6)
row.collectionRate = this.getRate(row.currencyId,val) row.collectionRate = this.getRate(row.currencyId, val);
} }
this.rateChange(row, index) this.rateChange(row, index);
}, },
//获取汇率 //获取汇率
getRate(sourceCurrencyId,targetCurrencyId){ getRate(sourceCurrencyId, targetCurrencyId) {
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId)) var rate = this.rateList.find(
if(rate) return rate.currencyRate (v) =>
return '' v.sourceCurrencyId === sourceCurrencyId &&
v.targetCurrencyId === targetCurrencyId
);
if (rate) return rate.currencyRate;
return "";
}, },
writeOffRateChange(row, index) { writeOffRateChange(row, index) {
if(row.writeOffRate==0&&parseInt(row.writeOffRate)===0){ if (row.writeOffRate == 0 && parseInt(row.writeOffRate) === 0) {
this.$modal.msgError(this.$t('汇率不能为0,请输入正确的汇率')); this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"));
} }
if(row.writeOffRate){ if (row.writeOffRate) {
row.writeOffAmount = NP.times(
row.writeOffAmount = NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2) row.writeOffRate || 0,
}else{ NP.minus(row.receivableAmount, row.discountTotal || 0)
row.writeOffAmount = '' ).toFixed(2);
} else {
row.writeOffAmount = "";
} }
const writeOffAmountTotal = this.form.receiptAccountList.filter(v => v.type !== 'total').reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0) const writeOffAmountTotal = this.form.receiptAccountList
this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal .filter((v) => v.type !== "total")
.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.writeOffAmount || 0),
0
);
this.form.receiptAccountList[
this.form.receiptAccountList.length - 1
].writeOffAmount = writeOffAmountTotal;
}, },
rateChange(row, index) { rateChange(row, index) {
if(row.collectionRate==0&&parseInt(row.collectionRate)===0){ if (row.collectionRate == 0 && parseInt(row.collectionRate) === 0) {
this.$modal.msgError(this.$t('汇率不能为0,请输入正确的汇率')); this.$modal.msgError(this.$t("汇率不能为0,请输入正确的汇率"));
} }
if(row.collectionRate){ if (row.collectionRate) {
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2)) row.receivableAmount &&
}else{ (row.collectionAmount = NP.times(
row.collectionAmount = '' row.collectionRate || 0,
NP.minus(row.receivableAmount, row.discountTotal || 0)
).toFixed(2));
} else {
row.collectionAmount = "";
} }
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = { ...row };
setTimeout(() => { setTimeout(() => {
// 收款总计 // 收款总计
this.editReceiptAccountList() this.editReceiptAccountList();
}, 100) }, 100);
}, },
editReceiptAccountList(){ editReceiptAccountList() {
var amountList =[] var amountList = [];
this.currencyList.forEach((item,index)=>{ this.currencyList.forEach((item, index) => {
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id) var dollarList = this.form.receiptAccountList.filter(
if(dollarList.length>0){ (v) => v.collectionCurrencyId == item.id
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0) );
amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar.toFixed(2)}) if (dollarList.length > 0) {
var dollar = dollarList.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.collectionAmount),
0
);
amountList.push({
currencyId: item.id,
currencyNameEn: item.titleEn,
currencyNameZh: item.titleZh,
amount: dollar.toFixed(2),
});
} }
}) });
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList this.form.receiptAccountList[
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList]) this.form.receiptAccountList.length - 1
].collectionAmount = amountList;
this.$set(this.form, "receiptAccountList", [
...this.form.receiptAccountList,
]);
}, },
//明细改变税率 //明细改变税率
changeTaxRate(row,index){ changeTaxRate(row, index) {
var pointArr = [] var pointArr = [];
var regs=/^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/; var regs = /^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/;
if(row.taxPoint&&!regs.test(row.taxPoint)){ if (row.taxPoint && !regs.test(row.taxPoint)) {
row.taxPoint = '' row.taxPoint = "";
this.$modal.msgError(this.$t('输入税率格式不对')); this.$modal.msgError(this.$t("输入税率格式不对"));
}else{ } else {
pointArr = row.taxPoint.split('.') pointArr = row.taxPoint.split(".");
if(pointArr.length>1&&pointArr[1]){ if (pointArr.length > 1 && pointArr[1]) {
row.taxPoint =Math.round(row.taxPoint*100)/100 row.taxPoint = Math.round(row.taxPoint * 100) / 100;
} }
} }
if(row.taxPoint){ if (row.taxPoint) {
var amout = NP.times(NP.divide(row.taxPoint,100), row.totalAmount) var amout = NP.times(NP.divide(row.taxPoint, 100), row.totalAmount);
row.taxAmount = NP.plus(row.totalAmount,amout) row.taxAmount = NP.plus(row.totalAmount, amout);
}else{ } else {
row.taxAmount = row.totalAmount row.taxAmount = row.totalAmount;
} }
this.list[index] = {...row} this.list[index] = { ...row };
let dataArrTemp = JSON.stringify(this.list); let dataArrTemp = JSON.stringify(this.list);
this.list= JSON.parse(dataArrTemp); this.list = JSON.parse(dataArrTemp);
if(pointArr.length>1&&!pointArr[1]){ if (pointArr.length > 1 && !pointArr[1]) {
return return;
}else{ } else {
this.calculation() this.calculation();
} }
}, },
calculation() { calculation() {
const copyList = this.form.receiptAccountList const copyList = this.form.receiptAccountList;
this.form.receiptAccountList = [] this.form.receiptAccountList = [];
this.currencyList.forEach((item,index)=>{ this.currencyList.forEach((item, index) => {
var dollarList = this.list.filter(v => v.currencyId === item.id) var dollarList = this.list.filter((v) => v.currencyId === item.id);
if(dollarList.length>0){ if (dollarList.length > 0) {
let dollar,discountDollar let dollar, discountDollar;
dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.taxAmount || 0), 0) dollar = dollarList.reduce(
discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0) (total, currentValue) =>
var t = copyList.find(v => v.currencyId == item.id) NP.plus(total, currentValue.taxAmount || 0),
console.log(discountDollar) 0
this.form.receiptAccountList.push( );
{ discountDollar = dollarList.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.discountTotal || 0),
0
);
var t = copyList.find((v) => v.currencyId == item.id);
console.log(discountDollar);
this.form.receiptAccountList.push({
discountTotal: discountDollar, discountTotal: discountDollar,
currencyId: item.id, currencyId: item.id,
receivableAmount: Math.round(dollar), receivableAmount: Math.round(dollar),
writeOffRate: item.id==this.showCurrencyId?1: this.getRate(item.id,this.showCurrencyId), writeOffRate:
platformAccountId: t?.platformAccountId || '', item.id == this.showCurrencyId
? 1
: this.getRate(item.id, this.showCurrencyId),
platformAccountId: t?.platformAccountId || "",
collectionCurrencyId: item.id, collectionCurrencyId: item.id,
collectionRate: 1 collectionRate: 1,
} });
) this.calculationCount(NP.minus(dollar, discountDollar), item.id);
this.calculationCount(NP.minus(dollar, discountDollar), item.id)
} }
}) });
// let dollar,discountDollar
// if (dollarList.length > 0) {
// dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 1)
// this.form.receiptAccountList = [
// {
// discountTotal: discountDollar,
// currencyId: 1,
// receivableAmount: dollar,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? 1 : this.showCurrencyId === 2 ? this.UStoRMB() : this.UStoNAN()),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || 1,
// collectionRate: t?.collectionRate || 1
// }
// ]
// this.calculationCount(NP.minus(dollar, discountDollar), 1)
// }
// const rmbList = this.list.filter(v => v.currencyId === 2)
// let rmb,discountRmb
// if (rmbList.length > 0) {
// rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 2)
// this.form.receiptAccountList = [
// ...this.form.receiptAccountList,
// {
// discountTotal: discountRmb,
// currencyId: 2,
// receivableAmount: rmb,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.RMBtoUS() : this.showCurrencyId === 2 ? 1 : this.RMBtoNAN()),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || '',
// collectionRate: t?.collectionRate || ''
// }
// ]
// this.calculationCount(NP.minus(rmb, discountRmb), 2)
// }
// const nairaList = this.list.filter(v => v.currencyId === 3)
// let naira,discountNaira
// if (nairaList.length > 0) {
// naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.totalAmount || 0), 0)
// discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const t = copyList.find(v => v.currencyId == 3)
// this.form.receiptAccountList = [
// ...this.form.receiptAccountList,
// {
// discountTotal: discountNaira,
// currencyId: 3,
// receivableAmount: naira,
// writeOffRate: t?.writeOffRate || (this.showCurrencyId === 1 ? this.NANtoUS() : this.showCurrencyId === 2 ? this.NANtoRMB() : 1),
// platformAccountId: t?.platformAccountId || '',
// collectionCurrencyId: t?.collectionCurrencyId || '',
// collectionRate: t?.collectionRate || '',
// collectionAmount:discountNaira
// }
// ]
// this.calculationCount(NP.minus(naira, discountNaira), 3)
// }
if (this.form.receiptAccountList.length > 0) { if (this.form.receiptAccountList.length > 0) {
// totalAmount // totalAmount
const totalt = this.form.receiptAccountList.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0) const totalt = this.form.receiptAccountList.reduce(
this.form.receiptAccountList = [...this.form.receiptAccountList, { (total, currentValue) =>
type: 'total', NP.plus(total, currentValue.writeOffAmount || 0),
writeOffAmount:totalt.toFixed(2), 0
collectionAmount: [] );
}] this.form.receiptAccountList = [
...this.form.receiptAccountList,
{
type: "total",
writeOffAmount: totalt.toFixed(2),
collectionAmount: [],
},
];
this.form.receivableTotalAmount = totalt.toFixed(2) this.form.receivableTotalAmount = totalt.toFixed(2);
} }
// receiptAccountList: [ // receiptAccountList: [
// { currencyId: 1, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 }, // { currencyId: 1, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
...@@ -1282,7 +1674,8 @@ export default { ...@@ -1282,7 +1674,8 @@ export default {
// { currencyId: 3, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 }, // { currencyId: 3, receivableAmount: 0, writeOffRate: 1, writeOffAmount: 999, platformAccountId: '', currencyId: '', rate: 1, collectionAmount: 0 },
// ] // ]
if (this.showCurrencyId === 1) { // 美元 if (this.showCurrencyId === 1) {
// 美元
// const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira)) // const usCount = NP.plus(dollar, NP.times(this.RMBtoUS(), rmb), NP.times(this.NANtoUS(), naira))
// this.form.receivableDetailList[0].rate = 1 // this.form.receivableDetailList[0].rate = 1
// this.form.receivableDetailList[0].amount = usCount // this.form.receivableDetailList[0].amount = usCount
...@@ -1290,7 +1683,8 @@ export default { ...@@ -1290,7 +1683,8 @@ export default {
// this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.UStoNAN()) // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.UStoNAN())
// this.form.receivableTotalAmount = usCount // this.form.receivableTotalAmount = usCount
// this.calculationCount(usCount) // this.calculationCount(usCount)
} else if (this.showCurrencyId === 2) { // 人民币 } else if (this.showCurrencyId === 2) {
// 人民币
// const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira)) // const rmbCount = NP.plus(rmb, NP.times(this.UStoRMB(), dollar), NP.times(this.NANtoRMB(), naira))
// this.form.receivableDetailList[1].rate = 1 // this.form.receivableDetailList[1].rate = 1
// this.form.receivableDetailList[1].amount = usCount // this.form.receivableDetailList[1].amount = usCount
...@@ -1298,7 +1692,8 @@ export default { ...@@ -1298,7 +1692,8 @@ export default {
// this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.RMBtoNAN()) // this.form.receivableDetailList[2].rate || (this.form.receivableDetailList[2].rate = this.RMBtoNAN())
// this.form.receivableTotalAmount = rmbCount // this.form.receivableTotalAmount = rmbCount
// this.calculationCount(rmbCount) // this.calculationCount(rmbCount)
} else if (this.showCurrencyId === 3) { // 奈拉 } else if (this.showCurrencyId === 3) {
// 奈拉
// const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar), NP.times(this.RMBtoNAN(), rmb)) // const nairaCount = NP.plus(naira, NP.times(this.UStoNAN(), dollar), NP.times(this.RMBtoNAN(), rmb))
// this.form.receivableDetailList[2].rate = 1 // this.form.receivableDetailList[2].rate = 1
// this.form.receivableDetailList[2].amount = nairaCount // this.form.receivableDetailList[2].amount = nairaCount
...@@ -1308,41 +1703,58 @@ export default { ...@@ -1308,41 +1703,58 @@ export default {
// this.calculationCount(nairaCount) // this.calculationCount(nairaCount)
} }
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList]) this.$set(this.form, "receiptAccountList", [
...this.form.receiptAccountList,
]);
}, },
calculationCount(usCount, type) { calculationCount(usCount, type) {
const index = this.form.receiptAccountList.findIndex(v => v.currencyId == type) const index = this.form.receiptAccountList.findIndex(
const t = this.form.receiptAccountList[index] (v) => v.currencyId == type
);
const t = this.form.receiptAccountList[index];
if (t) { if (t) {
t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount).toFixed(2) t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount).toFixed(2);
this.rateChange(t, index) this.rateChange(t, index);
} }
}, },
RMBtoUS() { RMBtoUS() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv).toFixed(6) return NP.divide(
100,
this.currencyList.find((v) => v.titleEn === "USD").huilv
).toFixed(6);
}, },
NANtoUS() { NANtoUS() {
return NP.times(this.RMBtoUS(), this.NANtoRMB()).toFixed(6) return NP.times(this.RMBtoUS(), this.NANtoRMB()).toFixed(6);
}, },
UStoRMB() { UStoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'USD').huilv, 100).toFixed(6) return NP.divide(
this.currencyList.find((v) => v.titleEn === "USD").huilv,
100
).toFixed(6);
}, },
UStoNAN() { UStoNAN() {
return NP.times(this.RMBtoNAN(), this.UStoRMB()).toFixed(6) return NP.times(this.RMBtoNAN(), this.UStoRMB()).toFixed(6);
}, },
RMBtoNAN() { RMBtoNAN() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'NGN').huilv).toFixed(6) return NP.divide(
100,
this.currencyList.find((v) => v.titleEn === "NGN").huilv
).toFixed(6);
}, },
NANtoRMB() { NANtoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100).toFixed(6) return NP.divide(
this.currencyList.find((v) => v.titleEn === "NGN").huilv,
100
).toFixed(6);
}, },
customerChange(value) { customerChange(value) {
if (this.flag||!value) { if (this.flag || !value) {
this.flag = false this.flag = false;
return return;
} }
this.form.customerName = value.payerName?value.payerName:value.name this.form.customerName = value.payerName ? value.payerName : value.name;
this.form.customerId && getCustomer(this.form.customerId).then(res => { this.form.customerId &&
getCustomer(this.form.customerId).then((res) => {
this.form = { this.form = {
...this.form, ...this.form,
invoice: res.data.invoiceTitle, invoice: res.data.invoiceTitle,
...@@ -1351,46 +1763,66 @@ export default { ...@@ -1351,46 +1763,66 @@ export default {
accountName: res.data.bankNumber, accountName: res.data.bankNumber,
projectName: res.data.project, projectName: res.data.project,
taxRate: res.data.taxRate, taxRate: res.data.taxRate,
addressPhone: `${res.data.billingAddress || ''}/${res.data.billingTell || ''}`, addressPhone: `${res.data.billingAddress || ""}/${
} res.data.billingTell || ""
}) }`,
};
});
}, },
cancelDiscount() { cancelDiscount() {
this.discountVisible = false this.discountVisible = false;
this.discountForm = {} this.discountForm = {};
this.selectListRow = {} this.selectListRow = {};
}, },
addDiscount(row, index) { addDiscount(row, index) {
this.discountVisible = true this.discountVisible = true;
this.selectListRow = { ...row } this.selectListRow = { ...row };
console.log(this.selectListRow) console.log(this.selectListRow);
this.selectListIndex = index this.selectListIndex = index;
this.$set(this.discountForm, 'time', dayjs().format('YYYY-MM-DD HH:mm:ss')) this.$set(
getReceivableDiscountLogById({ id: row.id }).then(res => { this.discountForm,
"time",
dayjs().format("YYYY-MM-DD HH:mm:ss")
);
getReceivableDiscountLogById({ id: row.id }).then((res) => {
if (res.data?.creatorName) { if (res.data?.creatorName) {
this.$set(this.discountForm, 'time', dayjs(res.data.createTime).format('YYYY-MM-DD HH:mm:ss')) this.$set(
this.$set(this.discountForm, 'discountTotal', res.data.discountTotal) this.discountForm,
this.$set(this.discountForm, 'discountRemark', res.data.discountRemark) "time",
this.$set(this.discountForm, 'author', res.data.creatorName) dayjs(res.data.createTime).format("YYYY-MM-DD HH:mm:ss")
this.opnotice = true );
}else{ this.$set(this.discountForm, "discountTotal", res.data.discountTotal);
this.opnotice = false this.$set(
this.$set(this.discountForm, 'discountTotal', '') this.discountForm,
this.$set(this.discountForm, 'discountRemark', '') "discountRemark",
this.$set(this.discountForm, 'author', '') res.data.discountRemark
);
this.$set(this.discountForm, "author", res.data.creatorName);
this.opnotice = true;
} else {
this.opnotice = false;
this.$set(this.discountForm, "discountTotal", "");
this.$set(this.discountForm, "discountRemark", "");
this.$set(this.discountForm, "author", "");
} }
}) });
}, },
saveDiscount() { saveDiscount() {
console.log(this.discountForm) console.log(this.discountForm);
// this.selectListRow.id // this.selectListRow.id
if (this.discountForm.discountTotal === 0||!this.discountForm.discountTotal) { if (
this.$modal.msgError(this.$t('优惠金额不能为空')); this.discountForm.discountTotal === 0 ||
return !this.discountForm.discountTotal
} ) {
if (this.discountForm.discountRemark === 0||!this.discountForm.discountRemark) { this.$modal.msgError(this.$t("优惠金额不能为空"));
this.$modal.msgError(this.$t('优惠原因不能为空')); return;
return }
if (
this.discountForm.discountRemark === 0 ||
!this.discountForm.discountRemark
) {
this.$modal.msgError(this.$t("优惠原因不能为空"));
return;
} }
const params = { const params = {
id: this.selectListRow.id, id: this.selectListRow.id,
...@@ -1398,14 +1830,14 @@ export default { ...@@ -1398,14 +1830,14 @@ export default {
discountRemark: this.discountForm.discountRemark, discountRemark: this.discountForm.discountRemark,
orderNo: this.selectListRow.orderNo, orderNo: this.selectListRow.orderNo,
orderId: this.selectListRow.orderId, orderId: this.selectListRow.orderId,
taxPoint:this.selectListRow.taxPoint, taxPoint: this.selectListRow.taxPoint,
taxAmount:this.selectListRow.taxAmount, taxAmount: this.selectListRow.taxAmount,
} };
updateReceivableDiscountById(params).then(res => { updateReceivableDiscountById(params).then((res) => {
if (this.selectListRow.discountTotal) { if (this.selectListRow.discountTotal) {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t("修改成功"));
} else { } else {
this.$modal.msgSuccess(this.$t('新增成功')); this.$modal.msgSuccess(this.$t("新增成功"));
} }
// if(this.id>0){ // if(this.id>0){
// getInvoicingItem({ id: this.id }).then(res => { // getInvoicingItem({ id: this.id }).then(res => {
...@@ -1414,22 +1846,19 @@ export default { ...@@ -1414,22 +1846,19 @@ export default {
// this.calculation() // this.calculation()
// }) // })
// }else{ // }else{
var discount = this.list[this.selectListIndex] var discount = this.list[this.selectListIndex];
discount['discountTotal'] = this.discountForm.discountTotal discount["discountTotal"] = this.discountForm.discountTotal;
discount['discountRemark'] = this.discountForm.discountRemark discount["discountRemark"] = this.discountForm.discountRemark;
setTimeout(()=>{ setTimeout(() => {
// getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => { // getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
this.$set(this.list, this.selectListIndex, {...discount}) this.$set(this.list, this.selectListIndex, { ...discount });
this.cancelDiscount() this.cancelDiscount();
this.calculation() this.calculation();
// }) // })
},1000) }, 1000);
// } // }
});
})
}, },
getList() { getList() {
this.loading1 = true; this.loading1 = true;
...@@ -1439,149 +1868,166 @@ export default { ...@@ -1439,149 +1868,166 @@ export default {
// 执行查询 // 执行查询
getReceivableList(params).then((response) => { getReceivableList(params).then((response) => {
this.orderData = response.data.list; this.orderData = response.data.list;
this.dialogTableKey ++ this.dialogTableKey++;
this.total = response.data.total; this.total = response.data.total;
this.loading1 = false; this.loading1 = false;
this.$nextTick(() => { this.$nextTick(() => {
this.list.forEach(itm => { this.list.forEach((itm) => {
const t = this.orderData.find(v => v.id == itm.id) const t = this.orderData.find((v) => v.id == itm.id);
t && this.$refs.multipleTable.toggleRowSelection(t, true) t && this.$refs.multipleTable.toggleRowSelection(t, true);
}) });
}) });
}); });
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.queryParams.customerId=this.form.customerId this.queryParams.customerId = this.form.customerId;
this.multipleSelection = this.list this.multipleSelection = this.list;
this.open = true; this.open = true;
}, },
hiddenDialog() { hiddenDialog() {
this.open = false; this.open = false;
this.queryParams.customerId='' this.queryParams.customerId = "";
}, },
changePlatformAccountId(platformAccountId,index){ changePlatformAccountId(platformAccountId, index) {
this.form.receiptAccountList[index].platformAccountId = platformAccountId this.form.receiptAccountList[index].platformAccountId = platformAccountId;
}, },
submitForm(addType) { submitForm(addType) {
// const params = {...this.form} // const params = {...this.form}
const params = JSON.parse(JSON.stringify(this.form)) const params = JSON.parse(JSON.stringify(this.form));
params.addType = addType params.addType = addType;
// params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, { })) // params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, { }))
if(!params.customerId){ if (!params.customerId) {
this.saveBtnLoading = false this.saveBtnLoading = false;
this.$modal.msgError(this.$t('客户不能为空')); this.$modal.msgError(this.$t("客户不能为空"));
return return;
} }
if(!params.departmentId){ if (!params.departmentId) {
this.saveBtnLoading = false this.saveBtnLoading = false;
this.$modal.msgError(this.$t('部门不能为空')); this.$modal.msgError(this.$t("部门不能为空"));
return return;
} }
if(!params.salesmanId){ if (!params.salesmanId) {
this.saveBtnLoading = false this.saveBtnLoading = false;
this.$modal.msgError(this.$t('业务员不能为空')); this.$modal.msgError(this.$t("业务员不能为空"));
return return;
} }
if(params.openInvoice!=0&&params.openInvoice!=1){ if (params.openInvoice != 0 && params.openInvoice != 1) {
console.log(params.openInvoice) console.log(params.openInvoice);
this.saveBtnLoading = false this.saveBtnLoading = false;
this.$modal.msgError(this.$t('请选择是否需要开票')); this.$modal.msgError(this.$t("请选择是否需要开票"));
return return;
} }
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
params.receivableVOList = this.list params.receivableVOList = this.list;
}else{ } else {
this.saveBtnLoading = false this.saveBtnLoading = false;
this.$modal.msgError(this.$t('请添加未收客户款项')); this.$modal.msgError(this.$t("请添加未收客户款项"));
return return;
} }
// params.receiptAccountList.length = params.receiptAccountList.length - 1 // params.receiptAccountList.length = params.receiptAccountList.length - 1
var saveStatus = true var saveStatus = true;
var writeStatus = true var writeStatus = true;
var reatStatus = true var reatStatus = true;
params.receiptAccountList.forEach(v => { params.receiptAccountList.forEach((v) => {
if (v.type != "total") {
if(v.type!='total'){ if (!v.platformAccountId) {
if(!v.platformAccountId){ saveStatus = false;
saveStatus = false }
} if (!v.writeOffRate) {
if(!v.writeOffRate){ writeStatus = false;
writeStatus = false }
} if (!v.collectionRate) {
if(!v.collectionRate){ reatStatus = false;
reatStatus = false }
} var bankname = this.bankData.filter(
var bankname = this.bankData.filter(item=>item.id == v.platformAccountId) (item) => item.id == v.platformAccountId
if(bankname.length>0){ );
v.platformAccountName = bankname[0].baAccountName if (bankname.length > 0) {
v.platformAccountNo = bankname[0].baAccountNum v.platformAccountName = bankname[0].baAccountName;
v.platformAccountBlankName = bankname[0].baBankName v.platformAccountNo = bankname[0].baAccountNum;
v.platformAccountBlankName = bankname[0].baBankName;
}
delete v.discountTotal;
v.writeOffRate = Number(v.writeOffRate);
} }
delete v.discountTotal });
v.writeOffRate = Number(v.writeOffRate) if (!writeStatus) {
} this.$modal.msgError(
}) this.$t("核销基准币种汇率不能为0,请输入正确的汇率")
if(!writeStatus){ );
this.$modal.msgError(this.$t('核销基准币种汇率不能为0,请输入正确的汇率')); return;
return
} }
if(!saveStatus){ if (!saveStatus) {
this.$modal.msgError(this.$t('请添加收款账户')); this.$modal.msgError(this.$t("请添加收款账户"));
return return;
} }
if(!reatStatus){ if (!reatStatus) {
this.$modal.msgError(this.$t('期望收款汇率不能为0,请输入正确的汇率')); this.$modal.msgError(this.$t("期望收款汇率不能为0,请输入正确的汇率"));
return return;
} }
delete params.receivableDetail delete params.receivableDetail;
if (addType === 1) { if (addType === 1) {
this.saveBtnLoading = true this.saveBtnLoading = true;
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1) params.receiptAccountList.splice(
params.receiptAccountList.length - 1,
1
);
if (this.id && this.id != 0) { if (this.id && this.id != 0) {
params.updateType = 0 params.updateType = 0;
updateReceipt(params).then(res => { updateReceipt(params)
this.$modal.msgSuccess(this.$t('提交成功')); .then((res) => {
this.$store.dispatch('tagsView/delCurrentView') this.$modal.msgSuccess(this.$t("提交成功"));
}).finally(() => { this.$store.dispatch("tagsView/delCurrentView");
this.saveBtnLoading = false
}) })
.finally(() => {
this.saveBtnLoading = false;
});
} else { } else {
params.currencyId = this.showCurrencyId params.currencyId = this.showCurrencyId;
createReceipt(params).then(res => { createReceipt(params)
this.$modal.msgSuccess(this.$t('保存成功')); .then((res) => {
this.$store.dispatch('tagsView/delCurrentView') this.$modal.msgSuccess(this.$t("保存成功"));
}).finally(() => { this.$store.dispatch("tagsView/delCurrentView");
this.saveBtnLoading = false
}) })
.finally(() => {
this.saveBtnLoading = false;
});
} }
return return;
} }
this.saveBtnLoading = true this.saveBtnLoading = true;
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1) params.receiptAccountList.splice(params.receiptAccountList.length - 1, 1);
if (this.id && this.id != 0) { if (this.id && this.id != 0) {
// if(params.state==0) params.state = 1 // if(params.state==0) params.state = 1
params.updateType = 1 params.updateType = 1;
updateReceipt(params).then(res => { //lanbm 2024-05-20 添加订单ID
this.$modal.msgSuccess(this.$t('修改成功')); params.orderId = this.orderId;
this.$store.dispatch('tagsView/delCurrentView') updateReceipt(params)
}).finally(() => { .then((res) => {
this.saveBtnLoading = false this.$modal.msgSuccess(this.$t("修改成功"));
this.$store.dispatch("tagsView/delCurrentView");
}) })
.finally(() => {
this.saveBtnLoading = false;
});
} else { } else {
params.currencyId = this.showCurrencyId params.currencyId = this.showCurrencyId;
createReceipt(params).then(res => { //lanbm 2024-05-20 添加订单ID
this.$modal.msgSuccess(this.$t('新增成功')); params.orderId = this.orderId;
this.$store.dispatch('tagsView/delCurrentView') createReceipt(params)
}).finally(() => { .then((res) => {
this.saveBtnLoading = false this.$modal.msgSuccess(this.$t("新增成功"));
this.$store.dispatch("tagsView/delCurrentView");
}) })
.finally(() => {
this.saveBtnLoading = false;
});
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
...@@ -1596,56 +2042,56 @@ export default { ...@@ -1596,56 +2042,56 @@ export default {
} }
let obj = {}; let obj = {};
let uniqueArr = arr.reduce(function (total, item) { let uniqueArr = arr.reduce(function (total, item) {
obj[item[batch]] ? '' : (obj[item[batch]] = true && total.push(item)); obj[item[batch]] ? "" : (obj[item[batch]] = true && total.push(item));
return total; return total;
}, []); }, []);
return uniqueArr; return uniqueArr;
}, },
saveSelectList() { saveSelectList() {
this.multipleSelection.map(v=>{ this.multipleSelection.map((v) => {
if(!v.taxPoint){ if (!v.taxPoint) {
v.taxAmount = v.totalAmount v.taxAmount = v.totalAmount;
} }
}) });
if(this.list.length>0){ if (this.list.length > 0) {
this.list = this.list.concat(this.multipleSelection) this.list = this.list.concat(this.multipleSelection);
this.list = this.removedup(this.list,'id') this.list = this.removedup(this.list, "id");
}else{ } else {
this.list = this.multipleSelection this.list = this.multipleSelection;
} }
this.open = false; this.open = false;
this.calculation() this.calculation();
}, },
deleteListRow(index) { deleteListRow(index) {
const list = [...this.list] const list = [...this.list];
delete list[index] delete list[index];
this.list = list.filter(v => v) this.list = list.filter((v) => v);
this.calculation() this.calculation();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1;
this.getList() this.getList();
}, },
//清空数据 //清空数据
removeData(){ removeData() {
this.id = 0 this.id = 0;
this.flag = false this.flag = false;
this.discountForm = { this.discountForm = {
author:'' author: "",
} };
this.$refs.customer.reset() this.$refs.customer.reset();
this.list = [] this.list = [];
for(var i in this.form){ for (var i in this.form) {
if(i=='receiptAccountList'){ if (i == "receiptAccountList") {
this.$set(this.form,i,[]) this.$set(this.form, i, []);
}else{ } else {
this.$set(this.form,i,'') this.$set(this.form, i, "");
}
} }
} }
}, },
},
}; };
</script> </script>
...@@ -1672,10 +2118,10 @@ export default { ...@@ -1672,10 +2118,10 @@ export default {
width: 30%; width: 30%;
} }
} }
.bpm-title{ .bpm-title {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color:#666; color: #666;
margin:20px 0; margin: 20px 0;
} }
</style> </style>
<template> <template>
<div class="app-container"> <div class="app-container">
<div slot="header" class="card-title">{{ $t('应付款') }}</div> <div slot="header" class="card-title">{{ $t("应付款") }}</div>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-card v-show="showSearch"> <el-card v-show="showSearch">
<el-form <el-form
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="订单号:" >
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> -->
<el-form-item :label="$t('始发仓')"> <el-form-item :label="$t('始发仓')">
<el-select <el-select
v-model="queryParams.departureId" v-model="queryParams.departureId"
...@@ -70,35 +67,38 @@ ...@@ -70,35 +67,38 @@
/> />
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row>
<!-- <el-form-item label="付款单号:" > <!--lanbm 2024-05-17 add-->
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" :placeholder="$t('请输入付款单号')" clearable @keyup.enter.native="handleQuery"/> <el-form-item label="时间节点" prop="dateType">
</el-form-item> --> <el-select
v-model="queryParams.dateType"
<!-- <el-form-item label="状态:"> :placeholder="$t('请选择时间类型')"
<dict-selector :type="DICT_TYPE.ECW_RECEIPT_STATE" v-model="queryParams.control" /> clearable
</el-form-item> size="small"
<el-form-item label="业务员:"> >
<el-select v-model="form.salesmanId" :placeholder="$t('请选择业务员')"> <el-option
<el-option v-for="item in creatorData" :key="item.id" :label="item.nickname" :value="item.id"/> v-for="item in dateTypes"
:key="item.value"
:label="$l(item, 'label')"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> --> </el-form-item>
<!-- <el-row> <el-form-item label="" prop="dateRangeCreateTime">
<el-form-item label="收款时间:" >
<el-date-picker <el-date-picker
v-model="dateType" v-model="queryParams.dateRangeCreateTime"
style="width: 300px"
value-format="yyyy-MM-dd"
type="datetimerange" type="datetimerange"
range-separator="到" range-separator="-"
start-placeholder="请选择日期" :start-placeholder="$t('开始日期')"
end-placeholder="请选择日期"> :end-placeholder="$t('结束日期')"
</el-date-picker> clearable
/>
</el-form-item> </el-form-item>
</el-row> --> </el-row>
<el-row> <el-row>
<!-- <el-form-item label="商品名称:" >
<el-input style="max-width: 188px;" v-model="queryParams.orderNo" :placeholder="$t('请输入商品名称')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> -->
<el-form-item :label="$t('供应商名称')"> <el-form-item :label="$t('供应商名称')">
<el-input <el-input
style="max-width: 188px" style="max-width: 188px"
...@@ -116,22 +116,44 @@ ...@@ -116,22 +116,44 @@
></dict-selector> ></dict-selector>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery">{{ $t('查找') }}</el-button> <el-button type="primary" @click="handleQuery">{{
$t("查找")
}}</el-button>
<el-button <el-button
style="margin-left: 10px" style="margin-left: 10px"
type="success" type="success"
v-hasPermi="['ecw:payable:create']" v-hasPermi="['ecw:payable:create']"
@click="handleAdd(0)" @click="handleAdd(0)"
>{{ $t('新增请款单') }}</el-button >{{ $t("新增付款单") }}</el-button
> >
<!--lanbm 2024-05-17修改此按钮名称-->
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-table v-loading="loadings" :data="list" border class="card"> <el-table v-loading="loadings" :data="list" border class="card">
<el-table-column :label="$t('自编号')" align="center" prop="payableNo" /> <el-table-column :label="$t('自编号')" align="center" prop="payableNo" />
<el-table-column :label="$t('货柜号')" align="center" prop="containerNo" /> <!--lanbm 2024-05-17 add-->
<el-table-column :label="$t('供应商')" align="center" prop="supplierName" /> <el-table-column
:label="$t('自编号状态')"
align="center"
prop="shipmentStatusText"
/>
<el-table-column
:label="$t('运输方式')"
align="center"
prop="transportTypeName"
/>
<el-table-column
:label="$t('货柜号')"
align="center"
prop="containerNo"
/>
<el-table-column
:label="$t('供应商')"
align="center"
prop="supplierName"
/>
<el-table-column :label="$t('费用类型')" align="center" prop="feeType"> <el-table-column :label="$t('费用类型')" align="center" prop="feeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
...@@ -143,11 +165,30 @@ ...@@ -143,11 +165,30 @@
<el-table-column :label="$t('金额')" align="center" prop="totalAmount"> <el-table-column :label="$t('金额')" align="center" prop="totalAmount">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span> <span>{{ scope.row.totalAmount }}</span>
<span>{{getCurrencyLabel(scope.row.currencyId)}}</span> <span>{{ getCurrencyLabel(scope.row.currencyId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column :label="$t('创建时间')" align="center" prop="channelName" /> <el-table-column
<el-table-column :label="$t('创建人')" align="center" prop="toDepartureId" /> --> :label="$t('费用产生时间')"
align="center"
prop="freecsdate"
/>
<!--lanbm 2024-05-17 添加字段 BaseDO -->
<el-table-column :label="$t('创建人')" align="center" prop="creator" />
<el-table-column
:label="$t('创建时间')"
align="center"
prop="createTime"
/>
<el-table-column :label="$t('修改人')" align="center" prop="updater" />
<el-table-column
:label="$t('修改时间')"
align="center"
prop="updateTime"
/>
<el-table-column :label="$t('备注')" align="center" prop="remark" />
<el-table-column <el-table-column
:label="$t('操作')" :label="$t('操作')"
align="center" align="center"
...@@ -159,10 +200,22 @@ ...@@ -159,10 +200,22 @@
type="text" type="text"
v-hasPermi="['ecw:payable:edit']" v-hasPermi="['ecw:payable:edit']"
@click="editClick(scope.row)" @click="editClick(scope.row)"
>{{ $t('编辑') }}</el-button> >{{ $t("编辑") }}</el-button
<el-button size="mini" type="text" v-hasPermi="['ecw:payable:add']" @click="handleAdd(scope.row.id)" >
>{{ $t('请款') }}</el-button> <el-button
<el-button size="mini" type="text" v-hasPermi="['ecw:payable:delete']" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button> size="mini"
type="text"
v-hasPermi="['ecw:payable:add']"
@click="handleAdd(scope.row.id)"
>{{ $t("请款") }}</el-button
>
<el-button
size="mini"
type="text"
v-hasPermi="['ecw:payable:delete']"
@click="deleteClick(scope.row)"
>{{ $t("删除") }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -181,45 +234,97 @@ ...@@ -181,45 +234,97 @@
width="500px" width="500px"
append-to-body append-to-body
> >
<el-form ref="costForm" :model="costObj" label-width="80px"> <el-form ref="costForm" :model="costObj" label-width="120px">
<el-form-item :label="$t('操作步骤')"> <el-form-item :label="$t('操作步骤')">
<el-select v-model="costObj.stepsId" :placeholder="$t('请选择操作步骤')"> <el-select
<el-option v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PROCESS)" :key="item.value" :label="item.label" :value="item.value"></el-option> v-model="costObj.stepsId"
:placeholder="$t('请选择操作步骤')"
>
<el-option
v-for="item in this.getDictDatas(DICT_TYPE.BOX_SHIPPING_PROCESS)"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('费用类型')"> <el-form-item :label="$t('费用类型')">
<el-select v-model="costObj.feeType" :placeholder="$t('请选择费用类型')"> <el-select
<el-option v-for="item in this.getDictDatas(DICT_TYPE.FEE_TYPE)" :key="item.value" :label="item.label" :value="item.value"></el-option> v-model="costObj.feeType"
:placeholder="$t('请选择费用类型')"
>
<el-option
v-for="item in this.getDictDatas(DICT_TYPE.FEE_TYPE)"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('供应商')"> <el-form-item :label="$t('供应商')">
<el-select v-model="costObj.supplierId" :placeholder="$t('请选择供应商')"> <el-select
<el-option v-for="supplier in allSupplier" :key="supplier.id" :label="supplier.companyZh" :value="supplier.id"></el-option> v-model="costObj.supplierId"
:placeholder="$t('请选择供应商')"
>
<el-option
v-for="supplier in allSupplier"
:key="supplier.id"
:label="supplier.companyZh"
:value="supplier.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--lanbm 2024-05-17 添加字段-->
<el-form-item :label="$t('费用产生时间')" prop="freecsdate">
<el-date-picker
v-model="costObj.freecsdate"
style="width: 200px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
type="datetime"
placeholder="费用产生时间"
/>
</el-form-item>
<el-row class="two-element"> <el-row class="two-element">
<el-form-item :label="$t('金额')"> <el-form-item :label="$t('金额')">
<el-input-number v-model="costObj.totalAmount" controls-position="right" :min="1"></el-input-number> <el-input-number
v-model="costObj.totalAmount"
controls-position="right"
:min="1"
></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="" label-width="0px"> <el-form-item label="" label-width="0px">
<el-select v-model="costObj.currencyId" :placeholder="$t('请选择单位')"> <el-select
<el-option v-for="item in currencyList" :key="item.id" :label="$i18n.locale=='zh_CN'?item.titleZh:item.titleEn" :value="item.id"></el-option> v-model="costObj.currencyId"
:placeholder="$t('请选择单位')"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
<el-input v-model="costObj.remark" type="textarea" rows="2" :placeholder="$t('请输入备注')"></el-input> <el-input
v-model="costObj.remark"
type="textarea"
rows="2"
:placeholder="$t('请输入备注')"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="operate-button"> <div slot="footer" class="operate-button">
<el-button type="primary" @click="submitEditForm">{{ $t('确定') }}</el-button> <el-button type="primary" @click="submitEditForm">{{
<el-button @click="cancelEditForm">{{ $t('取消') }}</el-button> $t("确定")
}}</el-button>
<el-button @click="cancelEditForm">{{ $t("取消") }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -229,10 +334,14 @@ ...@@ -229,10 +334,14 @@
import { userList } from "@/api/system/user"; import { userList } from "@/api/system/user";
import { DICT_TYPE } from "@/utils/dict"; import { DICT_TYPE } from "@/utils/dict";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import { getPayableList, deletePayable, updatePayable } from "@/api/ecw/financial" import {
getPayableList,
deletePayable,
updatePayable,
} from "@/api/ecw/financial";
import { getSupplierPage } from "@/api/ecw/supplier"; import { getSupplierPage } from "@/api/ecw/supplier";
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency";
import {getWarehouseList} from '@/api/ecw/warehouse' import { getWarehouseList } from "@/api/ecw/warehouse";
export default { export default {
name: "EcwFinancialPayable", name: "EcwFinancialPayable",
...@@ -256,10 +365,21 @@ export default { ...@@ -256,10 +365,21 @@ export default {
queryParams: { queryParams: {
page: 1, page: 1,
rows: 20, rows: 20,
dateRangeCreateTime: undefined,
}, },
allSupplier: [], allSupplier: [],
currencyList:[], currencyList: [],
warehouseList:[], warehouseList: [],
//lanbm 2024-05-17 add
dateTypes: [
{ value: "0", label: this.$t("费用产生时间") },
{ value: "1", label: this.$t("预装时间") },
{ value: "2", label: this.$t("装柜时间") },
{ value: "3", label: this.$t("起运时间") },
{ value: "4", label: this.$t("到港时间") },
{ value: "5", label: this.$t("清关时间") },
{ value: "6", label: this.$t("卸柜时间") },
],
}; };
}, },
computed: { computed: {
...@@ -269,24 +389,30 @@ export default { ...@@ -269,24 +389,30 @@ export default {
importCityList() { importCityList() {
return this.tradeCityList.filter((item) => item.type == 1); return this.tradeCityList.filter((item) => item.type == 1);
}, },
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
);
}, },
}, },
activated(){ activated() {
this.handleQuery() this.handleQuery();
}, },
created() { created() {
let that = this; let that = this;
getWarehouseList().then(res => this.warehouseList = res.data) getWarehouseList().then((res) => (this.warehouseList = res.data));
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
userList("salesman").then((res) => (that.creatorData = res.data)); userList("salesman").then((res) => (that.creatorData = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getList() this.getList();
getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => { getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res; const { data } = res;
this.allSupplier = data.list; this.allSupplier = data.list;
...@@ -306,10 +432,13 @@ export default { ...@@ -306,10 +432,13 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getCurrencyLabel(id){ getCurrencyLabel(id) {
var label = this.currencyList.filter(item=>item.id == id) var label = this.currencyList.filter((item) => item.id == id);
if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn if (label.length > 0)
return '' return this.$i18n.locale == "zh_CN"
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -329,67 +458,70 @@ export default { ...@@ -329,67 +458,70 @@ export default {
supplierId: this.costObj.supplierId, supplierId: this.costObj.supplierId,
totalAmount: this.costObj.totalAmount, totalAmount: this.costObj.totalAmount,
currencyId: this.costObj.currencyId, currencyId: this.costObj.currencyId,
remark: this.costObj.remark remark: this.costObj.remark,
} };
updatePayable(params).then(res => { updatePayable(params).then((res) => {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t("修改成功"));
this.getList(); this.getList();
this.open = false; this.open = false;
}) });
}, },
/** 取消按钮 */ /** 取消按钮 */
cancelEditForm() { cancelEditForm() {
this.open = false; this.open = false;
}, },
editClick(row) { editClick(row) {
row.stepsId = String(row.stepsId) row.stepsId = String(row.stepsId);
row.feeType = String(row.feeType) row.feeType = String(row.feeType);
row.currencyId = row.currencyId row.currencyId = row.currencyId;
console.log(row) console.log(row);
this.costObj = { ...row } this.costObj = { ...row };
this.open = true; this.open = true;
}, },
deleteClick(row) { deleteClick(row) {
const id = row.id; const id = row.id;
this.$modal.confirm(this.$t('是否确认删除该应付款')+'?').then(function() { this.$modal
.confirm(this.$t("是否确认删除该应付款") + "?")
.then(function () {
return deletePayable(id); return deletePayable(id);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess(this.$t('删除成功')); this.$modal.msgSuccess(this.$t("删除成功"));
}).catch(() => {}); })
.catch(() => {});
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.small-padding ::v-deep .el-button { .small-padding ::v-deep .el-button {
}
} // 页面内元素弹窗form控件宽度设置
// 页面内元素弹窗form控件宽度设置 ::v-deep .el-form-item__content {
::v-deep .el-form-item__content {
> div:not(.el-input-number) { > div:not(.el-input-number) {
width: 100%; width: 100%;
} }
} }
.operate-button { .operate-button {
text-align: center; text-align: center;
} }
.two-element { .two-element {
display: flex; display: flex;
> :last-child { > :last-child {
width: 100%; width: 100%;
margin-left: 10px; margin-left: 10px;
} }
} }
.card { .card {
margin-top: 20px; margin-top: 20px;
} }
.dialog-footer { .dialog-footer {
padding: 40px; padding: 40px;
} }
.card-title { .card-title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
} }
</style> </style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div slot="header" class="card-title">{{ $t('付款单详情') }}{{id ? `-${form.paymentNo}` :''}}</div> <div slot="header" class="card-title">
{{ $t("付款单详情") }}{{ id ? `-${form.paymentNo}` : "" }}
</div>
<el-form <el-form
ref="form" ref="form"
:model="form" :model="form"
...@@ -86,7 +88,10 @@ ...@@ -86,7 +88,10 @@
/> />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('供应商银行账号')" style="width: 50%"> <el-descriptions-item
:label="$t('供应商银行账号')"
style="width: 50%"
>
<el-form-item <el-form-item
label="" label=""
label-width="0" label-width="0"
...@@ -97,7 +102,7 @@ ...@@ -97,7 +102,7 @@
<el-option <el-option
v-for="item in bankData" v-for="item in bankData"
:key="item.id" :key="item.id"
:label="item.bankName + '(' + item.bankAccount+ ')'" :label="item.bankName + '(' + item.bankAccount + ')'"
:value="item.bankAccount" :value="item.bankAccount"
/> />
</el-select> </el-select>
...@@ -105,6 +110,23 @@ ...@@ -105,6 +110,23 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions :column="3" class="card" border> <el-descriptions :column="3" class="card" border>
<el-descriptions-item :label="$t('实际付款日期')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="latestPayAt"
>
<el-date-picker
clearable
v-model="form.latestPayAt"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
type="date"
disabled
/>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('最后付款日期')"> <el-descriptions-item :label="$t('最后付款日期')">
<el-form-item <el-form-item
label="" label=""
...@@ -135,13 +157,69 @@ ...@@ -135,13 +157,69 @@
/> />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('付款备注')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="settlementType"
>
<el-input
v-model="form.reason"
type="text"
rows="2"
disabled
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('付款人')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="settlementType"
>
<el-input
v-model="form.fkren"
type="text"
rows="2"
disabled
></el-input>
</el-form-item>
</el-descriptions-item>
<!--lanbm 2024-05-17 添加字段-->
<el-descriptions-item :label="$t('核销时间')">
<el-form-item
label=""
label-width="0"
style="margin-bottom: 0"
prop="settlementType"
>
<el-input
v-model="form.hexiaodate"
type="text"
rows="2"
disabled
></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-form> </el-form>
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
<div slot="header" class="card-title">{{ $t('费用信息') }}</div> <div slot="header" class="card-title">{{ $t("费用信息") }}</div>
<el-table v-loading="loadings" :data="list" border :show-summary="!!list.length" :summary-method="getSummaries"> <el-table
<el-table-column :label="$t('自编号')" align="center" prop="payableNo" /> v-loading="loadings"
:data="list"
border
:show-summary="!!list.length"
:summary-method="getSummaries"
>
<el-table-column
:label="$t('自编号')"
align="center"
prop="payableNo"
/>
<el-table-column :label="$t('费用类型')" align="center" prop="feeType"> <el-table-column :label="$t('费用类型')" align="center" prop="feeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag <dict-tag
...@@ -150,20 +228,40 @@ ...@@ -150,20 +228,40 @@
></dict-tag> ></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('发票号码')" align="center" prop="invoiceNumber" /> <el-table-column
<el-table-column :label="$t('应付金额')" align="center" prop="totalAmount" /> :label="$t('发票号码')"
align="center"
prop="invoiceNumber"
/>
<el-table-column
:label="$t('应付金额')"
align="center"
prop="totalAmount"
/>
<el-table-column :label="$t('币种')" align="center" prop="currencyId"> <el-table-column :label="$t('币种')" align="center" prop="currencyId">
<template slot-scope="scope"> <template slot-scope="scope">
{{getCurrencyLabel(scope.row.currencyId)}} {{ getCurrencyLabel(scope.row.currencyId) }}
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="exchangeRate" /> <el-table-column
<el-table-column :label="$t('税率')+'%'" align="center" prop="taxRate" /> :label="$t('汇率')"
<el-table-column :label="$t('价税合计')+'(RMB)'" align="center" prop="total" > align="center"
prop="exchangeRate"
/>
<el-table-column
:label="$t('税率') + '%'"
align="center"
prop="taxRate"
/>
<el-table-column
:label="$t('价税合计') + '(RMB)'"
align="center"
prop="total"
>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <span>{{ scope.row.total = ((scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100)).toFixed(6) }}</span> --> <!-- <span>{{ scope.row.total = ((scope.row.totalAmount * scope.row.exchangeRate) + (scope.row.totalAmount * scope.row.exchangeRate) * (scope.row.taxRate/100)).toFixed(6) }}</span> -->
<span>{{scope.row.total}}</span> <span>{{ scope.row.total }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -185,9 +283,7 @@ ...@@ -185,9 +283,7 @@
:error="$t('账单号不能为空')" :error="$t('账单号不能为空')"
prop="accountNumber" prop="accountNumber"
> >
<el-input <el-input v-model="form.accountNumber" disabled></el-input>
v-model="form.accountNumber" disabled
></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('发票')"> <el-descriptions-item :label="$t('发票')">
...@@ -197,10 +293,7 @@ ...@@ -197,10 +293,7 @@
style="margin-bottom: 0" style="margin-bottom: 0"
prop="invoiceStatus" prop="invoiceStatus"
> >
<el-select <el-select v-model="form.invoiceStatus" disabled>
v-model="form.invoiceStatus"
disabled
>
<el-option :label="$t('未开票')" value="0" /> <el-option :label="$t('未开票')" value="0" />
<el-option :label="$t('已开票')" value="1" /> <el-option :label="$t('已开票')" value="1" />
</el-select> </el-select>
...@@ -211,7 +304,11 @@ ...@@ -211,7 +304,11 @@
</el-card> </el-card>
<div slot="footer" style="margin: 20px 0"> <div slot="footer" style="margin: 20px 0">
<!-- <el-button type="primary" @click="submitDraft">{{ $t('保 存') }}</el-button> --> <!-- <el-button type="primary" @click="submitDraft">{{ $t('保 存') }}</el-button> -->
<el-button type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{ $t('返回') }}</el-button> <el-button
type="primary"
@click="$store.dispatch('tagsView/delCurrentView')"
>{{ $t("返回") }}</el-button
>
</div> </div>
</div> </div>
</template> </template>
...@@ -224,14 +321,21 @@ import { getChannelList } from "@/api/ecw/channel"; ...@@ -224,14 +321,21 @@ import { getChannelList } from "@/api/ecw/channel";
import CustomerSelector from "@/components/CustomerSelector"; import CustomerSelector from "@/components/CustomerSelector";
import { listSimpleDepts } from "@/api/system/dept"; import { listSimpleDepts } from "@/api/system/dept";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import { getSupplierPage,getSupplier } from "@/api/ecw/supplier"; import { getSupplierPage, getSupplier } from "@/api/ecw/supplier";
import { getPayableList, getPayableInfoByIds, createPayment, getPaymentInfoByIds, getPaymentItem, updatePayment } from "@/api/ecw/financial" import {
getPayableList,
getPayableInfoByIds,
createPayment,
getPaymentInfoByIds,
getPaymentItem,
updatePayment,
} from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency"; import { getCurrencyPage } from "@/api/ecw/currency";
import NP from 'number-precision' import NP from "number-precision";
export default { export default {
name: "CreatPayment", name: "CreatPayment",
components: { components: {
CustomerSelector CustomerSelector,
}, },
data() { data() {
return { return {
...@@ -265,60 +369,48 @@ export default { ...@@ -265,60 +369,48 @@ export default {
}; };
}, },
async created() { async created() {
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
let that = this; let that = this;
if (that.$route.query.payableId && that.$route.query.payableId !== '0') { if (that.$route.query.payableId && that.$route.query.payableId !== "0") {
this.payableId = this.$route.query.payableId; this.payableId = this.$route.query.payableId;
getPayableInfoByIds({ id: this.payableId }).then(res => { getPayableInfoByIds({ id: this.payableId }).then((res) => {
this.list = [{...res.data}] this.list = [{ ...res.data }];
this.$set(this.form, 'supplierId', res.data.supplierId) this.$set(this.form, "supplierId", res.data.supplierId);
}) });
} }
if (that.$route.query.id && that.$route.query.id !== '0') { if (that.$route.query.id && that.$route.query.id !== "0") {
this.id = this.$route.query.id; this.id = this.$route.query.id;
getPaymentInfoByIds({ id: this.id }).then(res => { getPaymentInfoByIds({ id: this.id }).then((res) => {
this.form = { this.form = {
...res.data, ...res.data,
latestPayAt: this.parseTime(res.data.latestPayAt, '{y}-{m}-{d}'), latestPayAt: this.parseTime(res.data.latestPayAt, "{y}-{m}-{d}"),
applicationAt: this.parseTime(res.data.applicationAt, '{y}-{m}-{d}'), applicationAt: this.parseTime(res.data.applicationAt, "{y}-{m}-{d}"),
invoiceStatus: String(res.data.invoiceStatus), invoiceStatus: String(res.data.invoiceStatus),
} };
this.$set(this.form,'supplierBankAccount',res.data.supplierBankAccount) this.$set(
console.log(this.form) this.form,
}) "supplierBankAccount",
getPaymentItem({ id: this.id }).then(res => { res.data.supplierBankAccount
this.list = [...res.data] );
this.defaultList = [...res.data] console.log(this.form);
}) });
getPaymentItem({ id: this.id }).then((res) => {
this.list = [...res.data];
this.defaultList = [...res.data];
});
} }
listSimpleUsers().then((res) => (that.creatorData = res.data)); listSimpleUsers().then((res) => (that.creatorData = res.data));
getChannelList().then((res) => (that.channelList = res.data)); getChannelList().then((res) => (that.channelList = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data));
// getBankAccountPage(that.params).then(
// (res) => (that.bankData = res.data.list)
// );
getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => { getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res; const { data } = res;
this.allSupplier = data.list; this.allSupplier = data.list;
this.selectChange(this.form.supplierId) this.selectChange(this.form.supplierId);
}); });
listSimpleDepts().then((res) => { listSimpleDepts().then((res) => {
that.deptData = res.data that.deptData = res.data;
// res.data.forEach((item) => {
// if (item.parentId == 0) {
// that.deptArr.push(item);
// } else {
// that.deptData.push(item);
// }
// });
// that.deptData.forEach((value) => {
// var dept = that.deptArr.filter((itt) => itt.id == value.parentId);
// if (dept.length > 0) {
// value.name = dept[0].name + " | " + value.name;
// }
// });
}); });
}, },
computed: { computed: {
...@@ -330,10 +422,13 @@ export default { ...@@ -330,10 +422,13 @@ export default {
}, },
}, },
methods: { methods: {
getCurrencyLabel(id){ getCurrencyLabel(id) {
var label = this.currencyList.filter(item=>item.id == id) var label = this.currencyList.filter((item) => item.id == id);
if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn if (label.length > 0)
return '' return this.$i18n.locale == "zh_CN"
? label[0].titleZh
: label[0].titleEn;
return "";
}, },
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -346,22 +441,24 @@ export default { ...@@ -346,22 +441,24 @@ export default {
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
this.$nextTick(() => { this.$nextTick(() => {
this.list.forEach(itm => { this.list.forEach((itm) => {
const t = this.orderData.find(v => v.id == itm.id) const t = this.orderData.find((v) => v.id == itm.id);
t && this.$refs.multipleTable.toggleRowSelection(t, true) t && this.$refs.multipleTable.toggleRowSelection(t, true);
}) });
}) });
}); });
}, },
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
const sums = new Array(columns.length).map(v => ''); const sums = new Array(columns.length).map((v) => "");
const index = sums.length - 1 const index = sums.length - 1;
sums[index - 1] = this.$t('价税合计大写') sums[index - 1] = this.$t("价税合计大写");
const t = data.map(v => v.total).reduce((prev, curr) => { const t = data
.map((v) => v.total)
.reduce((prev, curr) => {
return parseFloat(prev) + parseFloat(curr); return parseFloat(prev) + parseFloat(curr);
}, 0) }, 0);
sums[index] = this.convertCurrency(t) sums[index] = this.convertCurrency(t);
return sums; return sums;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -369,126 +466,148 @@ export default { ...@@ -369,126 +466,148 @@ export default {
this.open = true; this.open = true;
}, },
submitForm() { submitForm() {
this.$refs.form.validate ((valid)=>{ this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.$refs.forms.validate((val) => { this.$refs.forms.validate((val) => {
if (val) { if (val) {
const params = {...this.form} const params = { ...this.form };
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
params.payableReqVOList = [...this.list] params.payableReqVOList = [...this.list];
}else{ } else {
this.$modal.msgError(this.$t('请选择供应商未付款项')); this.$modal.msgError(this.$t("请选择供应商未付款项"));
return return;
} }
if(!params.supplierBankAccount){ if (!params.supplierBankAccount) {
this.$modal.msgError(this.$t('请选择供应商银行账号')); this.$modal.msgError(this.$t("请选择供应商银行账号"));
return return;
} }
if (this.id && this.id !== '0') { if (this.id && this.id !== "0") {
updatePayment(params).then(res => { updatePayment(params).then((res) => {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.back(); this.$router.back();
}) });
} else { } else {
createPayment(params).then(res => { createPayment(params).then((res) => {
this.$modal.msgSuccess(this.$t('新增成功')); this.$modal.msgSuccess(this.$t("新增成功"));
this.$router.back(); this.$router.back();
}) });
} }
} }
}) });
} }
}) });
}, },
submitDraft() { submitDraft() {
this.$refs.form.validate ((valid)=>{ this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = {...this.form} const params = { ...this.form };
if (this.list && this.list.length > 0) { if (this.list && this.list.length > 0) {
params.payableReqVOList = [...this.list] params.payableReqVOList = [...this.list];
}else{ } else {
this.$modal.msgError(this.$t('请选择供应商未付款项')); this.$modal.msgError(this.$t("请选择供应商未付款项"));
return return;
} }
if(!params.supplierBankAccount){ if (!params.supplierBankAccount) {
this.$modal.msgError(this.$t('请选择供应商银行账号')); this.$modal.msgError(this.$t("请选择供应商银行账号"));
return return;
} }
if (this.id && this.id !== '0') { if (this.id && this.id !== "0") {
updatePayment(params).then(res => { updatePayment(params).then((res) => {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.back(); this.$router.back();
}) });
} else { } else {
createPayment(params).then(res => { createPayment(params).then((res) => {
this.$modal.msgSuccess(this.$t('新增成功')); this.$modal.msgSuccess(this.$t("新增成功"));
this.$router.back(); this.$router.back();
}) });
} }
// console.log(params, '-----params---------') // console.log(params, '-----params---------')
} }
}) });
}, },
selectChangeBank(val){ selectChangeBank(val) {
this.$forceUpdate() this.$forceUpdate();
}, },
selectChange(val) { selectChange(val) {
this.bankData = [] this.bankData = [];
// this.form.supplierBankAccount='' // this.form.supplierBankAccount=''
if(val){ if (val) {
getSupplier(val).then((res)=>{ getSupplier(val).then((res) => {
this.bankData = res.data.bankList this.bankData = res.data.bankList;
var bank = this.bankData.find(item=>item.bankAccount==this.form.supplierBankAccount) var bank = this.bankData.find(
if(this.bankData.length==0||!bank) this.form.supplierBankAccount='' (item) => item.bankAccount == this.form.supplierBankAccount
}) );
if (this.bankData.length == 0 || !bank)
this.form.supplierBankAccount = "";
});
} }
const t = this.allSupplier.find(v => v.id == val) const t = this.allSupplier.find((v) => v.id == val);
t && (this.form.supplierName = t.companyZh) t && (this.form.supplierName = t.companyZh);
// t && (this.bankData = t.bankList) // t && (this.bankData = t.bankList)
}, },
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1;
this.getList() this.getList();
}, },
UStoRMB() { UStoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'USD').huilv, 100).toFixed(6) return NP.divide(
this.currencyList.find((v) => v.titleEn === "USD").huilv,
100
).toFixed(6);
}, },
NANtoRMB() { NANtoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100).toFixed(6) return NP.divide(
this.currencyList.find((v) => v.titleEn === "NGN").huilv,
100
).toFixed(6);
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val.map(v => { this.multipleSelection = val.map((v) => {
if(v.currencyId === 1) return Object.assign(v, { exchangeRate: this.UStoRMB() }) if (v.currencyId === 1)
if(v.currencyId === 2) return Object.assign(v, { exchangeRate: 1 }) return Object.assign(v, { exchangeRate: this.UStoRMB() });
if(v.currencyId === 3) return Object.assign(v, { exchangeRate: this.NANtoRMB() }) if (v.currencyId === 2) return Object.assign(v, { exchangeRate: 1 });
if (v.currencyId === 3)
return Object.assign(v, { exchangeRate: this.NANtoRMB() });
}); });
}, },
hiddenDialog() { hiddenDialog() {
this.open = false; this.open = false;
}, },
saveSelectList() { saveSelectList() {
if (this.id && this.id !== '0') { if (this.id && this.id !== "0") {
this.list = [...this.defaultList, ...this.multipleSelection] this.list = [...this.defaultList, ...this.multipleSelection];
} else { } else {
this.list = this.multipleSelection this.list = this.multipleSelection;
} }
this.open = false; this.open = false;
}, },
convertCurrency(money) { convertCurrency(money) {
//汉字的数字 //汉字的数字
var cnNums = new Array('', this.$t(''), this.$t(''), this.$t(''), this.$t(''), this.$t(''), this.$t(''), this.$t(''), this.$t(''), ''); var cnNums = new Array(
"",
this.$t(""),
this.$t(""),
this.$t(""),
this.$t(""),
this.$t(""),
this.$t(""),
this.$t(""),
this.$t(""),
""
);
//基本单位 //基本单位
var cnIntRadice = new Array('', this.$t(''), this.$t(''), ''); var cnIntRadice = new Array("", this.$t(""), this.$t(""), "");
//对应整数部分扩展单位 //对应整数部分扩展单位
var cnIntUnits = new Array('', this.$t(''), this.$t('亿'), ''); var cnIntUnits = new Array("", this.$t(""), this.$t("亿"), "");
//对应小数部分单位 //对应小数部分单位
var cnDecUnits = new Array('', this.$t(''), this.$t(''), ''); var cnDecUnits = new Array("", this.$t(""), this.$t(""), "");
//整数金额时后面跟的字符 //整数金额时后面跟的字符
var cnInteger = this.$t(''); var cnInteger = this.$t("");
//整型完以后的单位 //整型完以后的单位
var cnIntLast = this.$t(''); var cnIntLast = this.$t("");
//最大处理的数字 //最大处理的数字
var maxNum = 999999999999999.9999; var maxNum = 999999999999999.9999;
//金额整数部分 //金额整数部分
...@@ -496,52 +615,52 @@ export default { ...@@ -496,52 +615,52 @@ export default {
//金额小数部分 //金额小数部分
var decimalNum; var decimalNum;
//输出的中文金额字符串 //输出的中文金额字符串
var chineseStr = ''; var chineseStr = "";
//分离金额后用的数组,预定义 //分离金额后用的数组,预定义
var parts; var parts;
// 传入的参数为空情况 // 传入的参数为空情况
if(money === '') { if (money === "") {
return ''; return "";
} }
money = parseFloat(money) money = parseFloat(money);
if(money >= maxNum){ if (money >= maxNum) {
return '' return "";
} }
// 传入的参数为0情况 // 传入的参数为0情况
if (money === 0) { if (money === 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger; chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr return chineseStr;
} }
// 转为字符串 // 转为字符串
money = money.toString(); money = money.toString();
// indexOf 检测某字符在字符串中首次出现的位置 返回索引值(从0 开始) -1 代表无 // indexOf 检测某字符在字符串中首次出现的位置 返回索引值(从0 开始) -1 代表无
if (money.indexOf('.') == -1) { if (money.indexOf(".") == -1) {
integerNum = money; integerNum = money;
decimalNum = '' decimalNum = "";
}else{ } else {
parts = money.split('.'); parts = money.split(".");
integerNum = parts[0]; integerNum = parts[0];
decimalNum = parts[1].substr(0,4); decimalNum = parts[1].substr(0, 4);
} }
//转换整数部分 //转换整数部分
if(parseInt(integerNum,10) > 0){ if (parseInt(integerNum, 10) > 0) {
let zeroCount = 0; let zeroCount = 0;
let IntLen = integerNum.length let IntLen = integerNum.length;
for(let i = 0; i < IntLen; i++){ for (let i = 0; i < IntLen; i++) {
let n = integerNum.substr(i,1); let n = integerNum.substr(i, 1);
let p = IntLen - i - 1; let p = IntLen - i - 1;
let q = p / 4; let q = p / 4;
let m = p % 4; let m = p % 4;
if( n == '0'){ if (n == "0") {
zeroCount ++ ; zeroCount++;
}else{ } else {
if(zeroCount > 0){ if (zeroCount > 0) {
chineseStr += cnNums[0] chineseStr += cnNums[0];
} }
zeroCount = 0; zeroCount = 0;
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]; chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
} }
if(m == 0 && zeroCount < 4){ if (m == 0 && zeroCount < 4) {
chineseStr += cnIntUnits[q]; chineseStr += cnIntUnits[q];
} }
} }
...@@ -549,42 +668,42 @@ export default { ...@@ -549,42 +668,42 @@ export default {
chineseStr += cnIntLast; chineseStr += cnIntLast;
} }
// 转换小数部分 // 转换小数部分
if(decimalNum != ''){ if (decimalNum != "") {
let decLen = decimalNum.length; let decLen = decimalNum.length;
for(let i = 0; i <decLen; i++){ for (let i = 0; i < decLen; i++) {
let n = decimalNum.substr(i,1); let n = decimalNum.substr(i, 1);
if(n != '0'){ if (n != "0") {
chineseStr += cnNums[Number(n)] + cnDecUnits[i] chineseStr += cnNums[Number(n)] + cnDecUnits[i];
} }
} }
} }
if(chineseStr == ''){ if (chineseStr == "") {
chineseStr += cnNums[0] + cnIntLast + cnInteger; chineseStr += cnNums[0] + cnIntLast + cnInteger;
}else if(decimalNum == ''){ } else if (decimalNum == "") {
chineseStr += cnInteger; chineseStr += cnInteger;
} }
return chineseStr return chineseStr;
}, },
openDialog() { openDialog() {
this.getList() this.getList();
}, },
oninput(num) { oninput(num) {
let str = num let str = num;
let len1 = str.substr(0, 1) let len1 = str.substr(0, 1);
let len2 = str.substr(1, 1) let len2 = str.substr(1, 1);
//如果第一位是0,第二位不是点,就用数字把点替换掉 //如果第一位是0,第二位不是点,就用数字把点替换掉
if (str.length > 1 && len1 == 0 && len2 != '.') { if (str.length > 1 && len1 == 0 && len2 != ".") {
str = str.substr(1, 1) str = str.substr(1, 1);
} }
//第一位不能是. //第一位不能是.
if (len1 == '.') { if (len1 == ".") {
str = '' str = "";
} }
//限制只能输入一个小数点 //限制只能输入一个小数点
if (str.indexOf('.') != -1) { if (str.indexOf(".") != -1) {
let str_ = str.substr(str.indexOf('.') + 1) let str_ = str.substr(str.indexOf(".") + 1);
if (str_.indexOf('.') != -1) { if (str_.indexOf(".") != -1) {
str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1) str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1);
} else { } else {
// if (str_.length > 2) { // if (str_.length > 2) {
// str = str.substr(0, str.indexOf('.') + 1) + str_.substr(0, 2) // str = str.substr(0, str.indexOf('.') + 1) + str_.substr(0, 2)
...@@ -592,10 +711,10 @@ export default { ...@@ -592,10 +711,10 @@ export default {
} }
} }
//正则替换 //正则替换
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点 str = str.replace(/[^\d^\.]+/g, ""); // 保留数字和小数点
// str = str.replace(/\.\d\d\d$/,'') // 小数点后只能输两位 // str = str.replace(/\.\d\d\d$/,'') // 小数点后只能输两位
return str return str;
} },
}, },
}; };
</script> </script>
......
...@@ -7,23 +7,20 @@ ...@@ -7,23 +7,20 @@
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
size="small" size="small"
label-width="150px" :inline="true"
label-width="100px"
class="card" class="card"
> >
<el-row :gutter="10">
<el-col :span="4">
<el-form-item :label="$t('付款单号')"> <el-form-item :label="$t('付款单号')">
<el-input <el-input
clearable style="max-width: 188px"
style="max-width: 188px;"
v-model="queryParams.paymentNo" v-model="queryParams.paymentNo"
:placeholder="$t('请输入付款单号')" :placeholder="$t('请输入付款单号')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> </el-form-item ></el-input>
></el-col> </el-form-item>
<el-col :span="4" <el-form-item :label="$t('供应商')">
><el-form-item :label="$t('供应商')">
<el-select <el-select
clearable clearable
v-model="queryParams.supplierId" v-model="queryParams.supplierId"
...@@ -35,18 +32,9 @@ ...@@ -35,18 +32,9 @@
:label="supplier.companyZh" :label="supplier.companyZh"
:value="supplier.id" :value="supplier.id"
></el-option> ></el-option>
</el-select> </el-form-item </el-select>
></el-col> </el-form-item>
<el-col :span="4" <el-form-item :label="$t('业务员')">
><el-form-item :label="$t('业务员')">
<!-- <el-select v-model="form.salesmanId" :placeholder="$t('请选择业务员')">
<el-option
v-for="item in creatorData"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
</el-select> -->
<el-select <el-select
v-model="queryParams.salesmanName" v-model="queryParams.salesmanName"
filterable filterable
...@@ -61,9 +49,7 @@ ...@@ -61,9 +49,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> <el-form-item :label="$t('创建时间')">
<el-col :span="6"
><el-form-item :label="$t('创建时间')">
<el-date-picker <el-date-picker
v-model="queryParams.beginCreateTime" v-model="queryParams.beginCreateTime"
type="datetimerange" type="datetimerange"
...@@ -72,21 +58,16 @@ ...@@ -72,21 +58,16 @@
:start-placeholder="$t('请选择日期')" :start-placeholder="$t('请选择日期')"
:end-placeholder="$t('请选择日期')" :end-placeholder="$t('请选择日期')"
> >
</el-date-picker> </el-form-item </el-date-picker>
></el-col> </el-form-item>
</el-row>
<el-row :gutter="10">
<el-col :span="4">
<el-form-item :label="$t('状态')"> <el-form-item :label="$t('状态')">
<dict-selector <dict-selector
clearable clearable
:type="DICT_TYPE.ECW_PAYMENT_STATE" :type="DICT_TYPE.ECW_PAYMENT_STATE"
v-model="queryParams.state" v-model="queryParams.state"
/> ></dict-selector>
</el-form-item> </el-form-item>
</el-col> <el-form-item :label="$t('发票状态')">
<el-col :span="4"
><el-form-item :label="$t('发票状态')">
<el-select <el-select
clearable clearable
v-model="queryParams.invoiceStatus" v-model="queryParams.invoiceStatus"
...@@ -94,10 +75,9 @@ ...@@ -94,10 +75,9 @@
> >
<el-option :label="$t('未开票')" value="0" /> <el-option :label="$t('未开票')" value="0" />
<el-option :label="$t('已开票')" value="1" /> <el-option :label="$t('已开票')" value="1" />
</el-select> </el-form-item </el-select>
></el-col> </el-form-item>
<el-col :span="6" <el-form-item>
><el-form-item>
<el-button type="primary" @click="handleQuery">{{ <el-button type="primary" @click="handleQuery">{{
$t("查找") $t("查找")
}}</el-button> }}</el-button>
...@@ -107,12 +87,9 @@ ...@@ -107,12 +87,9 @@
type="success" type="success"
v-hasPermi="['ecw:paymentVoucher:create']" v-hasPermi="['ecw:paymentVoucher:create']"
@click="handleAdd(0)" @click="handleAdd(0)"
>{{ $t("新增付款单") }}</el-button >{{ $t("新增付款单") }}
</el-button>
> </el-form-item>
</el-form-item></el-col
>
</el-row>
</el-form> </el-form>
</el-card> </el-card>
<el-table v-loading="loadings" :data="list" border class="card"> <el-table v-loading="loadings" :data="list" border class="card">
...@@ -143,6 +120,15 @@ ...@@ -143,6 +120,15 @@
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span> <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
:label="$t('实际付款日期')"
align="center"
prop="sjfkdate"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sjfkdate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
:label="$t('最后付款时间')" :label="$t('最后付款时间')"
align="center" align="center"
...@@ -261,8 +247,6 @@ ...@@ -261,8 +247,6 @@
> >
{{ $t("取消反核销") }}</el-button {{ $t("取消反核销") }}</el-button
> >
<!-- <el-button v-if="scope.row.state == 3" size="mini" type="text">{{ $t('开票') }}</el-button> -->
<el-button <el-button
v-if="[6, 4].includes(row.state)" v-if="[6, 4].includes(row.state)"
size="mini" size="mini"
...@@ -279,7 +263,6 @@ ...@@ -279,7 +263,6 @@
@click="deleteClick(row)" @click="deleteClick(row)"
>{{ $t("删除") }} >{{ $t("删除") }}
</el-button> </el-button>
<!-- <el-button size="mini" type="text" @click="open = true">{{ $t('导出订单') }}</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -328,13 +311,23 @@ ...@@ -328,13 +311,23 @@
:visible.sync="examineShow" :visible.sync="examineShow"
> >
<div class="cancel_content"> <div class="cancel_content">
<span>{{ $t("申请理由") }}</span> <!--lanbm 2024-05-17 修改-->
<span>{{ $t("付款备注") }}</span>
<el-input <el-input
type="textarea" type="textarea"
:rows="6" :rows="6"
v-model="cancelReason" v-model="cancelReason"
:placeholder="$t('请输入取消理由')" :placeholder="$t('请输入付款备注')"
></el-input> ></el-input>
<span>{{ $t("实际付款日期") }}</span>
<el-date-picker
v-model="sjfkdate"
style="width: 200px"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd"
type="datetime"
placeholder="实际付款日期"
/>
</div> </div>
<span slot="footer" class="dialog-footers"> <span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick()">{{ <el-button type="primary" @click="cancelWriteOffClick()">{{
...@@ -343,6 +336,31 @@ ...@@ -343,6 +336,31 @@
<el-button @click="examineShow = false">{{ $t("取消") }}</el-button> <el-button @click="examineShow = false">{{ $t("取消") }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog
width="30%"
@close="cancelReason = ''"
:title="examineTitle"
:visible.sync="fhxShow"
>
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="cancelReason"
:placeholder="$t('申请理由')"
></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="cancelWriteOffClick2()">{{
$t("提交")
}}</el-button>
<el-button @click="cancelWriteOffClick2_Close">{{
$t("取消")
}}</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -372,10 +390,14 @@ export default { ...@@ -372,10 +390,14 @@ export default {
data() { data() {
return { return {
examineShow: false, examineShow: false,
fhxShow: false,
textTip:undefined,
examineTitle: "", examineTitle: "",
examineIndex: 0, examineIndex: 0,
examineData: {}, examineData: {},
cancelReason: "", cancelReason: "",
//实际付款日期 lanbm 2024-05-17 add
sjfkdate: undefined,
open: false, open: false,
showSearch: true, showSearch: true,
loadings: false, loadings: false,
...@@ -386,11 +408,6 @@ export default { ...@@ -386,11 +408,6 @@ export default {
total: 0, total: 0,
dateType: [], dateType: [],
loading: "", loading: "",
// params: {
// page: 1,
// rows: 20,
// },
// 查询参数
queryParams: { queryParams: {
page: 1, page: 1,
rows: 20, rows: 20,
...@@ -417,7 +434,6 @@ export default { ...@@ -417,7 +434,6 @@ export default {
created() { created() {
let that = this; let that = this;
listSimpleUsers().then((res) => (that.creatorData = res.data)); listSimpleUsers().then((res) => (that.creatorData = res.data));
// userList("salesman").then((res) => (that.creatorData = res.data));
getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => { getSupplierPage({ pageNo: "1", pageSize: "10000" }).then((res) => {
const { data } = res; const { data } = res;
this.allSupplier = data.list; this.allSupplier = data.list;
...@@ -535,8 +551,93 @@ export default { ...@@ -535,8 +551,93 @@ export default {
bridgeFn(index, title, row) { bridgeFn(index, title, row) {
this.examineIndex = index; this.examineIndex = index;
this.examineTitle = title; this.examineTitle = title;
this.textTip=title;//lanbm2024-05-16 add
this.examineData = row; this.examineData = row;
if (index == 5) {
//核销
this.examineShow = true; this.examineShow = true;
} else {
//lanbm 2024-05-17 add
this.fhxShow = true;
}
},
//lanbm 2024-05-17 add
cancelWriteOffClick2_Close() {
this.fhxShow = false;
},
cancelWriteOffClick2() {
//反核销对话框
if (!this.cancelReason) {
return this.$message.warning(this.$t("请输入申请理由!"));
}
let resolve = (val = this.$t("操作成功吗!")) => {
this.getList();
this.$message.success(val);
this.fhxShow = false;
};
let reject = () => {
this.fhxShow = false;
};
let { id: paymentId, paymentNo } = this.examineData;
let p = {
paymentId,
remark: this.cancelReason,
paymentNo,
reason: this.cancelReason,
//时间付款时间 lanbm 2024-05-17 add
sjfkdate: this.sjfkdate,
};
switch (this.examineIndex) {
case 1:
// 取消审核
cancelFinancePaymentApproval(p).then(
() => resolve(this.$t("取消付款单审核成功!")),
reject
);
break;
// 取消付款单反审核
case 2:
cancelFinancePaymentApprovalNo(p).then(
() => resolve(this.$t("取消付款单反审核成功!")),
reject
);
break;
case 3:
//取消付款单核销
cancelFinancePaymentWriteOffNo(p).then(
() => resolve(this.$t("取消付款单核销成功!")),
reject
);
break;
case 4:
// 反审核
paymentVerifyCancel(p).then(
() => resolve(this.$t("提交付款单反审核成功,请耐心等待审核结果!")),
reject
);
break;
case 5:
// 核销
paymentVerification(p).then(
() => resolve(this.$t("提交付款单核销成功,请耐心等待审核结果!")),
reject
);
break;
case 6:
// 反核销
paymentVerificationCancel(p).then(
() => resolve(this.$t("提交付款单反核销成功,请耐心等待审核结果!")),
reject
);
break;
case 7:
// 取消反核销
paymentCancelFinancePaymentWriteOffNo(p).then(
() => resolve(this.$t("取消付款单反核销成功!")),
reject
);
break;
}
}, },
cancelWriteOffClick() { cancelWriteOffClick() {
if (!this.cancelReason) { if (!this.cancelReason) {
...@@ -556,6 +657,8 @@ export default { ...@@ -556,6 +657,8 @@ export default {
remark: this.cancelReason, remark: this.cancelReason,
paymentNo, paymentNo,
reason: this.cancelReason, reason: this.cancelReason,
//时间付款时间 lanbm 2024-05-17 add
sjfkdate: this.sjfkdate,
}; };
switch (this.examineIndex) { switch (this.examineIndex) {
case 1: case 1:
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
...@@ -118,7 +117,6 @@ export default { ...@@ -118,7 +117,6 @@ export default {
created(){ created(){
this.show = true this.show = true
if(!this.order && this.orderId){ if(!this.order && this.orderId){
getOrder(this.orderId).then(res => { getOrder(this.orderId).then(res => {
this.orderDetail = res.data this.orderDetail = res.data
......
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<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="productCode"> <el-form-item :label="$t('商品编码')" prop="productCode">
......
...@@ -6,24 +6,91 @@ ...@@ -6,24 +6,91 @@
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch" v-show="showSearch"
label-width="68px" label-width="120px"
> >
<el-form-item label="运输方式" prop="titleZh"> <el-form-item label="收款单编号" prop="fuhao">
<el-select v-model="queryParams.titleZh" clearable style="width: 200px"> <el-input
<el-option label="海运拼柜" value="海运拼柜"></el-option> v-model="queryParams.receiptNo"
<el-option label="专线空运" value="专线空运"></el-option> placeholder="收款单编号"
</el-select> clearable
/>
</el-form-item>
<el-form-item label="订单号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="订单号"
clearable
/>
</el-form-item>
<el-form-item label="提单号" prop="tidanNo">
<el-input
v-model="queryParams.tidanNo"
placeholder="提单号"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="基础单位" prop="fuhao">
<el-form-item label="创建人" prop="fuhao">
<el-input <el-input
v-model="queryParams.fuhao" v-model="queryParams.fuhao"
placeholder="请输入基础单位" placeholder="创建人"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item v-show="false"> <el-form-item label="创建时间" prop="fuhao">
<Treeselect v-model="id" :options="listTree"> </Treeselect> <el-date-picker
v-model="queryParams.sDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输截止月"
/>
</el-form-item>
<el-form-item label="提交审批时间" prop="titleZh">
<el-date-picker
v-model="queryParams.sDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输截止月"
/>
</el-form-item>
<el-form-item label="审批通过时间" prop="titleZh">
<el-date-picker
v-model="queryParams.sDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate"
type="month"
style="width: 150px"
value-format="yyyy-MM"
clearable
placeholder="请输截止月"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" <el-button type="primary" icon="el-icon-search" @click="handleQuery"
...@@ -36,13 +103,10 @@ ...@@ -36,13 +103,10 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['report:vz:create']" v-hasPermi="['report:vz:create']"
> >
{{ $t("新增") }}</el-button {{ $t("批量提交审核") }}</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -59,57 +123,153 @@ ...@@ -59,57 +123,153 @@
{{ $t("导出") }}</el-button {{ $t("导出") }}</el-button
> >
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5"> </el-col>
<el-button
type="primary"
plain
icon="el-icon-plus"
v-show="true"
size="mini"
@click="TestFun"
>
{{ $t("测试功能") }}</el-button
>
</el-col>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
></right-toolbar> ></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" /> <el-table
<el-table-column label="运输方式" align="center" prop="titleZh" /> ref="multipleTable"
<el-table-column label="基础单位" align="center" prop="fuhao" /> v-loading="loading"
<el-table-column label="V值" align="center" prop="vz" width="100"> :data="list"
border
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" :reserve-selection="true">
</el-table-column>
<el-table-column
:label="$t('序号')"
type="index"
align="center"
width="50"
></el-table-column>
<el-table-column
:label="$t('收款单编号')"
align="center"
prop="receiptNo"
>
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail1(scope.row)">{{
scope.row.receiptNo
}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="修改日期" align="center" prop="updateTime"> <el-table-column :label="$t('订单编号')" align="center" prop="orderNo">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span> <span style="color: #1890ff" @click="paymentDetail2(scope.row)">{{
scope.row.orderNo
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('提单编号')" align="center" prop="tidanNo">
<template slot-scope="scope">
<span style="color: #1890ff" @click="paymentDetail3(scope.row)">{{
scope.row.tidanNo
}}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" :label="$t('收款账户')"
align="center" align="center"
class-name="small-padding fixed-width" prop="accountName"
> />
<el-table-column :label="$t('实收金额')" align="center" prop="amount" />
<el-table-column :label="$t('实收币种')" align="center" prop="marks">
<template slot-scope="scope">
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('实收日期')" align="center" prop="amountDate">
</el-table-column>
<el-table-column :label="$t('水单号')" align="center" prop="billNo" />
<el-table-column :label="$t('水单附件')" align="center" prop="attr">
<template slot-scope="scope" v-if="scope.row.attr">
<div v-for="(v, i) in scope.row.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('状态')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:type="DICT_TYPE.RECEIPT_ITEM_STATE"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" v-if="scope.row.status == 0"
v-hasPermi="['ecw:payment:detail:delete']"
type="text" type="text"
icon="el-icon-edit" @click="deleteClick(scope.row)"
@click="handleUpdate(scope.row)" >{{ $t("删除") }}</el-button
v-hasPermi="['report:vz:update']"
> >
{{ $t("修改") }}</el-button <el-button
v-if="scope.row.status == 0"
type="text"
@click="detailClick(scope.row)"
v-hasPermi="['ecw:payment:detail:detail']"
>{{ $t("详情") }}</el-button
> >
<el-button <el-button
size="mini" v-if="scope.row.status == 0"
type="text"
@click="
$router.push(`bankDetail?id=` + id + `&bankId=` + scope.row.id)
"
v-hasPermi="['ecw:payment:detail:writeOff']"
>{{ $t("核销") }}</el-button
>
<el-button
v-if="scope.row.status == 1"
type="text"
@click="showCancel(scope.$index)"
v-hasPermi="['ecw:payment:detail:cancelWriteOff']"
>{{ $t("反核销") }}</el-button
>
<el-button
v-if="scope.row.status == 0"
type="text"
@click="editClick(scope.row)"
v-hasPermi="['ecw:payment:detail:bankEdit']"
>{{ $t("编辑") }}</el-button
>
<el-button
v-if="scope.row.status == 2"
type="text"
@click="cancelClick(scope.$index, 1)"
v-hasPermi="['ecw:payment:detail:cancelDetailApproval']"
>{{ $t("取消审核") }}</el-button
>
<el-button
v-if="scope.row.status == 3"
type="text" type="text"
icon="el-icon-delete" @click="cancelClick(scope.$index, 2)"
@click="handleDelete(scope.row)" v-hasPermi="['ecw:payment:detail:cancelWriteOffNo']"
v-hasPermi="['report:vz:delete']" >{{ $t("取消反核销审核") }}</el-button
> >
{{ $t("删除") }}</el-button <el-button
v-if="scope.row.status == 3 || scope.row.status == 2"
type="text"
@click="
$router.push(`/bpm/process-instance/detail?id=` + scope.row.bmpId)
"
v-hasPermi="['ecw:payment:detail:approval']"
>{{ $t("审核详情") }}</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -124,17 +284,6 @@ ...@@ -124,17 +284,6 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="运输方式" prop="titleZh">
<el-select
v-model="form.titleZh"
@change="handleSelectChange"
clearable
style="width: 200px"
>
<el-option label="海运拼柜" value="海运拼柜"></el-option>
<el-option label="专线空运" value="专线空运"></el-option>
</el-select>
</el-form-item>
<el-form-item label="1V=" prop="vz"> <el-form-item label="1V=" prop="vz">
<el-input v-model="form.vz" placeholder="" style="width: 100px" /> <el-input v-model="form.vz" placeholder="" style="width: 100px" />
<el-input <el-input
...@@ -151,27 +300,20 @@ ...@@ -151,27 +300,20 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { getPageList, test } from "@/api/report/bankReceiptDetail";
create, import Treeselect from "@riophae/vue-treeselect";
update, import "@/assets/styles/vue-treeselect.css";
del, //弹出消息框
getModel, import { MessageBox } from "element-ui";
getPageList, //日期库函数
exportExcel, import dayjs from "dayjs";
test, import { getCurrencyPage } from "@/api/ecw/currency";
} from "@/api/report/vz";
import Treeselect from "@riophae/vue-treeselect";
import "@/assets/styles/vue-treeselect.css";
//弹出消息框
import { MessageBox } from "element-ui";
//日期库函数
import dayjs from "dayjs";
//2024-05-14 银行收款明细列表 //2024-05-14 银行收款明细列表
export default { export default {
name: "ReportBankReceiptDetailsIndex", name: "ReportBankReceiptDetailsIndex",
components: { components: {
Treeselect, Treeselect,
...@@ -195,9 +337,15 @@ ...@@ -195,9 +337,15 @@
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
titleZh: null, //运输方式 receiptNo: undefined, //收款单编号
fuhao: null, //基础单位 orderNo: undefined, //订单编号
tidanNo: undefined, //提单编号
}, },
currencyList: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
...@@ -210,57 +358,38 @@ ...@@ -210,57 +358,38 @@
}, },
], ],
}, },
id: 1,
listTree: [
{
//https://www.cnblogs.com/javahr/p/13607024.html
id: 1,
label: "1",
children: [
{
id: 11,
label: "11",
children: [
{
id: 111,
label: "111",
},
],
},
{
id: 12,
label: "12",
},
],
},
{
id: 2,
label: "2",
children: [
{
id: 21,
label: "21",
},
{
id: 22,
label: "22",
},
],
},
],
}; };
}, },
created() { async created() {
// 获取汇率
await getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
this.getList(); this.getList();
}, },
methods: { computed: {
handleSelectChange(sValue) { showCurrencyId() {
if (sValue == "海运拼柜") { let fieldList = [];
this.form.fuhao = "M3"; let groupList = [];
} else if (sValue == "专线空运") { this.list.map((element) => {
this.form.fuhao = "KG"; if (fieldList.indexOf(element["currencyId"]) === -1) {
fieldList.push(element["currencyId"]);
}
});
for (let i = 0; i < fieldList.length; i++) {
let arr = this.list.filter((element) => {
return element["currencyId"] === fieldList[i];
});
groupList.push({
currencyId: arr[0].currencyId,
list: arr,
});
} }
if (groupList.length === 1) return groupList[0].currencyId;
else return 1;
},
}, },
methods: {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -300,9 +429,13 @@ ...@@ -300,9 +429,13 @@
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
/*
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加V值"; this.title = "添加V值";*/
test(1).then((response) => {
alert(response.data);
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
...@@ -338,6 +471,35 @@ ...@@ -338,6 +471,35 @@
}); });
}); });
}, },
paymentDetail1(row) {
//到收款单详情 lanbm 2024-05-18 add
const id = row.receiptId;
return this.$router.push("/financial/receiptDetail?id=" + id);
},
paymentDetail2(row) {
//到订单详情 lanbm 2024-05-18 add
const id = row.id;
return this.$router.push("/financial/receiptDetail?id=" + id);
},
paymentDetail3(row) {
//到提档详情 lanbm 2024-05-18 add
const id = row.id;
return this.$router.push("/financial/receiptDetail?id=" + id);
},
getCurrencyLabel(id) {
let label = this.currencyList.filter((item) => item.id == id);
if (label.length > 0)
return this.$i18n.locale == "zh_CN"
? label[0].titleZh
: label[0].titleEn;
return "";
},
handleSelectionChange(selection) {
//表格多选函数 lanbm 2024-05-20 add
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
...@@ -352,34 +514,6 @@ ...@@ -352,34 +514,6 @@
}) })
.catch(() => {}); .catch(() => {});
}, },
TestFun() {
var bR= dayjs('2024-05-11').isBefore(dayjs('2024-05-12'));
alert(bR);
//获取当前日期
var now = dayjs().format('YYYY-MM-DD dddd HH:mm:ss.SSS A');
MessageBox(now);
//dayjs("2019-01-25").toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
var dJs = dayjs("2019-01-25").toJSON(); //'2019-01-25T02:00:00.000Z'
//MessageBox(dJs);
//dayjs 使用的相关参考
//https://segmentfault.com/a/1190000040835957?sort=newest
//https://dayjs.fenxianglu.cn/category/plugin.html#advancedformat
//年 : dayjs().year()
//月 : dayjs().month()
//日 : dayjs().date()
//星期 : dayjs().day()
//时 : dayjs().hour()
//分 : dayjs().minute()
//秒 : dayjs().second()
//毫秒 : dayjs().millisecond()
//调用后台函数
/*
test().then((response) => {
this.$modal.msgSuccess("测试发送");
});*/
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
...@@ -410,6 +544,6 @@ ...@@ -410,6 +544,6 @@
}; };
}, },
}, },
}; };
</script> </script>
\ No newline at end of file
...@@ -465,12 +465,9 @@ ...@@ -465,12 +465,9 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<WarehouseDetail <WarehouseDetail-detail :order="order" :orderItemId="showWarehouseInItemId"
:orderId="showWarehouseInItemId" v-if="showWarehouseInItemId" @close="showWarehouseInItemId=null">
:type="type" </WarehouseDetail-detail>
v-if="showWarehouseInItemId"
@close="showWarehouseInItemId = null"
></WarehouseDetail>
</div> </div>
</template> </template>
...@@ -484,6 +481,7 @@ import { getListPage, exportExcel,getStatisticalSummary } from "@/api/report/sal ...@@ -484,6 +481,7 @@ import { getListPage, exportExcel,getStatisticalSummary } from "@/api/report/sal
import { getCurUserPermission } from "@/api/report/EcwReportPermission"; import { getCurUserPermission } from "@/api/report/EcwReportPermission";
import { getAllChannelList, getChannelList } from "@/api/ecw/channel"; import { getAllChannelList, getChannelList } from "@/api/ecw/channel";
import { listSimpleDepts } from "@/api/system/dept"; import { listSimpleDepts } from "@/api/system/dept";
import {getOrder} from "@/api/ecw/order";
//入仓记录页面 //入仓记录页面
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail"; import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
...@@ -563,6 +561,7 @@ export default { ...@@ -563,6 +561,7 @@ export default {
objEcwReportPermission: {}, objEcwReportPermission: {},
DeptEx: { id: undefined, name: undefined, parentId: undefined }, DeptEx: { id: undefined, name: undefined, parentId: undefined },
showWarehouseInItemId: undefined, showWarehouseInItemId: undefined,
order: null,
type: 1, type: 1,
StatisticalSummary:{ StatisticalSummary:{
sumBox:0, sumBox:0,
...@@ -685,9 +684,10 @@ export default { ...@@ -685,9 +684,10 @@ export default {
}, },
// 显示入仓记录 // 显示入仓记录
showWarehouseLogs(row, type) { showWarehouseLogs(row, type) {
debugger; getOrder(row.orderId).then((response) => {
this.type = type; this.order = response.data;
this.showWarehouseInItemId = row.orderId; this.showWarehouseInItemId = row.orderItemId;
});
}, },
/** 查询部门下拉树结构 + 岗位下拉 */ /** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() { getTreeselect() {
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
> >
{{ $t("新增") }}</el-button {{ $t("新增") }}</el-button
> >
<el-button type="primary" @click="test" v-show="true">测试</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -353,12 +354,19 @@ export default { ...@@ -353,12 +354,19 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
test() {
//单元测试函数
var p = 12;
test(p).then((response) => {
this.$modal.msgSuccess("测试成功");
});
},
TestFun() { TestFun() {
var bR= dayjs('2024-05-11').isBefore(dayjs('2024-05-12')); var bR = dayjs("2024-05-11").isBefore(dayjs("2024-05-12"));
alert(bR); alert(bR);
//获取当前日期 //获取当前日期
var now = dayjs().format('YYYY-MM-DD dddd HH:mm:ss.SSS A'); var now = dayjs().format("YYYY-MM-DD dddd HH:mm:ss.SSS A");
MessageBox(now); MessageBox(now);
//dayjs("2019-01-25").toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ] //dayjs("2019-01-25").toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
var dJs = dayjs("2019-01-25").toJSON(); //'2019-01-25T02:00:00.000Z' var dJs = dayjs("2019-01-25").toJSON(); //'2019-01-25T02:00:00.000Z'
......
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