Commit b383e324 authored by liuzeheng's avatar liuzeheng

Merge branch 'dev'

# Conflicts:
#	src/i18n/languages/zh_CN.json
#	src/views/ecw/order/feeApplication.vue
parents 39f4974a 7d155129
......@@ -1056,3 +1056,11 @@ export function getOrderWarehouseDeleted(orderId,orderItem){
})
}
export function getRegionList(type,regionId){
return request({
url:'/ecw/warehouse/getRegionList?type='+type+'&regionId='+regionId,
method: 'get',
})
}
\ No newline at end of file
......@@ -159,3 +159,13 @@ export function batchAddPriceAir(data) {
data
})
}
//从商品列表中某一商品进入复制价格
export function copyPriceByProductIds(data){
return request({
url:'/ecw/product-price/copyPriceByProductIds',
method:'post',
data:data
})
}
import request from '@/utils/request'
//报表权限 lanbm 2024-04-15 add
export function create(data) {
return request({
url: '/Report/EcwReportPermission/create',
method: 'post',
data: data
})
}
export function update(data) {
return request({
url: '/Report/EcwReportPermission/update',
method: 'post',
data: data
})
}
export function del(id) {
return request({
url: '/Report/EcwReportPermission/delete?id=' + id,
method: 'get'
})
}
export function getModel(id) {
return request({
url: '/Report/EcwReportPermission/get?id=' + id,
method: 'get'
})
}
//获取当前用户的报表权限 lanbm 2024-05-15 add
export function getCurUserPermission() {
return request({
url: '/Report/EcwReportPermission/getCurUserPermission',
method: 'get'
})
}
export function getPageList(query) {
return request({
url: '/Report/EcwReportPermission/page',
method: 'get',
params: query
})
}
export function exportExcel(query) {
return request({
url: '/Report/EcwReportPermission/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
//lanbm 2024-04-19 add
//获取指定部门的子部门
export function getDeptChild(query) {
return request({
url: '/Report/SysDeptEx/getDeptChild',
method: 'get',
params: query
})
}
//根据部门过滤客户经理 2024-04-27
export function listServiceUser(query) {
return request({
url: '/Report/SysDeptEx/listServiceUser',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 获得测试分页
export function getListPage(data) {
return request({
url: '/Report/CustomerAnalysis/getListPage',
method: 'post',
data
})
}
// 导出测试 Excel -2024-04-27
export function exportExcel(data) {
return request({
url: '/Report/CustomerAnalysis/exportExcel',
method: 'get',
params: data,
responseType: 'blob'
})
}
import request from '@/utils/request'
//lanbm 2024-03-31 add
//获取报表统计结果
export function getReportResult(data) {
return request({
url: '/Report/CustomerReport/getPageList',
method: 'post',
data
})
}
export function getBarData(data) {
return request({
url: '/Report/CustomerReport/getBarData',
method: 'post',
data: data
})
}
// 导出测试 Excel 2024-04-27
export function exportExcel(query) {
return request({
url: '/Report/CustomerReport/exportExcel',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
export function getListPage(query) {
return request({
url: '/Report/SalesAnalysis/getListPage',
method: 'get',
params: query
})
}
//销售分析数据导出 Excel 2024-04-27
export function exportExcel(query) {
return request({
url: '/Report/SalesAnalysis/exportExcel',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
//查询运输方式体积货重量 lanbm 2024-04-01 add
export function SalesReportCount(data) {
return request({
url: '/Report/SalesReport/SalesReportCount',
method: 'post',
data: data
})
}
//查询首次成交客户数量 lanbm 2024-04-01 add
export function FirstCustomerCount(data) {
return request({
url: '/Report/SalesReport/FirstCustomerCount',
method: 'post',
data: data
})
}
//销售分析统计列表 lanbm 2024-04-01 add
export function SalesReportList(data) {
return request({
url: '/Report/SalesReport/SalesReportList',
method: 'post',
data: data
})
}
// 导出测试 Excel 2024-04-27
export function exportTestExcel(query) {
return request({
url: '/SalesReport/test/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
//报表V值设置参数 lanbm 2024-04-03 add
export function create(data) {
return request({
url: '/ecwVz/vz/create',
method: 'post',
data: data
})
}
export function update(data) {
return request({
url: '/ecwVz/vz/update',
method: 'post',
data: data
})
}
export function del(id) {
return request({
url: '/ecwVz/vz/delete?id=' + id,
method: 'get'
})
}
export function getModel(id) {
return request({
url: '/ecwVz/vz/get?id=' + id,
method: 'get'
})
}
//2024-04-27
export function getPageList(query) {
return request({
url: '/ecwVz/vz/page',
method: 'get',
params: query
})
}
export function exportExcel(query) {
return request({
url: '/ecwVz/vz/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
/*!
* vue-treeselect v0.4.0 | (c) 2017-2019 Riophae Lee
* Released under the MIT License.
* https://vue-treeselect.js.org/
*/
/**
* Dependencies
*/
/**
* Variables
*/
/**
* Mixins
*/
/**
* Helpers
*/
.vue-treeselect-helper-hide {
display: none;
}
.vue-treeselect-helper-zoom-effect-off {
-ms-transform: none !important;
transform: none !important;
}
/**
* Animations
*/
@keyframes vue-treeselect-animation-fade-in {
0% {
opacity: 0;
}
}
@keyframes vue-treeselect-animation-bounce {
0%,
100% {
transform: scale(0);
}
50% {
transform: scale(1);
}
}
@keyframes vue-treeselect-animation-rotate {
100% {
transform: rotate(360deg);
}
}
/**
* Transitions
*/
.vue-treeselect__multi-value-item--transition-enter-active,
.vue-treeselect__multi-value-item--transition-leave-active {
transition-duration: 200ms;
transition-property: transform, opacity;
}
.vue-treeselect__multi-value-item--transition-enter-active {
transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);
}
.vue-treeselect__multi-value-item--transition-leave-active {
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
position: absolute;
}
.vue-treeselect__multi-value-item--transition-enter,
.vue-treeselect__multi-value-item--transition-leave-to {
-ms-transform: scale(0.7);
transform: scale(0.7);
opacity: 0;
}
.vue-treeselect__multi-value-item--transition-move {
transition: 200ms transform cubic-bezier(0.165, 0.84, 0.44, 1);
}
/**
* Namespace
*/
.vue-treeselect {
position: relative;
text-align: left;
}
[dir="rtl"] .vue-treeselect {
text-align: right;
}
.vue-treeselect div,
.vue-treeselect span {
box-sizing: border-box;
}
.vue-treeselect svg {
fill: currentColor;
}
/**
* Control
*/
.vue-treeselect__control {
padding-left: 5px;
padding-right: 5px;
display: table;
table-layout: fixed;
width:300px;
height: 35px;
border: 1px solid #ddd;
border-radius: 5px;
background: #fff;
transition-duration: 200ms;
transition-property: border-color, box-shadow, width, height, background-color, opacity;
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
.vue-treeselect:not(.vue-treeselect--disabled):not(.vue-treeselect--focused) .vue-treeselect__control:hover {
border-color: #cfcfcf;
}
.vue-treeselect--focused:not(.vue-treeselect--open) .vue-treeselect__control {
border-color: #039be5;
box-shadow: 0 0 0 3px rgba(3, 155, 229, 0.1);
}
.vue-treeselect--disabled .vue-treeselect__control {
background-color: #f9f9f9;
}
.vue-treeselect--open .vue-treeselect__control {
border-color: #cfcfcf;
}
.vue-treeselect--open.vue-treeselect--open-below .vue-treeselect__control {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.vue-treeselect--open.vue-treeselect--open-above .vue-treeselect__control {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.vue-treeselect__value-container,
.vue-treeselect__multi-value {
width: 100%;
vertical-align: middle;
}
.vue-treeselect__value-container {
display: table-cell;
position: relative;
}
.vue-treeselect--searchable:not(.vue-treeselect--disabled) .vue-treeselect__value-container {
cursor: text;
}
.vue-treeselect__multi-value {
display: inline-block;
}
.vue-treeselect--has-value .vue-treeselect__multi-value {
margin-bottom: 5px;
}
.vue-treeselect__placeholder,
.vue-treeselect__single-value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 5px;
padding-right: 5px;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
line-height: 34px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
}
.vue-treeselect__placeholder {
color: #bdbdbd;
}
.vue-treeselect__single-value {
color: #333;
}
.vue-treeselect--focused.vue-treeselect--searchable .vue-treeselect__single-value {
color: #bdbdbd;
}
.vue-treeselect--disabled .vue-treeselect__single-value {
position: static;
}
.vue-treeselect__multi-value-item-container {
display: inline-block;
padding-top: 5px;
padding-right: 5px;
vertical-align: top;
}
[dir="rtl"] .vue-treeselect__multi-value-item-container {
padding-right: 0;
padding-left: 5px;
}
.vue-treeselect__multi-value-item {
cursor: pointer;
display: inline-table;
background: #e3f2fd;
padding: 2px 0;
border: 1px solid transparent;
border-radius: 2px;
color: #039be5;
font-size: 12px;
vertical-align: top;
}
.vue-treeselect:not(.vue-treeselect--disabled) .vue-treeselect__multi-value-item:not(.vue-treeselect__multi-value-item-disabled):hover .vue-treeselect__multi-value-item:not(.vue-treeselect__multi-value-item-new) .vue-treeselect__multi-value-item:not(.vue-treeselect__multi-value-item-new):hover {
cursor: pointer;
background: #e3f2fd;
color: #039be5;
}
.vue-treeselect__multi-value-item.vue-treeselect__multi-value-item-disabled {
cursor: default;
background: #f5f5f5;
color: #757575;
}
.vue-treeselect--disabled .vue-treeselect__multi-value-item {
cursor: default;
background: #fff;
border-color: #e5e5e5;
color: #555;
}
.vue-treeselect__multi-value-item.vue-treeselect__multi-value-item-new {
background: #e8f5e9;
}
.vue-treeselect__multi-value-item.vue-treeselect__multi-value-item-new:hover {
background: #e8f5e9;
}
.vue-treeselect__value-remove,
.vue-treeselect__multi-value-label {
display: table-cell;
padding: 0 5px;
vertical-align: middle;
}
.vue-treeselect__value-remove {
color: #039be5;
padding-left: 5px;
border-left: 1px solid #fff;
line-height: 0;
}
[dir="rtl"] .vue-treeselect__value-remove {
border-left: 0 none;
border-right: 1px solid #fff;
}
.vue-treeselect__multi-value-item:hover .vue-treeselect__value-remove {
color: #e53935;
}
.vue-treeselect--disabled .vue-treeselect__value-remove,
.vue-treeselect__multi-value-item-disabled .vue-treeselect__value-remove {
display: none;
}
.vue-treeselect__value-remove > svg {
width: 6px;
height: 6px;
}
.vue-treeselect__multi-value-label {
padding-right: 5px;
white-space: pre-line;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.vue-treeselect__limit-tip {
display: inline-block;
padding-top: 5px;
padding-right: 5px;
vertical-align: top;
}
[dir="rtl"] .vue-treeselect__limit-tip {
padding-right: 0;
padding-left: 5px;
}
.vue-treeselect__limit-tip-text {
cursor: default;
display: block;
margin: 2px 0;
padding: 1px 0;
color: #bdbdbd;
font-size: 12px;
font-weight: 600;
}
.vue-treeselect__input-container {
display: block;
max-width: 100%;
outline: none;
}
.vue-treeselect--single .vue-treeselect__input-container {
font-size: inherit;
height: 100%;
}
.vue-treeselect--multi .vue-treeselect__input-container {
display: inline-block;
font-size: 12px;
vertical-align: top;
}
.vue-treeselect--searchable .vue-treeselect__input-container {
padding-left: 5px;
padding-right: 5px;
}
.vue-treeselect--searchable.vue-treeselect--multi.vue-treeselect--has-value .vue-treeselect__input-container {
padding-top: 5px;
padding-left: 0;
}
[dir="rtl"] .vue-treeselect--searchable.vue-treeselect--multi.vue-treeselect--has-value .vue-treeselect__input-container {
padding-left: 5px;
padding-right: 0;
}
.vue-treeselect--disabled .vue-treeselect__input-container {
display: none;
}
.vue-treeselect__input,
.vue-treeselect__sizer {
margin: 0;
line-height: inherit;
font-family: inherit;
font-size: inherit;
}
.vue-treeselect__input {
max-width: 100%;
margin: 0;
padding: 0;
border: 0;
outline: none;
box-sizing: content-box;
box-shadow: none;
background: none transparent;
line-height: 1;
vertical-align: middle;
}
.vue-treeselect__input::-ms-clear {
display: none;
}
.vue-treeselect--single .vue-treeselect__input {
width: 100%;
height: 100%;
}
.vue-treeselect--multi .vue-treeselect__input {
padding-top: 3px;
padding-bottom: 3px;
}
.vue-treeselect--has-value .vue-treeselect__input {
line-height: inherit;
vertical-align: top;
}
.vue-treeselect__sizer {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
height: 0;
overflow: scroll;
white-space: pre;
}
.vue-treeselect__x-container {
display: table-cell;
vertical-align: middle;
width: 20px;
text-align: center;
line-height: 0;
cursor: pointer;
color: #ccc;
animation: 200ms vue-treeselect-animation-fade-in cubic-bezier(0.075, 0.82, 0.165, 1);
}
.vue-treeselect__x-container:hover {
color: #e53935;
}
.vue-treeselect__x {
width: 8px;
height: 8px;
}
.vue-treeselect__control-arrow-container {
display: table-cell;
vertical-align: middle;
width: 20px;
text-align: center;
line-height: 0;
cursor: pointer;
}
.vue-treeselect--disabled .vue-treeselect__control-arrow-container {
cursor: default;
}
.vue-treeselect__control-arrow {
width: 9px;
height: 9px;
color: #ccc;
}
.vue-treeselect:not(.vue-treeselect--disabled) .vue-treeselect__control-arrow-container:hover .vue-treeselect__control-arrow {
color: #616161;
}
.vue-treeselect--disabled .vue-treeselect__control-arrow {
opacity: 0.35;
}
.vue-treeselect__control-arrow--rotated {
-ms-transform: rotate(180deg);
transform: rotateZ(180deg);
}
/**
* Menu
*/
.vue-treeselect__menu-container {
position: absolute;
left: 0;
width: 100%;
overflow: visible;
transition: 0s;
}
.vue-treeselect--open-below:not(.vue-treeselect--append-to-body) .vue-treeselect__menu-container {
top: 100%;
}
.vue-treeselect--open-above:not(.vue-treeselect--append-to-body) .vue-treeselect__menu-container {
bottom: 100%;
}
.vue-treeselect__menu {
cursor: default;
padding-top: 5px;
padding-bottom: 5px;
display: block;
position: absolute;
overflow-x: hidden;
overflow-y: auto;
width: auto;
border: 1px solid #cfcfcf;
background: #fff;
line-height: 180%;
-webkit-overflow-scrolling: touch;
}
.vue-treeselect--open-below .vue-treeselect__menu {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
top: 0;
margin-top: -1px;
border-top-color: #f2f2f2;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.vue-treeselect--open-above .vue-treeselect__menu {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
bottom: 0;
margin-bottom: -1px;
border-bottom-color: #f2f2f2;
}
.vue-treeselect__indent-level-0 .vue-treeselect__option {
padding-left: 5px;
}
[dir="rtl"] .vue-treeselect__indent-level-0 .vue-treeselect__option {
padding-left: 5px;
padding-right: 5px;
}
.vue-treeselect__indent-level-0 .vue-treeselect__tip {
padding-left: 25px;
}
[dir="rtl"] .vue-treeselect__indent-level-0 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 25px;
}
.vue-treeselect__indent-level-1 .vue-treeselect__option {
padding-left: 25px;
}
[dir="rtl"] .vue-treeselect__indent-level-1 .vue-treeselect__option {
padding-left: 5px;
padding-right: 25px;
}
.vue-treeselect__indent-level-1 .vue-treeselect__tip {
padding-left: 45px;
}
[dir="rtl"] .vue-treeselect__indent-level-1 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 45px;
}
.vue-treeselect__indent-level-2 .vue-treeselect__option {
padding-left: 45px;
}
[dir="rtl"] .vue-treeselect__indent-level-2 .vue-treeselect__option {
padding-left: 5px;
padding-right: 45px;
}
.vue-treeselect__indent-level-2 .vue-treeselect__tip {
padding-left: 65px;
}
[dir="rtl"] .vue-treeselect__indent-level-2 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 65px;
}
.vue-treeselect__indent-level-3 .vue-treeselect__option {
padding-left: 65px;
}
[dir="rtl"] .vue-treeselect__indent-level-3 .vue-treeselect__option {
padding-left: 5px;
padding-right: 65px;
}
.vue-treeselect__indent-level-3 .vue-treeselect__tip {
padding-left: 85px;
}
[dir="rtl"] .vue-treeselect__indent-level-3 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 85px;
}
.vue-treeselect__indent-level-4 .vue-treeselect__option {
padding-left: 85px;
}
[dir="rtl"] .vue-treeselect__indent-level-4 .vue-treeselect__option {
padding-left: 5px;
padding-right: 85px;
}
.vue-treeselect__indent-level-4 .vue-treeselect__tip {
padding-left: 105px;
}
[dir="rtl"] .vue-treeselect__indent-level-4 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 105px;
}
.vue-treeselect__indent-level-5 .vue-treeselect__option {
padding-left: 105px;
}
[dir="rtl"] .vue-treeselect__indent-level-5 .vue-treeselect__option {
padding-left: 5px;
padding-right: 105px;
}
.vue-treeselect__indent-level-5 .vue-treeselect__tip {
padding-left: 125px;
}
[dir="rtl"] .vue-treeselect__indent-level-5 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 125px;
}
.vue-treeselect__indent-level-6 .vue-treeselect__option {
padding-left: 125px;
}
[dir="rtl"] .vue-treeselect__indent-level-6 .vue-treeselect__option {
padding-left: 5px;
padding-right: 125px;
}
.vue-treeselect__indent-level-6 .vue-treeselect__tip {
padding-left: 145px;
}
[dir="rtl"] .vue-treeselect__indent-level-6 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 145px;
}
.vue-treeselect__indent-level-7 .vue-treeselect__option {
padding-left: 145px;
}
[dir="rtl"] .vue-treeselect__indent-level-7 .vue-treeselect__option {
padding-left: 5px;
padding-right: 145px;
}
.vue-treeselect__indent-level-7 .vue-treeselect__tip {
padding-left: 165px;
}
[dir="rtl"] .vue-treeselect__indent-level-7 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 165px;
}
.vue-treeselect__indent-level-8 .vue-treeselect__option {
padding-left: 165px;
}
[dir="rtl"] .vue-treeselect__indent-level-8 .vue-treeselect__option {
padding-left: 5px;
padding-right: 165px;
}
.vue-treeselect__indent-level-8 .vue-treeselect__tip {
padding-left: 185px;
}
[dir="rtl"] .vue-treeselect__indent-level-8 .vue-treeselect__tip {
padding-left: 5px;
padding-right: 185px;
}
.vue-treeselect__option {
padding-left: 5px;
padding-right: 5px;
display: table;
table-layout: fixed;
width: 100%;
}
.vue-treeselect__option--highlight {
background: #f5f5f5;
}
.vue-treeselect--single .vue-treeselect__option--selected {
background: #e3f2fd;
font-weight: 600;
}
.vue-treeselect--single .vue-treeselect__option--selected:hover {
background: #e3f2fd;
}
.vue-treeselect__option--hide {
display: none;
}
.vue-treeselect__option-arrow-container,
.vue-treeselect__option-arrow-placeholder {
display: table-cell;
vertical-align: middle;
width: 20px;
text-align: center;
line-height: 0;
}
.vue-treeselect__option-arrow-container {
cursor: pointer;
}
.vue-treeselect__option-arrow {
display: inline-block;
width: 9px;
height: 9px;
color: #ccc;
vertical-align: middle;
transition: 200ms transform cubic-bezier(0.19, 1, 0.22, 1);
-ms-transform: rotate(-90deg);
transform: rotateZ(-90deg);
}
[dir="rtl"] .vue-treeselect__option-arrow {
-ms-transform: rotate(90deg);
transform: rotateZ(90deg);
}
.vue-treeselect__option-arrow-container:hover .vue-treeselect__option-arrow,
.vue-treeselect--branch-nodes-disabled .vue-treeselect__option:hover .vue-treeselect__option-arrow {
color: #616161;
}
.vue-treeselect__option-arrow--rotated {
-ms-transform: rotate(0);
transform: rotateZ(0);
}
[dir="rtl"] .vue-treeselect__option-arrow--rotated {
-ms-transform: rotate(0);
transform: rotateZ(0);
}
.vue-treeselect__option-arrow--rotated.vue-treeselect__option-arrow--prepare-enter {
-ms-transform: rotate(-90deg) !important;
transform: rotateZ(-90deg) !important;
}
[dir="rtl"] .vue-treeselect__option-arrow--rotated.vue-treeselect__option-arrow--prepare-enter {
-ms-transform: rotate(90deg) !important;
transform: rotateZ(90deg) !important;
}
.vue-treeselect__label-container {
display: table-cell;
vertical-align: middle;
cursor: pointer;
display: table;
width: 100%;
table-layout: fixed;
color: inherit;
}
.vue-treeselect__option--disabled .vue-treeselect__label-container {
cursor: not-allowed;
color: rgba(0, 0, 0, 0.25);
}
.vue-treeselect__checkbox-container {
display: table-cell;
width: 20px;
min-width: 20px;
height: 100%;
text-align: center;
vertical-align: middle;
}
.vue-treeselect__checkbox {
display: block;
margin: auto;
width: 12px;
height: 12px;
border-width: 1px;
border-style: solid;
border-radius: 2px;
position: relative;
transition: 200ms all cubic-bezier(0.075, 0.82, 0.165, 1);
}
.vue-treeselect__check-mark,
.vue-treeselect__minus-mark {
display: block;
position: absolute;
left: 1px;
top: 1px;
background-repeat: no-repeat;
opacity: 0;
transition: 200ms all ease;
}
.vue-treeselect__minus-mark {
width: 8px;
height: 8px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEUAAAD///////9zeKVjAAAAAnRSTlMAuLMp9oYAAAAPSURBVAjXY4CDrJUgBAMAGaECJ9dz3BAAAAAASUVORK5CYII=);
background-size: 8px 8px;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
.vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAAD///////////84wDuoAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAAD///////////84wDuoAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
.vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAD1BMVEUAAAD///////////////+PQt5oAAAABHRSTlMAy2EFIuWxUgAAACRJREFUGNNjGBBgJOICBY7KDCoucODEAJSAS6FwUJShGjAQAADBPRGrK2/FhgAAAABJRU5ErkJggg==);
}
}
.vue-treeselect__checkbox--indeterminate > .vue-treeselect__minus-mark {
opacity: 1;
}
.vue-treeselect__checkbox--disabled .vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEUAAADi4uLh4eHOxeSRAAAAAnRSTlMAuLMp9oYAAAAPSURBVAjXY4CDrJUgBAMAGaECJ9dz3BAAAAAASUVORK5CYII=);
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
.vue-treeselect__checkbox--disabled .vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAADi4uLi4uLh4eE5RQaIAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.vue-treeselect__checkbox--disabled .vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAADi4uLi4uLh4eE5RQaIAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
.vue-treeselect__checkbox--disabled .vue-treeselect__minus-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAD1BMVEUAAADh4eHg4ODNzc3h4eEYfw2wAAAABHRSTlMAy2EFIuWxUgAAACRJREFUGNNjGBBgJOICBY7KDCoucODEAJSAS6FwUJShGjAQAADBPRGrK2/FhgAAAABJRU5ErkJggg==);
}
}
.vue-treeselect__check-mark {
width: 8px;
height: 8px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAQlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////8IX9KGAAAAFXRSTlMA8u24NxILB+Tawb6jiH1zRz0xIQIIP3GUAAAAMklEQVQI1y3FtQEAMQDDQD+EGbz/qkEVOpyEOP6PudKjZNSXn4Jm2CKRdBKzSLsFWl8fMG0Bl6Jk1rMAAAAASUVORK5CYII=);
background-size: 8px 8px;
-ms-transform: scaleY(0.125);
transform: scaleY(0.125);
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
.vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////98JRy6AAAAH3RSTlMAzu4sDenl38fBvo1OMyIdEQrj1cSihX5hYFpHNycIcQOASAAAAF9JREFUGNN9zEcOgDAMRFHTS0LvNfe/JRmHKAIJ/mqeLJn+k9uDtaeUeFnFziGsBucUTirrprfe81RqZ3Bb6hPWeuZwDFOHyf+ig9CCzQ7INBn7bG5kF+QSt13BHNJnF7AaCT4Y+CW7AAAAAElFTkSuQmCC);
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////98JRy6AAAAH3RSTlMAzu4sDenl38fBvo1OMyIdEQrj1cSihX5hYFpHNycIcQOASAAAAF9JREFUGNN9zEcOgDAMRFHTS0LvNfe/JRmHKAIJ/mqeLJn+k9uDtaeUeFnFziGsBucUTirrprfe81RqZ3Bb6hPWeuZwDFOHyf+ig9CCzQ7INBn7bG5kF+QSt13BHNJnF7AaCT4Y+CW7AAAAAElFTkSuQmCC);
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
.vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAWlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////9ZMre9AAAAHXRSTlMA/PiJhGNI9XlEHJB/b2ldV08+Oibk49vPp6QhAYgGBuwAAACCSURBVCjPrdHdDoIwDAXgTWAqCigo/+f9X5OwnoUwtis4V92XNWladUl+rzQPeQJAN2EHxoOnsPn7/oYk8fxBv08Rr/deOH/aZ2Nm8ZJ+s573QGfWKnNuZGzWm3+lv2V3pcU1XQ385/yjmBoM3Z+dXvlbYLLD3ujhTaOM3KaIXvNkFkuSEvYy1LqOAAAAAElFTkSuQmCC);
}
}
.vue-treeselect__checkbox--checked > .vue-treeselect__check-mark {
opacity: 1;
-ms-transform: scaleY(1);
transform: scaleY(1);
}
.vue-treeselect__checkbox--disabled .vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEUAAADj4+Pf39/h4eHh4eHh4eHk5OTh4eHg4ODi4uLh4eHh4eHg4ODh4eHh4eHg4ODh4eHh4eHp6en////h4eFqcyvUAAAAFHRSTlMAOQfy7bgS5NrBvqOIfXNHMSELAgQ/iFsAAAA2SURBVAjXY4AANjYIzcjMAaVFuBkY+RkEWERYmRjYRXjANAOfiIgIFxNIAa8IpxBEi6AwiAQAK2MBd7xY8csAAAAASUVORK5CYII=);
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {
.vue-treeselect__checkbox--disabled .vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAADh4eHh4eHh4eHi4uLb29vh4eHh4eHh4eHh4eHh4eHh4eHh4eHi4uLi4uLj4+Pi4uLk5OTo6Ojh4eHh4eHi4uLg4ODg4ODh4eHg4ODh4eHf39/g4OD////h4eEzIk+wAAAAHnRSTlMAzu6/LA3p5eLZx8ONTjYiHRIKooV+YWBaRzEnCANnm5rnAAAAZElEQVQY033P2wqAIAyA4VWaaWrnc/n+j5mbhBjUf7WPoTD47TJb4i5zTr/sRDRHuyFaoWX7uK/RlbctlPEuyI1f4WY9yQINEkf6rzzo8YIzmUFoCs7J1EjeIaa9bXIEmzl8dgOZEAj/+2IvzAAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.vue-treeselect__checkbox--disabled .vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAADh4eHh4eHh4eHi4uLb29vh4eHh4eHh4eHh4eHh4eHh4eHh4eHi4uLi4uLj4+Pi4uLk5OTo6Ojh4eHh4eHi4uLg4ODg4ODh4eHg4ODh4eHf39/g4OD////h4eEzIk+wAAAAHnRSTlMAzu6/LA3p5eLZx8ONTjYiHRIKooV+YWBaRzEnCANnm5rnAAAAZElEQVQY033P2wqAIAyA4VWaaWrnc/n+j5mbhBjUf7WPoTD47TJb4i5zTr/sRDRHuyFaoWX7uK/RlbctlPEuyI1f4WY9yQINEkf6rzzo8YIzmUFoCs7J1EjeIaa9bXIEmzl8dgOZEAj/+2IvzAAAAABJRU5ErkJggg==);
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
.vue-treeselect__checkbox--disabled .vue-treeselect__check-mark {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAUVBMVEUAAADh4eHh4eHh4eHh4eHi4uLi4uLh4eHh4eHh4eHf39/j4+Ph4eHh4eHh4eHg4ODi4uLh4eHh4eHi4uLh4eHh4eHh4eHh4eHh4eH////h4eF3FMFTAAAAGnRSTlMA+/eJhGhfSHE9JBzz5KaQf3pXT0Xbz0I5AYDw8F0AAAB+SURBVCjPrdHbDoMgEEVRKAii1dZe9fz/hxplTiKIT7qfYCWTEEZdUvOwbckNAD2WHeh3brHW5f5EzGQ+iN+b1Gt6KPvtv16Dn6JX9M9ya3/A1yfu5dlyduL6Hec7mXY6ddXLPP2lpABGZ8PWXfYLTJxZekVhhl7eTX24zZPNKXoRC7zQLjUAAAAASUVORK5CYII=);
}
}
.vue-treeselect__checkbox--unchecked {
border-color: #e0e0e0;
background: #fff;
}
.vue-treeselect__label-container:hover .vue-treeselect__checkbox--unchecked {
border-color: #039be5;
background: #fff;
}
.vue-treeselect__checkbox--indeterminate {
border-color: #039be5;
background: #039be5;
}
.vue-treeselect__label-container:hover .vue-treeselect__checkbox--indeterminate {
border-color: #039be5;
background: #039be5;
}
.vue-treeselect__checkbox--checked {
border-color: #039be5;
background: #039be5;
}
.vue-treeselect__label-container:hover .vue-treeselect__checkbox--checked {
border-color: #039be5;
background: #039be5;
}
.vue-treeselect__checkbox--disabled {
border-color: #e0e0e0;
background-color: #f7f7f7;
}
.vue-treeselect__label-container:hover .vue-treeselect__checkbox--disabled {
border-color: #e0e0e0;
background-color: #f7f7f7;
}
.vue-treeselect__label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: table-cell;
padding-left: 5px;
max-width: 100%;
vertical-align: middle;
cursor: inherit;
}
[dir="rtl"] .vue-treeselect__label {
padding-left: 0;
padding-right: 5px;
}
.vue-treeselect__count {
margin-left: 5px;
font-weight: 400;
opacity: 0.6;
}
[dir="rtl"] .vue-treeselect__count {
margin-left: 0;
margin-right: 5px;
}
.vue-treeselect__tip {
padding-left: 5px;
padding-right: 5px;
display: table;
table-layout: fixed;
width: 100%;
color: #757575;
}
.vue-treeselect__tip-text {
display: table-cell;
vertical-align: middle;
padding-left: 5px;
padding-right: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
font-size: 12px;
}
.vue-treeselect__error-tip .vue-treeselect__retry {
cursor: pointer;
margin-left: 5px;
font-style: normal;
font-weight: 600;
text-decoration: none;
color: #039be5;
}
[dir="rtl"] .vue-treeselect__error-tip .vue-treeselect__retry {
margin-left: 0;
margin-right: 5px;
}
.vue-treeselect__icon-container {
display: table-cell;
vertical-align: middle;
width: 20px;
text-align: center;
line-height: 0;
}
.vue-treeselect--single .vue-treeselect__icon-container {
padding-left: 5px;
}
[dir="rtl"] .vue-treeselect--single .vue-treeselect__icon-container {
padding-left: 0;
padding-right: 5px;
}
.vue-treeselect__icon-warning {
display: block;
margin: auto;
border-radius: 50%;
position: relative;
width: 12px;
height: 12px;
background: #fb8c00;
}
.vue-treeselect__icon-warning::after {
display: block;
position: absolute;
content: "";
left: 5px;
top: 2.5px;
width: 2px;
height: 1px;
border: 0 solid #fff;
border-top-width: 5px;
border-bottom-width: 1px;
}
.vue-treeselect__icon-error {
display: block;
margin: auto;
border-radius: 50%;
position: relative;
width: 12px;
height: 12px;
background: #e53935;
}
.vue-treeselect__icon-error::before,
.vue-treeselect__icon-error::after {
display: block;
position: absolute;
content: "";
background: #fff;
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.vue-treeselect__icon-error::before {
width: 6px;
height: 2px;
left: 3px;
top: 5px;
}
.vue-treeselect__icon-error::after {
width: 2px;
height: 6px;
left: 5px;
top: 3px;
}
.vue-treeselect__icon-loader {
display: block;
margin: auto;
position: relative;
width: 12px;
height: 12px;
text-align: center;
animation: 1.6s vue-treeselect-animation-rotate linear infinite;
}
.vue-treeselect__icon-loader::before,
.vue-treeselect__icon-loader::after {
border-radius: 50%;
position: absolute;
content: "";
left: 0;
top: 0;
display: block;
width: 100%;
height: 100%;
opacity: 0.6;
animation: 1.6s vue-treeselect-animation-bounce ease-in-out infinite;
}
.vue-treeselect__icon-loader::before {
background: #039be5;
}
.vue-treeselect__icon-loader::after {
background: #b3e5fc;
animation-delay: -0.8s;
}
/**
* Menu Portal
*/
.vue-treeselect__menu-placeholder {
display: none;
}
.vue-treeselect__portal-target {
position: absolute;
display: block;
left: 0;
top: 0;
height: 0;
width: 0;
padding: 0;
margin: 0;
border: 0;
overflow: visible;
box-sizing: border-box;
}
/*# sourceMappingURL=vue-treeselect.css.map*/
\ No newline at end of file
<template>
<el-row :gutter="40" class="panel-group" v-if="data">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="checkPermi(['member:user']) ? $router.push('/member/member-user') : $alert($t('暂无权限'))">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{$t('业绩总览')}}
</div>
<count-to :start-val="0" :end-val="data.memberCount" :duration="2600" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/system/internalMessage/my-internal-message?status=0')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon icon-class="message" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{$t('海运拼柜')}}
</div>
<count-to :start-val="0" :end-val="data.messageCount" :duration="3000" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/system/internalMessage/my-internal-message?status=0')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon icon-class="message" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{$t('专线空运')}}
</div>
<count-to :start-val="0" :end-val="data.messageCount" :duration="3000" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/task/todo')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon icon-class="date" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{$t('客户成交总览')}}
</div>
<count-to :start-val="0" :end-val="todoCount" :duration="3200" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/order/mine')">
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{$t('首次成交')}}
</div>
<count-to :start-val="0" :end-val="data.messageCount" :duration="3600" class="card-panel-num" />
</div>
</div>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
import {panelData} from '@/api/system/pannel'
import {checkPermi} from '@/utils/permission'
import {taskTodoCount} from '@/api/bpm/task'
export default {
components: {
CountTo
},
props:['data1', 'data2'],
data(){
return {
data: null,
todoCount: 0
}
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
},
checkPermi
},
created(){
panelData().then(res => {
this.data = res.data
})
taskTodoCount().then(res => {
this.todoCount = res.data
})
}
}
</script>
<style lang="scss" scoped>
.panel-group {
margin-top: 5px;
.card-panel-col {
margin-bottom: 8px;
}
.card-panel {
display: flex;
justify-content: space-between;
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3
}
}
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3
}
.card-panel-icon-wrapper {
margin: 14px 0 0 14px;
padding: 5px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
font-size: 48px;
}
.card-panel-description {
font-weight: bold;
margin: 5px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width:550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
</style>
......@@ -232,7 +232,7 @@ import updateError from "./updateError.vue";
import { listUser } from "@/api/system/user";
export default {
name: "boxDetail",
name: "EcwBoxQuery",
props: {
shipmentId: String,
},
......
......@@ -176,6 +176,8 @@
<el-button :disabled="scope.row.isInOpenSea" v-has-permi="[selectAuthorityFn('ecw:customer:postpone')]" size="mini" type="text" icon="el-icon-user" @click="delay(scope.row)">{{$t('延期')}}</el-button>
<el-button v-has-permi="['ecw:customer:treat-recovery']" v-if="scope.row.customerService !== null && scope.row.customerServiceAssignedTime !== null && !scope.row.isCustomerServiceConfirmed && !scope.row.isInOpenSea && path === '/customer/customer'" size="mini" type="text" @click="recovery(scope.row)" > {{$t('回收客户')}} </el-button>
<el-button v-has-permi="['ecw:customer:performanceType']" v-if="path === '/customer/customer'" size="mini" type="text" @click="dialogVisible = true; customData = scope.row;currentisNew = scope.row.isNew" > {{$t('业绩类型')}} </el-button>
<el-button v-has-permi="[selectAuthorityFn('ecw:customer:treat-quoted-price')]" size="mini" type="text" icon="el-icon-user" @click="quote(scope.row)">{{$t('报价')}}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -786,6 +788,16 @@ export default {
this.$refs.CustomerFollowList.customerFollow.dialogVisible = true;
})
},
//报价
quote(row){
//this.$router.push({path:'/offer/create',query:{id:row.id}})
this.$router.push({path:'/offer/create' , query:{customer:row,type:1}}).then({
//this.$refs.push({path:'/customer-contacts/select',query:{pageNo:1,pageSize:10,searchKey:row.defaultContactPhone}})
})
},
/** 查询列表 */
getList() {
this.loading = true;
......
<template>
<div class="app-container">
<el-card>
<div slot="header" class="card-title">{{ $t('收款单详情') }}</div>
<div slot="header" class="card-title">{{ $t("收款单详情") }}</div>
<el-descriptions :column="3" border>
<el-descriptions-item :label="$t('收款单编号')">{{ form.receiptNo }}</el-descriptions-item>
<el-descriptions-item :label="$t('收款单编号')">{{
form.receiptNo
}}</el-descriptions-item>
<el-descriptions-item :label="$t('状态')">
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="form.state"/>
<dict-tag :type="DICT_TYPE.ECW_RECEIPT_STATE" :value="form.state" />
</el-descriptions-item>
<el-descriptions-item :label="$t('客户')">{{form.customerName }}</el-descriptions-item>
<el-descriptions-item :label="$t('部门')">{{ form.departmentName }}</el-descriptions-item>
<el-descriptions-item :label="$t('业务员')">{{ form.salesmanName }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户')">{{
form.customerName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('部门')">{{
form.departmentName
}}</el-descriptions-item>
<el-descriptions-item :label="$t('业务员')">{{
form.salesmanName
}}</el-descriptions-item>
<!-- <el-descriptions-item :label="$t('手续费(RMB)')">{{ form.feeRate }}</el-descriptions-item> -->
<el-descriptions-item :label="$t('备注')">{{ form.remark }}</el-descriptions-item>
<el-descriptions-item :label="$t('备注')">{{
form.remark
}}</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<div slot="header" class="card-title">{{ $t('应收明细') }}</div>
<div slot="header" class="card-title">{{ $t("应收明细") }}</div>
<el-table :data="list" border>
<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="title">
<template slot-scope="scope">
<span v-if="scope.row.feeType!=5">{{ scope.row.titleZh?(scope.row.titleZh + "(" + scope.row.titleEn + ")"):'' }}</span>
<span v-if="scope.row.feeType != 5">{{
scope.row.titleZh
? scope.row.titleZh + "(" + scope.row.titleEn + ")"
: ""
}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope">
<span v-if="scope.row.feeType!=5"> {{ scope.row.volume + "/" + scope.row.weight }}</span>
</template>
</el-table-column>
<span v-if="scope.row.feeType != 5">
{{ scope.row.volume + "/" + scope.row.weight }}</span
>
</template>
</el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType">
<template slot-scope="scope">
<dict-tag
......@@ -39,39 +55,58 @@
></dict-tag>
</template>
</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">
<span>{{ scope.row.unitPrice }}</span>
{{getCurrencyLabel(scope.row.currencyId)}}
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</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">
<span>{{ scope.row.totalAmount }}</span>
{{getCurrencyLabel(scope.row.currencyId)}}
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('优惠金额')" align="center">
<template slot-scope="scope">
{{ scope.row.discountTotal ? `${scope.row.discountTotal}(${scope.row.discountRemark})` : 0 }}
{{
scope.row.discountTotal
? `${scope.row.discountTotal}(${scope.row.discountRemark})`
: 0
}}
</template>
</el-table-column>
</el-table>
<el-descriptions :column="2" border class="card">
<el-descriptions-item :label="$t('是否需要开票')">
<span>{{ form.openInvoice == 1 ? $t('需要') : $t('不需要') }}</span>
<span>{{ form.openInvoice == 1 ? $t("需要") : $t("不需要") }}</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{$t('核销基准币种')}}
<span :title="$t('应收可能出现多个币种的情况,多个币种没法计算整个收款单的核销比例,所以增加一个中间币种,如果应收只有一个币种就使用应收币种,如果有多个币种就以美元为核销基准币种')"><i class="el-icon-question"></i></span>
</template>
{{getCurrencyLabel(showCurrencyId)}}
<template slot="label">
{{ $t("核销基准币种") }}
<span
:title="
$t(
'应收可能出现多个币种的情况,多个币种没法计算整个收款单的核销比例,所以增加一个中间币种,如果应收只有一个币种就使用应收币种,如果有多个币种就以美元为核销基准币种'
)
"
><i class="el-icon-question"></i
></span>
</template>
{{ getCurrencyLabel(showCurrencyId) }}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card 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-item :label="$t('发票抬头')">
{{ form.invoice }}
......@@ -88,72 +123,114 @@
<el-descriptions-item :label="$t('项目')">
{{ form.projectName }}
</el-descriptions-item>
<el-descriptions-item :label="$t('税率')+'%'">
<el-descriptions-item :label="$t('税率') + '%'">
{{ form.taxRate }}
</el-descriptions-item>
<el-descriptions-item :label="$t('开票地址/电话')">
{{ form.addressPhone }}
{{ form.addressPhone }}
</el-descriptions-item>
</el-descriptions>
</el-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>
<el-table-column :label="$t('应收币种')" align="center">
<template slot-scope="scope">
{{getCurrencyLabel(scope.row.currencyId)}}
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</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'">
<span v-if="scope.row.discountTotal&&scope.row.discountTotal>0">{{ `${scope.row.receivableAmount - scope.row.discountTotal }(${scope.row.receivableAmount} - ${scope.row.discountTotal})` }}</span>
<span v-else>{{ `${scope.row.receivableAmount}` }}</span>
<span
v-if="scope.row.discountTotal && scope.row.discountTotal > 0"
>{{
`${scope.row.receivableAmount - scope.row.discountTotal}(${
scope.row.receivableAmount
} - ${scope.row.discountTotal})`
}}</span
>
<span v-else>{{ `${scope.row.receivableAmount}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" width="220">
<template #header>
{{ $t('核销基准币种') }}{{getCurrencyLabel(showCurrencyId)}}{{ $t('汇率') }}
{{ $t("核销基准币种") }}{{ getCurrencyLabel(showCurrencyId) }}{{
$t("汇率")
}}
</template>
<template slot-scope="scope">
<template v-if="scope.row.type !== 'total'">
<span>{{ scope.row.writeOffRate }}</span>
</template>
<template v-else>
{{ $t('应核销总金额') }}{{getCurrencyLabel(showCurrencyId)}}
{{ $t("应核销总金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</template>
</el-table-column>
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t('核销基准金额') }}{{getCurrencyLabel(showCurrencyId)}}
{{ $t("核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center">
<template slot-scope="scope" v-if="scope.row.type !== 'total'">
{{ `${bankData.find(v => v.id == scope.row.platformAccountId)?bankData.find(v => v.id == scope.row.platformAccountId).baAccountName:''}(${bankData.find(v => v.id == scope.row.platformAccountId)?bankData.find(v => v.id == scope.row.platformAccountId).baAccountNum:''})` }}
{{
`${
bankData.find((v) => v.id == scope.row.platformAccountId)
? bankData.find((v) => v.id == scope.row.platformAccountId)
.baAccountName
: ""
}(${
bankData.find((v) => v.id == scope.row.platformAccountId)
? bankData.find((v) => v.id == scope.row.platformAccountId)
.baAccountNum
: ""
})`
}}
</template>
</el-table-column>
<el-table-column :label="$t('期望收款币种')" align="center">
<template slot-scope="scope">
{{getCurrencyLabel(scope.row.collectionCurrencyId)}}
{{ getCurrencyLabel(scope.row.collectionCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('期望收款汇率')" align="center">
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionRate }}</span>
<span v-else>{{ $t('期望收费金额') }}
<span :title="$t('导出账单给客户时显示的收款金额与币种')"><i class="el-icon-question"></i></span>
<span v-if="scope.row.type !== 'total'">{{
scope.row.collectionRate
}}</span>
<span v-else
>{{ $t("期望收费金额") }}
<span :title="$t('导出账单给客户时显示的收款金额与币种')"
><i class="el-icon-question"></i
></span>
</span>
</template>
</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">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount||0 }}</span>
<span v-if="scope.row.type !== 'total'">{{
scope.row.collectionAmount || 0
}}</span>
<div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?itemAmount.currencyNameZh:itemAmount.currencyNameEn}}: {{ itemAmount&&itemAmount.amount?itemAmount.amount:0}}</div>
<div v-for="itemAmount in scope.row.collectionAmount">
{{
$i18n.locale == "zh_CN"
? itemAmount.currencyNameZh
: itemAmount.currencyNameEn
}}:
{{ itemAmount && itemAmount.amount ? itemAmount.amount : 0 }}
</div>
</div>
</template>
</el-table-column>
......@@ -165,32 +242,65 @@
</el-descriptions>
</el-card>
<el-card class="card">
<div slot="header" class="card-title">{{ $t('银行收款明细') }}</div>
<div slot="header" class="card-title">{{ $t("银行收款明细") }}</div>
<div>
<el-button type="primary" v-if="form.state!=7&&form.state!=0" plain size="mini" @click="handleAddReceiptItem" v-hasPermi="['ecw:payment:detail:addBank']" style="padding: 10px; margin-bottom: 10px">{{ $t('添加收款明细') }}</el-button>
<el-button
type="primary"
v-if="form.state != 7 && form.state != 0"
plain
size="mini"
@click="handleAddReceiptItem"
v-hasPermi="['ecw:payment:detail:addBank']"
style="padding: 10px; margin-bottom: 10px"
>{{ $t("添加收款明细") }}</el-button
>
</div>
<el-table ref="multipleTable" :data="detailed" 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="accountName" />
<el-table
ref="multipleTable"
:data="detailed"
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="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)}}
{{ getCurrencyLabel(scope.row.currencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('汇率')" align="center" prop="rate" />
<el-table-column align="center" prop="writeOffAmount" >
<el-table-column align="center" prop="writeOffAmount">
<template #header>
{{ $t('兑核销基准金额') }}{{getCurrencyLabel(showCurrencyId)}}
{{ $t("兑核销基准金额") }}{{ getCurrencyLabel(showCurrencyId) }}
</template>
</el-table-column>
<el-table-column :label="$t('实收日期')" align="center" prop="amountDate">
<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>
<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">
......@@ -203,141 +313,294 @@
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="200">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" v-hasPermi="['ecw:payment:detail:delete']" type="text" @click="deleteClick(scope.row)">{{ $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 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" @click="cancelClick(scope.$index,2)" v-hasPermi="['ecw:payment:detail:cancelWriteOffNo']">{{ $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>
<el-button
v-if="scope.row.status == 0"
v-hasPermi="['ecw:payment:detail:delete']"
type="text"
@click="deleteClick(scope.row)"
>{{ $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
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"
@click="cancelClick(scope.$index, 2)"
v-hasPermi="['ecw:payment:detail:cancelWriteOffNo']"
>{{ $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>
</el-table-column>
</el-table>
</el-card>
<el-card class="card hexiaoCard">
<el-descriptions :column="3" border>
<el-descriptions-item >
<el-descriptions-item>
<template slot="label">
{{ $t('实收已核销总金额') }}<span :title="$t('所有银行收款明细中状态为已核销的实收金额,币种根据实收币种分类统计')"><i class="el-icon-question"></i></span>
</template>
<template v-if="!Object.keys(writeOffTotal).length">
0
{{ $t("实收已核销总金额")
}}<span
:title="
$t(
'所有银行收款明细中状态为已核销的实收金额,币种根据实收币种分类统计'
)
"
><i class="el-icon-question"></i
></span>
</template>
<template v-if="!Object.keys(writeOffTotal).length"> 0 </template>
<div v-else>
<div v-for="(amount, currency) in writeOffTotal" :key="currency">
{{amount}}{{getCurrencyLabel(currency)}}
{{ amount }}{{ getCurrencyLabel(currency) }}
</div>
</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{ $t('核销基准币种已核销总金额') }}{{getCurrencyLabel(showCurrencyId)}}
<span :title="$t('为了方便统计收款单核销比例,将所有银行收款明细中状态为已核销的实收金额,转换为核销基准币种的金额累加')"><i class="el-icon-question"></i></span>
{{ $t("核销基准币种已核销总金额") }}{{
getCurrencyLabel(showCurrencyId)
}}
<span
:title="
$t(
'为了方便统计收款单核销比例,将所有银行收款明细中状态为已核销的实收金额,转换为核销基准币种的金额累加'
)
"
><i class="el-icon-question"></i
></span>
</template>
{{ writeOffAmount}}
{{ writeOffAmount }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{ $t('总核销比例') }}{{getCurrencyLabel(showCurrencyId)}}
<span :title="$t('总核销比例=核销基准币种已核销总金额/核销基准币种应收总金额')"><i class="el-icon-question"></i></span>
{{ $t("总核销比例") }}{{ getCurrencyLabel(showCurrencyId) }}
<span
:title="
$t('总核销比例=核销基准币种已核销总金额/核销基准币种应收总金额')
"
><i class="el-icon-question"></i
></span>
</template>
{{ WriteOffProportion }}%
</el-descriptions-item>
</el-descriptions>
</el-card>
<div style="margin: 20px 0;font-size:16px" v-if="form.financeRemark">{{$t('备注')}}:{{form.financeRemark}}</div>
<div style="margin: 20px 0; font-size: 16px" v-if="form.financeRemark">
{{ $t("备注") }}:{{ form.financeRemark }}
</div>
<div slot="footer" style="margin: 20px 0">
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="toEdit" v-hasPermi="['ecw:payment:detail:edit']">{{ $t('编辑') }}</el-button>
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="verificationAll" v-hasPermi="['ecw:payment:detail:allWriteOff']">{{ $t('全部核销') }}</el-button>
<el-button
v-if="
form.state != 7 &&
form.state != 9 &&
form.state != 10 &&
form.state != 11 &&
form.state != 4 &&
form.state != 5 &&
form.state != 6
"
type="primary"
@click="toEdit"
v-hasPermi="['ecw:payment:detail:edit']"
>{{ $t("编辑") }}</el-button
>
<el-button
v-if="
form.state != 7 &&
form.state != 9 &&
form.state != 10 &&
form.state != 11 &&
form.state != 4 &&
form.state != 5 &&
form.state != 6
"
type="primary"
@click="verificationAll"
v-hasPermi="['ecw:payment:detail:allWriteOff']"
>{{ $t("全部核销") }}</el-button
>
<el-button
type="primary"
v-if="form.state == 11"
v-hasPermi="['ecw:voucher:cancelWriteOff']"
@click="$router.push(`/bpm/process-instance/detail?id=`+form.bmpId)"
>{{ $t('反核销审核详情') }}</el-button
@click="$router.push(`/bpm/process-instance/detail?id=` + form.bmpId)"
>{{ $t("反核销审核详情") }}</el-button
>
<el-button
type="primary"
v-if="form.state == 10"
v-hasPermi="['ecw:voucher:cancelWriteOff']"
@click="$router.push(`/bpm/process-instance/detail?id=`+form.bmpId)"
>{{ $t('全部核销审核详情') }}</el-button
@click="$router.push(`/bpm/process-instance/detail?id=` + form.bmpId)"
>{{ $t("全部核销审核详情") }}</el-button
>
<el-button
v-if="form.state == 11"
type="primary"
v-hasPermi="['ecw:vocher:cancelWriteOfflNo']"
@click="detailClickCancel(1)"
>{{ $t('取消反核销审核') }}</el-button
>{{ $t("取消反核销审核") }}</el-button
>
<el-button
v-if="form.state == 10"
type="primary"
v-hasPermi="['ecw:vocher:cancelWriteOffAll']"
@click="detailClickCancel(2)"
>{{ $t('取消全部核销审核') }}</el-button
>{{ $t("取消全部核销审核") }}</el-button
>
<el-button
v-if="form.state == 4 || form.state == 5 || form.state == 6"
type="primary"
v-hasPermi="['ecw:voucher:cancelWriteOff']"
@click="writeOffShow()"
>{{ $t('提交收款单反核销') }}</el-button
>{{ $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>
</div>
<el-dialog
:title="detailTitle"
:visible.sync="detailShow"
width="30%">
<div class="cancel_content">
<span>{{$t('申请理由')}}</span>
<el-input type="textarea" :rows ="6" v-model="detailReason" :placeholder="$t('请输入取消理由')"></el-input>
</div>
<el-dialog :title="detailTitle" :visible.sync="detailShow" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="detailReason"
:placeholder="$t('请输入取消理由')"
></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="detailWriteOffClick()">{{$t('提交')}}</el-button>
<el-button @click="detailShow = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="detailWriteOffClick()">{{
$t("提交")
}}</el-button>
<el-button @click="detailShow = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('收款单反核销')"
:visible.sync="wiffShow"
width="30%">
<div class="cancel_content">
<span>{{$t('申请理由')}}</span>
<el-input type="textarea" :rows ="6" v-model="wiffRemark" :placeholder="$t('请输入理由')"></el-input>
</div>
<el-dialog :title="$t('收款单反核销')" :visible.sync="wiffShow" width="30%">
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="wiffRemark"
:placeholder="$t('请输入理由')"
></el-input>
</div>
<span slot="footer" class="dialog-footers">
<el-button type="primary" @click="writeOffClick()">{{$t('提交反核销')}}</el-button>
<el-button @click="wiffShow = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="writeOffClick()">{{
$t("提交反核销")
}}</el-button>
<el-button @click="wiffShow = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<el-dialog v-if="openAddDialog" :visible.sync="openAddDialog" :title="dialogTitle" width="50%" append-to-body>
<el-dialog
v-if="openAddDialog"
:visible.sync="openAddDialog"
:title="dialogTitle"
width="50%"
append-to-body
>
<div style="padding: 0 24px">
<el-form ref="addForm" :model="addForm" label-width="250px">
<el-form-item :label="$t('收款单号')">{{ form.receiptNo }}</el-form-item>
<el-form-item :label="$t('收款单号')">{{
form.receiptNo
}}</el-form-item>
<el-form-item :label="$t('剩余应收金额')">
<template v-if="surplusData.length==0">
0
</template>
<template v-if="surplusData.length == 0"> 0 </template>
<div v-else>
<div v-for="(amount, currency) in surplusData" :key="currency">
<span v-if="amount"> {{amount}}{{getCurrencyLabel(currency)}}</span>
<span v-if="amount">
{{ amount }}{{ getCurrencyLabel(currency) }}</span
>
</div>
</div>
</el-form-item>
<el-form-item :label="$t('收款账户')" prop="accountNo" :rules="{ required: true, trigger: ['blur', 'change'], message: $t('收款账户不能为空') }">
<el-select v-if="!isView" filterable clear v-model="addForm.accountId" :placeholder="$t('请选择收款账户')" style="width: 220px" @change="accountChange" v-el-select-loadmore="loadmore">
<el-option v-for="item in bankData" :key="item.id" :label="item.baAccountName + '(' + item.baAccountNum + ')'" :value="item.id" />
<el-form-item
:label="$t('收款账户')"
prop="accountNo"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('收款账户不能为空'),
}"
>
<el-select
v-if="!isView"
filterable
clear
v-model="addForm.accountId"
:placeholder="$t('请选择收款账户')"
style="width: 220px"
@change="accountChange"
v-el-select-loadmore="loadmore"
>
<el-option
v-for="item in bankData"
:key="item.id"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
/>
</el-select>
<span v-else>{{ addForm.accountNo}}{{'('+addForm.accountName+')' }}</span>
<span v-else
>{{ addForm.accountNo
}}{{ "(" + addForm.accountName + ")" }}</span
>
</el-form-item>
<el-form-item
:label="$t('实收日期')"
prop="amountDate"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('实收日期不能为空') }"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('实收日期不能为空'),
}"
>
<el-date-picker
v-if="!isView"
......@@ -350,58 +613,89 @@
/>
<span v-else>{{ addForm.amountDate }}</span>
</el-form-item>
<div style="display: flex;">
<div style="display: flex">
<el-form-item
:label="$t('实收')"
prop="amount"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('实收不能为空') }"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('实收不能为空'),
}"
>
<el-input v-if="!isView" v-model="addForm.amount" style="width: 220px; margin-right: 12px" @input="setWriteOffAmount"></el-input>
<el-input
v-if="!isView"
v-model="addForm.amount"
style="width: 220px; margin-right: 12px"
@input="setWriteOffAmount"
></el-input>
<span v-else>{{ addForm.amount }}</span>
</el-form-item>
<el-form-item
label-width="0px"
prop="currencyId"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('币种不能为空') }"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('币种不能为空'),
}"
>
<el-select
v-model="addForm.currencyId"
:placeholder="$t('请选择')"
:disabled="isView"
@change="val => currencyIdChange(val)"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale=='zh_CN'?item.titleZh:item.titleEn"
:value="item.id"
/>
</el-select>
<el-select
v-model="addForm.currencyId"
:placeholder="$t('请选择')"
:disabled="isView"
@change="(val) => currencyIdChange(val)"
>
<el-option
v-for="item in currencyList"
:key="item.id"
:label="$i18n.locale == 'zh_CN' ? item.titleZh : item.titleEn"
:value="item.id"
/>
</el-select>
</el-form-item>
</div>
<el-form-item
v-if="showCurrencyId != addForm.currencyId"
prop="rate"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('兑核销基准币种汇率不能为空') }"
:rules="{
required: true,
trigger: ['blur', 'change'],
message: $t('兑核销基准币种汇率不能为空'),
}"
>
<template slot="label">
<span :title="$t('实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率')">{{ $t('兑核销基准币种汇率') }}{{getCurrencyLabel(showCurrencyId)}}</span>
<span
:title="
$t(
'实收币种与核销基准币种一样时,无需填写汇率,不一样需要填写汇率'
)
"
>{{ $t("兑核销基准币种汇率") }}{{
getCurrencyLabel(showCurrencyId)
}}</span
>
</template>
<el-input v-if="!isView" v-model="addForm.rate" style="width: 220px"></el-input>
<span v-else>{{ addForm.rate}}</span>
<el-input
v-if="!isView"
v-model="addForm.rate"
style="width: 220px"
></el-input>
<span v-else>{{ addForm.rate }}</span>
</el-form-item>
<el-form-item
v-if="showCurrencyId != addForm.currencyId"
>
<el-form-item v-if="showCurrencyId != addForm.currencyId">
<template slot="label">
{{ $t('兑核销基准币种金额') }}{{getCurrencyLabel(showCurrencyId)}}
{{ $t("兑核销基准币种金额") }}{{
getCurrencyLabel(showCurrencyId)
}}
</template>
<span>{{ addForm.writeOffAmount?parseFloat(addForm.writeOffAmount).toFixed(2):'' }}</span>
<span>{{
addForm.writeOffAmount
? parseFloat(addForm.writeOffAmount).toFixed(2)
: ""
}}</span>
</el-form-item>
<el-form-item
:label="$t('水单附件')"
prop="attr"
>
<el-form-item :label="$t('水单附件')" prop="attr">
<el-upload
v-if="!isView"
class="upload-demo"
......@@ -414,61 +708,82 @@
:file-list="addForm.attr"
multiple
>
<el-button size="small" type="primary">{{ $t('上传附件') }}</el-button>
<el-button size="small" type="primary">{{
$t("上传附件")
}}</el-button>
</el-upload>
<div v-else>
<div v-for="(v, i) in addForm.attr" :key="i"><el-link :href="v.url" type="primary" target="_blank">{{ v.name }}</el-link></div>
<div v-for="(v, i) in addForm.attr" :key="i">
<el-link :href="v.url" type="primary" target="_blank">{{
v.name
}}</el-link>
</div>
</div>
</el-form-item>
<el-form-item
:label="$t('水单号')"
prop="billNo"
>
<el-input v-if="!isView" v-model="addForm.billNo" style="width: 220px"></el-input>
<el-form-item :label="$t('水单号')" prop="billNo">
<el-input
v-if="!isView"
v-model="addForm.billNo"
style="width: 220px"
></el-input>
<span v-else>{{ addForm.billNo }}</span>
</el-form-item>
</el-form>
<div slot="footer" v-if="!isView">
<el-button type="primary" @click="saveFrom">{{ saveBtnText }}</el-button>
<el-button @click="hiddenDialog">{{ $t('取消') }}</el-button>
<el-button type="primary" @click="saveFrom">{{
saveBtnText
}}</el-button>
<el-button @click="hiddenDialog">{{ $t("取消") }}</el-button>
</div>
</div>
</el-dialog>
<el-dialog
:title="$t('收款单银行实收明细反核销-未提交')"
:visible.sync="dialogVisible"
width="30%">
<div class="cancel_content">
<span>{{$t('申请理由')}}</span>
<el-input type="textarea" :rows ="6" v-model="reason" :placeholder="$t('请输入理由')"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="verificationCancelClick()">{{$t('提交反核销')}}</el-button>
<el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('取消审核')"
:visible.sync="cancelShow"
width="30%">
<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-footer">
<el-button type="primary" @click="cancelWriteOffClick()">{{$t('提交')}}</el-button>
<el-button @click="cancelShow = false">{{$t('取消')}}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('收款单银行实收明细反核销-未提交')"
:visible.sync="dialogVisible"
width="30%"
>
<div class="cancel_content">
<span>{{ $t("申请理由") }}</span>
<el-input
type="textarea"
:rows="6"
v-model="reason"
:placeholder="$t('请输入理由')"
></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="verificationCancelClick()">{{
$t("提交反核销")
}}</el-button>
<el-button @click="dialogVisible = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
<el-dialog :title="$t('取消审核')" :visible.sync="cancelShow" width="30%">
<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-footer">
<el-button type="primary" @click="cancelWriteOffClick()">{{
$t("提交")
}}</el-button>
<el-button @click="cancelShow = false">{{ $t("取消") }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import helpIcon from "@/assets/images/help.png"
import helpIcon from "@/assets/images/help.png";
import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { getToken } from "@/utils/auth";
import { listSimpleDepts } from "@/api/system/dept";
import { getCustomer } from '@/api/ecw/customer'
import { getCustomer } from "@/api/ecw/customer";
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import {
......@@ -489,14 +804,12 @@ import {
cancelFinanceReceiptItemWriteOffNo,
cancelFinanceReceiptWriteOffNo,
cancelFinanceReceiptWriteOff,
financeReceiptWriteOffNo
financeReceiptWriteOffNo,
} from "@/api/ecw/financial";
import { getCurrencyPage } from "@/api/ecw/currency";
import NP from 'number-precision'
import NP from "number-precision";
export default {
data() {
return {
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的图片服务器地址
......@@ -517,8 +830,8 @@ export default {
detailed: [],
deptData: [],
deptArr: [],
dialogTitle: this.$t('添加银行实收明细'),
saveBtnText: this.$t('添加'),
dialogTitle: this.$t("添加银行实收明细"),
saveBtnText: this.$t("添加"),
isView: false,
multipleSelection: [],
currencyList: [],
......@@ -527,613 +840,754 @@ export default {
rmbCount: 0,
nairaCount: 0,
writtenOff: 0,
WriteOffProportion: 0
WriteOffProportion: 0,
},
remainingAmount: {
usAmount: 0,
rmbAmount: 0,
nairaAmount: 0
nairaAmount: 0,
},
surplusData:[],
dialogVisible:false,
reason:'',
cancelShow:false,
cancelTitle:'',
cancelReason:'',
cancelType:1,
detailReason:'',
detailTitle:'',
detailShow:false,
detailIndex:1,
wiffShow:false,
wiffRemark:'',
rateList:[],
surplusData: [],
dialogVisible: false,
reason: "",
cancelShow: false,
cancelTitle: "",
cancelReason: "",
cancelType: 1,
detailReason: "",
detailTitle: "",
detailShow: false,
detailIndex: 1,
wiffShow: false,
wiffRemark: "",
rateList: [],
codePage: {
pageNo: 1,
pageSize: 20
pageNo: 1,
pageSize: 20,
},
pages:1
}
pages: 1,
};
},
computed: {
showCurrencyId() {
let fieldList = [];
let groupList=[];
this.list.map((element)=>{
if(fieldList.indexOf(element['currencyId'])===-1){
fieldList.push(element['currencyId'])
let groupList = [];
this.list.map((element) => {
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];
})
});
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
})
currencyId: arr[0].currencyId,
list: arr,
});
}
if (groupList.length === 1) return groupList[0].currencyId
else return 1
if (groupList.length === 1) return groupList[0].currencyId;
else return 1;
},
// 已核销总金额
writeOffTotal(){
let total = {}
this.detailed.forEach(item => {
if(item.status){
if(!total[item.currencyId]){
total[item.currencyId] = item.amount
}else total[item.currencyId] = NP.plus(total[item.currencyId], item.amount)
writeOffTotal() {
let total = {};
this.detailed.forEach((item) => {
if (item.status) {
if (!total[item.currencyId]) {
total[item.currencyId] = item.amount;
} else
total[item.currencyId] = NP.plus(
total[item.currencyId],
item.amount
);
}
})
return total
});
return total;
},
// 已核销总金额
writeOffAmount(){
let total = 0
this.detailed.forEach(item => {
if(item.status){
total = NP.plus(total, item.writeOffAmount)
writeOffAmount() {
let total = 0;
this.detailed.forEach((item) => {
if (item.status) {
total = NP.plus(total, item.writeOffAmount);
}
})
});
return total.toFixed(2)
return total.toFixed(2);
},
//显示反审核反核销弹窗
writeOffShow(){
this.wiffRemark = ''
this.wiffShow = true
writeOffShow() {
this.wiffRemark = "";
this.wiffShow = true;
},
WriteOffProportion(){
let total = 0
if(!this.form.receiptAccountList) return 0
let amountTotal = this.form.receiptAccountList.find(item=>item.type=='total').writeOffAmount
WriteOffProportion() {
let total = 0;
if (!this.form.receiptAccountList) return 0;
let amountTotal = this.form.receiptAccountList.find(
(item) => item.type == "total"
).writeOffAmount;
this.detailed.forEach(item => {
if(item.status){
total = NP.plus(total, item.writeOffAmount)
}
})
this.detailed.forEach((item) => {
if (item.status) {
total = NP.plus(total, item.writeOffAmount);
}
});
let portion = NP.divide(total,amountTotal)
let portion = NP.divide(total, amountTotal);
console.log(portion);
if(!portion) return 0
return (portion*100).toFixed(2)
}
if (!portion) return 0;
return (portion * 100).toFixed(2);
},
},
watch: {
'addForm.rate'() {
this.setWriteOffAmount()
"addForm.rate"() {
this.setWriteOffAmount();
},
},
directives: {
'el-select-loadmore': {
bind (el, binding) {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
"el-select-loadmore": {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
);
SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) {
binding.value();
}
});
},
},
},
async created() {
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list)
await listSimpleDepts().then((res) => {
this.deptData = res.data
await getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
await getExchangeRatePage(this.params).then(
(res) => (this.rateList = res.data.list)
);
await listSimpleDepts().then((res) => {
this.deptData = res.data;
});
await getBankAccountPage(this.codePage).then((res) => {
this.bankData = res.data.list
this.pages = (res.data.total/this.codePage.pageSize)+1
this.bankData = res.data.list;
this.pages = res.data.total / this.codePage.pageSize + 1;
});
if (this.$route.query.id) {
this.id = this.$route.query.id;
await getReceiptInfoByIds({ id: this.id }).then(res => {
this.form = res.data
let dept = this.deptData.filter((itt) => itt.id == res.data.departmentId);
if(dept.length>0){
this.form.departmentName = dept[0].name
await getReceiptInfoByIds({ id: this.id }).then((res) => {
this.form = res.data;
let dept = this.deptData.filter(
(itt) => itt.id == res.data.departmentId
);
if (dept.length > 0) {
this.form.departmentName = dept[0].name;
}
})
await getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
})
getReceiptAccountList({ id: this.id }).then(res => {
});
await getInvoicingItem({ id: this.id }).then((res) => {
this.list = [...res.data];
});
getReceiptAccountList({ id: this.id }).then((res) => {
if (res.data.length > 0) {
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0).toFixed(2),
collectionAmount: []
}]
res.data = [
...res.data,
{
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);
// 收款总计
let num
let amountList =[]
this.currencyList.forEach((item,index)=>{
let nairaListByList = this.list.filter(v => v.currencyId === item.id)
if(nairaListByList.length>0){
let discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
num = res.data.find(v => v.currencyId == item.id)
num && (num.discountTotal = discountNaira)
let num;
let amountList = [];
this.currencyList.forEach((item, index) => {
let nairaListByList = this.list.filter(
(v) => v.currencyId === item.id
);
if (nairaListByList.length > 0) {
let discountNaira = nairaListByList.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.discountTotal || 0),
0
);
num = res.data.find((v) => v.currencyId == item.id);
num && (num.discountTotal = discountNaira);
}
let dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
let dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0).toFixed(2)
// if(n && n.discountTotal&&n.discountTotal>0){
// amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:(dollar-n.discountTotal).toFixed(2)})
// }else{
amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar||0})
// }
let dollarList = this.form.receiptAccountList.filter(
(v) => v.collectionCurrencyId == item.id
);
if (dollarList.length > 0) {
let dollar = dollarList
.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.collectionAmount || 0),
0
)
.toFixed(2);
// if(n && n.discountTotal&&n.discountTotal>0){
// amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:(dollar-n.discountTotal).toFixed(2)})
// }else{
amountList.push({
currencyId: item.id,
currencyNameEn: item.titleEn,
currencyNameZh: item.titleZh,
amount: dollar || 0,
});
// }
}
})
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
});
this.form.receiptAccountList[
this.form.receiptAccountList.length - 1
].collectionAmount = amountList;
this.$set(this.form, "receiptAccountList", [
...this.form.receiptAccountList,
]);
this.$nextTick(() => {
if(this.form.receiptAccountList.length>0){
this.editReceiptAccountList()
if (this.form.receiptAccountList.length > 0) {
this.editReceiptAccountList();
}
})
})
});
});
}
this.getList()
this.getList();
},
methods: {
// 懒加载
loadmore () {
this.codePage.pageNo++
loadmore() {
this.codePage.pageNo++;
// 大于页码不请求了
console.log(111)
console.log(111);
if (this.codePage.pageNo > this.pages) {
return
return;
}
this.getCodeList()
this.getCodeList();
},
getCodeList() {
setTimeout(() => {
getBankAccountPage(this.codePage).then(res => {
this.bankData = this.bankData.concat(res.data.list)
this.pages = (res.data.total/this.codePage.pageSize)+1
})
}, 200)
},
setTimeout(() => {
getBankAccountPage(this.codePage).then((res) => {
this.bankData = this.bankData.concat(res.data.list);
this.pages = res.data.total / this.codePage.pageSize + 1;
});
}, 200);
},
rateChange(row, index) {
if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
}else{
row.collectionAmount = ''
if (row.collectionRate) {
row.receivableAmount &&
(row.collectionAmount = Math.round(
NP.times(
row.collectionRate || 0,
NP.minus(row.receivableAmount, row.discountTotal || 0)
)
));
} else {
row.collectionAmount = "";
}
// row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2))
this.form.receiptAccountList[index] = {...row}
this.form.receiptAccountList[index] = { ...row };
},
editReceiptAccountList(){
let amountList =[]
this.currencyList.forEach((item,index)=>{
let dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
let dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar.toFixed(2)})
editReceiptAccountList() {
let amountList = [];
this.currencyList.forEach((item, index) => {
let dollarList = this.form.receiptAccountList.filter(
(v) => v.collectionCurrencyId == item.id
);
if (dollarList.length > 0) {
let dollar = dollarList.reduce(
(total, currentValue) =>
NP.plus(total, currentValue.collectionAmount || 0),
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.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
});
this.form.receiptAccountList[
this.form.receiptAccountList.length - 1
].collectionAmount = amountList;
this.$set(this.form, "receiptAccountList", [
...this.form.receiptAccountList,
]);
},
setWriteOffAmount() {
let pointArr = []
let regs=/^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/;
if(this.addForm.amount&&!regs.test(this.addForm.amount)){
this.addForm.amount = ''
this.$modal.msgError(this.$t('输入金额不对'));
}else{
if(this.addForm&&this.addForm.amount){
pointArr = this.addForm.amount.toString().split('.')
if(pointArr.length>1&&pointArr[1]){
this.addForm.amount =Math.round(this.addForm.amount*100)/100
let pointArr = [];
let regs = /^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/;
if (this.addForm.amount && !regs.test(this.addForm.amount)) {
this.addForm.amount = "";
this.$modal.msgError(this.$t("输入金额不对"));
} else {
if (this.addForm && this.addForm.amount) {
pointArr = this.addForm.amount.toString().split(".");
if (pointArr.length > 1 && pointArr[1]) {
this.addForm.amount = Math.round(this.addForm.amount * 100) / 100;
}
}
}
this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0))
this.$set(
this.addForm,
"writeOffAmount",
NP.times(this.addForm.rate || 0, this.addForm.amount || 0)
);
},
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 ''
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 "";
},
getsurplusData() {
// 已收
this.surplusData = []
let recepted = []
this.detailed.forEach(item => {
if(!recepted[item.currencyId]){
recepted[item.currencyId] = item.amount
}else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
})
// 应收
let collom = []
// 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList.find(item => item.type == 'total').collectionAmount.forEach(item => {
collom[item.currencyId] = item.amount
})
recepted.forEach((amount,currency)=>{
if(amount){
if(collom[currency]){
if((collom[currency]-amount)!=0) this.surplusData[currency] = +parseFloat((collom[currency]-amount).toPrecision(12))
}else{
this.surplusData[currency] = -amount
}
}
})
collom.forEach((amount,currency)=>{
if(amount){
if(!this.surplusData[currency]){
if(recepted[currency]){
if((amount-recepted[currency])!=0) this.surplusData[currency] = +parseFloat((amount-recepted[currency]).toPrecision(12))
}else{
this.surplusData[currency] = amount
}
}
}
})
},
accountChange(val){
let data = this.bankData.find(item=>item.id==val)
this.$set(this.addForm,'accountName',data.baAccountName||'')
this.$set(this.addForm,'accountNo',data.baAccountNum||'')
this.$set(this.addForm,'accountBankName',data.baBankName||'')
// 已收
this.surplusData = [];
let recepted = [];
this.detailed.forEach((item) => {
if (!recepted[item.currencyId]) {
recepted[item.currencyId] = item.amount;
} else
recepted[item.currencyId] = NP.plus(
recepted[item.currencyId],
item.amount
);
});
// 应收
let collom = [];
// 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList
.find((item) => item.type == "total")
.collectionAmount.forEach((item) => {
collom[item.currencyId] = item.amount;
});
recepted.forEach((amount, currency) => {
if (amount) {
if (collom[currency]) {
if (collom[currency] - amount != 0)
this.surplusData[currency] = +parseFloat(
(collom[currency] - amount).toPrecision(12)
);
} else {
this.surplusData[currency] = -amount;
}
}
});
collom.forEach((amount, currency) => {
if (amount) {
if (!this.surplusData[currency]) {
if (recepted[currency]) {
if (amount - recepted[currency] != 0)
this.surplusData[currency] = +parseFloat(
(amount - recepted[currency]).toPrecision(12)
);
} else {
this.surplusData[currency] = amount;
}
}
}
});
},
accountChange(val) {
let data = this.bankData.find((item) => item.id == val);
this.$set(this.addForm, "accountName", data.baAccountName || "");
this.$set(this.addForm, "accountNo", data.baAccountNum || "");
this.$set(this.addForm, "accountBankName", data.baBankName || "");
},
RMBtoUS() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv)
return NP.divide(
100,
this.currencyList.find((v) => v.titleEn === "USD").huilv
);
},
NANtoUS() {
return NP.times(this.RMBtoUS(), this.NANtoRMB())
return NP.times(this.RMBtoUS(), this.NANtoRMB());
},
UStoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'USD').huilv, 100)
return NP.divide(
this.currencyList.find((v) => v.titleEn === "USD").huilv,
100
);
},
UStoNAN() {
return NP.times(this.RMBtoNAN(), this.UStoRMB())
return NP.times(this.RMBtoNAN(), this.UStoRMB());
},
RMBtoNAN() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'NGN').huilv)
return NP.divide(
100,
this.currencyList.find((v) => v.titleEn === "NGN").huilv
);
},
NANtoRMB() {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100)
return NP.divide(
this.currencyList.find((v) => v.titleEn === "NGN").huilv,
100
);
},
//显示反核销弹窗
showCancel(index){
this.selectIndex = index
this.reason = ''
this.dialogVisible = true
showCancel(index) {
this.selectIndex = index;
this.reason = "";
this.dialogVisible = true;
},
writeOffClick(){
if(!this.wiffRemark){
this.$modal.msgError(this.$t('请输入申请理由'));
return
writeOffClick() {
if (!this.wiffRemark) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
}
this.$modal
.confirm(this.$t('您确认要反核销吗')+'?')
.then(()=>{
financeReceiptWriteOffNo({receiptId:this.id,receiptNo:this.form.receiptNo,remark:this.wiffRemark}).then(res=>{
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
this.wiffShow = false
// this.$store.dispatch('tagsView/delCurrentView')
});
})
.catch(() => {this.wiffShow = false});
this.$modal
.confirm(this.$t("您确认要反核销吗") + "?")
.then(() => {
financeReceiptWriteOffNo({
receiptId: this.id,
receiptNo: this.form.receiptNo,
remark: this.wiffRemark,
}).then((res) => {
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
this.wiffShow = false;
// this.$store.dispatch('tagsView/delCurrentView')
});
})
.catch(() => {
this.wiffShow = false;
});
},
//显示取消审核弹窗
detailClickCancel(type){
this.detailIndex = type
this.detailReason = ''
if(this.detailIndex==1){
this.detailTitle = this.$t('取消反核销审核')
}else{
this.detailTitle = this.$t('取消全部核销审核')
detailClickCancel(type) {
this.detailIndex = type;
this.detailReason = "";
if (this.detailIndex == 1) {
this.detailTitle = this.$t("取消反核销审核");
} else {
this.detailTitle = this.$t("取消全部核销审核");
}
this.detailShow = true
this.detailShow = true;
},
//取消审核弹窗
cancelClick(index,type){
this.selectIndex = index
this.cancelType = type
this.cancelReason = ''
this.cancelShow = true
cancelClick(index, type) {
this.selectIndex = index;
this.cancelType = type;
this.cancelReason = "";
this.cancelShow = true;
},
//取消审核
detailWriteOffClick(){
if(!this.detailReason){
this.$modal.msgError(this.$t('请输入申请理由'));
return
detailWriteOffClick() {
if (!this.detailReason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
}
if(this.detailIndex ==1){
cancelFinanceReceiptWriteOffNo({receiptId:this.id,remark:this.detailReason}).then(res=>{
this.detailShow = false
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
});
}else{
cancelFinanceReceiptWriteOff({receiptId:this.id,remark:this.detailReason}).then(res=>{
this.detailShow = false
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
});
if (this.detailIndex == 1) {
cancelFinanceReceiptWriteOffNo({
receiptId: this.id,
remark: this.detailReason,
}).then((res) => {
this.detailShow = false;
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
});
} else {
cancelFinanceReceiptWriteOff({
receiptId: this.id,
remark: this.detailReason,
}).then((res) => {
this.detailShow = false;
this.getReceiptInfoData();
this.$message.success(this.$t("提交成功"));
});
}
},
getReceiptInfoData(){
getReceiptInfoByIds({ id: this.id }).then(res => {
this.form = res.data
getCustomer(this.form.customerId).then(res => {
this.form.customerName = res?.data?.name
})
let dept = this.deptData.filter((itt) => itt.id == res.data.departmentId);
getReceiptInfoData() {
getReceiptInfoByIds({ id: this.id }).then((res) => {
this.form = res.data;
getCustomer(this.form.customerId).then((res) => {
this.form.customerName = res?.data?.name;
});
let dept = this.deptData.filter(
(itt) => itt.id == res.data.departmentId
);
// console.log(dept)
if(dept.length>0){
this.form.departmentName = dept[0].name
if (dept.length > 0) {
this.form.departmentName = dept[0].name;
}
})
});
},
//取消审核
cancelWriteOffClick(){
if(!this.cancelReason){
this.$modal.msgError(this.$t('请输入申请理由'));
return
cancelWriteOffClick() {
if (!this.cancelReason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
}
let receiptItemId = this.detailed[this.selectIndex].id
if(this.cancelType==1){
cancelFinanceReceiptItemWriteOff({receiptItemId:receiptItemId,remark:this.cancelReason}).then(res=>{
this.cancelShow = false
this.getList()
let receiptItemId = this.detailed[this.selectIndex].id;
if (this.cancelType == 1) {
cancelFinanceReceiptItemWriteOff({
receiptItemId: receiptItemId,
remark: this.cancelReason,
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
}else{
cancelFinanceReceiptItemWriteOffNo({receiptItemId:receiptItemId,remark:this.cancelReason}).then(res=>{
this.cancelShow = false
this.getList()
} else {
cancelFinanceReceiptItemWriteOffNo({
receiptItemId: receiptItemId,
remark: this.cancelReason,
}).then((res) => {
this.cancelShow = false;
this.getList();
this.$message.success(this.$t("提交成功"));
});
}
},
currencyIdChange(val) {
val = Number(val)
let rate
if(val === this.showCurrencyId) {
rate = 1
val = Number(val);
let rate;
if (val === this.showCurrencyId) {
rate = 1;
} else {
rate = this.getRate(val,this.showCurrencyId)
rate = this.getRate(val, this.showCurrencyId);
}
this.$set(this.addForm, 'rate', rate)
this.$set(this.addForm, "rate", rate);
},
//获取汇率
getRate(sourceCurrencyId,targetCurrencyId){
let rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate
return ''
getRate(sourceCurrencyId, targetCurrencyId) {
let rate = this.rateList.find(
(v) =>
v.sourceCurrencyId === sourceCurrencyId &&
v.targetCurrencyId === targetCurrencyId
);
if (rate) return rate.currencyRate;
return "";
},
getList() {
getReceivableItem({ id: this.id }).then(res => {
this.detailed = res.data.map(v => ({
getReceivableItem({ id: this.id }).then((res) => {
this.detailed = res.data.map((v) => ({
...v,
amountDate: this.parseTime(v.amountDate, '{y}-{m}-{d}'),
rate:parseFloat(v.rate),
attr: v.attr ? v.attr.split(',').map(t => ({ name: t.slice(t.lastIndexOf('/') + 1), url: t })) : []
}))
})
amountDate: this.parseTime(v.amountDate, "{y}-{m}-{d}"),
rate: parseFloat(v.rate),
attr: v.attr
? v.attr
.split(",")
.map((t) => ({ name: t.slice(t.lastIndexOf("/") + 1), url: t }))
: [],
}));
});
},
saveFrom() {
this.$refs.addForm.validate ((valid)=>{
this.$refs.addForm.validate((valid) => {
if (valid) {
if (this.addForm.id) {
const params = {...this.addForm}
params.attr && (params.attr = params.attr.map(v => v.url).join(','))
updateReceiptItem(params).then(res => {
this.$modal.msgSuccess(this.$t('修改成功'));
this.openAddDialog = false
this.getList()
})
return
const params = { ...this.addForm };
params.attr &&
(params.attr = params.attr.map((v) => v.url).join(","));
updateReceiptItem(params).then((res) => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.openAddDialog = false;
this.getList();
});
return;
}
const params = {...this.addForm}
params.attr && (params.attr = params.attr.map(v => v.url).join(','))
params.receiptId = this.id
receiptItemCreate(params).then(res => {
this.$modal.msgSuccess(this.$t('新增成功'));
this.openAddDialog = false
this.getList()
})
const params = { ...this.addForm };
params.attr &&
(params.attr = params.attr.map((v) => v.url).join(","));
params.receiptId = this.id;
receiptItemCreate(params).then((res) => {
this.$modal.msgSuccess(this.$t("新增成功"));
this.openAddDialog = false;
this.getList();
});
}
})
});
},
toEdit() {
return this.$router.push("creatCollection?id=" + this.id);
},
detailClick(row) {
this.getsurplusData()
this.openAddDialog = true
this.dialogTitle = this.$t('银行实收明细详情')
this.isView = true
this.getsurplusData();
this.openAddDialog = true;
this.dialogTitle = this.$t("银行实收明细详情");
this.isView = true;
setTimeout(() => {
this.addForm = { ...row }
this.setWriteOffAmount()
}, 0)
this.addForm = { ...row };
this.setWriteOffAmount();
}, 0);
},
editClick(row) {
this.getsurplusData()
this.openAddDialog = true
this.dialogTitle = this.$t('编辑银行实收明细')
this.saveBtnText = this.$t('提交')
this.isView = false
this.getsurplusData();
this.openAddDialog = true;
this.dialogTitle = this.$t("编辑银行实收明细");
this.saveBtnText = this.$t("提交");
this.isView = false;
setTimeout(() => {
this.addForm = { ...row }
let bank = this.bankData.find(v=>v.baAccountNum==this.addForm.accountNo)
if(bank) this.addForm.accountId = bank.id
this.setWriteOffAmount()
}, 0)
this.addForm = { ...row };
let bank = this.bankData.find(
(v) => v.baAccountNum == this.addForm.accountNo
);
if (bank) this.addForm.accountId = bank.id;
this.setWriteOffAmount();
}, 0);
},
deleteClick(row) {
const id = row.id;
this.$modal.confirm(this.$t('是否确认删除该收款单')+'?').then(function() {
return deleteReceiptItem(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess(this.$t('删除成功'));
}).catch(() => {});
this.$modal
.confirm(this.$t("是否确认删除该收款单") + "?")
.then(function () {
return deleteReceiptItem(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
})
.catch(() => {});
},
verificationClick(row) {
const id = row.id;
this.$modal
.confirm(this.$t('您确认要核销吗')+'?')
.confirm(this.$t("您确认要核销吗") + "?")
.then(function () {
return receiptItemVerification(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess(this.$t('核销成功'));
this.$modal.msgSuccess(this.$t("核销成功"));
})
.catch(() => {});
},
//银行明细反核销
verificationCancelClick() {
if(!this.reason){
this.$modal.msgError(this.$t('请输入申请理由'));
return
if (!this.reason) {
this.$modal.msgError(this.$t("请输入申请理由"));
return;
}
const id = this.detailed[this.selectIndex].id
const id = this.detailed[this.selectIndex].id;
this.$modal
.confirm(this.$t('您确认要反核销吗')+'?')
.then(()=>{
financeReceiptItemWriteOffNo({receiptId:this.id,receiptNo:this.form.receiptNo,receiptItemId:id,remark:this.reason}).then(res=>{
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false
});
.confirm(this.$t("您确认要反核销吗") + "?")
.then(() => {
financeReceiptItemWriteOffNo({
receiptId: this.id,
receiptNo: this.form.receiptNo,
receiptItemId: id,
remark: this.reason,
}).then((res) => {
this.getList();
this.$message.success(this.$t("提交成功"));
this.dialogVisible = false;
});
})
.catch(() => {this.dialogVisible = false});
.catch(() => {
this.dialogVisible = false;
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
batchVerification() {
if (this.multipleSelection.length === 0) {
this.$modal.msgError(this.$t('请选择需要核销的收款明细'));
return
this.$modal.msgError(this.$t("请选择需要核销的收款明细"));
return;
}
const params = { ids: this.multipleSelection.map(v => v.id).join(',') }
const params = { ids: this.multipleSelection.map((v) => v.id).join(",") };
this.$modal
.confirm(this.$t('您确认要核销吗'+'?'))
.confirm(this.$t("您确认要核销吗" + "?"))
.then(function () {
return receiptItemBatchVerification(params);
})
.then(() => {
this.multipleSelection.forEach(row => {
this.multipleSelection.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row);
});
this.getList();
this.$modal.msgSuccess(this.$t('核销成功'));
this.$modal.msgSuccess(this.$t("核销成功"));
})
.catch(() => {});
},
verificationAll() {
if(!this.detailed||this.detailed.length==0){
this.$modal.msgError(this.$t('当前收款单未添加银行收款明细,无法全部核销,请添加银行收款单明细,并核销所有实收明细后再进行全部核销'));
return
if (!this.detailed || this.detailed.length == 0) {
this.$modal.msgError(
this.$t(
"当前收款单未添加银行收款明细,无法全部核销,请添加银行收款单明细,并核销所有实收明细后再进行全部核销"
)
);
return;
}
this.$modal
.confirm(this.$t('您确认要全部核销吗'+'?'))
.confirm(this.$t("您确认要全部核销吗" + "?"))
.then(() => {
return financeReceiptWriteOff({receiptId:this.id,receiptNo:this.form.receiptNo});
return financeReceiptWriteOff({
receiptId: this.id,
receiptNo: this.form.receiptNo,
});
})
.then(() => {
this.$modal.msgSuccess(this.$t('核销成功'));
this.$store.dispatch('tagsView/delCurrentView');
this.$modal.msgSuccess(this.$t("核销成功"));
this.$store.dispatch("tagsView/delCurrentView");
})
.catch(() => {});
},
hiddenDialog() {
this.openAddDialog = false
this.openAddDialog = false;
},
handleAddReceiptItem() {
this.getsurplusData()
this.addForm = {}
this.openAddDialog = true
this.isView = false
this.dialogTitle = this.$t('添加银行实收明细')
this.saveBtnText = this.$t('添加')
this.getsurplusData();
this.addForm = {};
this.openAddDialog = true;
this.isView = false;
this.dialogTitle = this.$t("添加银行实收明细");
this.saveBtnText = this.$t("添加");
},
handleUploadSuccess(res, file, fileList) {
let arr = [];
setTimeout(() => {
fileList.forEach((item) => {
arr.push({ name: item.name, url: item.response ? item.response.data : item.url });
arr.push({
name: item.name,
url: item.response ? item.response.data : item.url,
});
});
this.addForm.attr = arr;
}, 300)
}, 300);
this.loading.close();
},
handleBeforeUpload() {
this.loading = this.$loading({
lock: true,
text: this.$t('上传中'),
text: this.$t("上传中"),
background: "rgba(0, 0, 0, 0.7)",
});
},
handleUploadError() {
this.$message({
type: "error",
message: this.$t('上传失败'),
message: this.$t("上传失败"),
});
this.loading.close();
},
beforeRemove(file, fileList) {
return this.$confirm(this.$t('确定移除')+'?').then(res => {
return this.$confirm(this.$t("确定移除") + "?").then((res) => {
setTimeout(() => {
this.addForm.attr = fileList.map(v => ({ name: v.name, url: v.response ? v.response.data : v.url }))
}, 300)
this.addForm.attr = fileList.map((v) => ({
name: v.name,
url: v.response ? v.response.data : v.url,
}));
}, 300);
});
}
}
}
},
},
};
</script>
<style scoped lang="scss">
......@@ -1163,15 +1617,15 @@ export default {
width: 22%;
}
}
.cancel_content{
display: flex;
// align-items: center;
flex-direction: column;
// padding-top: 20px;
}
.cancel_content span{
font-size: 16px;
font-weight:600;
margin-bottom:10px
}
.cancel_content {
display: flex;
// align-items: center;
flex-direction: column;
// padding-top: 20px;
}
.cancel_content span {
font-size: 16px;
font-weight: 600;
margin-bottom: 10px;
}
</style>
......@@ -9,63 +9,106 @@
inline
class="card"
>
<el-form-item :label="$t('自编号')" prop="selfNo">
<el-input v-model="queryParams.selfNo" clearable></el-input>
</el-form-item>
<el-form-item :label="$t('始发仓')" :rules="{required: true, message: $t('请选择始发仓')}" prop="startWarehouseIdList">
<el-select v-model="queryParams.startWarehouseIdList" multiple :placeholder="$t('请选择')" clearable>
<el-option
v-for="item in exportWarehouseList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的国')" :rules="{required: true, message: $t('请选择目的国')}" prop="destCountryId">
<el-select v-model="queryParams.destCountryId" :placeholder="$t('请选择')" filterable default-first-option>
<el-option
v-for="item in countryList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseIdList">
<el-select v-model="queryParams.destWarehouseIdList" multiple :placeholder="queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')" clearable>
<el-option
v-for="item in importWarehouseList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('自编号状态')" prop="boxStatus">
<dict-selector :type="DICT_TYPE.BOX_ORDER_SHIPMENT_STATE" v-model="queryParams.boxStatus" clearable></dict-selector>
</el-form-item>
<el-form-item :label="$t('结算时间')" prop="dateFilter">
<el-date-picker v-model="dateFilter" type="datetimerange" range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleQuery"
>
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('是否结算')" prop="slStatus">
<dict-selector :type="DICT_TYPE.SETTLEMENT_STATUS" v-model="queryParams.slStatus" clearable></dict-selector>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
:loading="loading"
>{{$t('查询')}}</el-button>
<el-button type="primary" :loading="exporting" icon="el-icon-download" @click="handleExport">{{$t('导出搜索')}}</el-button>
</el-form-item>
<el-form-item :label="$t('自编号')" prop="selfNo">
<el-input v-model="queryParams.selfNo" clearable></el-input>
</el-form-item>
<el-form-item
:label="$t('始发仓')"
:rules="{ required: true, message: $t('请选择始发仓') }"
prop="startWarehouseIdList"
>
<el-select
v-model="queryParams.startWarehouseIdList"
multiple
:placeholder="$t('请选择')"
clearable
>
<el-option
v-for="item in exportWarehouseList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item
:label="$t('目的国')"
:rules="{ required: true, message: $t('请选择目的国') }"
prop="destCountryId"
>
<el-select
v-model="queryParams.destCountryId"
:placeholder="$t('请选择')"
filterable
default-first-option
>
<el-option
v-for="item in countryList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseIdList">
<el-select
v-model="queryParams.destWarehouseIdList"
multiple
:placeholder="
queryParams.destCountryId ? $t('请选择') : $t('请先选择目的国')
"
clearable
>
<el-option
v-for="item in importWarehouseList"
:key="item.id"
:label="$l(item, 'title')"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('自编号状态')" prop="boxStatus">
<dict-selector
:type="DICT_TYPE.BOX_ORDER_SHIPMENT_STATE"
v-model="queryParams.boxStatus"
clearable
></dict-selector>
</el-form-item>
<el-form-item :label="$t('结算时间')" prop="dateFilter">
<el-date-picker
v-model="dateFilter"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleQuery"
>
</el-date-picker>
</el-form-item>
<el-form-item :label="$t('是否结算')" prop="slStatus">
<dict-selector
:type="DICT_TYPE.SETTLEMENT_STATUS"
v-model="queryParams.slStatus"
clearable
></dict-selector>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
:loading="loading"
>{{ $t("查询") }}</el-button
>
<el-button
type="primary"
:loading="exporting"
icon="el-icon-download"
@click="handleExport"
>{{ $t("导出搜索") }}</el-button
>
</el-form-item>
</el-form>
</el-card>
<el-table
......@@ -79,91 +122,180 @@
>
<el-table-column :label="$t('是否结算')" align="center">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.SETTLEMENT_STATUS" :value="scope.row.slStatus"></dict-tag>
<dict-tag
:type="DICT_TYPE.SETTLEMENT_STATUS"
:value="scope.row.slStatus"
></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('No.柜号')" align="center" prop="selfNo">
<template slot-scope="scope">
<el-button v-if="permissions.indexOf('selfno:report:detail') > -1" type="text" @click="$router.push('./self_no_report_detail?containerNumber=' + scope.row.selfNo)">{{scope.row.selfNo}}</el-button>
<span v-else>{{scope.row.selfNo}}</span>
<el-button
v-if="permissions.indexOf('selfno:report:detail') > -1"
type="text"
@click="
$router.push(
'./self_no_report_detail?containerNumber=' + scope.row.selfNo
)
"
>{{ scope.row.selfNo }}</el-button
>
<span v-else>{{ scope.row.selfNo }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('应收款(Accounts receivable)USD')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.receivableTotalFee}}{{row.summaryInfo.receivableTotalFeeCurrency}}
<el-table-column
:label="$t('应收款(Accounts receivable)USD')"
prop="summaryInfo.netReceiptsCollectFreightFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.receivableTotalFee
}}{{ row.summaryInfo.receivableTotalFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('应收款 RECEIVABLE')" align="center" prop="summaryInfo.receivableTotalFeeGroup">
<el-table-column :label="$t('运费 FREIGHT') + ColumnCurrencyName('Freight')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalReceivableFreightFee}}{{row.summaryInfo.totalFreightFeeCurrency}}
<el-table-column
:label="$t('应收款 RECEIVABLE')"
align="center"
prop="summaryInfo.receivableTotalFeeGroup"
>
<el-table-column
:label="$t('运费 FREIGHT') + ColumnCurrencyName('Freight')"
prop="summaryInfo.netReceiptsCollectFreightFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalReceivableFreightFee
}}{{ row.summaryInfo.totalFreightFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('清关费 CLEARING FEE') + ColumnCurrencyName('Clearance')">
<template slot-scope="{row}">
{{row.summaryInfo.totalReceivableClearanceFee}}{{row.summaryInfo.totalClearanceFeeCurrency}}
<el-table-column
:label="$t('清关费 CLEARING FEE') + ColumnCurrencyName('Clearance')"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalReceivableClearanceFee
}}{{ row.summaryInfo.totalClearanceFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用 EXTRAL FEE') + ColumnCurrencyName('Other')">
<template slot-scope="{row}">
{{row.summaryInfo.totalReceivableOtherFee}}{{row.summaryInfo.totalOtherFeeCurrency}}
<el-table-column
:label="$t('额外费用 EXTRAL FEE') + ColumnCurrencyName('Other')"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalReceivableOtherFee
}}{{ row.summaryInfo.totalOtherFeeCurrency }}
</template>
</el-table-column>
</el-table-column>
<el-table-column :label="'received in ' + (dstCountryName || $t('目的国')) + `(${$t('目的地实收')})`" align="center" prop="">
<el-table-column :label="$t('运费') + ColumnCurrencyName('Freight')" prop="summaryInfo.netReceiptsCollectFreightFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsCollectFreightFee}}{{row.summaryInfo.totalFreightFeeCurrency}}
<el-table-column
:label="
'received in ' +
(dstCountryName || $t('目的国')) +
`(${$t('目的地实收')})`
"
align="center"
prop=""
>
<el-table-column
:label="$t('运费') + ColumnCurrencyName('Freight')"
prop="summaryInfo.netReceiptsCollectFreightFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalNetReceiptsCollectFreightFee
}}{{ row.summaryInfo.totalFreightFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('清关费') + ColumnCurrencyName('Clearance')" prop="summaryInfo.netReceiptsCollectClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsCollectClearanceFee}}{{row.summaryInfo.totalClearanceFeeCurrency}}
<el-table-column
:label="$t('清关费') + ColumnCurrencyName('Clearance')"
prop="summaryInfo.netReceiptsCollectClearanceFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalNetReceiptsCollectClearanceFee
}}{{ row.summaryInfo.totalClearanceFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用') + ColumnCurrencyName('Other')" prop="summaryInfo.netReceiptsCollectOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsCollectOtherFee}}{{row.summaryInfo.totalOtherFeeCurrency}}
<el-table-column
:label="$t('额外费用') + ColumnCurrencyName('Other')"
prop="summaryInfo.netReceiptsCollectOtherFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalNetReceiptsCollectOtherFee
}}{{ row.summaryInfo.totalOtherFeeCurrency }}
</template>
</el-table-column>
</el-table-column>
<el-table-column :label="$t('received in China(中国实收)')" align="center" prop="" >
<el-table-column :label="$t('运费') + ColumnCurrencyName('Freight')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.netReceiptsAdvanceFreightFee}}{{row.summaryInfo.totalFreightFeeCurrency}}
<el-table-column
:label="$t('received in China(中国实收)')"
align="center"
prop=""
>
<el-table-column
:label="$t('运费') + ColumnCurrencyName('Freight')"
prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.netReceiptsAdvanceFreightFee
}}{{ row.summaryInfo.totalFreightFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('清关费') + ColumnCurrencyName('Clearance')" prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsAdvanceClearanceFee}}{{row.summaryInfo.totalClearanceFeeCurrency}}
<el-table-column
:label="$t('清关费') + ColumnCurrencyName('Clearance')"
prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalNetReceiptsAdvanceClearanceFee
}}{{ row.summaryInfo.totalClearanceFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用') + ColumnCurrencyName('Other')" prop="summaryInfo.netReceiptsAdvanceOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.totalNetReceiptsAdvanceOtherFee}}{{row.summaryInfo.totalOtherFeeCurrency}}
<el-table-column
:label="$t('额外费用') + ColumnCurrencyName('Other')"
prop="summaryInfo.netReceiptsAdvanceOtherFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.totalNetReceiptsAdvanceOtherFee
}}{{ row.summaryInfo.totalOtherFeeCurrency }}
</template>
</el-table-column>
</el-table-column>
<el-table-column :label="$t('Discounts 折扣')" align="center" prop="">
<el-table-column :label="$t('运费') + ColumnCurrencyName('Freight')" prop="summaryInfo.discountFreightFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.discountFreightFee}}{{row.summaryInfo.totalFreightFeeCurrency}}
<el-table-column
:label="$t('运费') + ColumnCurrencyName('Freight')"
prop="summaryInfo.discountFreightFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.discountFreightFee
}}{{ row.summaryInfo.totalFreightFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('清关费') + ColumnCurrencyName('Clearance')" prop="summaryInfo.discountClearanceFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.discountClearanceFee}}{{row.summaryInfo.totalClearanceFeeCurrency}}
<el-table-column
:label="$t('清关费') + ColumnCurrencyName('Clearance')"
prop="summaryInfo.discountClearanceFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.discountClearanceFee
}}{{ row.summaryInfo.totalClearanceFeeCurrency }}
</template>
</el-table-column>
<el-table-column :label="$t('额外费用') + ColumnCurrencyName('Other')" prop="summaryInfo.discountOtherFeeGroup">
<template slot-scope="{row}">
{{row.summaryInfo.discountOtherFee}}{{row.summaryInfo.totalOtherFeeCurrency}}
<el-table-column
:label="$t('额外费用') + ColumnCurrencyName('Other')"
prop="summaryInfo.discountOtherFeeGroup"
>
<template slot-scope="{ row }">
{{ row.summaryInfo.discountOtherFee
}}{{ row.summaryInfo.totalOtherFeeCurrency }}
</template>
</el-table-column>
</el-table-column>
<el-table-column :label="$t('操作')" v-if="permissions.indexOf('selfno:report:detail') > -1">
<el-table-column
:label="$t('操作')"
v-if="permissions.indexOf('selfno:report:detail') > -1"
>
<template slot-scope="scope">
<el-button type="text" @click="$router.push('./self_no_report_detail?containerNumber=' + scope.row.selfNo)">{{$t('查看')}}</el-button>
<el-button
type="text"
@click="
$router.push(
'./self_no_report_detail?containerNumber=' + scope.row.selfNo
)
"
>{{ $t("查看") }}</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -179,57 +311,62 @@
<script>
import { getCurrencyPage } from "@/api/ecw/currency";
import {getWarehouseList} from '@/api/ecw/warehouse'
import { getWarehouseList } from "@/api/ecw/warehouse";
import store from "@/store";
import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box";
import {getListTree} from "@/api/ecw/region";
import Decimal from 'decimal.js'
import { boxSettlementPage, exportSettlementExcel } from "@/api/ecw/box";
import { getListTree } from "@/api/ecw/region";
import Decimal from "decimal.js";
export default {
name: 'EcwFinancialSelfnoreport',
name: "EcwFinancialSelfnoreport",
data() {
return {
loading: false, // 是否加载中
dateFilter:[], // 筛选时间
dateFilter: [], // 筛选时间
list: [],
total: 0,
queryParams: {
page: 1,
rows: 10,
startWarehouseIdList:[],
destWarehouseIdList: []
startWarehouseIdList: [],
destWarehouseIdList: [],
},
// tradeCityList: [],
currencyList:[],
warehouseList:[],
currencyList: [],
warehouseList: [],
countryList: [],
// 导出中状态
exporting: false
exporting: false,
};
},
activated(){
activated() {
// 如果有必须的条件则查询
if(this.queryParams.startWarehouseIdList.length && this.queryParams.dstCountryId){
if (
this.queryParams.startWarehouseIdList.length &&
this.queryParams.dstCountryId
) {
this.getList();
}
},
created() {
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
getCurrencyPage(this.params).then(
(res) => (this.currencyList = res.data.list)
);
// getTradeCityList().then((res) => (this.tradeCityList = res.data));
// 默认不查询,必须选择目的国以后才可以查询 this.getList();
getWarehouseList().then(res => this.warehouseList = res.data)
getListTree({treeType: 1}).then(r => {
this.countryList = r.data
})
getWarehouseList().then((res) => (this.warehouseList = res.data));
getListTree({ treeType: 1 }).then((r) => {
this.countryList = r.data;
});
},
watch:{
watch: {
// 目的国变更后要重置目的仓
'queryParams.destCountryId': function(){
this.$set(this.queryParams, 'destWarehouseId', '')
}
"queryParams.destCountryId": function () {
this.$set(this.queryParams, "destWarehouseId", "");
},
},
computed: {
permissions(){
return store.getters.permissions
permissions() {
return store.getters.permissions;
},
/*exportCityList() {
return this.tradeCityList.filter((item) => item.type === 2);
......@@ -237,128 +374,144 @@ export default {
importCityList() {
return this.tradeCityList.filter((item) => item.type === 1);
},*/
exportWarehouseList(){
exportWarehouseList() {
/* 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() {
// 目的仓根据选择的目的国过滤
if(!this.queryParams.destCountryId) return []
return this.warehouseList.filter(item => {
return this.queryParams.destCountryId === item.guojia && ( +item.tradeType === 1 || +item.tradeType === 3)
})
if (!this.queryParams.destCountryId) return [];
return this.warehouseList.filter((item) => {
return (
this.queryParams.destCountryId === item.guojia &&
(+item.tradeType === 1 || +item.tradeType === 3)
);
});
},
// 目的国名称
dstCountryName(){
if(!this.queryParams.destCountryId) return null
const country = this.countryList.find(item => item.id == this.queryParams.destCountryId)
if(!country) return null
return this.$l(country, 'title')
dstCountryName() {
if (!this.queryParams.destCountryId) return null;
const country = this.countryList.find(
(item) => item.id == this.queryParams.destCountryId
);
if (!country) return null;
return this.$l(country, "title");
},
// 获取列的货币名称 columnName 取值为Other, Freight, Clearance
ColumnCurrencyName(){
ColumnCurrencyName() {
return (columnName, wrapper = true) => {
if(!this.list.length) return ''
let field = `total${columnName}FeeCurrency`
return wrapper ? `(${this.list[0]['summaryInfo'][field]})` : this.list[0]['summaryInfo'][field]
}
}
if (!this.list.length) return "";
let field = `total${columnName}FeeCurrency`;
return wrapper
? `(${this.list[0]["summaryInfo"][field]})`
: this.list[0]["summaryInfo"][field];
};
},
},
methods: {
getCurrencyLabel(id){
const item = this.currencyList.find(item => item.id === id);
if(!item)return ''
return this.$l(item, 'title')
getCurrencyLabel(id) {
const item = this.currencyList.find((item) => item.id === id);
if (!item) return "";
return this.$l(item, "title");
},
/** 查询列表 */
getList() {
this.loading = true;
let params = {
...this.queryParams,
startWarehouseIdList: this.queryParams.startWarehouseIdList.join(','),
destWarehouseIdList: this.queryParams.destWarehouseIdList.join(',')
}
startWarehouseIdList: this.queryParams.startWarehouseIdList.join(","),
destWarehouseIdList: this.queryParams.destWarehouseIdList.join(","),
};
this.addBeginAndEndTime(params, this.dateFilter, "JsDate", false);
// 执行查询
boxSettlementPage(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
}).finally(() => {
this.loading = false;
})
boxSettlementPage(params)
.then((response) => {
this.list = response.data.list;
this.total = response.data.total;
})
.finally(() => {
this.loading = false;
});
},
getTotal(field){
let total = new Decimal(0)
this.list.forEach(item => {
total = total.plus(item.summaryInfo[field] || 0)
})
return total.toNumber()
getTotal(field) {
let total = new Decimal(0);
this.list.forEach((item) => {
total = total.plus(item.summaryInfo[field] || 0);
});
return total.toNumber();
},
// 返回汇总行数据
getSummary(){
const FreightCurrencyName = this.ColumnCurrencyName('Freight', false)
const ClearanceCurrencyName = this.ColumnCurrencyName('Clearance', false)
const OtherCurrencyName = this.ColumnCurrencyName('Other', false)
getSummary() {
const FreightCurrencyName = this.ColumnCurrencyName("Freight", false);
const ClearanceCurrencyName = this.ColumnCurrencyName("Clearance", false);
const OtherCurrencyName = this.ColumnCurrencyName("Other", false);
const data = [
this.$t('合计'),
'',
this.$t("合计"),
"",
// 应收款
this.getTotal('receivableTotalFee') + 'USD',
this.getTotal("receivableTotalFee") + "USD",
// 应收运费
this.getTotal('totalReceivableFreightFee') + FreightCurrencyName,
this.getTotal("totalReceivableFreightFee") + FreightCurrencyName,
// 应收清关费
this.getTotal('totalReceivableClearanceFee') + ClearanceCurrencyName,
this.getTotal("totalReceivableClearanceFee") + ClearanceCurrencyName,
// 应收其他费用
this.getTotal('totalReceivableOtherFee') + OtherCurrencyName,
this.getTotal("totalReceivableOtherFee") + OtherCurrencyName,
// 目的地实收运费
this.getTotal('totalNetReceiptsCollectFreightFee') + FreightCurrencyName,
this.getTotal("totalNetReceiptsCollectFreightFee") +
FreightCurrencyName,
// 目的地实收清关费
this.getTotal('totalNetReceiptsCollectClearanceFee') + ClearanceCurrencyName,
this.getTotal("totalNetReceiptsCollectClearanceFee") +
ClearanceCurrencyName,
// 目的地实收其他费用
this.getTotal('totalNetReceiptsCollectOtherFee') + OtherCurrencyName,
this.getTotal("totalNetReceiptsCollectOtherFee") + OtherCurrencyName,
// 中国实收运费
this.getTotal('netReceiptsAdvanceFreightFee') + FreightCurrencyName,
this.getTotal("netReceiptsAdvanceFreightFee") + FreightCurrencyName,
// 中国实收清关费
this.getTotal('netReceiptsAdvanceClearanceFee') + ClearanceCurrencyName,
this.getTotal("netReceiptsAdvanceClearanceFee") + ClearanceCurrencyName,
// 中国实收其他费用
this.getTotal('netReceiptsAdvanceOtherFee') + OtherCurrencyName,
this.getTotal("netReceiptsAdvanceOtherFee") + OtherCurrencyName,
// 运费折扣
this.getTotal('discountFreightFee') + FreightCurrencyName,
this.getTotal("discountFreightFee") + FreightCurrencyName,
// 清关费折扣
this.getTotal('discountClearanceFee') + ClearanceCurrencyName,
this.getTotal("discountClearanceFee") + ClearanceCurrencyName,
// 其他费用折扣
this.getTotal('discountOtherFee') + OtherCurrencyName,
]
console.log('sum', {data})
return data
this.getTotal("discountOtherFee") + OtherCurrencyName,
];
console.log("sum", { data });
return data;
},
/** 搜索按钮操作 */
handleQuery() {
this.$refs.queryForm.validate().then(() => {
this.queryParams.page = 1;
this.getList();
})
});
},
handleReset(){
this.$refs['queryForm'].resetFields()
this.dateFilter = []
this.handleQuery()
handleReset() {
this.$refs["queryForm"].resetFields();
this.dateFilter = [];
this.handleQuery();
},
// 导出搜索
handleExport(){
handleExport() {
this.$refs.queryForm.validate().then(() => {
this.exporting = true
let params = {...this.queryParams}
this.exporting = true;
let params = { ...this.queryParams };
this.addBeginAndEndTime(params, this.dateFilter, "JsDate", false);
exportSettlementExcel(params).then(res => {
//this.$download.excel(res, 'shipment-summary.xls');
this.$message.success(this.$t('已加入导出队列,请稍后在下载日志中下载'))
}).finally(() => {
this.exporting = false
})
})
}
exportSettlementExcel(params)
.then((res) => {
//this.$download.excel(res, 'shipment-summary.xls');
this.$message.success(
this.$t("已加入导出队列,请稍后在下载日志中下载")
);
})
.finally(() => {
this.exporting = false;
});
});
},
},
};
</script>
......
......@@ -5,9 +5,10 @@
<el-card>
<div slot="header" class="card-title">{{$route.path.indexOf('create') > -1 ? $t('新建报价单') : $t('编辑报价单')}}</div>
<el-form-item :label="$t('所属人')" prop="relation">
<el-radio-group v-model="form.relation">
<el-radio :label="1">{{$t('发件人')}}</el-radio>
<el-radio :label="2">{{$t('收件人')}}</el-radio>
<!-- <el-radio-group v-model="form.relation" > -->
<el-radio-group v-model="form.relation" id="relation">
<el-radio :label="1" >{{$t('发件人')}}</el-radio>
<el-radio :label="2" >{{$t('收件人')}}</el-radio>
</el-radio-group>
</el-form-item>
<br/>
......@@ -19,41 +20,62 @@
</el-form-item>
<div class="form-section">
<el-form-item :label="$t('发货人')" prop="consignorId" >
<el-form-item :label="$t('发货人')" prop="consignorId">
<div class="contact">
<el-input v-model="form.consignorName" :placeholder="$t('选择或新建')" disabled style="width:120px"/>
<el-input v-model="form.consignorName" id="defaultContactName" :placeholder="$t('选择或新建')" disabled style="width:120px"/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType='consignor'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType='0'" />
</div>
</el-form-item>
<el-form-item :label="$t('发货人电话')" prop="consignorPhone">
<!-- <area-code-selector v-model="form.consignorCountryCode" class="w-200 mr-10" disabled /> -->
<el-input :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/>
<el-input id="defaultContactPhone" :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultContactPhone" class="w-200" disabled/>
<el-input v-else :value="`${form.consignorCountryCode ? '+' + form.consignorCountryCode : ''} ${form.consignorPhone || ''}`" class="w-200" disabled/> -->
</el-form-item>
<el-form-item :label="$t('发货人公司')" prop="consignorCompany">
<el-input v-model="form.consignorCompany" disabled class="w-200"/>
<!-- 修改从客户列表按钮进来的 -->
<el-input v-model="form.consignorCompany" id="company" disabled class="w-200"/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consignorEmail">
<el-input v-model="form.consignorEmail" disabled class="w-200"/>
<el-input v-model="form.consignorEmail" id="defaultEmail" disabled class="w-200"/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==1" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
</div>
<div class="form-section">
<el-form-item :label="$t('收货人')" prop="consigneeId">
<div class="contact">
<el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/>
<!-- <el-input v-model="form.consigneeName" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/> -->
<el-input v-model="form.consigneeName" id="defaultContactName2" :placeholder="$t('请选择或新建')" :disabled="true" style="width:120px"/>
<img src="@/assets/svg/contacts.svg" class="phonebook" @click="contactChooseType='consignee'" />
<img src="@/assets/svg/contact_create.svg" class="phonebook" @click="quickCreateType='1'" />
</div>
</el-form-item>
<el-form-item :label="$t('收货人电话')" prop="consigneePhone">
<!-- <area-code-selector v-model="form.consigneeCountryCode" class="w-200 mr-10" disabled/> -->
<el-input :value="`${form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''} ${form.consigneePhone || ''}`" disabled class="w-200"/>
<el-input id="defaultContactPhone2" :value="`${form.consigneeCountryCode ? '+' + form.consigneeCountryCode : ''} ${form.consigneePhone || ''}`" disabled class="w-200"/>
</el-form-item>
<el-form-item :label="$t('收货人公司')" prop="consigneeCompany">
<el-input v-model="form.consigneeCompany" :disabled="true" class="w-200"/>
<el-input id="company2" v-model="form.consigneeCompany" :disabled="true" class="w-200"/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.company" disabled class="w-200"/>
<el-input v-else v-model="form.consignorCompany" disabled class="w-200"/> -->
</el-form-item>
<el-form-item label="Email" prop="consigneeEmail">
<el-input v-model="form.consigneeEmail" :disabled="true" class="w-200"/>
<el-input id="defaultEmail2" v-model="form.consigneeEmail" :disabled="true" class="w-200"/>
<!-- <el-input v-if="$route.query.type==1 && form.relation==2" v-model="$route.query.customer.defaultEmail" disabled class="w-200"/>
<el-input v-else v-model="form.consigneeEmail" disabled class="w-200"/> -->
</el-form-item>
</div>
......@@ -519,6 +541,7 @@ import ChooseContactDialog from '@/components/ChooseContactDialog'
import QuickCreateCustomer from '@/components/QuickCreateCustomer'
import {getCustomerContactsSelect} from '@/api/ecw/customerContacts'
import Decimal from 'decimal.js'
import getQuote from '@/views/ecw/customer/index.vue'
window.Decimal= Decimal
const createDefaultForm = () => {
return {
......@@ -538,6 +561,13 @@ export default {
data() {
return {
// 遮罩层
form: {
relation: 1, // CustomerLevel 的初始值
},
type: this.$route.query.type,
contacts:null,
contactsList:[],
loading: true,
// productList:[], // 商品信息
productAttrList:[], // 商品属性
......@@ -562,9 +592,82 @@ export default {
contactChooseType: null, // 联系人选择对象consignor(发货人) 或者 consignee(收货人)
quickCreateType: null, // 快速新建客户类型,1发货人,2收货人
getOpenedRouterListHandler: undefined
};
},
computed:{
computedStandard() {
if(this.$route.query.type==1){
// 使用计算属性动态设置 'Standard' 的值
switch (this.form.relation) {
case 1:
if(this.$route.query.customer.defaultContactName !=null){
// document.getElementById("defaultContactName2").value="";
// document.getElementById("defaultContactName").value=this.$route.query.customer.defaultContactName
//this.form.consignorName = this.$route.query.customer.defaultContactName
this.form.consignorName = this.$route.query.customer.defaultContactName
this.form.consigneeName = ""
this.form.consignorId = this.$route.query.customer.defaultContactId
}
if(this.$route.query.customer.company !=null){
// document.getElementById("company").value =this.$route.query.customer.company;
// document.getElementById("company2").value="";
this.form.consignorCompany = this.$route.query.customer.company
this.form.consigneeCompany = ""
}
if(this.$route.query.customer.defaultContactPhone!=null){
this.form.consignorPhone = this.$route.query.customer.defaultContactPhone
this.form.consigneePhone = ""
this.form.consigeeCountryCode =""
// document.getElementById("defaultContactPhone").value =this.$route.query.customer.defaultContactPhone;
// document.getElementById("defaultContactPhone2").value="";
}
if(this.$route.query.customer.defaultEmail!=null){
this.form.consignorEmail = this.$route.query.customer.defaultEmail;
this.form.consigneeEmail = ""
// document.getElementById("defaultEmail2").value="";
// document.getElementById("defaultEmail").value =this.$route.query.customer.defaultEmail;
}
return;
case 2:
if(this.$route.query.customer.defaultContactName !=null){
//document.getElementById("defaultContactName").value="";
// document.getElementById("defaultContactName2").value =this.$route.query.customer.defaultContactName;
this.form.consignorName = ""
this.form.consigneeName = this.$route.query.customer.defaultContactName
this.form.consigneeId = this.$route.query.customer.defaultContactId
}
if(this.$route.query.customer.company !=null){
// document.getElementById("company").value="";
// document.getElementById("company2").value =this.$route.query.customer.company;
this.form.consignorCompany = ""
this.form.consigneeCompany = this.$route.query.customer.company
}
if(this.$route.query.customer.defaultContactPhone!=null){
this.form.consignorPhone = ""
this.form.consignorCountryCode =""
this.form.consigneePhone = this.$route.query.customer.defaultContactPhone
// document.getElementById("defaultContactPhone").value="";
// document.getElementById("defaultContactPhone2").value =this.$route.query.customer.defaultContactPhone;
}
if(this.$route.query.customer.defaultEmail!=null){
this.form.consignorEmail = ""
this.form.consigneeEmail = this.$route.query.customer.defaultEmail;
// document.getElementById("defaultEmail").value="";
// document.getElementById("defaultEmail2").value =this.$route.query.customer.defaultEmail;
}
return ;
default:
return "";
}
}
},
rules(){
let rules = {
marks: [
......@@ -593,8 +696,23 @@ export default {
{ type: 'number', min: 1, message: this.$t("请选择重要程度")}
]
}
if(this.form.relation == 1){
if(this.form.relation == 1 ){
rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
// if(this.$route.query.type ==1){
// if(this.$route.query.customer.defaultContactName==null){
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
// }else{
// // rules.consignorId = [{ required: true, message: ''}]
// }
// }else {
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
// }
// else if(this.$route.query.type !=='1'){
// rules.consignorId = [{ required: true, message: this.$t("发货人不能为空")}]
// }
}
if(this.form.relation == 2){
rules.consigneeId = [{ required: true, message: this.$t("收货人不能为空")}]
......@@ -614,7 +732,7 @@ export default {
getRouterNameById(){
return routerId => {
let router = this.routerList.find(item => item.id == routerId)
console.log({router})
if(router){
return router.startTitleZh + ' > ' + router.destTitleZh
}
......@@ -692,6 +810,7 @@ export default {
feeDtoList(){
return this.fee.feeDtoList || []
},
// 清关费
clearanceFeeList(){
return this.feeDtoList.filter(item => item.feeType == 2)
......@@ -790,6 +909,9 @@ export default {
}
},
watch:{
"form.relation": function(newVal) {
this.form.standard = this.computedStandard;
},
// 始发地
'form.departureId'(){
this.getOpenedRouterList()
......@@ -840,6 +962,7 @@ export default {
'form.transportVO.packageTypeArr'(val){
this.$set(this.form.transportVO, 'packageType', (val || []).join(','))
},
// 选择的路线变化后,需要判断是否开通了对应的服务,如果没开通需要取消对应的服务选择
selectedRouter(val){
if(!val) return
......@@ -854,6 +977,7 @@ export default {
if(this.form.offerId != this.$route.query.id){
this.getOffer()
}
},
async created() {
await this.getChannelList()
......@@ -865,9 +989,14 @@ export default {
if(this.$route.query.id){
this.getOffer()
}else this.addProduct()
}else {
// alert(this.$route.query.customer.defaultContactPhone)
this.addProduct()
}
},
methods: {
async getChannelList(){
let query = {
cityId: this.form.objectiveId,
......@@ -883,6 +1012,10 @@ export default {
this.tradeCityList = (await getTradeCityList(query)).data || []
},
getOffer(){
//加了是否从全部客户列表中报价按钮进来的判断
if(this.$route.query !==1){
getOffer(this.$route.query.id).then(res => {
let formData = res.data
formData.type = formData.type ? formData.type.split(',').filter(item => item != '') : []
......@@ -913,20 +1046,26 @@ export default {
this.$set(this, 'form', formData)
// 接口只返回了发货人和收货人ID,还需要调用接口获取详细信息回显
getCustomerContactsSelect({ids: [res.data.consigneeId, res.data.consignorId].join(',')}).then(({data}) => {
this.contactChooseType = 'consignee'
this.onContactChoose(data.list.find(item => item.customerContactsId == res.data.consigneeId))
this.contactChooseType = 'consignor'
this.onContactChoose(data.list.find(item => item.customerContactsId == res.data.consignorId))
})
})
}
},
onContactChoose(contact){
if(!contact) return
if(!this.contactChooseType && !this.quickCreateType) return
if(!this.contactChooseType && this.quickCreateType){
this.contactChooseType = this.quickCreateType == 0 ? 'consignor' : 'consignee'
}
this.$set(this.form, this.contactChooseType + 'Company', contact.company)
this.$set(this.form, this.contactChooseType + 'Id', contact.customerContactsId)
this.$set(this.form, this.contactChooseType + 'CountryCode', contact.areaCode)
......@@ -938,7 +1077,7 @@ export default {
this.quickCreateType = null
},
onProductChange(row, product){
console.log(product)
// row.goodsType = product ? product.typeId : null
row.prodAttrArr = !product ? [] : product.attrId.split(',').filter(item => item !== '').map(item => +item)
if(product){
......@@ -1041,13 +1180,29 @@ export default {
});
return;
}
let data = Object.assign({}, this.form, {
let data =null ;
if(this.$route.query.type ==1){
console.log(JSON.stringify(this.contactsList))
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
consignorId: this.$route.query.customer.defaultContactId,
status
})
// data.consignorId = contacts.customerContactsId
}else{
data = Object.assign({}, this.form, {
prodCreateReqVOList: this.getProductListWithDefaultValue(),
status
})
}
// 添加的提交
createOffer(data).then(response => {
// 重置表单内容
this.$set(this, 'form', {...createDefaultForm()})
this.routerList = []
this.$nextTick(() => {
......@@ -1062,13 +1217,13 @@ export default {
},
setLink(row){
this.$prompt(this.$t('请输入商品链接'), {inputValue: row.link}).then(({value}) => {
console.log('value', value)
this.$set(row, 'link', value)
})
},
// 计算商品运费
calculationPrice(tag){
console.log('calculationPrice@', tag)
let calcable = true
if(!this.form.prodCreateReqVOList.length) return
this.form.prodCreateReqVOList.forEach(item => {
......
......@@ -31,7 +31,7 @@
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
@keyup.enter.native="handleQuery" clearable />
@keyup.enter.native="handleQuery" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('提单号')" prop="tidanNo">
<el-input v-model="queryParams.tidanNo" :placeholder="$t('提单号')" clearable @keyup.enter.native="handleQuery" />
......@@ -58,7 +58,7 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('订单类型')" prop="number">
<el-select v-model="queryParams.type" :placeholder="$t('请选择')" clearable >
<el-select v-model="queryParams.type" :placeholder="$t('请选择')" clearable @change="handleQuery" >
<el-option :label="$t('普通订单')" :value="0"></el-option>
<el-option :label="$t('集运服务')" :value="1"></el-option>
<el-option :label="$t('海外仓')" :value="2"></el-option>
......
<template>
<el-dialog :visible.sync="dialogVisible" width="80%" :before-close="()=>{
$emit('update:dialogVisible',false)
}">
<el-dialog
:visible.sync="dialogVisible"
width="80%"
:before-close="
() => {
$emit('update:dialogVisible', false);
}
"
>
<div class="fee-application">
<h1>{{$t('费用申请')}}-{{orderDetails.orderNo}}
</h1>
<h1>{{ $t("费用申请") }}-{{ orderDetails.orderNo }}</h1>
<el-divider></el-divider>
<el-form label-width="100px" inline>
<el-form-item :label="$t('订单号')+':'"><div class="content">
{{orderDetails.orderNo}}
</div></el-form-item>
<el-form-item :label="$t('发货人')+':'"><div class="content">{{orderDetails.consignorVO ? orderDetails.consignorVO.name :''}}</div></el-form-item>
<el-form-item :label="$t('唛头')"><div class="content">{{orderDetails.marks}}</div></el-form-item>
<el-form-item> <el-button :disabled="!!processInstanceId || editMode" @click="addCost">{{$t('添加申请')}}</el-button></el-form-item>
<el-form-item :label="$t('订单号') + ':'"
><div class="content">
{{ orderDetails.orderNo }}
</div></el-form-item
>
<el-form-item :label="$t('发货人') + ':'"
><div class="content">
{{ orderDetails.consignorVO ? orderDetails.consignorVO.name : "" }}
</div></el-form-item
>
<el-form-item :label="$t('唛头')"
><div class="content">{{ orderDetails.marks }}</div></el-form-item
>
<el-form-item>
<el-button
:disabled="!!processInstanceId || editMode"
@click="addCost"
>{{ $t("添加申请") }}</el-button
></el-form-item
>
</el-form>
<el-table :data="list">
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('费用类型')">
<template v-slot:default = "scope">
<dict-selector :disabled="!scope.row.editMode && !!scope.row.status" :type="DICT_TYPE.FEE_TYPE" v-model="scope.row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('金额')">
<template v-slot:default = 'scope'>
<el-input :disabled="!scope.row.editMode && !!scope.row.status" v-model.number="scope.row.applicationFee" ></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货币类型')">
<template v-slot:default = 'scope'>
<el-select :disabled="!scope.row.editMode && !!scope.row.status" v-model="scope.row.applicationFeeCurrency">
<el-option v-for="item in JSON.parse(currencys)" :key="item.id" :label="isChinese ? item.titleZh : item.titleEn" :value="item.id" />
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('付款类型')">
<template v-slot = {row}>
<dict-selector :disabled="!row.editMode && !!row.status" :type="DICT_TYPE.PAYMENT_TYPE" v-model="row.payType" />
</template>
</el-table-column>
<el-table-column :label="$t('备注')">
<template v-slot:default="scope">
<el-input :disabled="!scope.row.editMode && !!scope.row.status" v-model="scope.row.remarks" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('确认收款')">
<template v-slot:default ="scope">
<dict-tag :type="DICT_TYPE.ECW_RECEIVABLE_STATE" :value="scope.row.receiveFlag" />
</template>
</el-table-column>
<el-table-column :label="$t('申请人')">
<template v-slot:default ="scope">
{{scope.row.status === 0 ? $t('未提交'): scope.row.applicationAuthor}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot:default = 'scope'>
<el-tag v-if="scope.row.status !== 0 && !scope.row.editMode">{{STATUS[scope.row.status]}}</el-tag>
<!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button-->
<el-button type="text" v-if="modifable(scope.$index)" @click="modify(scope.row)">{{$t('修改')}}</el-button>
<el-button type="text" v-if="scope.row.status === 0" @click="del(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('序号')" type="index"></el-table-column>
<el-table-column :label="$t('费用类型')">
<template v-slot:default="scope">
<dict-selector
:disabled="!scope.row.editMode && !!scope.row.status"
:type="DICT_TYPE.FEE_TYPE"
v-model="scope.row.feeType"
/>
</template>
</el-table-column>
<el-table-column :label="$t('金额')">
<template v-slot:default="scope">
<el-input
:disabled="!scope.row.editMode && !!scope.row.status"
v-model.number="scope.row.applicationFee"
></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货币类型')">
<template v-slot:default="scope">
<el-select
:disabled="!scope.row.editMode && !!scope.row.status"
v-model="scope.row.applicationFeeCurrency"
>
<el-option
v-for="item in JSON.parse(currencys)"
:key="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
:value="item.id"
/>
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('付款类型')">
<template v-slot="{ row }">
<dict-selector
:disabled="!row.editMode && !!row.status"
:type="DICT_TYPE.PAYMENT_TYPE"
v-model="row.payType"
/>
</template>
</el-table-column>
<el-table-column :label="$t('备注')">
<template v-slot:default="scope">
<el-input
:disabled="!scope.row.editMode && !!scope.row.status"
v-model="scope.row.remarks"
type="textarea"
></el-input>
</template>
</el-table-column>
<el-table-column :label="$t('确认收款')">
<template v-slot:default="scope">
<dict-tag
:type="DICT_TYPE.ECW_RECEIVABLE_STATE"
:value="scope.row.receiveFlag"
/>
</template>
</el-table-column>
<el-table-column :label="$t('申请人')">
<template v-slot:default="scope">
{{
scope.row.status === 0
? $t("未提交")
: scope.row.applicationAuthor
}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot:default="scope">
<el-tag v-if="scope.row.status !== 0 && !scope.row.editMode">{{
STATUS[scope.row.status]
}}</el-tag>
<!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button-->
<el-button
type="text"
v-if="modifable(scope.$index)"
@click="modify(scope.row)"
>{{ $t("修改") }}</el-button
>
<el-button
type="text"
v-if="scope.row.status === 0"
@click="del(scope.$index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div style="padding: 20px">
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
</div>
<div style="text-align: center;margin-top: 20px;">
<el-button type="primary" v-if="!processInstanceId" style="margin-right: 30px;" :disabled="!feeList.length && !editMode" @click="submit">{{$t('提交')}}</el-button>
<el-button type="primary" v-if="processInstanceId" style="margin-right: 30px;" @click="goProcessDetail">{{$t('审核中')}}</el-button>
<el-button type="primary" v-if="processInstanceId" style="margin-right: 30px;" @click="cancel">{{$t('取消审核')}}</el-button>
<el-button @click="$emit('update:dialogVisible',false)">{{$t('返回')}}</el-button>
<div style="text-align: center; margin-top: 20px">
<el-button
type="primary"
v-if="!processInstanceId"
style="margin-right: 30px"
:disabled="!feeList.length && !editMode"
@click="submit"
>{{ $t("提交") }}</el-button
>
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="goProcessDetail"
>{{ $t("审核中") }}</el-button
>
<el-button
type="primary"
v-if="processInstanceId"
style="margin-right: 30px"
@click="cancel"
>{{ $t("取消审核") }}</el-button
>
<el-button @click="$emit('update:dialogVisible', false)">{{
$t("返回")
}}</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
......@@ -86,35 +167,61 @@ import {
feeApplicationCancel,
getFeeApplicationApproveByOrderId,
getBatchFeeByProcessId,
qetBatchFeeByBusinessId, getBatchFeeByBusinessId
qetBatchFeeByBusinessId,
getBatchFeeByBusinessId,
} from "@/api/ecw/order";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import workFlow from "@/components/WorkFlow";
export default {
name: "feeApplication",
components: {workFlow},
props:{
orderId:[Number, String],
dialogVisible:{
type:Boolean,
default:false,
components: { workFlow },
props: {
orderId: [Number, String],
dialogVisible: {
type: Boolean,
default: false,
},
currencys:String
currencys: String,
},
data(){
data() {
return {
orderDetails:{},
orderDetails: {},
// 费用列表
list:[],
list: [],
// 审核ID,没有则表示不在审核中
processInstanceId: null,
DICT_TYPE,
getDictDatas,
STATUS:{},
selectedUsers:[]
}
STATUS: {},
selectedUsers: [],
};
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
feeList() {
return this.list.filter((item) => item.status === 0);
},
// 正在编辑的费用申请
currentItem() {
return this.list.find((item) => item.editMode);
},
// 是否修改模式
editMode() {
return !!this.currentItem;
},
modifable() {
return (index) => {
// 审核中不允许修改
if (this.processInstanceId) return false;
// 有未提交的不允许修改
if (this.feeList.length) return false;
// 有修改中的不允许修改
if (this.list.findIndex((item) => item.editMode) > -1) return false;
return true;
};
computed:{
isChinese() {
return this.$i18n.locale === "zh_CN";
......@@ -142,125 +249,141 @@ export default {
}
}
},
},
created() {
this.getDictDatas(this.DICT_TYPE.AUDIT_STATUS).forEach( e =>{
this.STATUS[e.value] = e.label
})
this.getDictDatas(this.DICT_TYPE.AUDIT_STATUS).forEach((e) => {
this.STATUS[e.value] = e.label;
});
getOrder(this.orderId).then(res => {
this.orderDetails = res.data
})
getOrder(this.orderId).then((res) => {
this.orderDetails = res.data;
});
// 查询历史申请
feeApplicationListByOrderId({orderId: this.orderId}).then(res => {
this.list = res.data
})
// 查询历史申请
feeApplicationListByOrderId({ orderId: this.orderId }).then((res) => {
this.list = res.data;
});
// 查询是否有审核中的费用申请
getFeeApplicationApproveByOrderId(this.orderId).then(res => {
if(res.data.formId){
this.processInstanceId = res.data.formId
getFeeApplicationApproveByOrderId(this.orderId).then((res) => {
if (res.data.formId) {
this.processInstanceId = res.data.formId;
/*getBatchFeeByBusinessId(res.data.orderApprovalId).then(res => {
this.list = res.data
})*/
}
})
});
},
methods:{
del(index){
methods: {
del(index) {
this.$confirm(this.$t("确定要删除此条费用申请么?")).then(() => {
this.list.splice(index, 1)
})
this.list.splice(index, 1);
});
},
// 修改
modify(item){
this.$set(item, 'editMode', true)
modify(item) {
this.$set(item, "editMode", true);
},
addCost(){
this.list.push({
orderId:this.orderId,
feeType:undefined,//费用申请类型
applicationFee:undefined,//金额
applicationFeeCurrency:undefined,// 费用申请货币类型
remarks:undefined,
receiveFlag:0,
applicationAuthor:undefined,
status:0,
})
addCost() {
this.list.push({
orderId: this.orderId,
feeType: undefined, //费用申请类型
applicationFee: undefined, //金额
applicationFeeCurrency: undefined, // 费用申请货币类型
remarks: undefined,
receiveFlag: 0,
applicationAuthor: undefined,
status: 0,
});
},
submit(){
// 判断费用申请是否有未填项
const errList = this.feeList.filter(item => {
return !item['feeType'] || !item['applicationFee'] || !item['applicationFeeCurrency'] || !item['payType']
})
if(errList.length){
return this.$message.error('请填写完整费用申请信息')
}
if(this.editMode){
// 要提交status=1,否则保持原状态
const data = {...this.currentItem,status:1, copyUserId:this.selectedUsers}
return applicationUpdate(data).then(r => {
this.$message.success(this.$t('修改成功'));
this.$emit('update:dialogVisible',false)
})
}
submit() {
// 判断费用申请是否有未填项
const errList = this.feeList.filter((item) => {
return (
!item["feeType"] ||
!item["applicationFee"] ||
!item["applicationFeeCurrency"] ||
!item["payType"]
);
});
if (errList.length) {
return this.$message.error("请填写完整费用申请信息");
}
if (this.editMode) {
// 要提交status=1,否则保持原状态
const data = {
...this.currentItem,
status: 1,
copyUserId: this.selectedUsers,
};
return applicationUpdate(data).then((r) => {
this.$message.success(this.$t("修改成功"));
this.$emit("update:dialogVisible", false);
});
}
feeApplicationCreateBatch( {
orderFeeApplicationCreateReqVOList: this.feeList,
copyUserId:this.selectedUsers,
orderId: this.orderId
}).then(r=>{
if(r.code === 0){
this.$emit('update:dialogVisible',false)
this.$message.success(this.$t('添加成功'));
this.selectedUsers = [];
}
})
feeApplicationCreateBatch({
orderFeeApplicationCreateReqVOList: this.feeList,
copyUserId: this.selectedUsers,
orderId: this.orderId,
}).then((r) => {
if (r.code === 0) {
this.$emit("update:dialogVisible", false);
this.$message.success(this.$t("添加成功"));
this.selectedUsers = [];
}
});
},
goProcessDetail(){
this.$emit('update:dialogVisible',false)
this.$router.push('/bpm/process-instance/detail?id=' + this.processInstanceId)
goProcessDetail() {
this.$emit("update:dialogVisible", false);
this.$router.push(
"/bpm/process-instance/detail?id=" + this.processInstanceId
);
},
cancel(){
this.$prompt(this.$t('请输入取消原因'), this.$t('提示'), {
confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t('取消'),
}).then(({ value }) => {
let item = this.list.find(e => e.status === 1);
feeApplicationCancel({huifu:value,bpmProcessId: this.processInstanceId}).then(r => {
this.$message({
type: 'success',
message:this.$t('取消成功')
cancel() {
this.$prompt(this.$t("请输入取消原因"), this.$t("提示"), {
confirmButtonText: this.$t("确定"),
cancelButtonText: this.$t("取消"),
})
.then(({ value }) => {
let item = this.list.find((e) => e.status === 1);
feeApplicationCancel({
huifu: value,
bpmProcessId: this.processInstanceId,
}).then((r) => {
this.$message({
type: "success",
message: this.$t("取消成功"),
});
this.$emit("update:dialogVisible", false);
});
this.$emit('update:dialogVisible',false)
})
}).catch(() => {
});
}
.catch(() => {});
},
},
watch:{
dialogVisible(val){
if(val){
this.getOrderList()
getOrder(this.orderId).then(r =>{
if(r.code === 0){
this.orderDetails = r.data
}
})
}
watch: {
dialogVisible(val) {
if (val) {
this.getOrderList();
getOrder(this.orderId).then((r) => {
if (r.code === 0) {
this.orderDetails = r.data;
}
});
}
},
}
}
},
};
</script>
<style scoped lang="scss">
.fee-application {
padding: 0 20px;
h1{
h1 {
font-weight: 600;
font-size: 20px;
}
.content{
.content {
width: 200px;
}
}
......
......@@ -4,7 +4,7 @@
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item :label="$t('编号')" prop="orderNo">
<el-input v-model="noParam.value" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery">
<el-input v-model.trim="noParam.value" :placeholder="$t('请输入订单号、唛头、提单号')" clearable @keyup.enter.native="handleQuery" >
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_NO_FIELD" defaultable v-model="noParam.key" class="w-50" />
</template>
......@@ -15,10 +15,10 @@
</el-form-item> -->
<el-form-item :label="$t('发货人')" prop="consignorKey">
<el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.consignorKey" :placeholder="$t('发货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey">
<el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.consigneeKey" :placeholder="$t('收货人')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<el-form-item label="">
<dict-selector :type="DICT_TYPE.ECW_BEGINTIME_TYPE_ENDTIME" :filter="(item) => item.value != 'PickTime'" v-model="dateFilterType" defaultable style="width: 150px; margin-right: 5px" />
......@@ -30,19 +30,45 @@
>
</el-date-picker>
</el-form-item>
<div>
<el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
<el-select v-model="queryParams.startWarehouseId" multiple :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的仓')" clearable @change="handleQuery">
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId" v-if="!transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery"/>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select v-model="destCountryId" multiple :label="destCountryId" :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option
v-for="item in AddressProvince" :key="item.guojia" :label="item.guojiaName" :value="item.guojia"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="objectiveId" multiple :placeholder="$t('请根据目的国选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option
v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="destWarehouseId" multiple :placeholder="$t('请根据目的城市选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option
v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<el-form-item :label="$t('运输方式')" prop="transportId" v-if="!transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery"/>
</el-form-item>
<!-- <el-form-item :label="$t('商品分类')" prop="goodsType">
......@@ -58,7 +84,7 @@
</el-form-item> -->
<el-form-item :label="$t('商品')" prop="tidanNo">
<el-input v-model="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery">
<el-input v-model.trim="prodParam.value" :placeholder="$t('请输入商品类型、品名或品牌')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
<template slot="prepend">
<dict-selector :type="DICT_TYPE.ORDER_QUERY_PROD_FIELD" defaultable v-model="prodParam.key" class="w-50" />
</template>
......@@ -66,21 +92,21 @@
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl">
<dict-selector v-model="queryParams.isCargoControl" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable />
<dict-selector v-model="queryParams.isCargoControl" :type="DICT_TYPE.INFRA_BOOLEAN_STRING" fomatter="bool" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('入仓类型')" prop="warehouseType">
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" clearable/>
<dict-selector :type="DICT_TYPE.ECW_WAREHOUSING_TYPE" v-model="queryParams.warehouseType" multiple clearable @change="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('客户经理')" >
<user-selector manage v-model="queryParams.salesmanId" clearable @change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理')}"/>
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
@keyup.enter.native="handleQuery" :filter="statusDictFilter" clearable />
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status"
@keyup.enter.native="handleQuery" :filter="statusDictFilter" clearable @change="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('报关方式')" prop="customsType">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="queryParams.customsType" clearable @change="handleQuery" />
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" multiple v-model="queryParams.customsType" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('是否齐货')" >
<!--// 字段存疑-->
......@@ -94,28 +120,28 @@
@keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item :label="$t('备案属性')" prop="productRecord">
<dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" v-model="queryParams.productRecord" clearable @change="handleQuery" />
<dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" multiple v-model="queryParams.productRecord" clearable @change="handleQuery" />
</el-form-item>
<el-form-item :label="$t('快递单号')" prop="number">
<el-input v-model="queryParams.number" :placeholder="$t('快递单号')" clearable @keyup.enter.native="handleQuery" />
<el-input v-model="queryParams.number" :placeholder="$t('快递单号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<el-form-item :label="$t('外部仓')" prop="number">
<el-select v-model="queryParams.isExternalWarehouse" :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-select v-model="queryParams.isExternalWarehouse" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('外部仓')" :value="1"></el-option>
<el-option :label="$t('自有仓')" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('异常状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_ABNORMAL_STATE" v-model="queryParams.abnormalState"
@keyup.enter.native="handleQuery" clearable />
<dict-selector :type="DICT_TYPE.ORDER_ABNORMAL_STATE" multiple v-model="queryParams.abnormalState"
@keyup.enter.native="handleQuery" clearable @change="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('审核状态')" prop="status">
<dict-selector :type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE" v-model="queryParams.auditType"
@keyup.enter.native="handleQuery" clearable />
<dict-selector :type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE" multiple v-model="queryParams.auditType"
@keyup.enter.native="handleQuery" clearable @change="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('订单类型')" prop="number">
<el-select v-model="queryParams.type" :placeholder="$t('请选择')" clearable >
<el-select v-model="queryParams.type" multiple :placeholder="$t('请选择')" clearable @change="handleQuery">
<el-option :label="$t('普通订单')" :value="0"></el-option>
<el-option :label="$t('集运服务')" :value="1"></el-option>
<el-option :label="$t('海外仓')" :value="2"></el-option>
......@@ -568,7 +594,9 @@ import {
exportShippingDatas,
exportShipFee,
exportUnload, splitCancelApply, orderSplitRevoke, setCanShipment, setCanNotShipment
,getParentOrder
,getParentOrder,
getRegionList
} from "@/api/ecw/order";
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
import PrintTag from './components/PrintTag'
......@@ -605,8 +633,24 @@ export default {
},
data() {
return {
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: [],
countryId:'',
//destCountryId:'',
objectiveId: [],
destWarehouseId: '',
// 选中数组
ids: [],
//目的国
countryList:[],
//目的城市
cityList:[],
//目的仓
destWarehouseList:[],
// 非单个禁用
single: true,
// 非多个禁用
......@@ -632,7 +676,7 @@ export default {
packageTypeArr: []
},
warehouseList:[],
// tradeCityList: [],
//tradeCityList: [],
productAttrList: [], // 商品属性
molecule: '', //重货比分子
denominator: '', //重货比分母
......@@ -655,10 +699,12 @@ export default {
multipleSelection:[],
transportId: null, // 指定运输方式
transportList:[],
orderNo:'',
params: {
page: 1,
rows: 20,
},
currencyList:[],
statistics: null ,// 统计数据
......@@ -681,7 +727,161 @@ export default {
watch:{
isChinese(){
this.getList()
}
},
// provinceCode destCountryId
destCountryId: { //监听当前地区值的变化,于与上方地区值进行了双向绑定
deep:true, //深度监听
handler () {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.findByprovinceCode();
if(this.destCountryId=="" ){
getRegionList(4, 4).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}else if(this.destCountryId!="" && this.objectiveId=="" && this.destWarehouseId==""){
getRegionList(2, this.destCountryId).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}
//重新加载目的城市
//目的城市
// getRegionList(4, 4).then(({data}) => {
// this.AddressCity = data;
// })
// .catch(error => {
// console.log(error);
// });
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
}
},
objectiveId: {
deep:true, //深度监听
handler () {
this.AddressTown = [] ;
this.destWarehouseId="";
this.findBycityCode();
if(this.objectiveId!="" && this.destCountryId!="" && this.destWarehouseId==""){
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}else if(this.destCountryId=="" && this.objectiveId=="" && this.destWarehouseId==""){
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
}).catch(error => {
console.log(error);
});
}else if(this.destCountryId!="" && this.objectiveId=="" && this.destWarehouseId==""){
getRegionList(2, this.destCountryId).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}
// else if(this.objectiveId!="" && this.objectiveId=="" ){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// }).catch(error => {
// console.log(error);
// });
// }
}
},
destWarehouseId:{
deep:true, //深度监听
handler () {
if(this.objectiveId!="" && this.destCountryId!="" && this.destWarehouseId==""){
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}else if( this.destCountryId!="" && this.objectiveId=="" && this.destWarehouseId=="" ){
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
}
// else if(this.objectiveId=="" && this.destWarehouseId==""){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
// }
}
},
},
computed: {
// 导出的权限字符串
......@@ -703,8 +903,18 @@ export default {
/* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
// importWarehouseList(){
// return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
// },
importCountryList(){
return this.countryList.filter(item => item.id !== null)
},
importCityList(){
return this.cityList.filter(item => item.id !== null)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
return this.destWarehouseList.filter(item => item.id !== null)
},
/* exportCityList() {
return this.tradeCityList.filter(item => item.type == 2)
......@@ -718,6 +928,7 @@ export default {
timeParams['begin' + this.dateFilterType] = this.dateFilter[0]
timeParams['end' + this.dateFilterType] = this.dateFilter[1]
}
let queryParams = Object.assign({}, this.queryParams, timeParams)
if(this.transportId){
queryParams.transportId = this.transportId
......@@ -728,6 +939,23 @@ export default {
if(this.prodParam.value){
queryParams[this.prodParam.key] = this.prodParam.value
}
//目的国
if(this.destCountryId !=null && this.destCountryId !=''){
queryParams.destCountryId = this.destCountryId
}
if(this.objectiveId !=null && this.objectiveId !=''){
//目的城市
queryParams.objectiveId = this.objectiveId
}
if(this.destWarehouseId !=null && this.destWarehouseId !=''){
//目的仓
queryParams.destWarehouseId = this.destWarehouseId
}
return queryParams
},
/*batchWarehouseAdjustment(){
......@@ -748,21 +976,97 @@ export default {
this.getList()
},
created() {
this.init();//
this.getTransportFromRoute()
this.getList();
getProductAttrList().then(res => this.productAttrList = res.data)
// getTradeCityList().then(res => this.tradeCityList = res.data)
getWarehouseList().then(res => this.warehouseList = res.data)
//getTradeCityList().then(res => this.tradeCityList = res.data)
getWarehouseList().then(res =>{
this.tradeCityList = res.data
this.warehouseList = res.data
})
getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
// 如果是空运(专线空运和海空联运)则获取渠道
if(this.transportId == 3 || this.transportId == 4){
getChannelList().then(res => this.channelList = res.data)
}
},
methods: {
init () {
//加载时发起请求获取所有省份值
getRegionList(1,1).then(({data}) => {
this.AddressProvince = data;
console.log(this.AddressProvince)
})
.catch(error => {
console.log(error);
});
//目的城市
getRegionList(4, 4).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
//目的仓
getRegionList(5, 5).then(({data}) => {
this.AddressTown = data;
})
.catch(error => {
console.log(error);
});
},
findByprovinceCode () {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
},
findBycityCode () {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId).then(({data}) => {
this.AddressTown = data;
// 去重
// let uniqueDataList = data.filter((item, index, self) => {
// // 返回第一个匹配项的索引,用于判断当前项是否为第一个匹配项
// const firstIndex = self.findIndex((obj) => obj.guojia === item.guojia);
// // 如果当前项是第一个匹配项,则保留,否则过滤掉
// return index === firstIndex;
// });
// this.AddressProvince = uniqueDataList
})
.catch(error => {
console.log(error);
});
},
getDictDatas,
// 取消拆单申请
splitRevoke(row){
this.splitRevokeOrderId = row.orderId
......@@ -824,7 +1128,7 @@ export default {
exportExcel(func, params, fileName = null){
this.exportLoading = true;
func(params).then(res => {
console.log({res})
if(!fileName){
fileName = this.$t('订单')
}
......@@ -871,12 +1175,13 @@ export default {
/** 查询列表 */
getList() {
this.loading = true;
console.log('this.combinedQueryParams', this.combinedQueryParams)
const query = {...this.combinedQueryParams}
if(query.packageTypeArr && query.packageTypeArr.length){
query.packageType = query.packageTypeArr.join(',')
}
let func = getOrderPage
if(this.mine){
func = getMyOrderPage
/* return getMyOrderPage(this.combinedQueryParams).then(response => {
......@@ -899,6 +1204,7 @@ export default {
});
this.getStatistics()
},
// 获得统计数据
getStatistics(){
......@@ -1005,7 +1311,7 @@ export default {
},
// 过滤订单状态筛选字典内容
statusDictFilter(item){
console.log('statusDictFilter', item)
if(this.transportId == 3 && item.cssClass && item.cssClass != 'air'){
return false
}
......@@ -1033,6 +1339,8 @@ export default {
}
}
};
</script>
<style lang="scss" scoped>
::v-deep .actions{
......
<template>
<div class="app-container">
<div align="center" style="font-size: 20px;">商品名称:{{this.$route.query.titleZh}}</div>
<div class="page-title">复制价格</div>
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('商品名称')" prop="titleZh" v-if="!$route.query.product_id">
<el-input v-model="queryParams.titleZh" :placeholder="$t('请输入中英文名称、商品编码、海关编码')" clearable @keyup.enter.native="handleQuery">
<template #prepend>
<el-select v-model="queryParams.searchType" style="width: 100px">
<el-option :value="1" :label="$t('包含')"></el-option>
<el-option :value="2" :label="$t('不包含')"></el-option>
<el-option :value="3" :label="$t('等于')"></el-option>
</el-select>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类型')" prop="typeId" v-if="!$route.query.product_id">
<el-select v-model="queryParams.typeId" :placeholder="$t('选择商品类型')" clearable>
<el-option v-for="type in typeList" :key="type.id" :label="$l(type, 'titleZh')" :value="type.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品属性')" prop="typeId" v-if="!$route.query.product_id">
<el-select v-model="queryParams.attrId" :placeholder="$t('选择商品类型')" clearable>
<el-option v-for="attr in attrList" :key="attr.id" :label="$l(attr, 'attrName')" :value="attr.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportType" v-if="!transportType">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="queryParams.transportType" formatter="number" clearable />
</el-form-item>
<!--海运不显示渠道-->
<el-form-item :label="$t('出货渠道')" prop="shippingChannelId" v-if="type !== 'sea'">
<el-select v-model="queryParams.shippingChannelId" clearable>
<el-option v-for="item in channelList" :key="item.id" :label="$l(item, 'name')" :value="item.channelId" />
</el-select>
</el-form-item>
<el-form-item :label="$t('始发地')" prop="startCityId">
<el-select v-model="queryParams.startCityId" clearable>
<el-option v-for="city in startCityList" :key="city.id" :label="$l(city, 'title')" :value="city.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('目的地')" prop="destCityId">
<el-select v-model="queryParams.destCityId" clearable>
<el-option v-for="city in destCityList" :key="city.id" :label="$l(city, 'title')" :value="city.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('是否预付')" prop="needPay">
<el-select v-model="queryParams.needPay" :placeholder="$t('请选择')" clearable>
<el-option :label="$t('是')" value="1"></el-option>
<el-option :label="$t('否')" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('上架状态')" prop="auditStatus">
<dict-selector :type="DICT_TYPE.ECW_PRICE_AUDIT_STATUS" v-model="queryParams.auditStatus" clearable/>
</el-form-item>
<el-form-item :label="$t('状态')" prop="combStatus">
<el-select v-model="queryParams.combStatus" :placeholder="$t('请选择状态')" clearable>
<el-option :label="$t('未设置价格')" value="setPrice_1"></el-option>
<el-option :label="$t('未过期')" value="setPrice_2"></el-option>
<el-option :label="$t('黑名单')" value="blacklist_1"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('是否单询')" prop="needOrderInquiry">
<el-select v-model="queryParams.needOrderInquiry" :placeholder="$t('请选择')" clearable>
<el-option :label="$t('是')" value="1"></el-option>
<el-option :label="$t('否')" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('单价模式')" prop="priceType">
<el-select v-model="queryParams.priceType" :placeholder="$t('请选择')" clearable>
<el-option :label="$t('运费+清关费')" value="0"></el-option>
<el-option :label="$t('全包价')" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<!--全部路线吗没有新增入口,指定商品的路线价格才有添加路线-->
<el-col :span="1.5" v-if="$route.query.product_id">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd('air')" v-hasPermi="['ecw:product-price:create']">{{$t('新建空运价格')}}</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd('sea')" v-hasPermi="['ecw:product-price:create']">{{$t('新建海运价格')}}</el-button>
</el-col>
<el-col :span="1.5">
<!--未指定商品-->
<template>
<!--<el-button type="primary" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit">{{$t('批量设置价格')}}</el-button>-->
<!-- <el-button type="primary" v-hasPermi="['ecw:product-price:bartch_black']" size="mini" @click="batchBlock" :disabled="multiple">{{$t('批量加入黑名单')}}</el-button>
<el-button type="primary" v-hasPermi="['ecw:product-price:batch_down']" size="mini" @click="batchOff" :disabled="multiple">{{$t('批量下架')}}</el-button>
<el-button type="warning" v-hasPermi="['ecw:product-price:export']" size="mini" @click="handleExport" :loading="exportLoading" >{{$t('导出')}}</el-button>
<el-button type="primary" v-if="type != 'air'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="handleBatchEdit('sea')">{{$t('批量设置海运价格')}}</el-button> -->
<el-button type="primary" v-if="type != 'sea'" v-hasPermi="['ecw:product-price:batch_update']" size="mini" @click="copyPrice">{{$t('批量复制价格')}}</el-button>
</template>
<!--指定商品-->
<!-- <template v-else>
<el-button type="primary" size="mini" v-hasPermi="['ecw:product-price:single_product']" @click="batchSetSingleProductPrice('sea')">{{$t('批量设置商品海运路线')}}</el-button>
<el-button type="primary" size="mini" v-hasPermi="['ecw:product-price:single_product']" @click="batchSetSingleProductPrice('air')">{{$t('批量设置商品空运路线')}}</el-button>
</template> -->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<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 :label="$t('序号')" prop="id" width="50" />
<el-table-column :label="$t('商品编码')" align="center" prop="productCode" >
<template slot-scope="{row}">
<el-link type="primary" @click.native="handleUpdate(row)">
{{ row.productDO ? row.productDO.productCode : $t('无productDO字段') }}
</el-link>
</template>
</el-table-column>
<el-table-column :label="$t('海关编码')" align="center" prop="customsCode">
<template slot-scope="{row}">
<div>
{{ row.productDO ? row.productDO.customsCode : $t('无productDO字段') }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('商品类型')" align="center" prop="typeId">
<template slot-scope="{row}">
<span>{{ row.productDO ? getTypeName(row.productDO.typeId) : $t('无productDO字段') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('商品名称')" align="center" prop="productName">
<template slot-scope="{row}">
<el-link type="primary" @click.native="handleUpdate(row)">
{{ row.productDO ? row.productDO.titleZh + '/' + row.productDO.titleEn : $t('无productDO字段') }}
</el-link>
</template>
</el-table-column>
<el-table-column prop="tansportType" :label="$t('运输方式')" align="center" width="100">
<template slot-scope="scope">
<div>
{{ transportName(scope.row.warehouseLineDO.transportType) }}
</div>
</template>
</el-table-column>
<el-table-column prop="tansportType" :label="$t('出货渠道')" align="center" width="100">
<template slot-scope="{row}">
<div>
{{ channelName(row.shippingChannelId) }}
</div>
</template>
</el-table-column>
<el-table-column prop="startDestTitle" :label="$t('始发地') + '/' + $t('目的地')" align="center">
<template slot-scope="scope">
<div>
{{ scope.row.warehouseLineDO.startTitleZh }}
<br />
{{ scope.row.warehouseLineDO.destTitleZh }}
</div>
</template>
</el-table-column>
<el-table-column prop="price" :label="$t('价格')" align="center">
<template slot-scope="scope">
<template v-if="scope.row.stepPrice == 1">
<!--全包价-->
<div v-if="scope.row.priceType">
<div v-if="!scope.row.fullPriceStepList || !scope.row.fullPriceStepList.length">{{$t('未设置全包价阶梯价')}}</div>
<div v-else>
{{$t("第{no}阶梯({start}~{end}{weightUnit}", {
no: 1,
start: scope.row.fullPriceStepList[0].startNum,
end: scope.row.fullPriceStepList[0].endNum,
weightUnit: getUnitTitle(scope.row.fullPriceStepList[0].weightUnit),
})}}<br/>
{{$t('全包价')}}:{{ getCurrencySymbol(scope.row.fullPriceStepList[0].allPriceUnit) + scope.row.fullPriceStepList[0].allPrice}}&nbsp;
{{ getCurrencyTitle(scope.row.fullPriceStepList[0].allPriceUnit) + '/' + getUnitTitle(scope.row.fullPriceStepList[0].allVolumeUnit)}}
</div>
</div>
<template v-else>
<div v-if="!scope.row.freightPriceStepList || !scope.row.freightPriceStepList.length">{{$t('未设置运费阶梯价')}}</div>
<div v-else>
{{$t("第{no}阶梯({start}~{end}{weightUnit}", {
no: 1,
start: scope.row.freightPriceStepList[0].startNum,
end: scope.row.freightPriceStepList[0].endNum,
weightUnit: getUnitTitle(scope.row.freightPriceStepList[0].weightUnit),
})}}<br/>
<div>
{{$t('运费')}}:{{ getCurrencySymbol(scope.row.freightPriceStepList[0].transportPriceUnit) + scope.row.freightPriceStepList[0].transportPrice}}&nbsp;
{{ getCurrencyTitle(scope.row.freightPriceStepList[0].transportPriceUnit) + '/' + getUnitTitle(scope.row.freightPriceStepList[0].transportVolumeUnit)}}
</div>
</div>
</template>
<el-button type="text" @click="showMoreStepPriceItem=scope.row">{{$t('查看更多')}}</el-button>
</template>
<template v-else>
<div v-if="scope.row.priceType == 0">
{{$t('运费')}}:{{ getCurrencySymbol(scope.row.transportPriceUnit) + scope.row.transportPrice}}&nbsp;
{{ getCurrencyTitle(scope.row.transportPriceUnit) + '/' + getUnitTitle(scope.row.transportVolumeUnit)}}
<br />
{{$t('清关费')}}:{{ getCurrencySymbol(scope.row.clearancePriceUnit) + scope.row.clearancePrice}}&nbsp;
{{ getCurrencyTitle(scope.row.clearancePriceUnit) + '/' + getUnitTitle(scope.row.clearanceVolumeUnit)}}
</div>
<div v-if="scope.row.priceType == 1">
{{$t('全包价')}}:{{ getCurrencySymbol(scope.row.allPriceUnit) + scope.row.allPrice}}&nbsp;
{{ getCurrencyTitle(scope.row.allPriceUnit) + '/' + getUnitTitle(scope.row.allVolumeUnit)}}
</div>
</template>
</template>
</el-table-column>
<el-table-column prop="auditStatus" align="center" :label="$t('状态')" width="120">
<template slot-scope="scope">
<div>
{{ statusName(scope.row) }}
<span style="color:red" v-if="(scope.row.validateStartDate && scope.row.validateStartDate > Date.now()) || (scope.row.validateEndDate && scope.row.validateEndDate < Date.now())">(已过期)</span>
</div>
</template>
</el-table-column>
<el-table-column prop="advanceStatus" :label="$t('单询')" align="center" width="80">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.NEED_ORDER_INQUIRY" :value="scope.row.needOrderInquiry"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="advanceStatus" :label="$t('预付')" align="center" width="80">
<template slot-scope="scope">
<div>
<!-- {{ getAdvanceStatuTitle(scope.row.advanceStatus) }} -->
<dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="scope.row.needPay"></dict-tag>
</div>
</template>
</el-table-column>
<el-table-column :label="$t('最后修改时间')">
<template slot-scope="{row}">
<div>
{{ row.updateTime|parseTime }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="140">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row, true)"
v-hasPermi="['ecw:product-price:show']">{{$t('查看')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:product-price:update']">{{$t('编辑')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="updateStatus(scope.row, 'blacklist')"
v-hasPermi="['ecw:product-price:black']">{{ scope.row.blacklist == 0 ? $t('加入黑名单') : $t('移除黑名单') }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="updateStatus(scope.row, 'auditStatus')"
v-hasPermi="['ecw:product-price:down']">{{scope.row.auditStatus == AuditStatusEnum.PASS ? $t('下架') : $t('上架')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:product-price:delete']">{{$t('删除')}}</el-button>
<el-button @click="copyTemplate(scope.row)" size="mini" type="text">{{$t('复制模板')}}</el-button>
<el-button @click="setOrderInquiry(scope.row, 0)" v-if="scope.row.needOrderInquiry" size="mini" type="text">{{$t('取消单询')}}</el-button>
<el-button @click="setOrderInquiry(scope.row, 1)" v-else size="mini" type="text">{{$t('单询异常')}}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<el-dialog :visible="!!showMoreStepPriceItem" :before-close="closeMoreStepPrice" :title="$t('查看阶梯价')">
<el-row :gutter="20" v-if="showMoreStepPriceItem">
<el-col :span="12">
<!--全包价-->
<template v-if="showMoreStepPriceItem.priceType">
<div v-for="(item, index) in showMoreStepPriceItem.fullPriceStepList">
<show-step-price-item
:value="item"
:unit-map="unitMap"
:currency-map="currencyMap"
:index="index"
field-prefix="all"
:price-name="$t('全包价')"></show-step-price-item>
</div>
</template>
<template v-else>
<template v-if="showMoreStepPriceItem.freightPriceStepList">
<div v-for="(item, index) in showMoreStepPriceItem.freightPriceStepList">
<show-step-price-item
:value="item"
:unit-map="unitMap"
:currency-map="currencyMap"
:index="index"
field-prefix="transport"
:price-name="$t('运费')"></show-step-price-item>
</div>
</template>
<template v-if="showMoreStepPriceItem.clearancePriceStepList">
<div v-for="(item, index) in showMoreStepPriceItem.clearancePriceStepList">
<show-step-price-item
:value="item"
:unit-map="unitMap"
:currency-map="currencyMap"
:index="index"
field-prefix="clearance"
:price-name="$t('清关费')"></show-step-price-item>
</div>
</template>
</template>
</el-col>
<!--空运的清关费单独显示-->
<!--
甲方要求不显示清关费 https://zentao.test.jdshangmen.com/bug-view-5298.html
-->
<!-- <el-col :span="12" v-if="[3,4].indexOf(+showMoreStepPriceItem.warehouseLineDO.transportType) > -1">
<template v-if="showMoreStepPriceItem.clearPriceStepList.length">
<div v-for="(item, index) in showMoreStepPriceItem.clearPriceStepList">
<div class="page-title">
{{$t("第{no}阶梯({start}~{end}{weightUnit}", {
no: index + 1,
start: item.startNum,
end: item.endNum,
weightUnit: getUnitTitle(item.weightUnit),
})}}
</div>
{{$t('清关费')}}:{{ getCurrencySymbol(item.clearancePriceUnit) + item.clearancePrice}}&nbsp;
{{ getCurrencyTitle(item.clearancePriceUnit) + '/' + getUnitTitle(item.clearanceVolumeUnit)}}
</div>
</template>
<template v-else>{{$t('暂无清关费设置')}}</template>
</el-col>-->
</el-row>
</el-dialog>
</div>
</template>
<script>
import {
createProductPrice,
updateProductPrice,
deleteProductPrice,
getProductPrice,
getProductPricePage,
updateOrderInquiry,
copyPriceByProductIds
} from "@/api/ecw/productPrice";
import { openedRouterList } from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductAttrList } from "@/api/ecw/productAttr";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit';
import { AuditStatusEnum} from '@/utils/constants'
import { getAllChannelList, getChannelList } from '@/api/ecw/channel'
import DictTag from '@/components/DictTag'
import {arrryToKeyedObjectBy} from '@/utils/index'
import { getProduct} from '@/api/ecw/product';
import {parseTime} from '@/utils/ruoyi'
import Template from "@/views/cms/template";
import {getStatusName} from "@/views/ecw/productPrice/util";
import ShowStepPriceItem from "@/views/ecw/productPrice/components/ShowStepPriceItem.vue";
export default {
name: "EcwProductCopyprice",
filters: {parseTime},
components: {
ShowStepPriceItem,
Template,
DictTag
},
data() {
return {
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
//特性列表
attrList:[],
typeList: [],
product: null,
cityList: [],
/* startCityList: [], //始发地城市
destCityList: [], //目的地城市 */
routedList: [], //已开头路线列表
currencyList: [], //货币列表
unitList: [], //单位列表
channelList:[] , // 渠道
routeParams:{}, //路线搜索条件
isUpdate: false, //更新操作
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 产品价格列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
// 查询参数
queryParams: {
searchType: 1,
pageNo: 1,
pageSize: 10,
productId: null,
warehouseLineId: null,
transportType: null,
transportPrice: null,
transportPriceUnit: null,
transportVolumeUnit: null,
clearancePrice: null,
clearancePriceUnit: null,
clearanceVolumeUnit: null,
shippingChannelId: null,
status: null,
},
// 表单参数
form: {
typeId: null,
titleZh: null
},
// 表单校验
rules: {
typeId: [{ required: true, message: this.$t("产品类型不能为空"), trigger: "blur" }],
titleZh: [{ required: true, message: this.$t("产品名称不能为空"), trigger: "blur" }],
titleEn: [{ required: true, message: this.$t("英文名称不能为空"), trigger: "blur" }],
transportPrice: [{ required: true, message: this.$t("海运费不能为空"), trigger: "blur" }],
clearancePrice: [{ required: true, message: this.$t("清关费不能为空"), trigger: "blur" }],
advanceStatus: [{ required: true, message: this.$t("是否预付不能为空"), trigger: "blur" }],
containerLocation:[{ required: true, message: this.$t("货柜位置不能为空"), trigger: "blur" }],
square:[{ required: true, message: this.$t("方数不能为空"), trigger: "blur" }],
needBook:[{ required: true, message: this.$t("预约入仓不能为空"), trigger: "blur" }],
},
lineList: [],
transportDatas: getDictDatas(DICT_TYPE.ECW_TRANSPORT_TYPE),
/* advanceStatusDictDatas: getDictDatas(DICT_TYPE.ADVANCE_STATUS), */
AuditStatusEnum: AuditStatusEnum,
locationList: getDictDatas(DICT_TYPE.ECW_CONTAINER_LOCATION),
// 查看更多阶梯价
showMoreStepPriceItem: null,
entryPath: null
};
},
computed: {
// 路径中的运输方式参数
transportType() {
// product-price-1_2的格式,如果没有三段则最后一段不是运输方式
return this.$route.path.split('-')[2] || '';
},
// 路由中的标题
routeName(){
return this.$route.name
},
// 类型,transportType是1和2(1_2用一个表示)表示海运,3和4表示空运
type(){
// 如果没有则表示商品路线价格
if(!this.transportType){
return null
}
return ['3','4'].indexOf(this.transportType) > -1 ? 'air' : 'sea'
},
// 商品名称
productTitle(){
if(!this.product){
return ''
}
return this.product.titleZh
},
// 渠道用id做键值
keyedChannel(){
return arrryToKeyedObjectBy(this.channelList, 'channelId')
},
// 根据渠道id获取渠道名
channelName(){
return id => {
return this.keyedChannel[id] ? this.keyedChannel[id].nameZh : null
}
},
// 根据类型获取类型名称
getTypeName() {
return typeId => {
for(let index in this.typeList) {
let typeItem = this.typeList[index];
if(typeItem.id == typeId) {
return this.$l(typeItem, 'title');
}
}
}
},
// 根据状态获取状态名称 ,这个应该可以改成字典,目前接口缺少相关数据,待定
statusName() {
return getStatusName
},
// 根据运输方式获取名称
transportName() {
return transportType => {
return this.getDictDataLabel(this.DICT_TYPE.ECW_TRANSPORT_TYPE, transportType)
}
},
// 显示币种符号
getCurrencySymbol() {
return currencyId => {
for(let index in this.currencyList) {
let currecyItem = this.currencyList[index];
if(currecyItem.id == currencyId) {
return currecyItem.fuhao;
}
}
}
},
// 显示币种名称
getCurrencyTitle() {
return currencyId => {
for(let index in this.currencyList) {
let currecyItem = this.currencyList[index];
if(currecyItem.id == currencyId) {
return this.$l(currecyItem, 'title');
}
}
}
},
getUnitTitle() {
return unitId => {
for(let index in this.unitList) {
let unitItem = this.unitList[index];
if(unitItem.id == unitId) {
return this.$l(unitItem, 'title');
}
}
}
},
startCityList(){
return this.cityList.filter(item => item.type == 2 || item.type == 3)
},
destCityList(){
return this.cityList.filter(item => item.type == 1 || item.type == 3)
},
currencyMap(){
let map = {}
this.currencyList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
unitMap(){
let map = {}
this.unitList.forEach(item => {
map[item.id] = this.$l(item, 'title')
})
return map
},
},
activated() {
// console.log('activated', Object.assign({}, this.$route.query))
/* this.$set(this.queryParams, 'typeId', +this.$route.query.product_type || null)
let productId = this.product?.id
console.log(this.$route.query.product_id, productId, this.$route.query.product_id != productId)
if(this.$route.query.product_id != productId){
this.queryParams = {
pageNo: 1,
pageSize: 10
}
}
this.handleQuery()
*/
if(this.$route.query.product_type){
this.$set(this.queryParams, 'typeId', +this.$route.query.product_type);
}
if(this.$route.query.transportType){
this.$set(this.queryParams, 'transportType', +this.$route.query.transportType);
}
// 指定产品获取产品信息
if(this.$route.query.product_id){
this.$set(this.queryParams, 'productId', +this.$route.query.product_id);
getProduct(this.$route.query.product_id).then(res => {
this.product = res.data
})
}else {
if (this.transportType) {
// 如果指定了单个的运输方式则赋值
if (this.transportType.split('_').length == 1) {
this.$set(this.queryParams, 'transportType', +this.transportType)
}
}
}
},
watch:{
'$route.query.product_id'(){
// if(!this.$route.query.product_id){
// return this.product = null
// }
// 价格列表 跟 商品的价格列表,有时候商品价格列表的路由变动会导致价格列表也执行此处代码,所以做一个判断排除
// https://zentao.test.jdshangmen.com/bug-view-4928.html
if(this.$route.path != this.entryPath) return
let productId = this.product?.id
if(this.$route.name === 'ProductPrice'){
if(this.$route.query.product_id != productId){
this.queryParams = {
pageNo: 1,
pageSize: 10,
productId: this.$route.query.product_id,
typeId: this.$route.query.product_type,
transportType:this.$route.query.transportType
}
}
getProduct(this.$route.query.product_id).then(res => {
this.product = res.data
})
this.getList();
}
}
},
created() {
this.entryPath = this.$route.path
if(this.$route.query.product_type){
this.$set(this.queryParams, 'typeId', +this.$route.query.product_type);
}
if(this.$route.query.transportType){
this.$set(this.queryParams, 'transportType', +this.$route.query.transportType);
}
// 指定产品获取产品信息
if(this.$route.query.product_id){
this.$set(this.queryParams, 'productId', +this.$route.query.product_id);
getProduct(this.$route.query.product_id).then(res => {
this.product = res.data
})
}else{
if(this.transportType) {
// 如果指定了单个的运输方式则赋值
if (this.transportType.split('_').length == 1) {
this.$set(this.queryParams, 'transportType', +this.transportType)
}
}
this.getAttrList();
}
//获取城市列表
this.getAllCityList()
this.getChannelList()
this.getTypeList()
this.getAttrList();
//获取货币列表
this.requestCurrencyList();
//获取单位列表
this.requestUnitList();
this.$nextTick(() => {
this.getList();
})
},
methods: {
getChannelList(){
getAllChannelList().then(res => this.channelList = res.data)
},
/** 获取产品属性列表 */
getAttrList() {
getProductAttrList().then(response => {
this.attrList = response.data;
})
},
/** 获取产品类型列表 */
getTypeList() {
getProductTypeList().then(response => {
this.typeList = response.data;
})
},
/**获取所有城市列表 */
getAllCityList() {
getTradeCityList({}).then(response => {
this.cityList = response.data;
})
},
/**获取已开通路线列表 */
getOpenedRouterList() {
openedRouterList(this.routeParams).then(response => {
this.routedList = response.data;
this.setDefaultSelect();
})
},
//复制价格
copyPrice(){
console.log(this.product)
if(this.ids.length==0){
return this.$message(this.$t('请至少选中一项复制价格'))
}
this.$confirm(this.$t('请再次确认是否将勾选的线路价格复制到'+this.$route.query.titleZh), '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => {
let productPriceIds = this.ids.join(',')
let productId = this.$route.query.id
let lineChannelList =[{lineId:1,shippingChannelId:2}]
let data = {productPriceIds:productPriceIds,productId:productId,lineChannelList:lineChannelList}
copyPriceByProductIds(data).then(res => {
this.$modal.msgSuccess(this.$t("复制价格成功"));
this.getList()
})
})
.catch(() => console.info("操作取消"));
},
/**获取所有货币列表 */
requestCurrencyList() {
getCurrencyList().then(response => {
this.currencyList = response.data;
})
},
/**获取所有单位列表 */
requestUnitList() {
getUnitList().then(response => {
this.unitList = response.data;
})
},
/*handleSelectionChange(val) {
this.lineList = val;
},*/
/**运输线路改变 */
transportTypeChange(newVal) {
this.routeParams.transportType = this.form.transportType;
this.getOpenedRouterList();
},
/**始发地改变 */
startCityChange(newVal) {
this.routeParams.startCityId = this.form.startCityId;
this.getOpenedRouterList();
},
/**目的地改变 */
destCityChange(newVal) {
this.routeParams.destCityId = this.form.destCityId;
this.getOpenedRouterList();
},
handleStatusChange(row) {
updateProductPrice(row).then(() => {
this.$modal.msgSuccess(this.$t("修改成功"));
}).catch(function() {
row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
});
},
/** 查询列表 */
getList() {
this.loading = true;
console.log(this.queryParams,'this.queryParams')
// 处理查询参数
let params = {...this.queryParams};
if(this.type == 'sea'){
params.transportType = 1
}
if(this.type == 'air'){
params.transportType = 3
}
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
console.log(params,'params')
getProductPricePage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
productId: undefined,
warehouseLineId: undefined,
transportPrice: undefined,
transportPriceUnit: undefined,
transportVolumeUnit: undefined,
clearancePrice: undefined,
clearancePriceUnit: undefined,
clearanceVolumeUnit: undefined,
status: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.queryParams.setPrice = undefined
this.queryParams.blacklist = undefined
if(this.queryParams.combStatus){
let tmp = this.queryParams.combStatus.split('_')
this.queryParams[tmp[0]] = tmp[1]
}
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(type) {
return this.$router.push(`../../lineProject/product-price/edit-${type}?` + (new URLSearchParams(this.$route.query)).toString())
},
// 批量修改单个商品的价格(一条或者多条,后者全部路线)
batchSetSingleProductPrice(type){
this.$router.push(`../../lineProject/product-price/edit-${type}?action=batchUpdate&type=${type}&product_id=${this.$route.query.product_id}&ids=${this.ids}`)
},
// 批量设置路线
handleBatchEdit(type) {
this.$router.push('../../lineProject/batch-edit-' + type)
},
/** 修改按钮操作 */
handleUpdate(row, readonly) {
let transportType = row.warehouseLineDO.transportType
let type = transportType == 3 || transportType == 4 ? 'air' : 'sea'
let url = `../../lineProject/product-price/edit-${type}?action=update&id=${row.id}`
if(readonly)url += '&readonly=1'
return this.$router.push(url)
},
updateStatus(row, type) {
if(type == 'blacklist') {
row.blacklist=row.blacklist == 0 ? 1 : 0;
} else if(type == 'auditStatus') {
row.auditStatus=row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
}
updateProductPrice(row).then(() => {
this.$modal.msgSuccess(this.$t("修改成功"));
}).catch(function() {
if(statusType == 'blacklist') {
row.blacklist = row.blacklist === 1 ? 0 : 1;
} else {
row.auditStatus = row.auditStatus === AuditStatusEnum.PASS ? AuditStatusEnum.NOT_PASS : AuditStatusEnum.PASS;
}
});
},
checkSelectable() {
return !this.isUpdate;
},
setDefaultSelect() {
let vm = this;
setTimeout(() => {
// 修改线路价格,选中已经选择的
if(vm.isUpdate && vm.routedList && vm.routedList.length) {
vm.$refs.routeTable.toggleRowSelection(vm.routedList[0]);
}
}, 300);
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm(this.$t('是否确认删除产品价格编号为{id}的数据项?', {id})).then(function() {
return deleteProductPrice(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess(this.$t("删除成功"));
}).catch(() => {});
},
// 表格多选
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
// 设置,取消単询
setOrderInquiry(row, needOrderInquiry){
row.needOrderInquiry = needOrderInquiry
updateOrderInquiry(row).then(res => {
this.$message.success(res.msg || this.$t('操作成功'))
this.getList()
})
},
// 复制模板
copyTemplate(row){
// 跳转到批量设置页面,并填充数据
let transportType = row.warehouseLineDO.transportType
this.$router.push(`../../lineProject/batch-edit-${transportType == 3 || transportType == 4 ? 'air' : 'sea'}?templateId=${row.id}`)
},
// 关闭更多阶梯价格窗口
closeMoreStepPrice(){
this.showMoreStepPriceItem=null
}
}
};
</script>
<style lang="scss" scoped>
</style>
......@@ -117,13 +117,33 @@
</el-table-column> -->
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="toPriceManager(scope.row)" v-hasPermi="['ecw:product-price:query']">{{$t('路线价格')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:product:update']">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:product:delete']">{{$t('删除')}}</el-button>
<el-button v-if="scope.row.auditStatus===2" size="mini" type="text" icon="el-icon-edit" @click="copyPrice(scope.row)" v-hasPermi="['ecw:product:copyPrice']">{{$t('复制价格')}}</el-button>
<!-- <div v-else>
<el-button size="mini" type="text" @click="toPriceManager(scope.row)" v-hasPermi="['ecw:product-price:query']">{{$t('路线价格')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:product:update']">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:product:delete']">{{$t('删除')}}</el-button>
</div> -->
<!-- <el-button v-else size="mini" type="text" icon="el-icon-edit" @click="copyPrice(scope.row)" v-hasPermi="['ecw:product:copyPrice']">{{$t('复制价格')}}</el-button> -->
</template>
<!-- <template v-else>
<el-button size="mini" type="text" @click="toPriceManager(scope.row)" v-hasPermi="['ecw:product-price:query']">{{$t('路线价格')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ecw:product:update']">{{$t('修改')}}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ecw:product:delete']">{{$t('删除')}}</el-button>
</template>
</template> -->
</el-table-column>
</el-table>
<!-- 分页组件 -->
......@@ -521,6 +541,10 @@ export default {
});
},
//复制价格
copyPrice(row){
this.$router.push({path:'/product/copyPrice',query:{titleZh:row.titleZh,id:row.id}})
},
/** 查询列表 */
getList() {
......
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用户姓名" prop="userId">
<user-selector
manage
v-model="queryParams.userId"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未选择用户') }"
/>
</el-form-item>
<el-form-item label="权限范围" prop="titleZh">
<el-select
v-model="queryParams.permissionFw"
clearable
style="width: 200px"
>
<el-option label="本人" value="1"></el-option>
<el-option label="部门" value="2"></el-option>
<el-option label="全公司" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">
{{ $t("搜索") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">
{{ $t("重置") }}
</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['report:permission:create']"
>
{{ $t("新增") }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
v-show="false"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['my:test:export']"
>
{{ $t("导出") }}</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="用户ID" align="center" prop="userId" />
<el-table-column label="用户姓名" align="center" prop="userName" />
<el-table-column label="权限类型" align="center" prop="permissionFw">
<template slot-scope="scope">
<span v-if="scope.row.permissionFw == 1">本人</span>
<span v-else-if="scope.row.permissionFw == 2">部门</span>
<span v-else-if="scope.row.permissionFw == 3">全公司</span>
<span v-else>权限定义异常</span>
</template>
</el-table-column>
<el-table-column
label="部门信息"
align="center"
prop="deptName"
width="100"
>
</el-table-column>
<el-table-column label="修改日期" align="center" prop="updateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['report:permission:update']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['report:permission:delete']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="用户姓名" prop="userId">
<user-selector
manage
v-model="form.userId"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未选择用户') }"
/>
</el-form-item>
<el-form-item label="权限范围" prop="permissionFw">
<el-select v-model="form.permissionFw" clearable style="width: 200px">
<el-option label="本人" value="1"></el-option>
<el-option label="部门" value="2"></el-option>
<el-option label="全公司" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="部门信息" prop="deptId">
<treeselect
v-model="form.deptId"
:options="deptOptions"
:show-count="true"
:placeholder="$t('请选择部门')"
:normalizer="normalizer"
/>
</el-form-item>
<el-form-item label="数据导出权" prop="exportdataq">
<el-radio-group v-model="form.exportdataq">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</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>
</template>
<script>
import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect";
//自定义目录数样式
import "@/assets/styles/vue-treeselect.css";
//部门树需要的函数
import { listSimpleDepts } from "@/api/system/dept";
import {
create,
update,
del,
getModel,
getPageList,
exportExcel,
} from "@/api/report/EcwReportPermission";
//2024-04-27
export default {
name: "EcwReportPermission",
components: {
UserSelector,
Treeselect,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 测试列表
list: [],
// 弹出层标题
title: "",
//是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
userId: null, //用户ID
userName: null, //用户姓名
permissionFw: null, //权限范围
deptId: null, //部门信息
},
// 表单参数
form: {},
// 表单校验
rules: {},
deptOptions: undefined,
};
},
created() {
this.getTreeselect();
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
// 执行查询
getPageList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
userId: undefined, //用户ID
userName: undefined, //用户姓名
permissionFw: undefined, //权限范围
deptId: null, //部门
exportdataq: "0", //是否有数据导出权
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加测试";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getModel(id).then((response) => {
this.form = response.data;
//要把数据类型做一下转换,不让是在页面上显示不了lable信息
this.form.permissionFw = response.data.permissionFw.toString();
//vue 控件对类型很敏感,类型不对很容易出问题
this.form.userId = parseInt(response.data.userId);
if (
response.data.deptId == null ||
response.data.deptId == undefined ||
response.data.deptId == ""
) {
//treeselect 若是空值,必须是null,不能赋值"",0,等。
this.form.deptId = null;
}
//vue控件的数据类型一定要和后台一致
this.form.exportdataq = response.data.exportdataq.toString();
this.open = true;
this.title = "修改测试";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
if (
this.form.userId == null ||
this.form.userId == undefined ||
this.form.userId == ""
) {
this.$message.error("请选择用户");
return;
}
if (
this.form.permissionFw == null ||
this.form.permissionFw == undefined ||
this.form.permissionFw == ""
) {
this.$message.error("请选择权限范围");
return;
} else {
if (this.form.permissionFw == 1 || this.form.permissionFw == 3) {
//本人和全公司权限,不用选择部门
this.form.deptId = "";
} else if (this.form.permissionFw == 2) {
//部门权限,需要选中部门信息
if (
this.form.deptId == null ||
this.form.deptId == undefined ||
this.form.deptId == ""
) {
this.$message.error("请选择部门");
return;
}
}
}
// 修改的提交
if (this.form.id != null) {
update(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
create(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除测试编号为"' + id + '"的数据项?')
.then(function () {
return del(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
// 执行导出
this.$modal
.confirm("是否确认导出所有测试数据项?")
.then(() => {
this.exportLoading = true;
return exportExcel(params);
})
.then((response) => {
this.$download.excel(response, "${table.classComment}.xls");
this.exportLoading = false;
})
.catch(() => {});
},
Test() {
this.form.userId = 31;
},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
listSimpleDepts().then((response) => {
// 处理deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
},
//格式化部门的下拉框
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
};
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="120px"
>
<el-form-item label="客户" prop="name">
<el-select
v-model="queryParams.searchtype"
clearable
style="width: 100px"
>
<el-option
v-for="dict in SearchTypeList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
style="width: 200px"
v-model="queryParams.name"
placeholder="请输入客户姓名/编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="部门" v-show="showDept">
<treeselect
v-model="queryParams.deptid"
:options="deptOptions"
:show-count="true"
:placeholder="$t('请选择部门')"
:normalizer="normalizer"
/>
</el-form-item>
<el-form-item
label="客户经理"
prop="salesmanid"
v-show="showCustomsManage"
>
<user-selector
manage
v-model="queryParams.salesmanid"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理') }"
/>
</el-form-item>
<el-form-item label="首次成交" prop="delFlag">
<el-select v-model="queryParams.first" clearable style="width: 200px">
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户业绩类型" prop="remark">
<el-select
v-model="queryParams.cusYjType"
clearable
style="width: 200px"
>
<el-option label="新客户" value="1"></el-option>
<el-option label="老客户" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户来源" prop="remark">
<el-select
v-model="queryParams.source"
:placeholder="$t('请选择客户来源')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item label="客户角色" prop="customerrole">
<el-select
v-model="queryParams.customerrole"
clearable
style="width: 200px"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_TYPE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户国家" prop="country">
<el-select
clearable
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item label="数据筛选" prop="searchDataType">
<el-select
v-model="queryParams.searchDataType1"
clearable
style="width: 200px"
>
<el-option
v-for="dict in SearchDataTypeList1"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-select
v-model="queryParams.searchDataType2"
clearable
style="width: 200px"
>
<el-option
v-for="dict in SearchDataTypeList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
v-model="queryParams.searchDataType3"
style="width: 200px"
placeholder="请输入数值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="时间筛选" prop="searchDateType4">
<el-select
v-model="queryParams.searchDataType4"
clearable
style="width: 200px"
>
<el-option label="首次成交时间" value="1"></el-option>
<el-option label="客户创建时间" value="0"></el-option>
</el-select>
<el-date-picker
v-model="queryParams.sdate4"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输入起始日期"
/>
<el-date-picker
v-model="queryParams.edate4"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止日期"
/>
</el-form-item>
<el-form-item label="业绩产生时间" prop="searchDateType">
<el-date-picker
v-model="queryParams.sdate"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输入起始日期"
/>
<el-date-picker
v-model="queryParams.edate"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止日期"
/>
</el-form-item>
<el-form-item label="同比年份" prop="duibiYear">
<el-date-picker
v-model="queryParams.duibiYear"
type="year"
value-format="yyyy"
placeholder="请选择同比年份"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">
{{ $t("查询") }}</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery"
>{{ $t("重置") }}
</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-show="objEcwReportPermission.exportdataq == 1"
>
{{ $t("导出") }}</el-button
>
<el-button type="primary" size="mini" @click="test" v-show="false">
测试
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list">
<el-table-column label="排名" align="center" prop="px" />
<el-table-column label="客户编号" align="center" prop="number">
<template slot-scope="{ row }">
<el-link
type="primary"
@click.native="$router.push('/customer/query/' + row.id)"
>{{ row.number }}</el-link
>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="name" />
<el-table-column label="客户经理" align="center" prop="salesman" />
<el-table-column label="部门" align="center" prop="deptname" />
<el-table-column label="总V值" align="center" prop="allsumvolume" />
<el-table-column
label="总V值同比"
align="center"
prop="allsumvolumeTbShow"
/>
<el-table-column label="海运拼柜" align="center" prop="sumvolumeV1" />
<el-table-column label="海运占比" align="center" prop="seaZb" />
<el-table-column
label="海运拼柜同比"
align="center"
prop="sumvolumeTbShow1"
/>
<el-table-column label="专线空运" align="center" prop="sumweightV3" />
<el-table-column label="空运占比" align="center" prop="airZb" />
<el-table-column
label="专线空运同比"
align="center"
prop="sumweightTbShow3"
/>
<el-table-column label="月均" align="center" prop="monthAvg" />
<el-table-column label="月均同比" align="center" prop="monthAvgTbShow" />
<el-table-column label="海运月均方数" align="center" prop="seaMonthAvg" />
<el-table-column
label="海运月均同比"
align="center"
prop="sumvolumeTbShow1"
/>
<el-table-column label="空运月均重量" align="center" prop="airMothAvg" />
<el-table-column
label="空运月均同比"
align="center"
prop="sumweightTbShow3"
/>
<el-table-column label="重货总V值" align="center" prop="weightSumV" />
<el-table-column label="重货占比" align="center" prop="weithtSumZb" />
<el-table-column label="泡货总V值" align="center" prop="phSumV" />
<el-table-column label="泡货占比" align="center" prop="phSumZb" />
<el-table-column label="控货总V值" align="center" prop="khSumV" />
<el-table-column label="控货占比" align="center" prop="khSumZb" />
<el-table-column label="是否首次成交" align="center" prop="isFirst" />
<el-table-column label="首次成交时间" align="center" prop="firstDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.firstDate) }}</span>
</template>
</el-table-column>
<el-table-column label="提货率" align="center" prop="thL" />
<el-table-column label="客户业绩类型" align="center" prop="cusYjType" />
<el-table-column label="客户来源" align="center" prop="sourcename" />
<el-table-column label="客户角色" align="center" prop="customerrole" />
<el-table-column label="客户国家" align="center" prop="country" />
<el-table-column
label="客户创建时间"
align="center"
prop="createtime"
width="200px"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
//国家列表接口
import { getCountryListAll } from "@/api/ecw/country";
import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect";
//自定义目录数样式
import "@/assets/styles/vue-treeselect.css";
import { listSimpleDepts } from "@/api/system/dept";
import { getListPage, exportExcel } from "@/api/report/customeranalysis";
import {
getCurUserPermission,
getDeptChild,
listServiceUser,
} from "@/api/report/EcwReportPermission";
import { MessageBox } from "element-ui";
function currentTime2() {
var date = new Date();
var year = date.getFullYear();
//月份从0~11,所以加一
let month = date.getMonth() + 1;
//如果格式是MM则需要此步骤,如果是M格式则此处注释掉
if (month >= 1 && month <= 9) {
month = "0" + month;
}
let day = date.getDay();
let strDate = year + "-" + month + "-" + day;
return strDate;
}
function formatDate2() {
var date = new Date();
const day = date.getDate().toString().padStart(2, "0");
const month = (date.getMonth() + 1).toString().padStart(2, "0");
// 月份是从0开始的
const year = date.getFullYear();
const hours = date.getHours().toString().padStart(2, "0");
const minutes = date.getMinutes().toString().padStart(2, "0");
const seconds = date.getSeconds().toString().padStart(2, "0");
//`${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
return `${year}-${month}-${day}`;
}
function formatDate3() {
var date = new Date();
// 月份是从0开始的
const year = date.getFullYear();
return `${year}-01-01`;
}
function getLastYear() {
//获取上一年份
var date = new Date();
date.setFullYear(date.getFullYear() - 1);
let year = date.getFullYear();
return year.toString();
}
//获取月份的最后一天 lanbm 2024-04-27 add
function getLastDay(sDate) {
var date = new Date(sDate);
var year = date.getFullYear();
//月份从0开始计算,需要加1
var month = date.getMonth() + 1;
var lastDay = new Date(year, month, 0).getDate();
return lastDay;
}
//2024-04-27
export default {
name: "ReportCustomer_analysisIndex",
components: {
UserSelector,
Treeselect,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showDept: true, //是否显示部门选择过滤条件
showCustomsManage: true, //是否显示客户经理过滤条件
deptOptions: undefined,
// 总条数
total: 0,
// 测试列表
list: [],
countryList: [], //国家列表
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeCreateTime: [],
SearchTypeList: [
{ value: "in", label: "包含" },
{ value: "notin", label: "不包含" },
{ value: "eq", label: "等于" },
{ value: "noeq", label: "不等于" },
],
// 禁止选择超出当前日期
pickerOptions: {
disabledDate(time) {
const _now = Date.now();
return time.getTime() <= _now;
},
},
SearchDataTypeList1: [
{ value: "allsumvolume", label: "总值" },
{ value: "2", label: "总值同比" },
{ value: "3", label: "海运拼柜" },
{ value: "4", label: "海运占比" },
{ value: "5", label: "海运同比" },
{ value: "6", label: "海运占比" },
{ value: "7", label: "专线空运" },
{ value: "8", label: "空运占比" },
{ value: "9", label: "空运同比" },
{ value: "10", label: "月均" },
{ value: "11", label: "月均同比" },
{ value: "12", label: "海运月均方数" },
{ value: "13", label: "空运月均重量" },
{ value: "14", label: "重货总V值" },
{ value: "15", label: "重货占比" },
{ value: "16", label: "泡货总V值" },
{ value: "17", label: "泡货总V值" },
{ value: "18", label: "泡货占比" },
{ value: "19", label: "控货总V值" },
{ value: "20", label: "控货占比" },
{ value: "21", label: "提货率" },
],
SearchDataTypeList: [
{ value: "1", label: "大于等于" },
{ value: "2", label: "等于" },
{ value: "3", label: "小于等于" },
],
SearchDateTypeList: [
{ value: "firstdate", label: "首次成交时间" },
{ value: "createdate", label: "客户创建时间" },
],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
searchtype: undefined,
name: undefined, //客户姓名
number: undefined, //客户编号
salesmanid: undefined, //客户经理
deptid: undefined, //部门
country: undefined, //客户国家
source: undefined, //客户来源
customerrole: undefined, //客户角色
first: undefined, //是否首次成交
cusYjType: undefined, //客户业绩类型,新客户还是老客户
searchDataType1: undefined, //查询数据类型
searchDataType2: undefined,
searchDataType3: undefined,
searchDataType4: undefined, //时间筛选
searchDateType: "createdate", //日期查询类型
sdate: formatDate3(), //开始日期
edate: formatDate2(), //结束日期
duibiYear: getLastYear(), //对比年份
sdate4: undefined, //时间筛选开始值
edate4: undefined, //时间筛选结束值
},
// 表单参数
form: {},
// 表单校验
rules: {},
//报表权限信息
objEcwReportPermission: {},
DeptEx: { id: undefined, name: undefined, parentId: undefined },
ParentPar: {},
};
},
created() {
getCountryListAll().then((r) => {
this.countryList = r.data;
});
//获取当前用户报表权限
getCurUserPermission().then((response) => {
//复制对象
Object.assign(this.objEcwReportPermission, response.data);
//this.objEcwReportPermission = response.data;
if (this.objEcwReportPermission.permissionFw == 1) {
//只能看自己的,不能选择部门和客户经理
this.showCustomsManage = false;
this.showDept = false;
}
//获取页面传参
let sSalesmanid = this.$route.query.salesmanid;
let sDeptid = this.$route.query.deptid;
let s = this.$route.query.sDate;
let e = this.$route.query.eDate;
let bd = this.$route.query.duibiYear;
//客户编号
let number = this.$route.query.number;
if (sSalesmanid != undefined && sSalesmanid != null) {
this.queryParams.salesmanid = parseInt(sSalesmanid);
}
if (sDeptid != undefined && sDeptid != null) {
this.queryParams.deptid = parseInt(sDeptid);
}
if (s != undefined && s != null) {
this.queryParams.sdate = s + "-01";
}
if (e != undefined && s != null) {
let lastDay = getLastDay(e + "-01");
this.queryParams.edate = e + "-" + lastDay;
}
if (bd != undefined && bd != null) {
this.queryParams.duibiYear = bd;
}
if (number != undefined && number != null) {
this.queryParams.searchtype = "eq";
this.queryParams.name = number;
}
this.getTreeselect();
this.getList();
});
},
computed: {},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
// 执行查询
if (this.objEcwReportPermission.permissionFw == 1) {
//只能看自己的,不能选择部门和客户经理
this.queryParams.salesmanid = this.objEcwReportPermission.userId;
} else if (this.objEcwReportPermission.permissionFw == 2) {
//部门权限
this.queryParams.deptid = parseInt(this.objEcwReportPermission.deptId);
} else if (this.objEcwReportPermission.permissionFw == 3) {
//全公司权限
}
getListPage(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
isChinese() {
//基础函数,判断系统显示语言是中文还是英文
return this.$i18n.locale === "zh_CN";
},
handleView(row) {
//查看客户详情
this.$router.push("/customer/query/" + row.id);
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
resetQuery() {
this.queryParams = {
pageNo: 1,
pageSize: 10,
searchtype: undefined,
name: undefined, //客户姓名
number: undefined, //客户编号
salesmanid: undefined, //客户经理
deptid: undefined, //部门
country: undefined, //客户国家
source: undefined, //客户来源
customerrole: undefined, //客户角色
first: undefined, //是否首次成交
cusYjType: undefined, //客户业绩类型,新客户还是老客户
searchDataType: undefined, //查询数据类型
searchDateType: undefined, //日期查询类型
sdate: undefined, //开始日期
edate: undefined, //结束日期
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
if (this.isRightPar() == true) {
this.queryParams.pageNo = 1;
this.getList();
}
},
isRightPar() {
if (
this.queryParams.sdate == undefined ||
this.queryParams.sdate == null ||
this.queryParams.sdate == ""
) {
MessageBox("请输入开始日期。");
return false;
}
if (
this.queryParams.edate == undefined ||
this.queryParams.edate == null ||
this.queryParams.edate == ""
) {
MessageBox("请输入结束日期。");
return false;
}
if (
this.queryParams.duibiYear == undefined ||
this.queryParams.duibiYear == null ||
this.queryParams.duibiYear == ""
) {
MessageBox("请输入对比年份。");
return false;
} else {
let y = parseInt(this.queryParams.duibiYear);
if (y < 2023) {
MessageBox("对比年份只能选2023年和2023年之后的年份。");
return false;
}
var date = new Date();
var year = date.getFullYear();
if (y > year) {
MessageBox("对比年份只能选当前年份之前的年份。");
return false;
}
}
return true;
},
/** 导出按钮操作 */
handleExport() {
if (this.isRightPar() == false) return;
// 执行导出
this.$modal
.confirm("是否确认导出数据项?")
.then(() => {
this.exportLoading = true;
return exportExcel(this.queryParams);
})
.then((response) => {
this.$download.excel(response, "客户分析报表.xls");
this.exportLoading = false;
})
.catch(() => {});
},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
if (this.objEcwReportPermission.permissionFw == 3) {
listSimpleDepts().then((response) => {
// 处理 deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.DeptEx.id = this.objEcwReportPermission.deptId;
getDeptChild(this.DeptEx).then((response) => {
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
}
},
//格式化部门的下拉框
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
};
},
getNowDate() {
let now = new Date();
year = now.getFullYear();
month = (now.getMonth() + 1).toString().padStart(2, "0"); //得到月份
day = now.getDate().toString().padStart(2, "0"); //得到日期
let strDate = year + "-" + month + "-" + day;
return strDate;
},
test() {
this.DeptEx.id = this.objEcwReportPermission.deptId;
listServiceUser(this.DeptEx).then((response) => {
let json1 = JSON.stringify(response.data);
alert(json1);
return;
});
return;
let json1 = JSON.stringify(this.deptOptions);
alert(json1);
return;
//对象的拷贝 lanbm 2024-04-19 add
let target = {};
let source = { c: 3 };
Object.assign(target, source);
let json = JSON.stringify(this.objEcwReportPermission);
alert(json);
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="选择日期" prop="selDate">
<el-date-picker
v-model="queryParams.sDate"
type="month"
value-format="yyyy-MM"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate"
type="month"
value-format="yyyy-MM"
clearable
placeholder="请输截止月"
/>
</el-form-item>
<el-form-item label="同比年份" prop="duibiYear">
<el-date-picker
v-model="queryParams.duibiYear"
type="year"
value-format="yyyy"
placeholder="请选择同比年份"
/>
</el-form-item>
<el-form-item label="部门" prop="deptid" v-show="showDept">
<treeselect
v-model="queryParams.deptid"
:options="deptOptions"
:show-count="true"
:placeholder="$t('请选择部门')"
:normalizer="normalizer"
/>
</el-form-item>
<el-form-item
label="客户经理"
prop="salesmanid"
v-show="showCustomsManage"
>
<user-selector
manage
v-model="queryParams.salesmanid"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理') }"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">
{{ $t("重置") }}</el-button
>
</el-form-item>
<el-form-item> </el-form-item>
</el-form>
<el-row>
<el-form size="small" :inline="true" label-width="150px">
<el-form-item label="">
<el-button
type="primary"
icon="el-icon-search"
@click="hhandleQueryAnalysis"
>
{{ $t("更多") }}
</el-button>
</el-form-item>
</el-form>
</el-row>
<div
ref="mainBar"
:class="className"
:style="{ height: height, width: width }"
></div>
<!--
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>-->
</div>
</template>
<script>
import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect";
//自定义目录数样式
import "@/assets/styles/vue-treeselect.css";
import { listSimpleDepts } from "@/api/system/dept";
import * as echarts from "echarts";
require("echarts/theme/macarons");
import resize from "../../dashboard/mixins/resize";
import { getReportResult } from "@/api/report/customerreport";
import {
getCurUserPermission,
getDeptChild,
} from "@/api/report/EcwReportPermission";
import { MessageBox } from "element-ui";
const CurDate = new Date();
function currentTime() {
var date = new Date();
var year = date.getFullYear();
//月份从0~11,所以加一
let month = date.getMonth() + 1;
//如果格式是MM则需要此步骤,如果是M格式则此处注释掉
if (month >= 1 && month <= 9) {
month = "0" + month;
}
let strDate = year + "-" + month;
return strDate;
}
function getLastYear() {
//获取上一年份
var date = new Date();
date.setFullYear(date.getFullYear() - 1);
let year = date.getFullYear();
return year.toString();
}
//2024-04-27
export default {
name: "ReportCustomerreportIndex",
components: {
UserSelector,
Treeselect,
},
mixins: [resize],
props: {
className: {
type: String,
default: "chart",
},
width: {
type: String,
default: "100%",
},
height: {
type: String,
default: "500px",
},
autoResize: {
type: Boolean,
default: true,
},
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 总条数
total: 0,
// 显示搜索条件
showSearch: true,
showDept: true, //是否显示部门选择过滤条件
showCustomsManage: true, //是否显示客户经理过滤条件
deptOptions: undefined,
chart: null,
dateRangeCreateTime: [],
queryParams: {
sDate: CurDate.getFullYear() + "-01",
eDate: currentTime(), //结束日期
duibiYear: getLastYear(), //对比年份
deptid: undefined, //部门
salesmanid: undefined, //客户经理
number: undefined, //客户编号
pageNo: 1,
pageSize: 30,
},
//报表权限信息
objEcwReportPermission: {},
DeptEx: { id: undefined, name: undefined, parentId: undefined },
resultList: [],
};
},
watch: {},
mounted() {
/*
this.$nextTick(() => {
this.initChart();
});*/
},
created() {
//获取当前用户报表权限
getCurUserPermission().then((response) => {
this.objEcwReportPermission = response.data;
if (this.objEcwReportPermission.permissionFw == 1) {
//本人权限
this.showCustomsManage = false;
this.showDept = false;
this.queryParams.salesmanid = this.objEcwReportPermission.userId;
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.showCustomsManage = true;
this.showDept = true;
this.queryParams.deptid = parseInt(this.objEcwReportPermission.deptId);
} else if (this.objEcwReportPermission.permissionFw == 3) {
//全公司权限
this.showCustomsManage = true;
this.showDept = true;
}
this.getTreeselect();
//获取权限后再初始化统计图表
this.initChart();
});
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
var chartDom = this.$refs["mainBar"];
this.chart = echarts.init(chartDom, "macarons");
this.chart.on("click", (params) => {
if (this.isRight() == false) return;
let p = {};
this.queryParams.salesmanid = parseInt(
this.resultList[params.dataIndex].salesmanid
);
this.queryParams.number = this.resultList[params.dataIndex].number;
Object.assign(p, this.queryParams);
this.$router.push({
path: "/report/customer_analysis",
query: p,
});
});
this.setOptions();
},
setOptions() {
this.loading = true;
getReportResult(this.queryParams).then((response) => {
//全部列表数据
this.total = response.data.total;
this.resultList = response.data.resultList;
let resultList2 = response.data.resultList;
this.loading = false;
this.chart.setOption({
title: {
text: "客户贡献排名",
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
// 自定义提示框内容,使用回调函数
formatter: function (params) {
//params 是一个数组,数组中每个元素代表一个系列的数据信息
var result = "";
params.forEach(function (item) {
//var s=JSON.stringify(item);
//alert(s);
//在数据中查询
let sN = item.name;
var arr = sN.split("_");
let vR = resultList2.filter((r) => r.number === arr[1]);
result += "客户:" + item.name + "<br/>";
result += "客户编号:" + vR[0].number + "<br/>";
result += "客户经理:" + vR[0].salesman + "<br/>";
result += "总V值:" + item.value + "<br/>";
result += "海运V值:" + vR[0].sumvolume1 + "<br/>";
result += "空运V值:" + vR[0].sumweight3 + "<br/>";
result += "对比年份:" + vR[0].duibiYear + "<br/>";
result += "同比:" + vR[0].allsumvolumeTbMsg + "<br/>";
result += "环比:" + vR[0].allsumvolumeTbMsg + "<br/>";
});
return result;
},
},
legend: {},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.5],
},
yAxis: response.data.objyAxis,
series: response.data.obSseries,
});
});
},
hhandleQueryAnalysis() {
if (this.isRight() == false) return;
let p = {};
Object.assign(p, this.queryParams);
this.$router.push({
path: "/report/customer_analysis",
query: p,
});
},
isRight() {
//校验查询参数 lanbm 2024-04-07 add
if (this.queryParams.sDate == undefined) {
MessageBox("请输入起始月份。");
return false;
}
if (this.queryParams.eDate == undefined) {
MessageBox("请输入截止月份。");
return false;
}
if (this.queryParams.duibiYear == undefined) {
MessageBox("请输入对比年份。");
return false;
} else {
let y = parseInt(this.queryParams.duibiYear);
if (y < 2023) {
MessageBox("对比年份只能选2023年和2023年之后的年份。");
return false;
}
var date = new Date();
var year = date.getFullYear();
if (y > year) {
MessageBox("对比年份只能选当前年份之前的年份。");
return false;
}
}
return true;
},
handleQuery() {
if (this.isRight() == false) return;
//查询统计结果
this.initChart();
},
getList() {
//this.initChart();
},
resetQuery() {
this.queryParams = {
sDate: undefined, //开始日期
eDate: undefined, //结束日期
duibiYear: undefined, //对比年份
deptid: undefined, //部门
salesmanid: undefined, //客户经理
pageNo: 1,
pageSize: 30,
};
},
handleAdd() {},
handleExport() {},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
if (this.objEcwReportPermission.permissionFw == 3) {
listSimpleDepts().then((response) => {
// 处理deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.DeptEx.id = this.objEcwReportPermission.deptId;
getDeptChild(this.DeptEx).then((response) => {
// 处理deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
}
},
//格式化部门的下拉框
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
};
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="订单编号" prop="name">
<el-select
v-model="queryParams.SearchType1"
clearable
style="width: 100px"
>
<el-option
v-for="dict in SearchType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
style="width: 200px"
v-model="queryParams.orderNo"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="提单号" prop="tidanNo">
<el-select
v-model="queryParams.SearchType2"
clearable
style="width: 100px"
>
<el-option
v-for="dict in SearchType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
style="width: 200px"
v-model="queryParams.tidanNo"
placeholder="请输入提单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发货人编号">
<el-select
v-model="queryParams.SearchType3"
clearable
style="width: 100px"
>
<el-option
v-for="dict in SearchType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
style="width: 200px"
v-model="queryParams.fhNumber"
placeholder="请输入发货人编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="收货人编号" prop="delFlag">
<el-select
v-model="queryParams.SearchType4"
clearable
style="width: 100px"
>
<el-option
v-for="dict in SearchType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input
style="width: 200px"
v-model="queryParams.fhNumber"
placeholder="请输入收货人编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="唛头" prop="remark">
<el-input
v-model="queryParams.remark"
placeholder="请输入唛头"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="客户经理" prop="salesmanId">
<user-selector
manage
v-model="queryParams.salesmanId"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理') }"
/>
</el-form-item>
<el-form-item label="部门" prop="remark">
<treeselect
v-model="queryParams.deptid"
:options="deptOptions"
:show-count="true"
:placeholder="$t('请选择部门')"
:normalizer="normalizer"
/>
</el-form-item>
<el-form-item :label="$t('订单状态')" prop="status">
<dict-selector
:type="DICT_TYPE.ORDER_STATUS"
v-model="queryParams.status"
@keyup.enter.native="handleQuery"
clearable
/>
</el-form-item>
<el-form-item :label="$t('运输方式')" prop="transportId">
<dict-selector
:type="DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model.number="queryParams.transportId"
clearable
@change="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select
v-model="queryParams.startWarehouseId"
:placeholder="$t('请选择始发仓')"
clearable
@change="handleQuery"
>
<el-option
v-for="item in exportWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="目的国" prop="muDiGuo">
<el-select
clearable
v-model="queryParams.muDiGuo"
:placeholder="$t('请选择国家')"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item label="目的城市" prop="muDiShi">
<el-input
v-model="queryParams.muDiShi"
placeholder="选择目的城市"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select
v-model="queryParams.destWarehouseId"
:placeholder="$t('请选择目的仓')"
clearable
@change="handleQuery"
>
<el-option
v-for="item in importWarehouseList"
:label="$l(item, 'title')"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货')" prop="isCargoControl">
<dict-selector
v-model="queryParams.isCargoControl"
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
fomatter="bool"
clearable
/>
</el-form-item>
<el-form-item label="重泡类型" prop="remark">
<el-select v-model="queryParams.zpType" clearable>
<el-option label="重货" value="2"></el-option>
<el-option label="泡货" value="3"></el-option>
<el-option label="普货" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="付款方" prop="remark">
<el-select v-model="queryParams.drawee" clearable>
<el-option label="发货方" value="1"></el-option>
<el-option label="收货方" value="2"></el-option>
<el-option label="自定义" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="渠道" prop="remark">
<el-select v-model="queryParams.shippingChannelId" clearable>
<el-option
v-for="item in channelList"
:key="item.id"
:label="$l(item, 'name')"
:value="item.channelId"
/>
</el-select>
</el-form-item>
<el-form-item label="资源类型" prop="ResourceType">
<el-select v-model="queryParams.ResourceType" clearable>
<el-option label="开发客户" value="1"></el-option>
<el-option label="公司客户" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="业绩类型" prop="YeJiType">
<el-select v-model="queryParams.YeJiType" clearable>
<el-option label="新客户" value="1"></el-option>
<el-option label="老客户" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="数据筛选" prop="remark">
<el-select v-model="queryParams.dataSearch1" clearable style="width: 150px">
<el-option label="入仓箱数" value="1"></el-option>
<el-option label="入仓体积" value="2"></el-option>
<el-option label="入仓重量" value="3"></el-option>
<el-option label="重/泡标准" value="3"></el-option>
<el-option label="提货率" value="4"></el-option>
</el-select>
<el-select v-model="queryParams.dataSearch2" clearable style="width: 150px">
<el-option label="大于等于" value="1"></el-option>
<el-option label="等于" value="2"></el-option>
<el-option label="小于等于" value="3"></el-option>
</el-select>
<el-input style="width: 100px"
v-model="queryParams.dataSearch3"
placeholder="请输入数值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="时间筛选" prop="dateSearch">
<el-select v-model="queryParams.dateSearch1" clearable>
<el-option label="订单创建时间" value="1"></el-option>
<el-option label="业绩创建时间" value="2"></el-option>
<el-option label="首次入仓时间" value="3"></el-option>
</el-select>
<el-date-picker
v-model="queryParams.sdate1"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输入起始日期"
/>
<el-date-picker
v-model="queryParams.edate1"
type="date"
value-format="yyyy-MM-dd"
clearable
placeholder="请输截止日期"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-show="objEcwReportPermission.exportdataq == 1"
>导出</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">总箱数 总方数 总重量 总V值</div>
</el-col>
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">新客户 总箱数 总方数 总重量 总V值</div>
</el-col>
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">旧客户 总箱数 总方数 总重量 总V值</div>
</el-col>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="排名" align="center" prop="px" />
<el-table-column label="订单编号" align="center" prop="orderNo">
<template slot-scope="scope">
<router-link
:to="{
path: '/order/detail',
query: { orderId: scope.row.orderId },
}"
class="link-type"
>
<span>{{ scope.row.orderNo }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="提单号" align="center" prop="tidanNo">
<template slot-scope="scope">
<router-link
:to="{
path: '/order/detail',
query: { orderId: scope.row.orderId },
}"
class="link-type"
>
<span>{{ scope.row.tidanNo }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="发货人编号" align="center" prop="fhNumber">
<template slot-scope="{ row }">
<el-link
type="primary"
@click.native="$router.push('/customer/query/' + row.cfCustomerId)"
>{{ row.fhNumber }}</el-link
>
</template>
</el-table-column>
<el-table-column label="收货人编号" align="center" prop="shNumber">
<template slot-scope="{ row }">
<el-link
type="primary"
@click.native="$router.push('/customer/query/' + row.shCustomerId)"
>{{ row.shNumber }}</el-link
>
</template>
</el-table-column>
<el-table-column label="客户经理" align="center" prop="salesmanidName">
</el-table-column>
<el-table-column label="订单状态" align="center" prop="statusName" />
<el-table-column label="运输方式" align="center" prop="transportIdName" />
<el-table-column
label="始发仓"
align="center"
prop="startwarehousename"
/>
<el-table-column label="目的国" align="center" prop="muDiGuo" />
<el-table-column label="目的城市" align="center" prop="muDiShi" />
<el-table-column label="目的仓" align="center" prop="dstwarehousename" />
<el-table-column label="渠道" align="center" prop="channelidName" />
<el-table-column label="创建时间" align="center" prop="createtime" />
<el-table-column
label="业绩创建时间"
align="center"
prop="businesstime"
/>
<el-table-column
label="资源类型"
align="center"
prop="showResourceType"
/>
<el-table-column label="业绩类型" align="center" prop="showYeJiType" />
<el-table-column label="唛头" align="center" prop="marks" />
<el-table-column label="入仓箱数" align="center" prop="sumquantity" />
<el-table-column label="体积" align="center" prop="sumvolume" />
<el-table-column label="重量" align="center" prop="sumweight" />
<el-table-column label="控货" align="center" prop="iscargocontrol" />
<el-table-column label="重货/泡货" align="center" prop="ordertypeShow" />
<el-table-column label="重货/泡货标准" align="center" prop="zpUnitShow" />
<el-table-column label="付款方" align="center" prop="draweeName" />
<el-table-column label="首次入仓时间" align="center" prop="firstInTime" />
<el-table-column label="提货率" align="center" prop="showThl">
</el-table-column>
<el-table-column label="入仓记录" align="center" prop="orderId">
<template slot-scope="{ row }">
<el-link type="primary" @click.native="showWarehouseLogs(row, 1)">
入仓记录
</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<WarehouseDetail
:orderId="showWarehouseInItemId"
:type="type"
v-if="showWarehouseInItemId"
@close="showWarehouseInItemId = null"
></WarehouseDetail>
</div>
</template>
<script>
import UserSelector from "@/components/UserSelector";
import { getCountryListAll } from "@/api/ecw/country";
import Treeselect from "@riophae/vue-treeselect";
import "@/assets/styles/vue-treeselect.css";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getListPage, exportExcel } from "@/api/report/salesanalysis";
import { getCurUserPermission } from "@/api/report/EcwReportPermission";
import { getAllChannelList, getChannelList } from "@/api/ecw/channel";
import { listSimpleDepts } from "@/api/system/dept";
//入仓记录页面
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
//2024-04-27
export default {
name: "ReportSales_analysisIndex",
components: {
UserSelector,
Treeselect,
WarehouseDetail,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 测试列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
deptOptions: undefined,
dateRangeCreateTime: [],
SearchType: [
{ value: "in", label: "包含" },
{ value: "notin", label: "不包含" },
{ value: "eq", label: "等于" },
{ value: "noeq", label: "不等于" },
],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
SearchType3: undefined,
fhNumber: undefined, //发货客户编号
SearchType3: undefined,
shNumber: undefined, //收货客户编号
startWarehouseId: undefined, //始发仓
muDiGuo: undefined, //目的国
muDiShi: undefined, //目的城市
dstwarehousename: undefined, //目的仓
transportId: undefined, //运输方式
SearchType1: undefined, //订单编号查询类型
orderNo: undefined, //订单编号
SearchType2: undefined, //提单号的查询类别
tidanNo: undefined, //提单号
marks: undefined, //唛头
status: undefined, //订单状态
salesmanId: undefined, //客户经理
isCargoControl: undefined, //是否控货
deptid: undefined, //部门
drawee: undefined, //付款方
zpType: undefined, //货物类型,1普货,2重货,3泡货
YeJiType: undefined, //业绩类型 新客户,老客户
dateSearch1: undefined, //时间筛选类型
sdate1: undefined, //开始时间
edate2: undefined, //结束时间
dataSearch1:undefined,//数据类型筛选
dataSearch2:undefined,//比较符号设置
dataSearch3:undefined,//数据值
},
channelList: [],
countryList: [],
// 表单参数
form: {},
// 表单校验
rules: {},
warehouseList: [],
//报表权限信息
objEcwReportPermission: {},
DeptEx: { id: undefined, name: undefined, parentId: undefined },
showWarehouseInItemId: undefined,
type: 1,
};
},
created() {
//获取国家列表
getCountryListAll().then((r) => {
this.countryList = r.data;
});
getAllChannelList().then((res) => (this.channelList = res.data));
getWarehouseList().then((res) => (this.warehouseList = res.data));
this.loading = false;
//获取当前用户报表权限
getCurUserPermission().then((response) => {
//复制对象
Object.assign(this.objEcwReportPermission, response.data);
if (this.objEcwReportPermission.permissionFw == 1) {
//只能看自己的,不能选择部门和客户经理
// this.showCustomsManage = false;
// this.showDept = false;
}
this.getTreeselect();
this.getList();
});
},
computed: {
exportWarehouseList() {
//始发仓列表
return this.warehouseList.filter(
(item) => item.tradeType == 2 || item.tradeType == 3
);
},
importWarehouseList() {
//目的仓列表
return this.warehouseList.filter(
(item) => item.tradeType == 1 || item.tradeType == 3
);
},
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
// 执行查询
getListPage(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
name: undefined,
empGender: undefined,
age: undefined,
email: undefined,
};
this.resetForm("form");
},
isChinese() {
//基础函数,判断系统显示语言是中文还是英文
return this.$i18n.locale === "zh_CN";
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
// 执行导出
this.$modal
.confirm("是否确认导出所选数据?")
.then(() => {
this.exportLoading = true;
return exportExcel(params);
})
.then((response) => {
this.$download.excel(response, "销售分析数据报表.xls");
this.exportLoading = false;
})
.catch(() => {});
},
// 显示入仓记录
showWarehouseLogs(row, type) {
debugger;
this.type = type;
this.showWarehouseInItemId = row.orderId;
},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
if (this.objEcwReportPermission.permissionFw == 3) {
listSimpleDepts().then((response) => {
// 处理 deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.DeptEx.id = this.objEcwReportPermission.deptId;
getDeptChild(this.DeptEx).then((response) => {
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
}
},
normalizer(node) {
//格式化部门的下拉框
return {
id: node.id,
label: node.name,
children: node.children,
};
},
},
};
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 32px 32px 0;
margin-bottom: 32px;
margin-left: 32px;
}
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
/* .my-process-designer {
height: calc(100vh - 200px);
} */
.box-card {
width: 100%;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="选择日期" prop="testName">
<el-date-picker
v-model="queryParams.sDate"
type="month"
value-format="yyyy-MM"
clearable
placeholder="请输起始月"
/>
<el-date-picker
v-model="queryParams.eDate"
type="month"
value-format="yyyy-MM"
clearable
placeholder="请输截止月"
/>
</el-form-item>
<el-form-item label="同比年份" prop="duibiYear">
<el-date-picker
v-model="queryParams.duibiYear"
type="year"
value-format="yyyy"
placeholder="请选择同比年份"
/>
</el-form-item>
<el-form-item label="部门" prop="deptid">
<treeselect
v-model="queryParams.deptid"
:options="deptOptions"
:show-count="true"
:placeholder="$t('请选择部门')"
:normalizer="normalizer"
/>
</el-form-item>
<el-form-item label="客户经理" prop="salesmanid">
<user-selector
manage
v-model="queryParams.salesmanid"
clearable
@change="handleQuery"
:prepend="{ id: 0, nickname: $t('未分配客户经理') }"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="
checkPermi(['member:user'])
? $router.push('/member/member-user')
: $alert($t('暂无权限'))
"
>
<div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t("业绩总览") }}
</div>
<count-to
:start-val="0"
:end-val="100"
:duration="2600"
class="card-panel-num"
/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="
$router.push('/system/internalMessage/my-internal-message?status=0')
"
>
<div class="card-panel-icon-wrapper icon-message">
<svg-icon icon-class="message" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t("海运拼柜") }}
</div>
<count-to
:start-val="0"
:end-val="200"
:duration="3000"
class="card-panel-num"
/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/task/todo')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon icon-class="date" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t("专线空运") }}
</div>
<count-to
:start-val="0"
:end-val="500"
:duration="3200"
class="card-panel-num"
/>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="$router.push('/order/mine')">
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t("成交总览") }}
</div>
<count-to
:start-val="0"
:end-val="700"
:duration="3600"
class="card-panel-num"
/>
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div
class="card-panel"
@click="$router.push('/member/member/under-review')"
>
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="time-range" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
{{ $t("首次成交") }}
</div>
<count-to
:start-val="0"
:end-val="100"
:duration="3600"
class="card-panel-num"
/>
</div>
</div>
</el-col>
</el-row>
<div
ref="mainBar"
:class="className"
:style="{ height: height, width: width }"
/>
</div>
</template>
<script>
import UserSelector from "@/components/UserSelector";
import Treeselect from "@riophae/vue-treeselect";
//自定义目录数样式
import "@/assets/styles/vue-treeselect.css";
import { listSimpleDepts } from "@/api/system/dept";
//报表权限接口
import { getCurUserPermission } from "@/api/report/EcwReportPermission";
import {
SalesReportCount,
FirstCustomerCount,
getEChartData,
} from "@/api/report/salesreport";
import * as echarts from "echarts";
require("echarts/theme/macarons");
import resize from "../../dashboard/mixins/resize";
import SalesPanelGroup from "../../dashboard/SalesPanelGroup";
//2024-04-27
export default {
name: "ReportSalesreportIndex",
components: {
SalesPanelGroup,
UserSelector,
Treeselect,
},
mixins: [resize],
props: {
className: {
type: String,
default: "chart",
},
width: {
type: String,
default: "100%",
},
height: {
type: String,
default: "500px",
},
autoResize: {
type: Boolean,
default: true,
},
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
showCustomsManage: true,
showDept: true,
chart: null,
allsumvolume: undefined,
sumvolume1: undefined,
sumweight3: undefined,
sumCustomerCount: undefined, //成交客户总数
fisCustomerCount: undefined, //首次成交客户户数
dateRangeCreateTime: [],
queryParams: {
salesmanid: undefined, //销售经理
deptid: undefined, //部门
sDate: undefined, //开始日期
eDate: undefined, //结束日期
duibiYear: undefined, //对比年份
},
deptOptions: [],
deptData: [],
//报表权限信息
objEcwReportPermission: {},
};
},
watch: {},
mounted() {},
created() {
//获取当前用户报表权限
getCurUserPermission().then((response) => {
this.objEcwReportPermission = response.data;
if (this.objEcwReportPermission.permissionFw == 1) {
//本人权限
this.showCustomsManage = false;
this.showDept = false;
this.queryParams.salesmanid = this.objEcwReportPermission.userId;
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.showCustomsManage = true;
this.showDept = true;
this.queryParams.deptid = parseInt(this.objEcwReportPermission.deptId);
} else if (this.objEcwReportPermission.permissionFw == 3) {
//全公司权限
this.showCustomsManage = true;
this.showDept = true;
}
this.getTreeselect();
//this.getSalesReportCount();
// this.getFirstCustomerCount();
//获取权限后再初始化统计图表
this.initChart();
});
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
getDept() {
listSimpleDepts().then((response) => {
//this.deptData.add
});
},
getSalesReportCount() {
//获取运输方式统计数 lanbm 2024-04-01 add
SalesReportCount(this.queryParams).then((response) => {
//业绩总览
this.allsumvolume = response.data.allsumvolume;
//海运拼柜
this.sumvolume1 = response.data.sumvolume1;
//专线空运
this.sumweight3 = response.data.sumweight3;
});
},
getFirstCustomerCount() {
//获取首次成交客户数 lanbm 2024-04-01 add
FirstCustomerCount(this.queryParams).then((response) => {
//首次成交客户数
this.fisCustomerCount = response.data;
});
},
initChart() {
var chartDom = this.$refs["mainBar"];
this.chart = echarts.init(chartDom, "macarons");
this.setOptions();
},
setOptions() {
this.loading = true;
getEChartData(this.queryParams).then((response) => {
this.chart.setOption({
title: {
text: "月度业绩分布",
},
legend: {},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.5],
},
yAxis: response.data.objyAxis,
series: response.data.obSseries,
});
});
},
handleQuery() {},
getList() {},
resetQuery() {
this.queryParams = {
salesmanid: undefined, //销售经理
deptid: undefined, //部门
sDate: undefined, //开始日期
eDate: undefined, //结束日期
duibiYear: undefined, //对比年份
};
},
handleAdd() {},
handleExport() {},
/** 查询部门下拉树结构 + 岗位下拉 */
getTreeselect() {
if (this.objEcwReportPermission.permissionFw == 3) {
listSimpleDepts().then((response) => {
// 处理deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
} else if (this.objEcwReportPermission.permissionFw == 2) {
this.DeptEx.id = this.objEcwReportPermission.deptId;
getDeptChild(this.DeptEx).then((response) => {
// 处理deptOptions 参数
this.deptOptions = [];
this.deptOptions.push(...this.handleTree(response.data, "id"));
});
}
},
//格式化部门的下拉框
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
};
},
},
};
</script>
<style lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
display: flex;
justify-content: space-between;
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3;
}
}
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3;
}
.card-panel-icon-wrapper {
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
font-size: 48px;
}
.card-panel-description {
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width: 550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="运输方式" prop="titleZh">
<el-select v-model="queryParams.titleZh" 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="基础单位" prop="fuhao">
<el-input
v-model="queryParams.fuhao"
placeholder="请输入基础单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item v-show="false">
<Treeselect v-model="id" :options="listTree"> </Treeselect>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['report:vz:create']"
>
{{ $t("新增") }}</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
v-show="false"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['my:test:export']"
>
{{ $t("导出") }}</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="运输方式" align="center" prop="titleZh" />
<el-table-column label="基础单位" align="center" prop="fuhao" />
<el-table-column label="V值" align="center" prop="vz" width="100">
</el-table-column>
<el-table-column label="修改日期" align="center" prop="updateTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['report:vz:update']"
>
{{ $t("修改") }}</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['report:vz:delete']"
>
{{ $t("删除") }}</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@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="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-input v-model="form.vz" placeholder="" style="width: 100px" />
<el-input
v-model="form.fuhao"
style="width: 100px"
placeholder="基础单位"
readonly="true"
/>
</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>
</template>
<script>
import {
create,
update,
del,
getModel,
getPageList,
exportExcel,
} from "@/api/report/vz";
import Treeselect from "@riophae/vue-treeselect";
import "@/assets/styles/vue-treeselect.css";
import { MessageBox } from "element-ui";
//2024-04-27
export default {
name: "vz",
components: {
Treeselect,
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 测试列表
list: [],
// 弹出层标题
title: "",
//是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
titleZh: null, //运输方式
fuhao: null, //基础单位
},
// 表单参数
form: {},
// 表单校验
rules: {
vz: [
{
required: true,
message: this.$t("V值不能为空"),
trigger: "blur",
},
],
},
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() {
this.getList();
},
methods: {
handleSelectChange(sValue) {
if (sValue == "海运拼柜") {
this.form.fuhao = "M3";
} else if (sValue == "专线空运") {
this.form.fuhao = "KG";
}
},
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = { ...this.queryParams };
// 执行查询
getPageList(params).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
titleZh: undefined, //运输方式
fuhao: undefined, //基础单位
vz: undefined, //v值
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加V值";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getModel(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改V值";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
update(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
create(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm("是否确认删除选中数据项?")
.then(function () {
return del(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
// 执行导出
this.$modal
.confirm("是否确认导出所有测试数据项?")
.then(() => {
this.exportLoading = true;
return exportExcel(params);
})
.then((response) => {
this.$download.excel(response, "${table.classComment}.xls");
this.exportLoading = false;
})
.catch(() => {});
},
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children,
};
},
},
};
</script>
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