✨ MK公开页、预结算体验优化、地图选址与认证密码规则完善
This commit is contained in:
@@ -48,6 +48,15 @@ export const syncIamOrganizations = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const clearNonTopDept = signal => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/dept/clear-non-top',
|
||||||
|
method: 'post',
|
||||||
|
timeout: 60000,
|
||||||
|
signal,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const syncOaCompany = (current = 1, size = 20, signal) => {
|
export const syncOaCompany = (current = 1, size = 20, signal) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/blade-system/dept/sync-oa-company',
|
url: '/blade-system/dept/sync-oa-company',
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
longitude: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
latitude: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'confirm'],
|
emits: ['update:modelValue', 'confirm'],
|
||||||
data() {
|
data() {
|
||||||
@@ -66,9 +74,11 @@ export default {
|
|||||||
this.visible = value;
|
this.visible = value;
|
||||||
if (value) {
|
if (value) {
|
||||||
this.keyword = this.address || '';
|
this.keyword = this.address || '';
|
||||||
this.selected = {};
|
|
||||||
this.status = '可搜索地址或点击地图选点';
|
|
||||||
this.searchResults = [];
|
this.searchResults = [];
|
||||||
|
this.selected = this.buildInitialSelection();
|
||||||
|
this.status = this.selected.longitude
|
||||||
|
? this.selected.address || '已选点,可确认回填'
|
||||||
|
: '可搜索地址或点击地图选点';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -82,6 +92,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
buildInitialSelection() {
|
||||||
|
const longitude = Number(this.longitude);
|
||||||
|
const latitude = Number(this.latitude);
|
||||||
|
if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
address: this.address || '',
|
||||||
|
};
|
||||||
|
},
|
||||||
loadAmap() {
|
loadAmap() {
|
||||||
if (window.AMap && window.AMap.Map) {
|
if (window.AMap && window.AMap.Map) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
@@ -110,15 +132,27 @@ export default {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.$refs.map) return resolve(null);
|
if (!this.$refs.map) return resolve(null);
|
||||||
|
const initial = this.buildInitialSelection();
|
||||||
|
const center =
|
||||||
|
Number.isFinite(initial.longitude) && Number.isFinite(initial.latitude)
|
||||||
|
? [initial.longitude, initial.latitude]
|
||||||
|
: [116.40769, 39.89945];
|
||||||
if (!this.amap) {
|
if (!this.amap) {
|
||||||
this.amap = new window.AMap.Map(this.$refs.map, {
|
this.amap = new window.AMap.Map(this.$refs.map, {
|
||||||
center: [116.40769, 39.89945],
|
center,
|
||||||
zoom: 11,
|
zoom: initial.longitude ? 14 : 11,
|
||||||
});
|
});
|
||||||
this.amap.on('click', event => this.pickPoint(event.lnglat));
|
this.amap.on('click', event => this.pickPoint(event.lnglat));
|
||||||
} else {
|
} else {
|
||||||
this.amap.resize();
|
this.amap.resize();
|
||||||
this.clearMarker();
|
this.clearMarker();
|
||||||
|
this.amap.setZoomAndCenter(initial.longitude ? 14 : 11, center);
|
||||||
|
}
|
||||||
|
if (initial.longitude) {
|
||||||
|
const point = new window.AMap.LngLat(initial.longitude, initial.latitude);
|
||||||
|
this.renderMarker(point);
|
||||||
|
this.selected = { ...initial };
|
||||||
|
this.status = initial.address || '已选点,可确认回填';
|
||||||
}
|
}
|
||||||
resolve(this.amap);
|
resolve(this.amap);
|
||||||
});
|
});
|
||||||
@@ -254,11 +288,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
|
if (!this.selected.longitude || !this.selected.latitude) {
|
||||||
|
this.$message.warning('请先搜索或点击地图完成选点');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this.selected.address) {
|
if (!this.selected.address) {
|
||||||
this.$message.warning('请等待地址解析完成后再确认');
|
this.$message.warning('请等待地址解析完成后再确认');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('confirm', this.selected.address);
|
this.$emit('confirm', {
|
||||||
|
address: this.selected.address,
|
||||||
|
longitude: this.selected.longitude,
|
||||||
|
latitude: this.selected.latitude,
|
||||||
|
});
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const createOption = () => ({
|
|||||||
label: '计量单位编码',
|
label: '计量单位编码',
|
||||||
prop: 'unitCode',
|
prop: 'unitCode',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
|
span: 24,
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 4,
|
searchOrder: 4,
|
||||||
searchSpan: 6,
|
searchSpan: 6,
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ export const option = {
|
|||||||
},
|
},
|
||||||
...auditColumns.map(column => ({ ...column, hide: true })),
|
...auditColumns.map(column => ({ ...column, hide: true })),
|
||||||
])),
|
])),
|
||||||
dialogWidth: '96%',
|
dialogWidth: '1100px',
|
||||||
menuFixed: 'right',
|
menuFixed: 'right',
|
||||||
menuWidth: 320,
|
menuWidth: 320,
|
||||||
index: false,
|
index: false,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const GRANT_TYPE_DIC = [
|
|||||||
{ label: '社交登录', value: 'social' },
|
{ label: '社交登录', value: 'social' },
|
||||||
{ label: '客户端凭证', value: 'client_credentials' },
|
{ label: '客户端凭证', value: 'client_credentials' },
|
||||||
{ label: '刷新令牌', value: 'refresh_token' },
|
{ label: '刷新令牌', value: 'refresh_token' },
|
||||||
|
{ label: '退出登录', value: 'logout' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const authLogOption = {
|
export const authLogOption = {
|
||||||
@@ -38,7 +39,7 @@ export const authLogOption = {
|
|||||||
prop: 'realName',
|
prop: 'realName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '授权类型',
|
label: '操作类型',
|
||||||
prop: 'grantType',
|
prop: 'grantType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
@@ -80,7 +81,7 @@ export const authLogOption = {
|
|||||||
width: 120,
|
width: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '登录时间',
|
label: '操作时间',
|
||||||
prop: 'loginTime',
|
prop: 'loginTime',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
span: 24,
|
span: 24,
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { getDeptLazyTree } from '@/api/system/dept';
|
import { getDeptLazyTree } from '@/api/system/dept';
|
||||||
|
import { validateLoginPassword } from '@/utils/validate';
|
||||||
|
|
||||||
export const userOption = safe => {
|
export const userOption = safe => {
|
||||||
const validatePass = (rule, value, callback) => {
|
const validatePass = (rule, value, callback) => {
|
||||||
if (value === '') {
|
validateLoginPassword(rule, value, callback);
|
||||||
callback(new Error('请输入密码'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const validatePass2 = (rule, value, callback) => {
|
const validatePass2 = (rule, value, callback) => {
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
-->
|
-->
|
||||||
<userLogin v-if="activeName === 'user'"></userLogin>
|
<userLogin v-if="activeName === 'user'"></userLogin>
|
||||||
<registerLogin v-else-if="activeName === 'register'"></registerLogin>
|
<registerLogin v-else-if="activeName === 'register'"></registerLogin>
|
||||||
|
<!-- 暂时默认账号密码登录,IAM 选择入口先隐藏
|
||||||
<div v-else class="iam-login">
|
<div v-else class="iam-login">
|
||||||
<el-button type="primary" class="login-submit" @click.prevent="handleIamLogin">
|
<el-button type="primary" class="login-submit" @click.prevent="handleIamLogin">
|
||||||
IAM统一身份认证
|
IAM统一身份认证
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
账号密码登录
|
账号密码登录
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,7 +63,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
website: website,
|
website: website,
|
||||||
time: '',
|
time: '',
|
||||||
activeName: 'iam',
|
activeName: 'user',
|
||||||
socialForm: {
|
socialForm: {
|
||||||
tenantId: '000000',
|
tenantId: '000000',
|
||||||
source: '',
|
source: '',
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/business/project-apply/public-view',
|
path: '/business/project-apply/public-view',
|
||||||
name: '查看项目信息',
|
name: '查看项目信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/business/project-apply-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
@@ -98,7 +98,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/business/contract-manage/public-view',
|
path: '/business/contract-manage/public-view',
|
||||||
name: '查看合同信息',
|
name: '查看合同信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/business/contract-manage-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
@@ -109,7 +109,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/business/waybill-manage/public-view',
|
path: '/business/waybill-manage/public-view',
|
||||||
name: '查看运单信息',
|
name: '查看运单信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/business/waybill-manage-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
@@ -120,7 +120,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/settlement/pre-settlement/public-view',
|
path: '/settlement/pre-settlement/public-view',
|
||||||
name: '查看预结算信息',
|
name: '查看预结算信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/settlement/pre-settlement-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
@@ -131,7 +131,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/settlement/formal-settlement/public-view',
|
path: '/settlement/formal-settlement/public-view',
|
||||||
name: '查看正式结算信息',
|
name: '查看正式结算信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/settlement/formal-settlement-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
@@ -142,7 +142,7 @@ export default [
|
|||||||
{
|
{
|
||||||
path: '/payment/payment-application/public-view',
|
path: '/payment/payment-application/public-view',
|
||||||
name: '查看付款申请信息',
|
name: '查看付款申请信息',
|
||||||
component: () => import('@/views/mk/public-biz-view.vue'),
|
component: () => import('@/views/payment/payment-application-public-view.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
isTab: false,
|
isTab: false,
|
||||||
|
|||||||
@@ -40,10 +40,22 @@ export const MK_BIZ = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function resolveMkTemplateCode(dictName) {
|
const MK_SWITCH_NAME = '开启MK';
|
||||||
|
|
||||||
|
async function loadMkTemplateList() {
|
||||||
const res = await getDictionary({ code: 'mk_template' });
|
const res = await getDictionary({ code: 'mk_template' });
|
||||||
const list = res?.data?.data || [];
|
return res?.data?.data || [];
|
||||||
const matched = list.find(item => String(item.dictValue || '').trim() === dictName);
|
}
|
||||||
|
|
||||||
|
/** 业务字典 mk_template:名称「开启MK」且键值为 1 时才请求 MK */
|
||||||
|
export function isMkEnabled(list = []) {
|
||||||
|
const matched = list.find(item => String(item.dictValue || '').trim() === MK_SWITCH_NAME);
|
||||||
|
return String(matched?.dictKey ?? '').trim() === '1';
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function resolveMkTemplateCode(dictName, list) {
|
||||||
|
const dictList = list || (await loadMkTemplateList());
|
||||||
|
const matched = dictList.find(item => String(item.dictValue || '').trim() === dictName);
|
||||||
const templateCode = matched?.dictKey;
|
const templateCode = matched?.dictKey;
|
||||||
if (!templateCode) {
|
if (!templateCode) {
|
||||||
ElMessage.warning(`未配置业务字典 mk_template「${dictName}」,无法提交审核流`);
|
ElMessage.warning(`未配置业务字典 mk_template「${dictName}」,无法提交审核流`);
|
||||||
@@ -62,10 +74,14 @@ export async function submitMkApprovalFlow({
|
|||||||
if (!conf) {
|
if (!conf) {
|
||||||
return Promise.reject(new Error(`不支持的MK业务类型:${bizType}`));
|
return Promise.reject(new Error(`不支持的MK业务类型:${bizType}`));
|
||||||
}
|
}
|
||||||
|
const list = await loadMkTemplateList();
|
||||||
|
if (!isMkEnabled(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((conf.rejected || []).includes(approvalStatus)) {
|
if ((conf.rejected || []).includes(approvalStatus)) {
|
||||||
await processDelete({ formInstanceId: String(formInstanceId) });
|
await processDelete({ formInstanceId: String(formInstanceId) });
|
||||||
}
|
}
|
||||||
const templateCode = await resolveMkTemplateCode(conf.dictName);
|
const templateCode = await resolveMkTemplateCode(conf.dictName, list);
|
||||||
const subject = subjectName
|
const subject = subjectName
|
||||||
? `${conf.subjectPrefix}:${subjectName}`
|
? `${conf.subjectPrefix}:${subjectName}`
|
||||||
: `${conf.subjectPrefix}:${formInstanceId}`;
|
: `${conf.subjectPrefix}:${formInstanceId}`;
|
||||||
|
|||||||
@@ -283,3 +283,31 @@ export function validatejson(val) {
|
|||||||
// 非对象、非数组、非字符串,或者字符串不是 JSON
|
// 非对象、非数组、非字符串,或者字符串不是 JSON
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 登录密码规则提示 */
|
||||||
|
export const LOGIN_PASSWORD_RULE_MESSAGE =
|
||||||
|
'密码须大于8位,且同时包含字母、数字和特殊字符(.!@#$%^&*)';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验登录密码强度:大于8位,同时包含字母、数字、特殊字符(.!@#$%^&*)
|
||||||
|
* @param {string} password
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export function isValidLoginPassword(password) {
|
||||||
|
return /^(?=.*[A-Za-z])(?=.*\d)(?=.*[.!@#$%^&*]).{9,}$/.test(String(password || ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Element Plus / Avue 表单校验器:登录密码强度
|
||||||
|
*/
|
||||||
|
export function validateLoginPassword(rule, value, callback) {
|
||||||
|
if (value === undefined || value === null || String(value).trim() === '') {
|
||||||
|
callback(new Error('请输入登录密码'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isValidLoginPassword(value)) {
|
||||||
|
callback(new Error(LOGIN_PASSWORD_RULE_MESSAGE));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|||||||
@@ -94,6 +94,17 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
<template #detailAddress-form>
|
||||||
|
<el-input
|
||||||
|
v-model="form.detailAddress"
|
||||||
|
class="detail-address-input"
|
||||||
|
readonly
|
||||||
|
maxlength="255"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="点击选择地图地址"
|
||||||
|
@click="openAddressMapPicker"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #longitude-form>
|
<template #longitude-form>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.longitude"
|
v-model="form.longitude"
|
||||||
@@ -121,6 +132,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</avue-form>
|
</avue-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<address-map-picker
|
||||||
|
v-model="addressMapPickerVisible"
|
||||||
|
:address="form.detailAddress"
|
||||||
|
:longitude="form.longitude"
|
||||||
|
:latitude="form.latitude"
|
||||||
|
@confirm="handleAddressMapConfirm"
|
||||||
|
/>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -134,6 +152,7 @@ import { openImportDialog } from '@/utils/import-excel';
|
|||||||
import { formatUpdateUserName } from '@/utils/audit';
|
import { formatUpdateUserName } from '@/utils/audit';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
||||||
|
import AddressMapPicker from '@/components/address-map-picker/main.vue';
|
||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
|
|
||||||
@@ -181,6 +200,9 @@ const addExcelRequiredHeaderMarks = async blob => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
AddressMapPicker,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
const validateIataCode = (rule, value, callback) => {
|
const validateIataCode = (rule, value, callback) => {
|
||||||
if (!/^[A-Z]{3}$/.test(String(value || '').toUpperCase())) {
|
if (!/^[A-Z]{3}$/.test(String(value || '').toUpperCase())) {
|
||||||
@@ -220,6 +242,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
data: [],
|
data: [],
|
||||||
excelBox: false,
|
excelBox: false,
|
||||||
|
addressMapPickerVisible: false,
|
||||||
excelForm: {},
|
excelForm: {},
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
cityOptions: [],
|
cityOptions: [],
|
||||||
@@ -368,15 +391,14 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '详细地址',
|
label: '详细地址',
|
||||||
prop: 'detailAddress',
|
prop: 'detailAddress',
|
||||||
type: 'textarea',
|
formslot: true,
|
||||||
minRows: 2,
|
|
||||||
span: 24,
|
span: 24,
|
||||||
minWidth: 220,
|
minWidth: 220,
|
||||||
overHidden: false,
|
overHidden: false,
|
||||||
maxlength: 255,
|
maxlength: 255,
|
||||||
showWordLimit: true,
|
showWordLimit: true,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
{ required: true, message: '请选择详细地址', trigger: 'change' },
|
||||||
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -669,6 +691,29 @@ export default {
|
|||||||
handleCoordinateInput(prop, value) {
|
handleCoordinateInput(prop, value) {
|
||||||
this.form[prop] = normalizeCoordinateInput(value);
|
this.form[prop] = normalizeCoordinateInput(value);
|
||||||
},
|
},
|
||||||
|
openAddressMapPicker() {
|
||||||
|
this.addressMapPickerVisible = true;
|
||||||
|
},
|
||||||
|
handleAddressMapConfirm(payload) {
|
||||||
|
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
|
||||||
|
if (selection.address) {
|
||||||
|
this.form.detailAddress = selection.address;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
selection.longitude !== undefined &&
|
||||||
|
selection.longitude !== null &&
|
||||||
|
selection.longitude !== ''
|
||||||
|
) {
|
||||||
|
this.form.longitude = Number(selection.longitude).toFixed(6);
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
selection.latitude !== undefined &&
|
||||||
|
selection.latitude !== null &&
|
||||||
|
selection.latitude !== ''
|
||||||
|
) {
|
||||||
|
this.form.latitude = Number(selection.latitude).toFixed(6);
|
||||||
|
}
|
||||||
|
},
|
||||||
normalizeRow(row) {
|
normalizeRow(row) {
|
||||||
row.code = row.iataCode ? `JC-${row.iataCode}` : row.code;
|
row.code = row.iataCode ? `JC-${row.iataCode}` : row.code;
|
||||||
row.regionCode = String(row.regionCode || '').trim();
|
row.regionCode = String(row.regionCode || '').trim();
|
||||||
@@ -917,4 +962,13 @@ export default {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-address-input {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
:deep(.el-input__wrapper),
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -194,10 +194,11 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="form.detailAddress"
|
v-model="form.detailAddress"
|
||||||
class="detail-address-input"
|
class="detail-address-input"
|
||||||
clearable
|
readonly
|
||||||
maxlength="255"
|
maxlength="255"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
placeholder="请输入"
|
placeholder="点击选择地图地址"
|
||||||
|
@click="openAddressMapPicker"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #remark-form>
|
<template #remark-form>
|
||||||
@@ -244,6 +245,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</avue-form>
|
</avue-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<address-map-picker
|
||||||
|
v-model="addressMapPickerVisible"
|
||||||
|
:address="form.detailAddress"
|
||||||
|
:longitude="form.longitude"
|
||||||
|
:latitude="form.latitude"
|
||||||
|
@confirm="handleAddressMapConfirm"
|
||||||
|
/>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -264,12 +272,16 @@ import { openImportDialog } from '@/utils/import-excel';
|
|||||||
import { formatUpdateUserName } from '@/utils/audit';
|
import { formatUpdateUserName } from '@/utils/audit';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
||||||
|
import AddressMapPicker from '@/components/address-map-picker/main.vue';
|
||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
|
|
||||||
const DEFAULT_COUNTRY_CODE = '+86';
|
const DEFAULT_COUNTRY_CODE = '+86';
|
||||||
const newLocal = '请选择类型';
|
const newLocal = '请选择类型';
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
AddressMapPicker,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
const validateCode = (rule, value, callback) => {
|
const validateCode = (rule, value, callback) => {
|
||||||
const code = String(value || '').toUpperCase();
|
const code = String(value || '').toUpperCase();
|
||||||
@@ -315,6 +327,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
data: [],
|
data: [],
|
||||||
excelBox: false,
|
excelBox: false,
|
||||||
|
addressMapPickerVisible: false,
|
||||||
excelForm: {},
|
excelForm: {},
|
||||||
portOptions: [],
|
portOptions: [],
|
||||||
countryOptions: [],
|
countryOptions: [],
|
||||||
@@ -572,11 +585,11 @@ export default {
|
|||||||
minWidth: 220,
|
minWidth: 220,
|
||||||
overHidden: false,
|
overHidden: false,
|
||||||
order: 85,
|
order: 85,
|
||||||
placeholder: '请输入',
|
placeholder: '点击选择地图地址',
|
||||||
maxlength: 255,
|
maxlength: 255,
|
||||||
showWordLimit: true,
|
showWordLimit: true,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
{ required: true, message: '请选择详细地址', trigger: 'change' },
|
||||||
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -1040,6 +1053,21 @@ export default {
|
|||||||
handleCoordinateInput(prop, value) {
|
handleCoordinateInput(prop, value) {
|
||||||
this.form[prop] = normalizeCoordinateInput(value);
|
this.form[prop] = normalizeCoordinateInput(value);
|
||||||
},
|
},
|
||||||
|
openAddressMapPicker() {
|
||||||
|
this.addressMapPickerVisible = true;
|
||||||
|
},
|
||||||
|
handleAddressMapConfirm(payload) {
|
||||||
|
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
|
||||||
|
if (selection.address) {
|
||||||
|
this.form.detailAddress = selection.address;
|
||||||
|
}
|
||||||
|
if (selection.longitude !== undefined && selection.longitude !== null && selection.longitude !== '') {
|
||||||
|
this.form.longitude = Number(selection.longitude).toFixed(6);
|
||||||
|
}
|
||||||
|
if (selection.latitude !== undefined && selection.latitude !== null && selection.latitude !== '') {
|
||||||
|
this.form.latitude = Number(selection.latitude).toFixed(6);
|
||||||
|
}
|
||||||
|
},
|
||||||
resolveCountryCode(country) {
|
resolveCountryCode(country) {
|
||||||
if (!country) {
|
if (!country) {
|
||||||
return Promise.resolve('');
|
return Promise.resolve('');
|
||||||
@@ -1107,7 +1135,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isBlank(row.detailAddress)) {
|
if (isBlank(row.detailAddress)) {
|
||||||
this.$message.warning('请输入详细地址');
|
this.$message.warning('请选择详细地址');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isBlank(row.longitude)) {
|
if (isBlank(row.longitude)) {
|
||||||
@@ -1399,6 +1427,15 @@ export default {
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-address-input {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
:deep(.el-input__wrapper),
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -94,6 +94,17 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
<template #detailAddress-form>
|
||||||
|
<el-input
|
||||||
|
v-model="form.detailAddress"
|
||||||
|
class="detail-address-input"
|
||||||
|
readonly
|
||||||
|
maxlength="255"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="点击选择地图地址"
|
||||||
|
@click="openAddressMapPicker"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #longitude-form>
|
<template #longitude-form>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.longitude"
|
v-model="form.longitude"
|
||||||
@@ -121,6 +132,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</avue-form>
|
</avue-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<address-map-picker
|
||||||
|
v-model="addressMapPickerVisible"
|
||||||
|
:address="form.detailAddress"
|
||||||
|
:longitude="form.longitude"
|
||||||
|
:latitude="form.latitude"
|
||||||
|
@confirm="handleAddressMapConfirm"
|
||||||
|
/>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -134,12 +152,16 @@ import { openImportDialog } from '@/utils/import-excel';
|
|||||||
import { formatUpdateUserName } from '@/utils/audit';
|
import { formatUpdateUserName } from '@/utils/audit';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
||||||
|
import AddressMapPicker from '@/components/address-map-picker/main.vue';
|
||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
|
|
||||||
const DEFAULT_COUNTRY_CODE = '+86';
|
const DEFAULT_COUNTRY_CODE = '+86';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
AddressMapPicker,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
const validateTmisCode = (rule, value, callback) => {
|
const validateTmisCode = (rule, value, callback) => {
|
||||||
if (!/^\d{5}$/.test(value || '')) {
|
if (!/^\d{5}$/.test(value || '')) {
|
||||||
@@ -185,6 +207,7 @@ export default {
|
|||||||
loading: true,
|
loading: true,
|
||||||
data: [],
|
data: [],
|
||||||
excelBox: false,
|
excelBox: false,
|
||||||
|
addressMapPickerVisible: false,
|
||||||
excelForm: {},
|
excelForm: {},
|
||||||
provinceOptions: [],
|
provinceOptions: [],
|
||||||
cityOptions: [],
|
cityOptions: [],
|
||||||
@@ -340,15 +363,14 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '详细地址',
|
label: '详细地址',
|
||||||
prop: 'detailAddress',
|
prop: 'detailAddress',
|
||||||
type: 'textarea',
|
formslot: true,
|
||||||
minRows: 2,
|
|
||||||
span: 24,
|
span: 24,
|
||||||
minWidth: 220,
|
minWidth: 220,
|
||||||
overHidden: false,
|
overHidden: false,
|
||||||
maxlength: 255,
|
maxlength: 255,
|
||||||
showWordLimit: true,
|
showWordLimit: true,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
{ required: true, message: '请选择详细地址', trigger: 'change' },
|
||||||
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -652,6 +674,29 @@ export default {
|
|||||||
handleCoordinateInput(prop, value) {
|
handleCoordinateInput(prop, value) {
|
||||||
this.form[prop] = normalizeCoordinateInput(value);
|
this.form[prop] = normalizeCoordinateInput(value);
|
||||||
},
|
},
|
||||||
|
openAddressMapPicker() {
|
||||||
|
this.addressMapPickerVisible = true;
|
||||||
|
},
|
||||||
|
handleAddressMapConfirm(payload) {
|
||||||
|
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
|
||||||
|
if (selection.address) {
|
||||||
|
this.form.detailAddress = selection.address;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
selection.longitude !== undefined &&
|
||||||
|
selection.longitude !== null &&
|
||||||
|
selection.longitude !== ''
|
||||||
|
) {
|
||||||
|
this.form.longitude = Number(selection.longitude).toFixed(6);
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
selection.latitude !== undefined &&
|
||||||
|
selection.latitude !== null &&
|
||||||
|
selection.latitude !== ''
|
||||||
|
) {
|
||||||
|
this.form.latitude = Number(selection.latitude).toFixed(6);
|
||||||
|
}
|
||||||
|
},
|
||||||
normalizeRow(row) {
|
normalizeRow(row) {
|
||||||
row.code = row.tmisCode ? `TL${row.tmisCode}` : row.code;
|
row.code = row.tmisCode ? `TL${row.tmisCode}` : row.code;
|
||||||
row.regionCode = String(row.regionCode || '').trim();
|
row.regionCode = String(row.regionCode || '').trim();
|
||||||
@@ -910,9 +955,16 @@ export default {
|
|||||||
:deep(.el-table td .cell) {
|
:deep(.el-table td .cell) {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-address-input {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
:deep(.el-input__wrapper),
|
||||||
|
:deep(.el-input__inner) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -162,9 +162,9 @@
|
|||||||
v-model="row.billingUnit"
|
v-model="row.billingUnit"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
:disabled="!row.billingElement"
|
:disabled="!canSelectBillingUnit(row)"
|
||||||
:loading="unitLoading"
|
:loading="unitLoading"
|
||||||
:placeholder="row.billingElement ? '请选择' : '请先选择计费要素'"
|
:placeholder="billingUnitPlaceholder(row)"
|
||||||
><el-option
|
><el-option
|
||||||
v-for="item in unitOptionsFor(row)"
|
v-for="item in unitOptionsFor(row)"
|
||||||
:key="item.id || item.value"
|
:key="item.id || item.value"
|
||||||
@@ -381,11 +381,18 @@ import { getDictionary } from '@/api/system/dictbiz';
|
|||||||
import SectionCard from '@/components/section-card/main.vue';
|
import SectionCard from '@/components/section-card/main.vue';
|
||||||
|
|
||||||
const clone = value => JSON.parse(JSON.stringify(value));
|
const clone = value => JSON.parse(JSON.stringify(value));
|
||||||
/** 计费要素与计量单位维度的对应关系 */
|
/** 计费要素与计量单位维度的对应关系(这些要素可选计费单位) */
|
||||||
const BILLING_ELEMENT_DIMENSION_MAP = {
|
const BILLING_ELEMENT_DIMENSION_MAP = {
|
||||||
按重量: '重量',
|
按重量: '重量',
|
||||||
按体积: '体积',
|
按体积: '体积',
|
||||||
按车辆: '数量',
|
按数量: '数量',
|
||||||
|
};
|
||||||
|
const BILLING_UNIT_SELECTABLE_ELEMENTS = Object.keys(BILLING_ELEMENT_DIMENSION_MAP);
|
||||||
|
/** 固定计费单位(不可编辑) */
|
||||||
|
const FIXED_BILLING_UNIT_MAP = {
|
||||||
|
按里程: '公里',
|
||||||
|
'按吨·公里': '吨公里',
|
||||||
|
'固定金额(整单一口价)': '单',
|
||||||
};
|
};
|
||||||
const defaultRule = () => ({
|
const defaultRule = () => ({
|
||||||
feeType: '',
|
feeType: '',
|
||||||
@@ -436,7 +443,6 @@ export default {
|
|||||||
billingElements: [
|
billingElements: [
|
||||||
'按重量',
|
'按重量',
|
||||||
'按体积',
|
'按体积',
|
||||||
'按车辆',
|
|
||||||
'按里程',
|
'按里程',
|
||||||
'按吨·公里',
|
'按吨·公里',
|
||||||
'固定金额(整单一口价)',
|
'固定金额(整单一口价)',
|
||||||
@@ -445,7 +451,6 @@ export default {
|
|||||||
typeMap: {
|
typeMap: {
|
||||||
按重量: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
按重量: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
||||||
按体积: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
按体积: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
||||||
按车辆: ['固定单价'],
|
|
||||||
按里程: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
按里程: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
||||||
'按吨·公里': ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
'按吨·公里': ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
||||||
'固定金额(整单一口价)': ['固定一口价'],
|
'固定金额(整单一口价)': ['固定一口价'],
|
||||||
@@ -560,6 +565,7 @@ export default {
|
|||||||
next.limitRanges = next.limitRanges.map(item => ({ ...item, minimumBillingWeight: '' }));
|
next.limitRanges = next.limitRanges.map(item => ({ ...item, minimumBillingWeight: '' }));
|
||||||
this.syncLegacyLimit(next);
|
this.syncLegacyLimit(next);
|
||||||
next.matchCondition = { ...defaultRule().matchCondition, ...(rule.matchCondition || {}) };
|
next.matchCondition = { ...defaultRule().matchCondition, ...(rule.matchCondition || {}) };
|
||||||
|
this.syncBillingUnit(next);
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
normalizeRanges(row) {
|
normalizeRanges(row) {
|
||||||
@@ -651,7 +657,26 @@ export default {
|
|||||||
measurementDimension(billingElement) {
|
measurementDimension(billingElement) {
|
||||||
return BILLING_ELEMENT_DIMENSION_MAP[billingElement] || '';
|
return BILLING_ELEMENT_DIMENSION_MAP[billingElement] || '';
|
||||||
},
|
},
|
||||||
|
fixedBillingUnit(billingElement) {
|
||||||
|
return FIXED_BILLING_UNIT_MAP[String(billingElement || '').trim()] || '';
|
||||||
|
},
|
||||||
|
canSelectBillingUnit(row) {
|
||||||
|
return BILLING_UNIT_SELECTABLE_ELEMENTS.includes(String(row?.billingElement || '').trim());
|
||||||
|
},
|
||||||
|
billingUnitPlaceholder(row) {
|
||||||
|
if (!row?.billingElement) return '请先选择计费要素';
|
||||||
|
if (this.fixedBillingUnit(row.billingElement)) return this.fixedBillingUnit(row.billingElement);
|
||||||
|
if (!this.canSelectBillingUnit(row)) return '当前计费要素无需选择';
|
||||||
|
return '请选择';
|
||||||
|
},
|
||||||
unitOptionsFor(row) {
|
unitOptionsFor(row) {
|
||||||
|
const fixedUnit = this.fixedBillingUnit(row?.billingElement);
|
||||||
|
if (fixedUnit) {
|
||||||
|
return [{ id: fixedUnit, label: fixedUnit, value: fixedUnit }];
|
||||||
|
}
|
||||||
|
if (!this.canSelectBillingUnit(row)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const dimension = this.measurementDimension(row?.billingElement);
|
const dimension = this.measurementDimension(row?.billingElement);
|
||||||
if (dimension) {
|
if (dimension) {
|
||||||
return this.measurementUnits
|
return this.measurementUnits
|
||||||
@@ -663,15 +688,18 @@ export default {
|
|||||||
}))
|
}))
|
||||||
.filter(item => item.value);
|
.filter(item => item.value);
|
||||||
}
|
}
|
||||||
return (this.unitOptions || [])
|
return [];
|
||||||
.map(item => ({
|
|
||||||
id: item.id || item.dictKey || item.dictValue,
|
|
||||||
label: item.dictValue,
|
|
||||||
value: item.dictValue,
|
|
||||||
}))
|
|
||||||
.filter(item => item.value);
|
|
||||||
},
|
},
|
||||||
syncBillingUnit(row) {
|
syncBillingUnit(row) {
|
||||||
|
const fixedUnit = this.fixedBillingUnit(row?.billingElement);
|
||||||
|
if (fixedUnit) {
|
||||||
|
row.billingUnit = fixedUnit;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.canSelectBillingUnit(row)) {
|
||||||
|
row.billingUnit = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
const options = this.unitOptionsFor(row);
|
const options = this.unitOptionsFor(row);
|
||||||
if (!options.some(item => String(item.value) === String(row.billingUnit || ''))) {
|
if (!options.some(item => String(item.value) === String(row.billingUnit || ''))) {
|
||||||
row.billingUnit = '';
|
row.billingUnit = '';
|
||||||
@@ -892,7 +920,6 @@ export default {
|
|||||||
['taxRate', '税率'],
|
['taxRate', '税率'],
|
||||||
['billingElement', '计费要素'],
|
['billingElement', '计费要素'],
|
||||||
['billingType', '计费类型'],
|
['billingType', '计费类型'],
|
||||||
['billingUnit', '计费单位'],
|
|
||||||
];
|
];
|
||||||
for (const [i, row] of this.draft.rules.entries()) {
|
for (const [i, row] of this.draft.rules.entries()) {
|
||||||
const empty = required.find(
|
const empty = required.find(
|
||||||
@@ -902,6 +929,15 @@ export default {
|
|||||||
this.$message.warning(`第${i + 1}行${empty[1]}不能为空`);
|
this.$message.warning(`第${i + 1}行${empty[1]}不能为空`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
this.canSelectBillingUnit(row) &&
|
||||||
|
(row.billingUnit === undefined ||
|
||||||
|
row.billingUnit === null ||
|
||||||
|
String(row.billingUnit).trim() === '')
|
||||||
|
) {
|
||||||
|
this.$message.warning(`第${i + 1}行计费单位不能为空`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const feeItem = String(row.feeItem).trim();
|
const feeItem = String(row.feeItem).trim();
|
||||||
if (feeItemSet.has(feeItem)) {
|
if (feeItemSet.has(feeItem)) {
|
||||||
this.$message.warning(`费用项“${feeItem}”不能重复`);
|
this.$message.warning(`费用项“${feeItem}”不能重复`);
|
||||||
|
|||||||
@@ -1899,11 +1899,11 @@
|
|||||||
label-width="auto"
|
label-width="auto"
|
||||||
class="business-crud-page__module-form business-crud-page__module-form--three"
|
class="business-crud-page__module-form business-crud-page__module-form--three"
|
||||||
>
|
>
|
||||||
<el-form-item label="账单起始日期" required :error="settlementRuleErrors.billStartDate">
|
<el-form-item label="账单起始日" required :error="settlementRuleErrors.billStartDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="settlementRuleForm.billStartDate"
|
v-model="settlementRuleForm.billStartDate"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="请选择账单起始日期"
|
placeholder="请选择账单起始日"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
:disabled="dialogReadonly"
|
:disabled="dialogReadonly"
|
||||||
@@ -7784,8 +7784,8 @@ export default {
|
|||||||
const rule = this.normalizeSettlementRule(source);
|
const rule = this.normalizeSettlementRule(source);
|
||||||
this.settlementRuleErrors = {};
|
this.settlementRuleErrors = {};
|
||||||
if (this.isBillingFieldEmpty(rule.billStartDate)) {
|
if (this.isBillingFieldEmpty(rule.billStartDate)) {
|
||||||
this.settlementRuleErrors = { billStartDate: '请选择账单起始日期' };
|
this.settlementRuleErrors = { billStartDate: '请选择账单起始日' };
|
||||||
this.$message.warning(`${label}${label ? ':' : ''}请选择账单起始日期`);
|
this.$message.warning(`${label}${label ? ':' : ''}请选择账单起始日`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isBillingFieldEmpty(rule.settlementType)) {
|
if (this.isBillingFieldEmpty(rule.settlementType)) {
|
||||||
|
|||||||
@@ -103,8 +103,13 @@
|
|||||||
<div class="contract-attachment-upload-dialog__body">
|
<div class="contract-attachment-upload-dialog__body">
|
||||||
<div class="contract-attachment-upload-dialog__field">
|
<div class="contract-attachment-upload-dialog__field">
|
||||||
<span class="contract-attachment-upload-dialog__label">附件位置</span>
|
<span class="contract-attachment-upload-dialog__label">附件位置</span>
|
||||||
<el-select :model-value="attachmentLocation" disabled style="width: 100%">
|
<el-select v-model="uploadDialogLocation" placeholder="请选择附件位置" style="width: 100%">
|
||||||
<el-option :label="attachmentLocation" :value="attachmentLocation" />
|
<el-option
|
||||||
|
v-for="item in resolvedLocationOptions"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="contract-attachment-upload-dialog__field">
|
<div class="contract-attachment-upload-dialog__field">
|
||||||
@@ -273,15 +278,17 @@ export default {
|
|||||||
markApprovedOnUpload: Boolean,
|
markApprovedOnUpload: Boolean,
|
||||||
useUploadDialog: Boolean,
|
useUploadDialog: Boolean,
|
||||||
attachmentLocation: { type: String, default: '合同文件' },
|
attachmentLocation: { type: String, default: '合同文件' },
|
||||||
|
attachmentLocationOptions: { type: Array, default: null },
|
||||||
preview: { type: Function, default: null },
|
preview: { type: Function, default: null },
|
||||||
},
|
},
|
||||||
emits: ['update:rows'],
|
emits: ['update:rows', 'upload-to-location'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selected: [],
|
selected: [],
|
||||||
attachmentFileTypes,
|
attachmentFileTypes,
|
||||||
contractAttachmentTypeOptions: [...defaultContractAttachmentTypeOptions],
|
contractAttachmentTypeOptions: [...defaultContractAttachmentTypeOptions],
|
||||||
uploadDialogVisible: false,
|
uploadDialogVisible: false,
|
||||||
|
uploadDialogLocation: '合同文件',
|
||||||
uploadDialogType: resolveOtherAttachmentType(defaultContractAttachmentTypeOptions),
|
uploadDialogType: resolveOtherAttachmentType(defaultContractAttachmentTypeOptions),
|
||||||
uploadDialogFiles: [],
|
uploadDialogFiles: [],
|
||||||
uploadDialogFileList: [],
|
uploadDialogFileList: [],
|
||||||
@@ -300,6 +307,11 @@ export default {
|
|||||||
defaultAttachmentType() {
|
defaultAttachmentType() {
|
||||||
return resolveOtherAttachmentType(this.contractAttachmentTypeOptions);
|
return resolveOtherAttachmentType(this.contractAttachmentTypeOptions);
|
||||||
},
|
},
|
||||||
|
resolvedLocationOptions() {
|
||||||
|
const options = (this.attachmentLocationOptions || []).filter(Boolean);
|
||||||
|
if (options.length) return options;
|
||||||
|
return ['合同文件', '其它附件'];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadAttachmentTypeOptions();
|
this.loadAttachmentTypeOptions();
|
||||||
@@ -340,6 +352,10 @@ export default {
|
|||||||
this.update([...this.rows]);
|
this.update([...this.rows]);
|
||||||
},
|
},
|
||||||
openUploadDialog() {
|
openUploadDialog() {
|
||||||
|
const options = this.resolvedLocationOptions;
|
||||||
|
this.uploadDialogLocation = options.includes(this.attachmentLocation)
|
||||||
|
? this.attachmentLocation
|
||||||
|
: options[0] || this.attachmentLocation;
|
||||||
this.uploadDialogType = this.defaultAttachmentType;
|
this.uploadDialogType = this.defaultAttachmentType;
|
||||||
this.uploadDialogFiles = [];
|
this.uploadDialogFiles = [];
|
||||||
this.uploadDialogFileList = [];
|
this.uploadDialogFileList = [];
|
||||||
@@ -348,6 +364,7 @@ export default {
|
|||||||
resetUploadDialog() {
|
resetUploadDialog() {
|
||||||
this.uploadDialogFiles = [];
|
this.uploadDialogFiles = [];
|
||||||
this.uploadDialogFileList = [];
|
this.uploadDialogFileList = [];
|
||||||
|
this.uploadDialogLocation = this.attachmentLocation;
|
||||||
this.uploadDialogType = this.defaultAttachmentType;
|
this.uploadDialogType = this.defaultAttachmentType;
|
||||||
},
|
},
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
@@ -416,6 +433,10 @@ export default {
|
|||||||
this.$message.warning('请先上传附件');
|
this.$message.warning('请先上传附件');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.uploadDialogLocation) {
|
||||||
|
this.$message.warning('请选择附件位置');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this.uploadDialogType) {
|
if (!this.uploadDialogType) {
|
||||||
this.$message.warning('请选择附件类型');
|
this.$message.warning('请选择附件类型');
|
||||||
return;
|
return;
|
||||||
@@ -430,7 +451,14 @@ export default {
|
|||||||
uploadTime: row.uploadTime || uploadTime,
|
uploadTime: row.uploadTime || uploadTime,
|
||||||
...(this.markApprovedOnUpload ? { approved: true } : {}),
|
...(this.markApprovedOnUpload ? { approved: true } : {}),
|
||||||
}));
|
}));
|
||||||
|
if (this.uploadDialogLocation === this.attachmentLocation) {
|
||||||
this.update([...(this.rows || []), ...appended]);
|
this.update([...(this.rows || []), ...appended]);
|
||||||
|
} else {
|
||||||
|
this.$emit('upload-to-location', {
|
||||||
|
location: this.uploadDialogLocation,
|
||||||
|
rows: appended,
|
||||||
|
});
|
||||||
|
}
|
||||||
this.uploadDialogVisible = false;
|
this.uploadDialogVisible = false;
|
||||||
},
|
},
|
||||||
handleChange(rows) {
|
handleChange(rows) {
|
||||||
|
|||||||
@@ -1927,7 +1927,8 @@
|
|||||||
v-if="!waybillIsCarrier(detailRow)"
|
v-if="!waybillIsCarrier(detailRow)"
|
||||||
class="waybill-manage-page__waybill-detail-field"
|
class="waybill-manage-page__waybill-detail-field"
|
||||||
>
|
>
|
||||||
<span>里程(km)</span><strong>{{ detailRow.mileage || '-' }}</strong>
|
<span>里程(km)</span
|
||||||
|
><strong>{{ normalizeMileageValue(detailRow.mileage) || '-' }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="waybillIsNonRoadTransport(detailRow)">
|
<template v-else-if="waybillIsNonRoadTransport(detailRow)">
|
||||||
@@ -2315,7 +2316,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="detailPageLocked" class="waybill-manage-page__detail-footer">
|
<div v-if="detailPageLocked && !isPublicWaybillView" class="waybill-manage-page__detail-footer">
|
||||||
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="!detailPageLocked" #footer>
|
<template v-if="!detailPageLocked" #footer>
|
||||||
@@ -3122,6 +3123,7 @@ import {
|
|||||||
getVoucherImages as getProcessConfigVoucherImages,
|
getVoucherImages as getProcessConfigVoucherImages,
|
||||||
} from '@/api/business/process-config';
|
} from '@/api/business/process-config';
|
||||||
import { getPunchRecords as getWaybillPunchRecords, locateVehicle, trackVehicle } from '@/api/business/waybill-manage';
|
import { getPunchRecords as getWaybillPunchRecords, locateVehicle, trackVehicle } from '@/api/business/waybill-manage';
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import { getList as getDriverList } from '@/api/transportCapacity/driver';
|
import { getList as getDriverList } from '@/api/transportCapacity/driver';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||||
@@ -3646,6 +3648,7 @@ export default {
|
|||||||
this.formPageLocked = this.isStandaloneWaybillFormPage;
|
this.formPageLocked = this.isStandaloneWaybillFormPage;
|
||||||
this.detailPageLocked = this.isStandaloneWaybillDetailPage;
|
this.detailPageLocked = this.isStandaloneWaybillDetailPage;
|
||||||
this.formModeLocked = this.$route.query.mode || '';
|
this.formModeLocked = this.$route.query.mode || '';
|
||||||
|
if (this.isPublicWaybillView) return;
|
||||||
if (this.config.enableAllDept && this.isAdmin) {
|
if (this.config.enableAllDept && this.isAdmin) {
|
||||||
this.allDept = 1;
|
this.allDept = 1;
|
||||||
}
|
}
|
||||||
@@ -3709,8 +3712,14 @@ export default {
|
|||||||
isStandaloneWaybillFormPage() {
|
isStandaloneWaybillFormPage() {
|
||||||
return this.isStandaloneWaybillPage && ['add', 'edit'].includes(this.$route.query.mode);
|
return this.isStandaloneWaybillPage && ['add', 'edit'].includes(this.$route.query.mode);
|
||||||
},
|
},
|
||||||
|
isPublicWaybillView() {
|
||||||
|
return this.$route.path === '/business/waybill-manage/public-view';
|
||||||
|
},
|
||||||
isStandaloneWaybillDetailPage() {
|
isStandaloneWaybillDetailPage() {
|
||||||
return this.standaloneDetailPage && this.$route.path === standaloneWaybillDetailRoute;
|
return (
|
||||||
|
(this.standaloneDetailPage && this.$route.path === standaloneWaybillDetailRoute) ||
|
||||||
|
this.isPublicWaybillView
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 容器形态读实例创建时锁定的标志,不随 $route 翻转(详见 data 中 formPageLocked 的说明)
|
// 容器形态读实例创建时锁定的标志,不随 $route 翻转(详见 data 中 formPageLocked 的说明)
|
||||||
// 当前路由是否仍属于本实例(tab.js 按 fullPath 建实例,一个实例只对应一个 path)。
|
// 当前路由是否仍属于本实例(tab.js 按 fullPath 建实例,一个实例只对应一个 path)。
|
||||||
@@ -4591,14 +4600,19 @@ export default {
|
|||||||
this.waybillVoucherFolder = null;
|
this.waybillVoucherFolder = null;
|
||||||
this.waybillVoucherFolderView = false;
|
this.waybillVoucherFolderView = false;
|
||||||
this.waybillVoucherImagesLoaded = false;
|
this.waybillVoucherImagesLoaded = false;
|
||||||
const request =
|
const request = this.isPublicWaybillView
|
||||||
typeof this.api.getDetail === 'function'
|
? getMkPublicDetail('waybill-manage', row.id)
|
||||||
|
: typeof this.api.getDetail === 'function'
|
||||||
? this.api.getDetail(row.id)
|
? this.api.getDetail(row.id)
|
||||||
: Promise.resolve({ data: { data: row } });
|
: Promise.resolve({ data: { data: row } });
|
||||||
request
|
request
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const detail = res?.data?.data || res?.data || row;
|
const detail = res?.data?.data || res?.data || row;
|
||||||
this.detailRow = detail;
|
this.detailRow = detail;
|
||||||
|
if (this.isPublicWaybillView) {
|
||||||
|
this.applyFormDetail(detail);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.loadWaybillPunchRecords();
|
this.loadWaybillPunchRecords();
|
||||||
this.loadWaybillVoucherImages();
|
this.loadWaybillVoucherImages();
|
||||||
if (detail.contractId) {
|
if (detail.contractId) {
|
||||||
@@ -8560,7 +8574,7 @@ export default {
|
|||||||
};
|
};
|
||||||
this.mileageForm = {
|
this.mileageForm = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
mileage: row.mileage === null || row.mileage === undefined ? '' : String(row.mileage),
|
mileage: this.normalizeMileageValue(row.mileage),
|
||||||
mileageRemark: row.mileageRemark || '',
|
mileageRemark: row.mileageRemark || '',
|
||||||
};
|
};
|
||||||
this.$nextTick(() => this.$refs.mileageFormRef?.clearValidate());
|
this.$nextTick(() => this.$refs.mileageFormRef?.clearValidate());
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="YYYY-MM-DD"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
<span>至</span>
|
<span>至</span>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="YYYY-MM-DD"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -92,12 +92,12 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同金额">
|
<el-form-item label="合同金额">
|
||||||
<el-input-number
|
<el-input
|
||||||
v-model="form.contractAmount"
|
:model-value="contractAmountDisplay"
|
||||||
:min="0"
|
|
||||||
:precision="2"
|
|
||||||
:controls="false"
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
|
clearable
|
||||||
|
@input="handleContractAmountInput"
|
||||||
|
@clear="form.contractAmount = null"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否范本">
|
<el-form-item label="是否范本">
|
||||||
@@ -190,9 +190,11 @@
|
|||||||
description
|
description
|
||||||
attachment-type
|
attachment-type
|
||||||
use-upload-dialog
|
use-upload-dialog
|
||||||
|
:attachment-location-options="changeAttachmentLocationOptions"
|
||||||
:rows="contractFileRows"
|
:rows="contractFileRows"
|
||||||
:preview="previewAttachment"
|
:preview="previewAttachment"
|
||||||
@update:rows="contractFileRows = $event"
|
@update:rows="contractFileRows = $event"
|
||||||
|
@upload-to-location="handleAttachmentUploadToLocation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="change-section">
|
<section class="change-section">
|
||||||
@@ -218,7 +220,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<el-form v-if="settlementRule.autoGenerate === 1" :model="settlementRule" label-position="right" label-width="auto" class="settlement-form">
|
<el-form v-if="settlementRule.autoGenerate === 1" :model="settlementRule" label-position="right" label-width="auto" class="settlement-form">
|
||||||
<el-form-item label="账单起始日期" required><el-date-picker v-model="settlementRule.billStartDate" type="date" placeholder="请选择账单起始日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /></el-form-item>
|
<el-form-item label="账单起始日" required><el-date-picker v-model="settlementRule.billStartDate" type="date" placeholder="请选择账单起始日" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /></el-form-item>
|
||||||
<el-form-item label="结算类型" required><el-select v-model="settlementRule.settlementType" placeholder="请选择结算类型" @change="handleSettlementTypeChange"><el-option v-for="item in settlementTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
<el-form-item label="结算类型" required><el-select v-model="settlementRule.settlementType" placeholder="请选择结算类型" @change="handleSettlementTypeChange"><el-option v-for="item in settlementTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
||||||
<el-form-item v-if="showSettlementBillCycleType" label="结算周期" required><el-select v-model="settlementRule.billCycleType" placeholder="请选择结算周期" @change="handleCycleTypeChange"><el-option v-for="item in billCycleTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
<el-form-item v-if="showSettlementBillCycleType" label="结算周期" required><el-select v-model="settlementRule.billCycleType" placeholder="请选择结算周期" @change="handleCycleTypeChange"><el-option v-for="item in billCycleTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
||||||
<el-form-item v-if="showSettlementBillCutoffDay" label="账单截单日" required><el-select v-model="settlementRule.billCutoffDay" placeholder="请选择账单截单日"><el-option v-for="item in billCutoffDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
<el-form-item v-if="showSettlementBillCutoffDay" label="账单截单日" required><el-select v-model="settlementRule.billCutoffDay" placeholder="请选择账单截单日"><el-option v-for="item in billCutoffDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||||
@@ -258,9 +260,11 @@
|
|||||||
attachment-type
|
attachment-type
|
||||||
use-upload-dialog
|
use-upload-dialog
|
||||||
attachment-location="其它附件"
|
attachment-location="其它附件"
|
||||||
|
:attachment-location-options="changeAttachmentLocationOptions"
|
||||||
:rows="attachments"
|
:rows="attachments"
|
||||||
:preview="previewAttachment"
|
:preview="previewAttachment"
|
||||||
@update:rows="attachments = $event"
|
@update:rows="attachments = $event"
|
||||||
|
@upload-to-location="handleAttachmentUploadToLocation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="change-section change-reason-section">
|
<section class="change-section change-reason-section">
|
||||||
@@ -283,9 +287,11 @@
|
|||||||
attachment-type
|
attachment-type
|
||||||
use-upload-dialog
|
use-upload-dialog
|
||||||
attachment-location="变更材料"
|
attachment-location="变更材料"
|
||||||
|
:attachment-location-options="changeAttachmentLocationOptions"
|
||||||
:rows="changeMaterials"
|
:rows="changeMaterials"
|
||||||
:preview="previewAttachment"
|
:preview="previewAttachment"
|
||||||
@update:rows="changeMaterials = $event"
|
@update:rows="changeMaterials = $event"
|
||||||
|
@upload-to-location="handleAttachmentUploadToLocation"
|
||||||
/>
|
/>
|
||||||
<div class="page-footer">
|
<div class="page-footer">
|
||||||
<el-button @click="$router.back()">取消</el-button>
|
<el-button @click="$router.back()">取消</el-button>
|
||||||
@@ -343,7 +349,15 @@ const normalizeOptionalPositiveInteger = value => {
|
|||||||
return Number.isInteger(number) && number > 0 ? number : null;
|
return Number.isInteger(number) && number > 0 ? number : null;
|
||||||
};
|
};
|
||||||
const normalizeOptionalAmount = value => {
|
const normalizeOptionalAmount = value => {
|
||||||
if (value === undefined || value === null || value === '') return null;
|
if (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === '' ||
|
||||||
|
Number(value) === -1 ||
|
||||||
|
String(value) === '-1'
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const number = Number(value);
|
const number = Number(value);
|
||||||
return Number.isFinite(number) && number >= 0 ? Number(number.toFixed(2)) : null;
|
return Number.isFinite(number) && number >= 0 ? Number(number.toFixed(2)) : null;
|
||||||
};
|
};
|
||||||
@@ -421,6 +435,22 @@ export default {
|
|||||||
pageTitle() {
|
pageTitle() {
|
||||||
return this.$route.query.name || '合同变更';
|
return this.$route.query.name || '合同变更';
|
||||||
},
|
},
|
||||||
|
changeAttachmentLocationOptions() {
|
||||||
|
return ['合同文件', '其它附件', '变更材料'];
|
||||||
|
},
|
||||||
|
contractAmountDisplay() {
|
||||||
|
const value = this.form.contractAmount;
|
||||||
|
if (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === '' ||
|
||||||
|
Number(value) === -1 ||
|
||||||
|
String(value) === '-1'
|
||||||
|
) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
contractCategoryOptions() {
|
contractCategoryOptions() {
|
||||||
return this.contractCategoryDictOptions.length
|
return this.contractCategoryDictOptions.length
|
||||||
? this.contractCategoryDictOptions
|
? this.contractCategoryDictOptions
|
||||||
@@ -464,6 +494,13 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleContractAmountInput(value) {
|
||||||
|
const text = String(value || '').replace(/[^\d.]/g, '');
|
||||||
|
const parts = text.split('.');
|
||||||
|
const normalized =
|
||||||
|
parts.length > 1 ? `${parts[0]}.${parts.slice(1).join('').slice(0, 2)}` : parts[0];
|
||||||
|
this.form.contractAmount = normalized === '' ? null : normalized;
|
||||||
|
},
|
||||||
loadDictionaries() {
|
loadDictionaries() {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
getSystemDictionary({ code: 'currency_type' }),
|
getSystemDictionary({ code: 'currency_type' }),
|
||||||
@@ -619,6 +656,20 @@ export default {
|
|||||||
attachmentExtension(row = {}) { const source = String(this.attachmentName(row) || this.attachmentUrl(row)).split('?')[0]; const index = source.lastIndexOf('.'); return index > -1 ? source.slice(index + 1).toLowerCase() : ''; },
|
attachmentExtension(row = {}) { const source = String(this.attachmentName(row) || this.attachmentUrl(row)).split('?')[0]; const index = source.lastIndexOf('.'); return index > -1 ? source.slice(index + 1).toLowerCase() : ''; },
|
||||||
isAttachmentImage(row) { return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(this.attachmentExtension(row)); },
|
isAttachmentImage(row) { return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(this.attachmentExtension(row)); },
|
||||||
previewAttachment(row, rows = this.attachments) { const url = this.attachmentUrl(row); if (!url) { this.$message.warning('附件地址为空,无法预览'); return; } if (this.isAttachmentImage(row)) { this.imagePreviewUrls = (rows || []).filter(item => this.isAttachmentImage(item) && this.attachmentUrl(item)).map(item => this.attachmentUrl(item)); this.imagePreviewIndex = Math.max(this.imagePreviewUrls.indexOf(url), 0); this.imagePreviewVisible = true; return; } this.previewFile = { name: this.attachmentName(row), url, mimeType: row.mimeType || row.contentType || '' }; this.documentPreviewVisible = true; },
|
previewAttachment(row, rows = this.attachments) { const url = this.attachmentUrl(row); if (!url) { this.$message.warning('附件地址为空,无法预览'); return; } if (this.isAttachmentImage(row)) { this.imagePreviewUrls = (rows || []).filter(item => this.isAttachmentImage(item) && this.attachmentUrl(item)).map(item => this.attachmentUrl(item)); this.imagePreviewIndex = Math.max(this.imagePreviewUrls.indexOf(url), 0); this.imagePreviewVisible = true; return; } this.previewFile = { name: this.attachmentName(row), url, mimeType: row.mimeType || row.contentType || '' }; this.documentPreviewVisible = true; },
|
||||||
|
handleAttachmentUploadToLocation({ location, rows = [] }) {
|
||||||
|
if (!rows.length) return;
|
||||||
|
if (location === '合同文件') {
|
||||||
|
this.contractFileRows = [...(this.contractFileRows || []), ...rows];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (location === '其它附件') {
|
||||||
|
this.attachments = [...(this.attachments || []), ...rows];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (location === '变更材料') {
|
||||||
|
this.changeMaterials = [...(this.changeMaterials || []), ...rows];
|
||||||
|
}
|
||||||
|
},
|
||||||
handlePreviewUnsupported() { this.$message.warning('当前文件暂不支持在线预览'); },
|
handlePreviewUnsupported() { this.$message.warning('当前文件暂不支持在线预览'); },
|
||||||
handlePreviewError() { this.$message.error('附件预览失败'); },
|
handlePreviewError() { this.$message.error('附件预览失败'); },
|
||||||
formatFileSize(value) { const size = Number(value || 0); return size > 1024 * 1024 ? `${(size / 1024 / 1024).toFixed(2)}MB` : `${Math.max(1, Math.ceil(size / 1024))}KB`; },
|
formatFileSize(value) { const size = Number(value || 0); return size > 1024 * 1024 ? `${(size / 1024 / 1024).toFixed(2)}MB` : `${Math.max(1, Math.ceil(size / 1024))}KB`; },
|
||||||
@@ -629,7 +680,7 @@ export default {
|
|||||||
addCustomPeriodRow() { const periods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); periods.push({ startDay: '', endDay: '' }); this.settlementRule.customPeriods = periods; },
|
addCustomPeriodRow() { const periods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); periods.push({ startDay: '', endDay: '' }); this.settlementRule.customPeriods = periods; },
|
||||||
removeCustomPeriodRow(index) { if (index <= 0) return; const periods = [...(this.settlementRule.customPeriods || [])]; periods.splice(index, 1); this.settlementRule.customPeriods = normalizeCustomPeriods(periods); },
|
removeCustomPeriodRow(index) { if (index <= 0) return; const periods = [...(this.settlementRule.customPeriods || [])]; periods.splice(index, 1); this.settlementRule.customPeriods = normalizeCustomPeriods(periods); },
|
||||||
validateCustomPeriods(periods = [], label) { const rows = normalizeCustomPeriods(periods); if (!rows.length) { this.$message.warning(`${label}:请至少配置一段自定义周期`); return false; } for (let index = 0; index < rows.length; index += 1) { const row = rows[index]; const startDay = Number(row.startDay); const endDay = Number(row.endDay); if (!Number.isFinite(startDay) || startDay < 1 || startDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间开始日`); return false; } if (!Number.isFinite(endDay) || endDay < 1 || endDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间结束日`); return false; } if (endDay < startDay) { this.$message.warning(`${label}:第${index + 1}行结束日不能早于开始日`); return false; } if (index > 0 && startDay !== Number(rows[index - 1].endDay) + 1) { this.$message.warning(`${label}:自定义多周期区间必须连续,不允许重叠或存在日期缺口`); return false; } } return true; },
|
validateCustomPeriods(periods = [], label) { const rows = normalizeCustomPeriods(periods); if (!rows.length) { this.$message.warning(`${label}:请至少配置一段自定义周期`); return false; } for (let index = 0; index < rows.length; index += 1) { const row = rows[index]; const startDay = Number(row.startDay); const endDay = Number(row.endDay); if (!Number.isFinite(startDay) || startDay < 1 || startDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间开始日`); return false; } if (!Number.isFinite(endDay) || endDay < 1 || endDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间结束日`); return false; } if (endDay < startDay) { this.$message.warning(`${label}:第${index + 1}行结束日不能早于开始日`); return false; } if (index > 0 && startDay !== Number(rows[index - 1].endDay) + 1) { this.$message.warning(`${label}:自定义多周期区间必须连续,不允许重叠或存在日期缺口`); return false; } } return true; },
|
||||||
validateSettlementRule(rule, label) { if (Number(rule.autoGenerate) !== 1) return true; if (!rule.billStartDate || !rule.settlementType) { this.$message.warning(`${label}:请完整填写账单起始日期和结算类型`); return false; } if (rule.settlementType === '月结' && !rule.billCycleType) { this.$message.warning(`${label}:请选择结算周期`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '固定截单日' && !rule.billCutoffDay) { this.$message.warning(`${label}:请选择账单截单日`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') return this.validateCustomPeriods(rule.customPeriods, label); if (rule.settlementType === '固定天数周期结算' && !rule.cycleDays) { this.$message.warning(`${label}:请选择周期天数`); return false; } return true; },
|
validateSettlementRule(rule, label) { if (Number(rule.autoGenerate) !== 1) return true; if (!rule.billStartDate || !rule.settlementType) { this.$message.warning(`${label}:请完整填写账单起始日和结算类型`); return false; } if (rule.settlementType === '月结' && !rule.billCycleType) { this.$message.warning(`${label}:请选择结算周期`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '固定截单日' && !rule.billCutoffDay) { this.$message.warning(`${label}:请选择账单截单日`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') return this.validateCustomPeriods(rule.customPeriods, label); if (rule.settlementType === '固定天数周期结算' && !rule.cycleDays) { this.$message.warning(`${label}:请选择周期天数`); return false; } return true; },
|
||||||
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } if (this.settlementConfigTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; if (!this.validateSettlementRule(this.preSettlementConfig, '预结算配置') || !this.validateSettlementRule(this.formalSettlementConfig, '正式结算配置')) return; const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), invoiceCycle: normalizeOptionalPositiveInteger(this.form.invoiceCycle), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), contractAmount: normalizeOptionalAmount(this.form.contractAmount), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); await submitMkApprovalFlow({ bizType: 'contract-manage', formInstanceId: this.form.id, subjectName: this.form.contractName || '', approvalStatus: this.form.approvalStatus || 'change_rejected' }); this.$message.success('变更已提交'); this.$router.back(); },
|
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } if (this.settlementConfigTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; if (!this.validateSettlementRule(this.preSettlementConfig, '预结算配置') || !this.validateSettlementRule(this.formalSettlementConfig, '正式结算配置')) return; const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), invoiceCycle: normalizeOptionalPositiveInteger(this.form.invoiceCycle), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), contractAmount: normalizeOptionalAmount(this.form.contractAmount), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); await submitMkApprovalFlow({ bizType: 'contract-manage', formInstanceId: this.form.id, subjectName: this.form.contractName || '', approvalStatus: this.form.approvalStatus || 'change_rejected' }); this.$message.success('变更已提交'); this.$router.back(); },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -654,6 +705,14 @@ export default {
|
|||||||
.contract-basic-section :deep(.el-input),
|
.contract-basic-section :deep(.el-input),
|
||||||
.contract-basic-section :deep(.el-select),
|
.contract-basic-section :deep(.el-select),
|
||||||
.contract-basic-section :deep(.el-date-editor) { width: 360px; max-width: 100%; }
|
.contract-basic-section :deep(.el-date-editor) { width: 360px; max-width: 100%; }
|
||||||
|
.contract-basic-section :deep(.el-input-number) {
|
||||||
|
width: 360px;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
|
.el-input__inner {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
.dialog-section-title { margin-bottom: 18px; font-size: 16px; font-weight: 600; }
|
.dialog-section-title { margin-bottom: 18px; font-size: 16px; font-weight: 600; }
|
||||||
.dialog-section-title::before { display: inline-block; width: 4px; height: 16px; margin-right: 8px; vertical-align: -2px; background: #409eff; content: ''; }
|
.dialog-section-title::before { display: inline-block; width: 4px; height: 16px; margin-right: 8px; vertical-align: -2px; background: #409eff; content: ''; }
|
||||||
.section-head { display: flex; align-items: center; justify-content: space-between; }
|
.section-head { display: flex; align-items: center; justify-content: space-between; }
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<mk-public-shell biz-type="contract-manage" :get-form="getForm">
|
||||||
|
<contract-manage ref="page" />
|
||||||
|
</mk-public-shell>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
|
import ContractManage from '@/views/business/contract-manage.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ContractManagePublicView',
|
||||||
|
components: { MkPublicShell, ContractManage },
|
||||||
|
methods: {
|
||||||
|
getForm() {
|
||||||
|
const row = this.$refs.page?.detailRow || {};
|
||||||
|
return { ...row, subject: row.contractName || row.contractNo || '' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
Number(detailSettlementRule.autoGenerate) === 1 ? '开启' : '关闭'
|
Number(detailSettlementRule.autoGenerate) === 1 ? '开启' : '关闭'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<template v-if="Number(detailSettlementRule.autoGenerate) === 1">
|
<template v-if="Number(detailSettlementRule.autoGenerate) === 1">
|
||||||
<el-descriptions-item label="账单起始日期">{{
|
<el-descriptions-item label="账单起始日">{{
|
||||||
displayValue(detailSettlementRule.billStartDate)
|
displayValue(detailSettlementRule.billStartDate)
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="结算类型">{{
|
<el-descriptions-item label="结算类型">{{
|
||||||
@@ -244,7 +244,7 @@
|
|||||||
}}</el-descriptions-item
|
}}</el-descriptions-item
|
||||||
>
|
>
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
v-if="detailSettlementRule.settlementType === '固定天数周期结算'"
|
v-if="isFixedCycleSettlementType(detailSettlementRule.settlementType)"
|
||||||
label="周期天数"
|
label="周期天数"
|
||||||
>{{
|
>{{
|
||||||
detailObjectUnitValue(detailSettlementRule, 'cycleDays', '天')
|
detailObjectUnitValue(detailSettlementRule, 'cycleDays', '天')
|
||||||
@@ -345,7 +345,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="contract-manage-page__footer">
|
<div class="contract-manage-page__footer">
|
||||||
<el-button @click="closeDetail">关闭</el-button>
|
<el-button v-if="!isPublicViewPage" @click="closeDetail">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="YYYY-MM-DD"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
<span>至</span>
|
<span>至</span>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -486,7 +486,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="YYYY-MM-DD"
|
placeholder="请输入"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -498,12 +498,12 @@
|
|||||||
><template #suffix>天</template></el-input>
|
><template #suffix>天</template></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同金额">
|
<el-form-item label="合同金额">
|
||||||
<el-input-number
|
<el-input
|
||||||
v-model="form.contractAmount"
|
:model-value="contractAmountDisplay"
|
||||||
:min="0"
|
|
||||||
:precision="2"
|
|
||||||
:controls="false"
|
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
|
clearable
|
||||||
|
@input="handleContractAmountInput"
|
||||||
|
@clear="form.contractAmount = null"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否范本">
|
<el-form-item label="是否范本">
|
||||||
@@ -593,11 +593,13 @@
|
|||||||
description
|
description
|
||||||
attachment-type
|
attachment-type
|
||||||
use-upload-dialog
|
use-upload-dialog
|
||||||
|
:attachment-location-options="contractAttachmentLocationOptions"
|
||||||
:lock-approved="isAttachmentUploadMode || hasApprovedContractFiles"
|
:lock-approved="isAttachmentUploadMode || hasApprovedContractFiles"
|
||||||
:mark-approved-on-upload="isAttachmentUploadMode"
|
:mark-approved-on-upload="isAttachmentUploadMode"
|
||||||
:rows="contractFileRows"
|
:rows="contractFileRows"
|
||||||
:preview="previewAttachment"
|
:preview="previewAttachment"
|
||||||
@update:rows="contractFileRows = $event"
|
@update:rows="contractFileRows = $event"
|
||||||
|
@upload-to-location="handleAttachmentUploadToLocation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section class="contract-manage-form__section contract-manage-form__section--panel">
|
<section class="contract-manage-form__section contract-manage-form__section--panel">
|
||||||
@@ -646,7 +648,7 @@
|
|||||||
content="开启时,系统根据配置规则归集运单,定时生成结算单"
|
content="开启时,系统根据配置规则归集运单,定时生成结算单"
|
||||||
placement="top"
|
placement="top"
|
||||||
>
|
>
|
||||||
<el-icon class="settlement-switch-tip"><QuestionFilled /></el-icon>
|
<el-icon class="contract-manage-form__fee-mode-tip"><QuestionFilled /></el-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-radio :label="0">关闭</el-radio>
|
<el-radio :label="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -655,13 +657,13 @@
|
|||||||
v-if="settlementRuleEnabled"
|
v-if="settlementRuleEnabled"
|
||||||
class="contract-manage-form__grid contract-manage-form__settlement-grid"
|
class="contract-manage-form__grid contract-manage-form__settlement-grid"
|
||||||
>
|
>
|
||||||
<el-form-item label="账单起始日期" required>
|
<el-form-item label="账单起始日" required>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="settlementRuleForm.billStartDate"
|
v-model="settlementRuleForm.billStartDate"
|
||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="请选择账单起始日期"
|
placeholder="请选择账单起始日"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="结算类型" required>
|
<el-form-item label="结算类型" required>
|
||||||
@@ -813,10 +815,12 @@
|
|||||||
attachment-type
|
attachment-type
|
||||||
use-upload-dialog
|
use-upload-dialog
|
||||||
attachment-location="其它附件"
|
attachment-location="其它附件"
|
||||||
|
:attachment-location-options="contractAttachmentLocationOptions"
|
||||||
:readonly="isAttachmentUploadMode"
|
:readonly="isAttachmentUploadMode"
|
||||||
:rows="attachmentRows"
|
:rows="attachmentRows"
|
||||||
:preview="previewAttachment"
|
:preview="previewAttachment"
|
||||||
@update:rows="attachmentRows = $event"
|
@update:rows="attachmentRows = $event"
|
||||||
|
@upload-to-location="handleAttachmentUploadToLocation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
@@ -1027,6 +1031,7 @@ import NProgress from 'nprogress';
|
|||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
import * as api from '@/api/business/contract-manage';
|
import * as api from '@/api/business/contract-manage';
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||||
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
@@ -1058,7 +1063,15 @@ const normalizeOptionalInteger = (value, emptyValue = null) => {
|
|||||||
return Number.isFinite(number) ? Math.trunc(number) : emptyValue;
|
return Number.isFinite(number) ? Math.trunc(number) : emptyValue;
|
||||||
};
|
};
|
||||||
const normalizeOptionalAmount = (value, emptyValue = null) => {
|
const normalizeOptionalAmount = (value, emptyValue = null) => {
|
||||||
if (value === undefined || value === null || value === '') return emptyValue;
|
if (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === '' ||
|
||||||
|
Number(value) === -1 ||
|
||||||
|
String(value) === '-1'
|
||||||
|
) {
|
||||||
|
return emptyValue;
|
||||||
|
}
|
||||||
const number = Number(value);
|
const number = Number(value);
|
||||||
return Number.isFinite(number) && number >= 0 ? Number(number.toFixed(2)) : emptyValue;
|
return Number.isFinite(number) && number >= 0 ? Number(number.toFixed(2)) : emptyValue;
|
||||||
};
|
};
|
||||||
@@ -1100,7 +1113,7 @@ const defaultForm = () => ({
|
|||||||
settlementCurrency: '',
|
settlementCurrency: '',
|
||||||
invoiceCycle: '',
|
invoiceCycle: '',
|
||||||
paymentDays: '',
|
paymentDays: '',
|
||||||
contractAmount: '',
|
contractAmount: null,
|
||||||
templateFlag: 0,
|
templateFlag: 0,
|
||||||
originalContractNo: '',
|
originalContractNo: '',
|
||||||
electronicSealFlag: 0,
|
electronicSealFlag: 0,
|
||||||
@@ -1272,7 +1285,7 @@ export default {
|
|||||||
formalSettlementRuleForm: defaultSettlementRule(),
|
formalSettlementRuleForm: defaultSettlementRule(),
|
||||||
paymentRatioRows: [],
|
paymentRatioRows: [],
|
||||||
changeRecordRows: [],
|
changeRecordRows: [],
|
||||||
settlementTypeOptions: ['月结', '日结', '周结', '半月结', '固定天数周期结算'],
|
settlementTypeOptions: ['现结', '日结', '周结', '月结', '按固定天数周期'],
|
||||||
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||||
detailLoading: false,
|
detailLoading: false,
|
||||||
detailRow: {},
|
detailRow: {},
|
||||||
@@ -1316,7 +1329,12 @@ export default {
|
|||||||
return this.$route.path === '/business/contract-manage/form';
|
return this.$route.path === '/business/contract-manage/form';
|
||||||
},
|
},
|
||||||
isDetailPage() {
|
isDetailPage() {
|
||||||
return this.$route.path === '/business/contract-manage/detail';
|
return (
|
||||||
|
this.$route.path === '/business/contract-manage/detail' || this.isPublicViewPage
|
||||||
|
);
|
||||||
|
},
|
||||||
|
isPublicViewPage() {
|
||||||
|
return this.$route.path === '/business/contract-manage/public-view';
|
||||||
},
|
},
|
||||||
formMode() {
|
formMode() {
|
||||||
return this.$route.query.mode === 'edit' ? 'edit' : 'add';
|
return this.$route.query.mode === 'edit' ? 'edit' : 'add';
|
||||||
@@ -1331,6 +1349,23 @@ export default {
|
|||||||
isAttachmentUploadMode() {
|
isAttachmentUploadMode() {
|
||||||
return this.$route.query.attachmentUpload === '1';
|
return this.$route.query.attachmentUpload === '1';
|
||||||
},
|
},
|
||||||
|
contractAttachmentLocationOptions() {
|
||||||
|
if (this.isAttachmentUploadMode) return ['合同文件'];
|
||||||
|
return ['合同文件', '其它附件'];
|
||||||
|
},
|
||||||
|
contractAmountDisplay() {
|
||||||
|
const value = this.form.contractAmount;
|
||||||
|
if (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === '' ||
|
||||||
|
Number(value) === -1 ||
|
||||||
|
String(value) === '-1'
|
||||||
|
) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
hasApprovedContractFiles() {
|
hasApprovedContractFiles() {
|
||||||
return (this.contractFileRows || []).some(
|
return (this.contractFileRows || []).some(
|
||||||
row =>
|
row =>
|
||||||
@@ -1412,7 +1447,7 @@ export default {
|
|||||||
return this.showBillCycleType && this.settlementRuleForm.billCycleType === '自定义多周期';
|
return this.showBillCycleType && this.settlementRuleForm.billCycleType === '自定义多周期';
|
||||||
},
|
},
|
||||||
showCycleDays() {
|
showCycleDays() {
|
||||||
return this.settlementRuleForm.settlementType === '固定天数周期结算';
|
return this.isFixedCycleSettlementType(this.settlementRuleForm.settlementType);
|
||||||
},
|
},
|
||||||
billCutoffDayOptions() {
|
billCutoffDayOptions() {
|
||||||
return Array.from({ length: 31 }, (_, index) => ({
|
return Array.from({ length: 31 }, (_, index) => ({
|
||||||
@@ -1473,9 +1508,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (!this.isPublicViewPage) {
|
||||||
this.loadProjectOptions();
|
this.loadProjectOptions();
|
||||||
this.loadSettlementDictionaries();
|
this.loadSettlementDictionaries();
|
||||||
this.loadOrganizationOptions();
|
this.loadOrganizationOptions();
|
||||||
|
}
|
||||||
if (this.isFormPage) this.initFormPage();
|
if (this.isFormPage) this.initFormPage();
|
||||||
if (this.isDetailPage) this.initDetailPage();
|
if (this.isDetailPage) this.initDetailPage();
|
||||||
},
|
},
|
||||||
@@ -1675,7 +1712,7 @@ export default {
|
|||||||
copyCount: normalizeOptionalInteger(detail.copyCount, ''),
|
copyCount: normalizeOptionalInteger(detail.copyCount, ''),
|
||||||
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle, ''),
|
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle, ''),
|
||||||
paymentDays: normalizeOptionalInteger(detail.paymentDays, ''),
|
paymentDays: normalizeOptionalInteger(detail.paymentDays, ''),
|
||||||
contractAmount: normalizeOptionalAmount(detail.contractAmount, ''),
|
contractAmount: normalizeOptionalAmount(detail.contractAmount, null),
|
||||||
archiveStatus: detail.archiveStatus || '未归档',
|
archiveStatus: detail.archiveStatus || '未归档',
|
||||||
feeGenerationMode:
|
feeGenerationMode:
|
||||||
detail.feeGenerationMode || (Number(detail.billingEnabled) === 0 ? 'manual' : 'system'),
|
detail.feeGenerationMode || (Number(detail.billingEnabled) === 0 ? 'manual' : 'system'),
|
||||||
@@ -2118,6 +2155,13 @@ export default {
|
|||||||
integerInput(prop, value) {
|
integerInput(prop, value) {
|
||||||
this.form[prop] = String(value || '').replace(/\D/g, '');
|
this.form[prop] = String(value || '').replace(/\D/g, '');
|
||||||
},
|
},
|
||||||
|
handleContractAmountInput(value) {
|
||||||
|
const text = String(value || '').replace(/[^\d.]/g, '');
|
||||||
|
const parts = text.split('.');
|
||||||
|
const normalized =
|
||||||
|
parts.length > 1 ? `${parts[0]}.${parts.slice(1).join('').slice(0, 2)}` : parts[0];
|
||||||
|
this.form.contractAmount = normalized === '' ? null : normalized;
|
||||||
|
},
|
||||||
positiveIntegerInput(prop, value) {
|
positiveIntegerInput(prop, value) {
|
||||||
const normalized = String(value || '').replace(/\D/g, '').replace(/^0+/, '');
|
const normalized = String(value || '').replace(/\D/g, '').replace(/^0+/, '');
|
||||||
this.form[prop] = normalized;
|
this.form[prop] = normalized;
|
||||||
@@ -2148,6 +2192,16 @@ export default {
|
|||||||
};
|
};
|
||||||
this.attachmentDocumentPreviewVisible = true;
|
this.attachmentDocumentPreviewVisible = true;
|
||||||
},
|
},
|
||||||
|
handleAttachmentUploadToLocation({ location, rows = [] }) {
|
||||||
|
if (!rows.length) return;
|
||||||
|
if (location === '合同文件') {
|
||||||
|
this.contractFileRows = [...(this.contractFileRows || []), ...rows];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (location === '其它附件') {
|
||||||
|
this.attachmentRows = [...(this.attachmentRows || []), ...rows];
|
||||||
|
}
|
||||||
|
},
|
||||||
handleAttachmentPreviewUnsupported() {
|
handleAttachmentPreviewUnsupported() {
|
||||||
this.$message.warning('当前文件暂不支持在线预览');
|
this.$message.warning('当前文件暂不支持在线预览');
|
||||||
},
|
},
|
||||||
@@ -2206,8 +2260,12 @@ export default {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
isFixedCycleSettlementType(value) {
|
||||||
|
return value === '按固定天数周期' || value === '固定天数周期结算';
|
||||||
|
},
|
||||||
normalizeSettlementRule(rule = {}) {
|
normalizeSettlementRule(rule = {}) {
|
||||||
const next = { ...defaultSettlementRule(), ...rule };
|
const next = { ...defaultSettlementRule(), ...rule };
|
||||||
|
if (next.settlementType === '固定天数周期结算') next.settlementType = '按固定天数周期';
|
||||||
if (next.settlementType !== '月结') {
|
if (next.settlementType !== '月结') {
|
||||||
next.billCycleType = '';
|
next.billCycleType = '';
|
||||||
next.billCutoffDay = '';
|
next.billCutoffDay = '';
|
||||||
@@ -2222,7 +2280,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
next.customPeriods = [];
|
next.customPeriods = [];
|
||||||
}
|
}
|
||||||
if (next.settlementType !== '固定天数周期结算') next.cycleDays = '';
|
if (!this.isFixedCycleSettlementType(next.settlementType)) next.cycleDays = '';
|
||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
syncSettlementConfig() {
|
syncSettlementConfig() {
|
||||||
@@ -2245,7 +2303,7 @@ export default {
|
|||||||
this.settlementRuleForm.billCycleType = '';
|
this.settlementRuleForm.billCycleType = '';
|
||||||
this.settlementRuleForm.billCutoffDay = '';
|
this.settlementRuleForm.billCutoffDay = '';
|
||||||
this.settlementRuleForm.customPeriods = [];
|
this.settlementRuleForm.customPeriods = [];
|
||||||
if (value !== '固定天数周期结算') this.settlementRuleForm.cycleDays = '';
|
if (!this.isFixedCycleSettlementType(value)) this.settlementRuleForm.cycleDays = '';
|
||||||
},
|
},
|
||||||
handleBillCycleTypeChange(value) {
|
handleBillCycleTypeChange(value) {
|
||||||
if (value !== '固定截单日') this.settlementRuleForm.billCutoffDay = '';
|
if (value !== '固定截单日') this.settlementRuleForm.billCutoffDay = '';
|
||||||
@@ -2336,7 +2394,7 @@ export default {
|
|||||||
validateSettlementRule(rule, label) {
|
validateSettlementRule(rule, label) {
|
||||||
if (Number(rule.autoGenerate) !== 1) return true;
|
if (Number(rule.autoGenerate) !== 1) return true;
|
||||||
if (!rule.billStartDate || !rule.settlementType) {
|
if (!rule.billStartDate || !rule.settlementType) {
|
||||||
this.$message.warning(`${label}:请完整填写账单起始日期和结算类型`);
|
this.$message.warning(`${label}:请完整填写账单起始日和结算类型`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (rule.settlementType === '月结' && !rule.billCycleType) {
|
if (rule.settlementType === '月结' && !rule.billCycleType) {
|
||||||
@@ -2354,7 +2412,7 @@ export default {
|
|||||||
if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') {
|
if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') {
|
||||||
return this.validateCustomPeriods(rule.customPeriods, label);
|
return this.validateCustomPeriods(rule.customPeriods, label);
|
||||||
}
|
}
|
||||||
if (rule.settlementType === '固定天数周期结算' && !rule.cycleDays) {
|
if (this.isFixedCycleSettlementType(rule.settlementType) && !rule.cycleDays) {
|
||||||
this.$message.warning(`${label}:请选择周期天数`);
|
this.$message.warning(`${label}:请选择周期天数`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2406,8 +2464,10 @@ export default {
|
|||||||
if (!id) return;
|
if (!id) return;
|
||||||
this.detailLoading = true;
|
this.detailLoading = true;
|
||||||
this.applyDetailState({});
|
this.applyDetailState({});
|
||||||
this.api
|
const request = this.isPublicViewPage
|
||||||
.getDetail(id)
|
? getMkPublicDetail('contract-manage', id)
|
||||||
|
: this.api.getDetail(id);
|
||||||
|
request
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.applyDetailState(res.data?.data || {});
|
this.applyDetailState(res.data?.data || {});
|
||||||
})
|
})
|
||||||
@@ -2576,7 +2636,7 @@ export default {
|
|||||||
.join(',')}`
|
.join(',')}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (config.billStartDate) parts.push(`账单起始日期:${config.billStartDate}`);
|
if (config.billStartDate) parts.push(`账单起始日:${config.billStartDate}`);
|
||||||
return parts.join(',');
|
return parts.join(',');
|
||||||
};
|
};
|
||||||
if (normalized.preSettlementConfig || normalized.formalSettlementConfig) {
|
if (normalized.preSettlementConfig || normalized.formalSettlementConfig) {
|
||||||
@@ -2672,6 +2732,15 @@ export default {
|
|||||||
},
|
},
|
||||||
detailValue(prop) {
|
detailValue(prop) {
|
||||||
const value = this.detailRow[prop];
|
const value = this.detailRow[prop];
|
||||||
|
if (prop === 'contractAmount') {
|
||||||
|
return value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === '' ||
|
||||||
|
Number(value) === -1 ||
|
||||||
|
String(value) === '-1'
|
||||||
|
? '-'
|
||||||
|
: value;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
prop === 'contractStage' ||
|
prop === 'contractStage' ||
|
||||||
prop === 'approvalStatus' ||
|
prop === 'approvalStatus' ||
|
||||||
@@ -3018,13 +3087,6 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
|
||||||
.settlement-switch-tip {
|
|
||||||
margin: 0 4px;
|
|
||||||
color: #a8abb2;
|
|
||||||
cursor: help;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__settlement-grid {
|
&__settlement-grid {
|
||||||
@@ -3082,11 +3144,19 @@ export default {
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.el-input-number) {
|
||||||
|
width: 360px;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
|
.el-input__inner {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-input),
|
:deep(.el-input),
|
||||||
:deep(.el-select),
|
:deep(.el-select),
|
||||||
:deep(.el-cascader),
|
:deep(.el-cascader),
|
||||||
:deep(.el-tree-select),
|
:deep(.el-tree-select),
|
||||||
:deep(.el-input-number),
|
|
||||||
:deep(.el-date-editor) {
|
:deep(.el-date-editor) {
|
||||||
width: 360px;
|
width: 360px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="page" class="project-apply-public-view">
|
||||||
|
<project-apply ref="project" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ProjectApply from './project-apply.vue';
|
||||||
|
import { postMkPublicProcessMessage } from '@/api/mk-process';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProjectApplyPublicView',
|
||||||
|
components: {
|
||||||
|
ProjectApply,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.handleIframeHeight = () => this.sendIframeHeight();
|
||||||
|
this.handleProcessMessage = event => this.onProcessMessage(event);
|
||||||
|
document.addEventListener('DOMContentLoaded', this.handleIframeHeight, false);
|
||||||
|
window.addEventListener('message', this.handleProcessMessage);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.documentElement.classList.add('mk-iframe-page');
|
||||||
|
document.body.classList.add('mk-iframe-page');
|
||||||
|
const app = document.getElementById('app');
|
||||||
|
if (app) app.classList.add('mk-iframe-page');
|
||||||
|
this.handleIframeHeight();
|
||||||
|
window.addEventListener('load', this.handleIframeHeight);
|
||||||
|
this.mkHeightTimers = [300, 800, 1600].map(delay => setTimeout(this.handleIframeHeight, delay));
|
||||||
|
if (typeof ResizeObserver === 'undefined') return;
|
||||||
|
this.mkHeightObserver = new ResizeObserver(() => this.handleIframeHeight());
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.page) this.mkHeightObserver.observe(this.$refs.page);
|
||||||
|
this.mkHeightObserver.observe(document.body);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
document.removeEventListener('DOMContentLoaded', this.handleIframeHeight, false);
|
||||||
|
window.removeEventListener('load', this.handleIframeHeight);
|
||||||
|
window.removeEventListener('message', this.handleProcessMessage);
|
||||||
|
(this.mkHeightTimers || []).forEach(timer => clearTimeout(timer));
|
||||||
|
if (this.mkHeightObserver) {
|
||||||
|
this.mkHeightObserver.disconnect();
|
||||||
|
this.mkHeightObserver = null;
|
||||||
|
}
|
||||||
|
document.documentElement.classList.remove('mk-iframe-page');
|
||||||
|
document.body.classList.remove('mk-iframe-page');
|
||||||
|
const app = document.getElementById('app');
|
||||||
|
if (app) app.classList.remove('mk-iframe-page');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
sendIframeHeight() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
window.parent.postMessage({ height: document.body.clientHeight }, '*');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onProcessMessage(event) {
|
||||||
|
const data = event && event.data;
|
||||||
|
if (!data || typeof data !== 'object') return;
|
||||||
|
if (data.height && !data.status && !data.type) return;
|
||||||
|
if (data.type === 'formValues' || data.type === 'afterSubmit') return;
|
||||||
|
const formValues = data.formValues;
|
||||||
|
if (data.status === 'submit') {
|
||||||
|
this.submitData(formValues);
|
||||||
|
} else if (data.status === 'save') {
|
||||||
|
this.saveData(formValues);
|
||||||
|
}
|
||||||
|
if (data.type === 'getFormValues') {
|
||||||
|
window.parent.postMessage({ type: 'formValues', formData: this.buildFormData() }, '*');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitData(lbpmFormValues) {
|
||||||
|
const formData = this.buildFormData();
|
||||||
|
this.postFormData('submit', lbpmFormValues, formData);
|
||||||
|
if (!lbpmFormValues) return;
|
||||||
|
const parameters = Object.assign({}, lbpmFormValues, {
|
||||||
|
loginName: this.getLoginName(lbpmFormValues),
|
||||||
|
formInstanceId: this.getFormId(),
|
||||||
|
subject: formData.subject,
|
||||||
|
});
|
||||||
|
window.parent.postMessage({ type: 'afterSubmit', success: true, parameters }, '*');
|
||||||
|
},
|
||||||
|
saveData(lbpmFormValues) {
|
||||||
|
this.postFormData('save', lbpmFormValues, this.buildFormData());
|
||||||
|
},
|
||||||
|
postFormData(status, formValues, formData) {
|
||||||
|
postMkPublicProcessMessage('project-apply', {
|
||||||
|
status,
|
||||||
|
formValues: formValues || {},
|
||||||
|
formData,
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('项目公开页提交流程数据失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buildFormData() {
|
||||||
|
const form = this.getProjectForm();
|
||||||
|
return {
|
||||||
|
...form,
|
||||||
|
subject: form.projectName || form.projectShortName || '',
|
||||||
|
formInstanceId: this.getFormId(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getProjectForm() {
|
||||||
|
const form = this.$refs.project && this.$refs.project.form;
|
||||||
|
if (!form) return {};
|
||||||
|
try {
|
||||||
|
return JSON.parse(JSON.stringify(form));
|
||||||
|
} catch (error) {
|
||||||
|
return { ...form };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getFormId() {
|
||||||
|
return this.$route.query.id || this.getProjectForm().id || '';
|
||||||
|
},
|
||||||
|
getLoginName(formValues = {}) {
|
||||||
|
return (
|
||||||
|
formValues.loginName ||
|
||||||
|
this.$route.query.loginName ||
|
||||||
|
this.$route.query.submitIdentity ||
|
||||||
|
''
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
html.mk-iframe-page,
|
||||||
|
html.mk-iframe-page body,
|
||||||
|
html.mk-iframe-page #app,
|
||||||
|
html.mk-iframe-page #app.mk-iframe-page {
|
||||||
|
height: auto !important;
|
||||||
|
min-height: 100%;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.project-apply-public-view {
|
||||||
|
min-height: 100%;
|
||||||
|
padding: 12px 0 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #f0f2f5;
|
||||||
|
|
||||||
|
:deep(.basic-container) {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<basic-container class="project-apply-page">
|
<basic-container class="project-apply-page" :class="{ 'is-public-view': isPublicViewPage }">
|
||||||
<avue-crud
|
<avue-crud
|
||||||
v-if="!isProjectFormPage"
|
v-if="!isProjectFormPage"
|
||||||
:option="tableOption"
|
:option="tableOption"
|
||||||
@@ -784,6 +784,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
v-if="!isPublicViewPage"
|
||||||
class="project-apply-dialog__footer"
|
class="project-apply-dialog__footer"
|
||||||
:class="{ 'project-apply-dialog__footer--change': isChangeDialog }"
|
:class="{ 'project-apply-dialog__footer--change': isChangeDialog }"
|
||||||
>
|
>
|
||||||
@@ -909,12 +910,29 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="publicCustomerVisible"
|
||||||
|
title="查看客商档案"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
width="92%"
|
||||||
|
top="4vh"
|
||||||
|
class="project-apply-public-customer-dialog"
|
||||||
|
>
|
||||||
|
<customer-archive
|
||||||
|
v-if="publicCustomerVisible"
|
||||||
|
:embedded-public-id="publicCustomerId"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
|
import { defineAsyncComponent } from 'vue';
|
||||||
import * as api from '@/api/business/project-apply';
|
import * as api from '@/api/business/project-apply';
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import {
|
import {
|
||||||
getList as getCustomerArchiveList,
|
getList as getCustomerArchiveList,
|
||||||
getDetail as getCustomerArchiveDetail,
|
getDetail as getCustomerArchiveDetail,
|
||||||
@@ -1045,7 +1063,9 @@ const majorProjectAttachmentTypeOptions = [
|
|||||||
].map(item => ({ label: item, value: item })).concat(otherAttachmentType);
|
].map(item => ({ label: item, value: item })).concat(otherAttachmentType);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'ProjectApply',
|
||||||
components: {
|
components: {
|
||||||
|
CustomerArchive: defineAsyncComponent(() => import('@/views/vehicle/customer-archive.vue')),
|
||||||
ElImageViewer,
|
ElImageViewer,
|
||||||
OpenFileViewer,
|
OpenFileViewer,
|
||||||
PdfPreview,
|
PdfPreview,
|
||||||
@@ -1239,6 +1259,8 @@ export default {
|
|||||||
changeRecordDetail: null,
|
changeRecordDetail: null,
|
||||||
changeRecordDetailRows: [],
|
changeRecordDetailRows: [],
|
||||||
userBox: false,
|
userBox: false,
|
||||||
|
publicCustomerVisible: false,
|
||||||
|
publicCustomerId: '',
|
||||||
userPickType: '',
|
userPickType: '',
|
||||||
userLoading: false,
|
userLoading: false,
|
||||||
userData: [],
|
userData: [],
|
||||||
@@ -1315,6 +1337,9 @@ export default {
|
|||||||
isProjectFormPage() {
|
isProjectFormPage() {
|
||||||
return this.isFormPageInstance;
|
return this.isFormPageInstance;
|
||||||
},
|
},
|
||||||
|
isPublicViewPage() {
|
||||||
|
return this.$route.path === '/business/project-apply/public-view';
|
||||||
|
},
|
||||||
projectFormContainer() {
|
projectFormContainer() {
|
||||||
// 表单页实例始终用页面容器,避免 keep-alive 失活时误切弹窗
|
// 表单页实例始终用页面容器,避免 keep-alive 失活时误切弹窗
|
||||||
return this.isFormPageInstance ? 'div' : 'el-dialog';
|
return this.isFormPageInstance ? 'div' : 'el-dialog';
|
||||||
@@ -1361,6 +1386,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (this.isPublicViewPage) {
|
||||||
|
this.isFormPageInstance = true;
|
||||||
|
this.openPublicProjectForm();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.loadDeptOptions();
|
this.loadDeptOptions();
|
||||||
this.loadCargoTypeOptions();
|
this.loadCargoTypeOptions();
|
||||||
this.loadTransportTypeOptions();
|
this.loadTransportTypeOptions();
|
||||||
@@ -1384,6 +1414,7 @@ export default {
|
|||||||
this.attachmentDocumentPreviewVisible = false;
|
this.attachmentDocumentPreviewVisible = false;
|
||||||
this.attachmentImagePreviewVisible = false;
|
this.attachmentImagePreviewVisible = false;
|
||||||
this.userBox = false;
|
this.userBox = false;
|
||||||
|
this.publicCustomerVisible = false;
|
||||||
},
|
},
|
||||||
buildTableOption() {
|
buildTableOption() {
|
||||||
return {
|
return {
|
||||||
@@ -1406,6 +1437,75 @@ export default {
|
|||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
||||||
},
|
},
|
||||||
|
openPublicProjectForm() {
|
||||||
|
const id = this.$route.query.id;
|
||||||
|
this.dialogType = 'view';
|
||||||
|
this.dialogReadonly = true;
|
||||||
|
this.projectBox = true;
|
||||||
|
if (!id) {
|
||||||
|
this.$message.error('缺少项目ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getMkPublicDetail('project-apply', id)
|
||||||
|
.then(res => {
|
||||||
|
const detail = res.data?.data || {};
|
||||||
|
this.applyPublicDictOptions(detail);
|
||||||
|
const displayDetail = { ...detail };
|
||||||
|
delete displayDetail.cargoTypeOptions;
|
||||||
|
delete displayDetail.transportTypeOptions;
|
||||||
|
delete displayDetail.settlementModeOptions;
|
||||||
|
this.applyProjectDetail(displayDetail);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error('项目信息加载失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
applyPublicDictOptions(detail = {}) {
|
||||||
|
this.cargoTypeOptions = this.resolvePublicDictOptions(
|
||||||
|
detail.cargoTypeOptions,
|
||||||
|
detail.cargoType
|
||||||
|
);
|
||||||
|
this.transportTypeOptions = this.resolvePublicDictOptions(
|
||||||
|
detail.transportTypeOptions,
|
||||||
|
detail.transportType
|
||||||
|
);
|
||||||
|
this.settlementModeOptions = this.resolvePublicDictOptions(
|
||||||
|
detail.settlementModeOptions,
|
||||||
|
detail.settlementMode
|
||||||
|
);
|
||||||
|
if (detail.businessDeptId) {
|
||||||
|
const label = detail.businessDeptName || String(detail.businessDeptId);
|
||||||
|
this.businessDeptTreeOptions = [{ label, value: detail.businessDeptId }];
|
||||||
|
this.deptOptions = [{ label, rawLabel: label, value: detail.businessDeptId }];
|
||||||
|
}
|
||||||
|
if (detail.undertakeDeptId) {
|
||||||
|
this.platformCompanyOptions = [
|
||||||
|
{
|
||||||
|
label: detail.undertakeDeptName || String(detail.undertakeDeptId),
|
||||||
|
value: detail.undertakeDeptId,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resolvePublicDictOptions(options, currentValue) {
|
||||||
|
const list = Array.isArray(options)
|
||||||
|
? options
|
||||||
|
.filter(item => item && item.value !== undefined && item.value !== null && item.value !== '')
|
||||||
|
.map(item => ({
|
||||||
|
label: item.label || String(item.value),
|
||||||
|
value: item.value,
|
||||||
|
}))
|
||||||
|
: [];
|
||||||
|
if (
|
||||||
|
currentValue !== undefined &&
|
||||||
|
currentValue !== null &&
|
||||||
|
currentValue !== '' &&
|
||||||
|
!list.some(item => String(item.value) === String(currentValue))
|
||||||
|
) {
|
||||||
|
list.unshift({ label: String(currentValue), value: currentValue });
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
},
|
||||||
openProjectFormPage() {
|
openProjectFormPage() {
|
||||||
const type = this.$route.query.mode || 'add';
|
const type = this.$route.query.mode || 'add';
|
||||||
const id = this.$route.query.id;
|
const id = this.$route.query.id;
|
||||||
@@ -2012,6 +2112,11 @@ export default {
|
|||||||
this.$message.warning('客商档案 ID 为空,无法打开');
|
this.$message.warning('客商档案 ID 为空,无法打开');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.isPublicViewPage) {
|
||||||
|
this.publicCustomerId = String(id);
|
||||||
|
this.publicCustomerVisible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/vehicle/customer-archive/form',
|
path: '/vehicle/customer-archive/form',
|
||||||
query: { id: String(id), name: '查看客商档案', view: '1' },
|
query: { id: String(id), name: '查看客商档案', view: '1' },
|
||||||
@@ -2594,6 +2699,12 @@ export default {
|
|||||||
this.$message.warning('项目ID为空,无法查看变更详情');
|
this.$message.warning('项目ID为空,无法查看变更详情');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.isPublicViewPage) {
|
||||||
|
this.changeRecordDetail = { ...row };
|
||||||
|
this.changeRecordDetailRows = this.buildChangeRecordDetailRows(this.changeRecordDetail);
|
||||||
|
this.changeRecordDetailVisible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (!this.transportTypeOptions.length) {
|
if (!this.transportTypeOptions.length) {
|
||||||
await this.loadTransportTypeOptions();
|
await this.loadTransportTypeOptions();
|
||||||
@@ -2650,6 +2761,12 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.project-apply-page.is-public-view {
|
||||||
|
:deep(.el-link) {
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.project-apply-form {
|
.project-apply-form {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
@@ -3019,3 +3136,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.project-apply-public-customer-dialog .el-dialog__body {
|
||||||
|
max-height: 78vh;
|
||||||
|
overflow: auto;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -99,13 +99,25 @@
|
|||||||
<el-table :data="attachmentRows" border @selection-change="selectedAttachments = $event">
|
<el-table :data="attachmentRows" border @selection-change="selectedAttachments = $event">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
<el-table-column label="文件名" min-width="240" show-overflow-tooltip>
|
<el-table-column label="文件名称" min-width="240" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" @click="previewAttachment(row)">
|
<el-link type="primary" @click="previewAttachment(row)">
|
||||||
{{ attachmentName(row) }}
|
{{ attachmentName(row) }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="附件描述" min-width="220">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span v-if="dialogReadonly">{{ row.description || '-' }}</span>
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
v-model="row.description"
|
||||||
|
maxlength="200"
|
||||||
|
placeholder="请输入"
|
||||||
|
@input="syncAttachmentsJson"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="文件大小" width="120" align="center">
|
<el-table-column label="文件大小" width="120" align="center">
|
||||||
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -172,7 +184,7 @@
|
|||||||
title="查看临时额度申请"
|
title="查看临时额度申请"
|
||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
width="96%"
|
width="1100px"
|
||||||
class="temporary-credit-limit-dialog temporary-credit-limit-detail-dialog"
|
class="temporary-credit-limit-dialog temporary-credit-limit-detail-dialog"
|
||||||
>
|
>
|
||||||
<div v-loading="detailLoading" class="business-crud-page__detail-content">
|
<div v-loading="detailLoading" class="business-crud-page__detail-content">
|
||||||
@@ -204,13 +216,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-table :data="attachmentRows" empty-text="暂无附件">
|
<el-table :data="attachmentRows" empty-text="暂无附件">
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
<el-table-column label="文件名" min-width="240" show-overflow-tooltip>
|
<el-table-column label="文件名称" min-width="240" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" @click="previewAttachment(row)">
|
<el-link type="primary" @click="previewAttachment(row)">
|
||||||
{{ attachmentName(row) }}
|
{{ attachmentName(row) }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="附件描述" min-width="220" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">{{ row.description || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="文件大小" width="120" align="center">
|
<el-table-column label="文件大小" width="120" align="center">
|
||||||
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -783,24 +798,37 @@ export default {
|
|||||||
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
this.attachmentRows = (list || []).map(item => ({
|
this.attachmentRows = (list || []).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
|
description: item.description || '',
|
||||||
uploadUserName: item.uploadUserName || uploadUserName,
|
uploadUserName: item.uploadUserName || uploadUserName,
|
||||||
uploadTime: item.uploadTime || uploadTime,
|
uploadTime: item.uploadTime || uploadTime,
|
||||||
}));
|
}));
|
||||||
this.form.attachmentsJson = JSON.stringify(this.attachmentRows);
|
this.syncAttachmentsJson();
|
||||||
},
|
},
|
||||||
removeAttachment(index) {
|
removeAttachment(index) {
|
||||||
this.attachmentRows.splice(index, 1);
|
this.attachmentRows.splice(index, 1);
|
||||||
this.form.attachmentsJson = JSON.stringify(this.attachmentRows);
|
this.syncAttachmentsJson();
|
||||||
|
},
|
||||||
|
syncAttachmentsJson() {
|
||||||
|
this.form.attachmentsJson = JSON.stringify(this.attachmentRows || []);
|
||||||
},
|
},
|
||||||
parseJsonArray(value) {
|
parseJsonArray(value) {
|
||||||
if (Array.isArray(value)) return value;
|
let list = [];
|
||||||
if (!value) return [];
|
if (Array.isArray(value)) {
|
||||||
|
list = value;
|
||||||
|
} else if (!value) {
|
||||||
|
return [];
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(value);
|
const data = JSON.parse(value);
|
||||||
return Array.isArray(data) ? data : [];
|
list = Array.isArray(data) ? data : [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return list.map(item => ({
|
||||||
|
...item,
|
||||||
|
description: item?.description || '',
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
attachmentName(row = {}) {
|
attachmentName(row = {}) {
|
||||||
return row.originalName || row.name || row.fileName || '附件';
|
return row.originalName || row.name || row.fileName || '附件';
|
||||||
@@ -907,6 +935,7 @@ export default {
|
|||||||
.temporary-credit-limit-page {
|
.temporary-credit-limit-page {
|
||||||
&__field {
|
&__field {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: 240px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__attachment-head {
|
&__attachment-head {
|
||||||
@@ -993,7 +1022,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 14px 16px 4px;
|
padding: 14px 0 4px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
@@ -1086,9 +1115,36 @@ export default {
|
|||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
padding: 0 !important;
|
padding: 0 16px 8px !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增/编辑:控件限宽,避免宽屏下撑满列宽贴到弹窗右边缘
|
||||||
|
&:not(.temporary-credit-limit-detail-dialog) {
|
||||||
|
.el-form-item__content {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content > .el-input,
|
||||||
|
.el-form-item__content > .el-select,
|
||||||
|
.el-form-item__content > .el-date-editor,
|
||||||
|
.el-form-item__content > .el-cascader,
|
||||||
|
.el-form-item__content > .el-textarea,
|
||||||
|
.temporary-credit-limit-page__field {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content > .el-textarea {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-date-editor.el-input,
|
||||||
|
.el-date-editor.el-input__wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 240px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.temporary-credit-limit-dialog .business-crud-page__detail-content .el-descriptions__label {
|
.temporary-credit-limit-dialog .business-crud-page__detail-content .el-descriptions__label {
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<mk-public-shell biz-type="waybill-manage" :get-form="getForm">
|
||||||
|
<waybill-manage-page
|
||||||
|
ref="page"
|
||||||
|
:api="api"
|
||||||
|
:config="config"
|
||||||
|
:crud-option="option"
|
||||||
|
:detail-id="detailId"
|
||||||
|
standalone-detail-page
|
||||||
|
/>
|
||||||
|
</mk-public-shell>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
|
import WaybillManagePage from '@/views/business/components/waybill-manage-page.vue';
|
||||||
|
import * as api from '@/api/business/waybill-manage';
|
||||||
|
import { config, option } from '@/option/business/waybill-manage';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WaybillManagePublicView',
|
||||||
|
components: { MkPublicShell, WaybillManagePage },
|
||||||
|
data() {
|
||||||
|
return { api, config, option };
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
detailId() {
|
||||||
|
return this.$route.query.id || '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getForm() {
|
||||||
|
const row = this.$refs.page?.detailRow || {};
|
||||||
|
return { ...row, subject: row.waybillNo || '' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="page" class="mk-public-shell">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { postMkPublicProcessMessage } from '@/api/mk-process';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MkPublicShell',
|
||||||
|
props: {
|
||||||
|
bizType: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
getForm: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.handleIframeHeight = () => this.sendIframeHeight();
|
||||||
|
this.handleProcessMessage = event => this.onProcessMessage(event);
|
||||||
|
document.addEventListener('DOMContentLoaded', this.handleIframeHeight, false);
|
||||||
|
window.addEventListener('message', this.handleProcessMessage);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.documentElement.classList.add('mk-iframe-page');
|
||||||
|
document.body.classList.add('mk-iframe-page');
|
||||||
|
const app = document.getElementById('app');
|
||||||
|
if (app) app.classList.add('mk-iframe-page');
|
||||||
|
this.handleIframeHeight();
|
||||||
|
window.addEventListener('load', this.handleIframeHeight);
|
||||||
|
this.mkHeightTimers = [300, 800, 1600].map(delay => setTimeout(this.handleIframeHeight, delay));
|
||||||
|
if (typeof ResizeObserver === 'undefined') return;
|
||||||
|
this.mkHeightObserver = new ResizeObserver(() => this.handleIframeHeight());
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.page) this.mkHeightObserver.observe(this.$refs.page);
|
||||||
|
this.mkHeightObserver.observe(document.body);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
document.removeEventListener('DOMContentLoaded', this.handleIframeHeight, false);
|
||||||
|
window.removeEventListener('load', this.handleIframeHeight);
|
||||||
|
window.removeEventListener('message', this.handleProcessMessage);
|
||||||
|
(this.mkHeightTimers || []).forEach(timer => clearTimeout(timer));
|
||||||
|
if (this.mkHeightObserver) {
|
||||||
|
this.mkHeightObserver.disconnect();
|
||||||
|
this.mkHeightObserver = null;
|
||||||
|
}
|
||||||
|
document.documentElement.classList.remove('mk-iframe-page');
|
||||||
|
document.body.classList.remove('mk-iframe-page');
|
||||||
|
const app = document.getElementById('app');
|
||||||
|
if (app) app.classList.remove('mk-iframe-page');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
sendIframeHeight() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
window.parent.postMessage({ height: document.body.clientHeight }, '*');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onProcessMessage(event) {
|
||||||
|
const data = event && event.data;
|
||||||
|
if (!data || typeof data !== 'object') return;
|
||||||
|
if (data.height && !data.status && !data.type) return;
|
||||||
|
if (data.type === 'formValues' || data.type === 'afterSubmit') return;
|
||||||
|
const formValues = data.formValues;
|
||||||
|
if (data.status === 'submit') {
|
||||||
|
this.submitData(formValues);
|
||||||
|
} else if (data.status === 'save') {
|
||||||
|
this.saveData(formValues);
|
||||||
|
}
|
||||||
|
if (data.type === 'getFormValues') {
|
||||||
|
window.parent.postMessage({ type: 'formValues', formData: this.buildFormData() }, '*');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitData(lbpmFormValues) {
|
||||||
|
const formData = this.buildFormData();
|
||||||
|
this.postFormData('submit', lbpmFormValues, formData);
|
||||||
|
if (!lbpmFormValues) return;
|
||||||
|
const parameters = Object.assign({}, lbpmFormValues, {
|
||||||
|
loginName: this.getLoginName(lbpmFormValues),
|
||||||
|
formInstanceId: this.getFormId(),
|
||||||
|
subject: formData.subject,
|
||||||
|
});
|
||||||
|
window.parent.postMessage({ type: 'afterSubmit', success: true, parameters }, '*');
|
||||||
|
},
|
||||||
|
saveData(lbpmFormValues) {
|
||||||
|
this.postFormData('save', lbpmFormValues, this.buildFormData());
|
||||||
|
},
|
||||||
|
postFormData(status, formValues, formData) {
|
||||||
|
postMkPublicProcessMessage(this.bizType, {
|
||||||
|
status,
|
||||||
|
formValues: formValues || {},
|
||||||
|
formData,
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('公开页提交流程数据失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buildFormData() {
|
||||||
|
const form = this.readForm();
|
||||||
|
return {
|
||||||
|
...form,
|
||||||
|
subject: form.subject || '',
|
||||||
|
formInstanceId: this.getFormId(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
readForm() {
|
||||||
|
const form = typeof this.getForm === 'function' ? this.getForm() : {};
|
||||||
|
if (!form) return {};
|
||||||
|
try {
|
||||||
|
return JSON.parse(JSON.stringify(form));
|
||||||
|
} catch (error) {
|
||||||
|
return { ...form };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getFormId() {
|
||||||
|
return this.$route.query.id || this.readForm().id || '';
|
||||||
|
},
|
||||||
|
getLoginName(formValues = {}) {
|
||||||
|
return (
|
||||||
|
formValues.loginName ||
|
||||||
|
this.$route.query.loginName ||
|
||||||
|
this.$route.query.submitIdentity ||
|
||||||
|
''
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
html.mk-iframe-page,
|
||||||
|
html.mk-iframe-page body,
|
||||||
|
html.mk-iframe-page #app,
|
||||||
|
html.mk-iframe-page #app.mk-iframe-page {
|
||||||
|
height: auto !important;
|
||||||
|
min-height: 100%;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mk-public-shell {
|
||||||
|
min-height: 100%;
|
||||||
|
padding: 12px 0 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #f0f2f5;
|
||||||
|
|
||||||
|
:deep(.basic-container) {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
>提交</el-button
|
>提交</el-button
|
||||||
>
|
>
|
||||||
<el-button @click="goBack">返回</el-button>
|
<el-button v-if="!isPublicViewPage" @click="goBack">返回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@@ -596,6 +596,7 @@ import '@open-file-viewer/core/style.css';
|
|||||||
import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
|
import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import * as api from '@/api/payment/paymentApplication';
|
import * as api from '@/api/payment/paymentApplication';
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import * as billLedgerApi from '@/api/payment/billLedger';
|
import * as billLedgerApi from '@/api/payment/billLedger';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||||
@@ -791,7 +792,10 @@ export default {
|
|||||||
return this.$route.query.id || '';
|
return this.$route.query.id || '';
|
||||||
},
|
},
|
||||||
readonly() {
|
readonly() {
|
||||||
return this.$route.query.mode === 'view';
|
return this.$route.query.mode === 'view' || this.isPublicViewPage;
|
||||||
|
},
|
||||||
|
isPublicViewPage() {
|
||||||
|
return this.$route.path === '/payment/payment-application/public-view';
|
||||||
},
|
},
|
||||||
canSave() {
|
canSave() {
|
||||||
const code = this.recordId ? 'payment_application_edit' : 'payment_application_add';
|
const code = this.recordId ? 'payment_application_edit' : 'payment_application_add';
|
||||||
@@ -1036,7 +1040,55 @@ export default {
|
|||||||
const body = response?.data || response || {};
|
const body = response?.data || response || {};
|
||||||
return body?.data || body;
|
return body?.data || body;
|
||||||
},
|
},
|
||||||
|
async loadPublicDetail() {
|
||||||
|
if (!this.recordId) return;
|
||||||
|
const data = this.unwrapData(
|
||||||
|
await getMkPublicDetail('payment-application', this.recordId)
|
||||||
|
);
|
||||||
|
this.form = {
|
||||||
|
...emptyForm(),
|
||||||
|
...data,
|
||||||
|
preSettlementIds: data.preSettlementIds?.length
|
||||||
|
? data.preSettlementIds
|
||||||
|
: data.preSettlementId
|
||||||
|
? [data.preSettlementId]
|
||||||
|
: [],
|
||||||
|
attachments: this.parse(data.attachmentsJson),
|
||||||
|
invoices: data.invoices || [],
|
||||||
|
};
|
||||||
|
if (this.form.paymentMethod) {
|
||||||
|
this.paymentMethodOptions = [
|
||||||
|
{
|
||||||
|
label: this.form.paymentMethodName || this.form.paymentMethod,
|
||||||
|
value: this.form.paymentMethod,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if (this.form.projectId) {
|
||||||
|
this.projectOptions = [
|
||||||
|
{
|
||||||
|
id: this.form.projectId,
|
||||||
|
projectName: this.form.projectName || this.form.projectCode,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if (this.form.contractId) {
|
||||||
|
this.contractOptions = [
|
||||||
|
{
|
||||||
|
id: this.form.contractId,
|
||||||
|
contractName: this.form.contractName || this.form.contractNo,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
const referenceRow = this.createReferenceRow(data);
|
||||||
|
this.referenceRows = referenceRow.settlementNo ? [referenceRow] : [];
|
||||||
|
this.paymentRecords = data.paymentRecords || [];
|
||||||
|
},
|
||||||
async initialize() {
|
async initialize() {
|
||||||
|
if (this.isPublicViewPage) {
|
||||||
|
await this.loadPublicDetail();
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.loadPaymentMethodOptions();
|
await this.loadPaymentMethodOptions();
|
||||||
if (this.recordId) {
|
if (this.recordId) {
|
||||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<mk-public-shell biz-type="payment-application" :get-form="getForm">
|
||||||
|
<payment-application-form ref="page" />
|
||||||
|
</mk-public-shell>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
|
import PaymentApplicationForm from '@/views/payment/payment-application-form.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PaymentApplicationPublicView',
|
||||||
|
components: { MkPublicShell, PaymentApplicationForm },
|
||||||
|
methods: {
|
||||||
|
getForm() {
|
||||||
|
const form = this.$refs.page?.form || {};
|
||||||
|
return { ...form, subject: form.paymentNo || form.projectName || '' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -211,8 +211,15 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-show="!detailCollapsed" :data="filteredDetails" border>
|
<el-table v-show="!detailCollapsed" :data="pagedDetails" border>
|
||||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
width="64"
|
||||||
|
fixed="left"
|
||||||
|
align="center"
|
||||||
|
:index="detailIndexMethod"
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="column in detailTableColumns"
|
v-for="column in detailTableColumns"
|
||||||
:key="column.prop"
|
:key="column.prop"
|
||||||
@@ -245,6 +252,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div v-show="!detailCollapsed" class="formal-editor__pagination">
|
||||||
|
<el-pagination
|
||||||
|
v-model:current-page="detailPage.current"
|
||||||
|
v-model:page-size="detailPage.size"
|
||||||
|
:total="filteredDetails.length"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleDetailPageSizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</section-card>
|
</section-card>
|
||||||
|
|
||||||
<section-card>
|
<section-card>
|
||||||
@@ -623,7 +640,7 @@
|
|||||||
>提交</el-button
|
>提交</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="pageMode" class="formal-editor__page-actions">
|
<div v-if="pageMode && !publicMode" class="formal-editor__page-actions">
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="editable && !recordId"
|
v-if="editable && !recordId"
|
||||||
@@ -929,6 +946,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import {
|
import {
|
||||||
adjustDetail,
|
adjustDetail,
|
||||||
getCandidateDetails,
|
getCandidateDetails,
|
||||||
@@ -977,6 +995,10 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
publicMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'success'],
|
emits: ['update:modelValue', 'success'],
|
||||||
data() {
|
data() {
|
||||||
@@ -1088,6 +1110,10 @@ export default {
|
|||||||
batchNo: '',
|
batchNo: '',
|
||||||
cargoName: '',
|
cargoName: '',
|
||||||
},
|
},
|
||||||
|
detailPage: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -1135,6 +1161,13 @@ export default {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
pagedDetails() {
|
||||||
|
const list = this.filteredDetails;
|
||||||
|
const size = Number(this.detailPage.size) || 10;
|
||||||
|
const current = Math.max(Number(this.detailPage.current) || 1, 1);
|
||||||
|
const start = (current - 1) * size;
|
||||||
|
return list.slice(start, start + size);
|
||||||
|
},
|
||||||
missingAttachmentTypeText() {
|
missingAttachmentTypeText() {
|
||||||
const missing = this.getMissingAttachmentTypes();
|
const missing = this.getMissingAttachmentTypes();
|
||||||
return missing.length ? `未上传:${missing.join('、')}` : '';
|
return missing.length ? `未上传:${missing.join('、')}` : '';
|
||||||
@@ -1159,6 +1192,16 @@ export default {
|
|||||||
if (value) this.initialize();
|
if (value) this.initialize();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
filteredDetails: {
|
||||||
|
handler(list) {
|
||||||
|
const size = Number(this.detailPage.size) || 10;
|
||||||
|
const maxPage = Math.max(1, Math.ceil((list?.length || 0) / size) || 1);
|
||||||
|
if (this.detailPage.current > maxPage) {
|
||||||
|
this.detailPage.current = maxPage;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
summaryTotal(value) {
|
summaryTotal(value) {
|
||||||
this.form.settlementAmount = Number(value || 0).toFixed(2);
|
this.form.settlementAmount = Number(value || 0).toFixed(2);
|
||||||
this.form.localSettlementAmount = (
|
this.form.localSettlementAmount = (
|
||||||
@@ -1173,7 +1216,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadFormalDetail(id) {
|
async loadFormalDetail(id) {
|
||||||
const response = await getDetail(id);
|
const response = this.publicMode
|
||||||
|
? await getMkPublicDetail('formal-settlement', id)
|
||||||
|
: await getDetail(id);
|
||||||
const data = this.unwrapData(response);
|
const data = this.unwrapData(response);
|
||||||
this.form = {
|
this.form = {
|
||||||
...createFormalSettlementForm(),
|
...createFormalSettlementForm(),
|
||||||
@@ -1185,12 +1230,13 @@ export default {
|
|||||||
};
|
};
|
||||||
this.sources = data.sources || [];
|
this.sources = data.sources || [];
|
||||||
this.details = data.details || [];
|
this.details = data.details || [];
|
||||||
|
this.detailPage.current = 1;
|
||||||
this.summaryFees = data.summaryFees || [];
|
this.summaryFees = data.summaryFees || [];
|
||||||
// 服务端数据已刷新,费用快照与暂存调整全部作废。
|
// 服务端数据已刷新,费用快照与暂存调整全部作废。
|
||||||
this.detailFeeSnapshots = {};
|
this.detailFeeSnapshots = {};
|
||||||
this.pendingAdjustments = {};
|
this.pendingAdjustments = {};
|
||||||
this.paymentApplications = data.paymentApplications || [];
|
this.paymentApplications = data.paymentApplications || [];
|
||||||
if (this.readonly && this.form.settlementType === 'receivable') {
|
if (this.readonly && this.form.settlementType === 'receivable' && !this.publicMode) {
|
||||||
this.receiptClaims = this.unwrapData(await getReceiptClaims(id)) || [];
|
this.receiptClaims = this.unwrapData(await getReceiptClaims(id)) || [];
|
||||||
}
|
}
|
||||||
this.adjustments = data.adjustments || [];
|
this.adjustments = data.adjustments || [];
|
||||||
@@ -1237,7 +1283,9 @@ export default {
|
|||||||
rule: null,
|
rule: null,
|
||||||
};
|
};
|
||||||
this.detailCollapsed = false;
|
this.detailCollapsed = false;
|
||||||
|
this.detailPage = { current: 1, size: 10 };
|
||||||
this.resetDetailQuery(false);
|
this.resetDetailQuery(false);
|
||||||
|
if (!this.publicMode) {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.loadAllContracts(),
|
this.loadAllContracts(),
|
||||||
this.loadFeeOptions(),
|
this.loadFeeOptions(),
|
||||||
@@ -1245,6 +1293,7 @@ export default {
|
|||||||
this.loadAttachmentTypeOptions(),
|
this.loadAttachmentTypeOptions(),
|
||||||
this.loadTransportTypeOptions(),
|
this.loadTransportTypeOptions(),
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
if (!this.recordId) {
|
if (!this.recordId) {
|
||||||
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
|
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
|
||||||
if (this.initialData) await this.applyInitialData();
|
if (this.initialData) await this.applyInitialData();
|
||||||
@@ -1328,6 +1377,7 @@ export default {
|
|||||||
settlementAmountTax:
|
settlementAmountTax:
|
||||||
row.settlementAmountTax ?? row.totalAmount ?? row.afterAmount ?? row.settlementAmount,
|
row.settlementAmountTax ?? row.totalAmount ?? row.afterAmount ?? row.settlementAmount,
|
||||||
}));
|
}));
|
||||||
|
this.detailPage.current = 1;
|
||||||
this.form.sourceDetailIds = this.details.map(item => item.sourceDetailId);
|
this.form.sourceDetailIds = this.details.map(item => item.sourceDetailId);
|
||||||
await this.refreshSummaryFees();
|
await this.refreshSummaryFees();
|
||||||
},
|
},
|
||||||
@@ -1373,6 +1423,7 @@ export default {
|
|||||||
sourcePreSettlementId: settlement.id,
|
sourcePreSettlementId: settlement.id,
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
this.detailPage.current = 1;
|
||||||
const summaryMap = new Map();
|
const summaryMap = new Map();
|
||||||
settlements
|
settlements
|
||||||
.flatMap(settlement => settlement.summaryFees || [])
|
.flatMap(settlement => settlement.summaryFees || [])
|
||||||
@@ -1601,6 +1652,7 @@ export default {
|
|||||||
...this.details.filter(item => item.formalSettlementId),
|
...this.details.filter(item => item.formalSettlementId),
|
||||||
...existing.values(),
|
...existing.values(),
|
||||||
];
|
];
|
||||||
|
this.detailPage.current = 1;
|
||||||
this.form.sourceDetailIds = [...existing.values()].map(item => item.sourceDetailId);
|
this.form.sourceDetailIds = [...existing.values()].map(item => item.sourceDetailId);
|
||||||
this.detailCandidate.loading = true;
|
this.detailCandidate.loading = true;
|
||||||
try {
|
try {
|
||||||
@@ -1819,6 +1871,9 @@ export default {
|
|||||||
return sourceDetailId ? `src:${sourceDetailId}` : '';
|
return sourceDetailId ? `src:${sourceDetailId}` : '';
|
||||||
},
|
},
|
||||||
async loadDetailFeeRows(detail) {
|
async loadDetailFeeRows(detail) {
|
||||||
|
if (this.publicMode) {
|
||||||
|
return [this.normalizeAdjustRow(detail)];
|
||||||
|
}
|
||||||
if (detail.formalSettlementId && detail.id) {
|
if (detail.formalSettlementId && detail.id) {
|
||||||
const rows = this.unwrapData(await getDetailFees(detail.id)) || [];
|
const rows = this.unwrapData(await getDetailFees(detail.id)) || [];
|
||||||
return rows.map(item => this.normalizeAdjustRow(item));
|
return rows.map(item => this.normalizeAdjustRow(item));
|
||||||
@@ -1920,12 +1975,19 @@ export default {
|
|||||||
},
|
},
|
||||||
handleDetailQuery() {
|
handleDetailQuery() {
|
||||||
this.appliedDetailQuery = { ...this.detailQuery };
|
this.appliedDetailQuery = { ...this.detailQuery };
|
||||||
|
this.detailPage.current = 1;
|
||||||
},
|
},
|
||||||
resetDetailQuery(apply = true) {
|
resetDetailQuery(apply = true) {
|
||||||
this.detailQuery = { documentNo: '', waybillNo: '', batchNo: '', cargoName: '' };
|
this.detailQuery = { documentNo: '', waybillNo: '', batchNo: '', cargoName: '' };
|
||||||
if (apply) this.handleDetailQuery();
|
if (apply) this.handleDetailQuery();
|
||||||
else this.appliedDetailQuery = { ...this.detailQuery };
|
else this.appliedDetailQuery = { ...this.detailQuery };
|
||||||
},
|
},
|
||||||
|
handleDetailPageSizeChange() {
|
||||||
|
this.detailPage.current = 1;
|
||||||
|
},
|
||||||
|
detailIndexMethod(index) {
|
||||||
|
return (this.detailPage.current - 1) * this.detailPage.size + index + 1;
|
||||||
|
},
|
||||||
exportDetails() {
|
exportDetails() {
|
||||||
if (!this.details.length) return this.$message.warning('暂无可导出的结算明细');
|
if (!this.details.length) return this.$message.warning('暂无可导出的结算明细');
|
||||||
const rows = this.details.map((row, index) => {
|
const rows = this.details.map((row, index) => {
|
||||||
|
|||||||
@@ -66,6 +66,9 @@
|
|||||||
<span v-else-if="field.prop === 'settlementType'" class="form-readonly">
|
<span v-else-if="field.prop === 'settlementType'" class="form-readonly">
|
||||||
{{ settlementTypeName }}
|
{{ settlementTypeName }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else-if="field.prop === 'createTime'" class="form-readonly">
|
||||||
|
{{ formatCreateDate(form.createTime) }}
|
||||||
|
</span>
|
||||||
<span v-else-if="field.money" class="form-readonly">
|
<span v-else-if="field.money" class="form-readonly">
|
||||||
{{ formatMoney(form[field.prop], moneyCurrency(field.prop)) }}
|
{{ formatMoney(form[field.prop], moneyCurrency(field.prop)) }}
|
||||||
</span>
|
</span>
|
||||||
@@ -184,7 +187,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-form
|
<el-form
|
||||||
:model="detailQuery"
|
:model="detailQuery"
|
||||||
inline
|
|
||||||
label-position="right"
|
label-position="right"
|
||||||
label-width="auto"
|
label-width="auto"
|
||||||
class="pre-settlement-editor__detail-filter"
|
class="pre-settlement-editor__detail-filter"
|
||||||
@@ -228,8 +230,15 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div v-show="!detailCollapsed">
|
<div v-show="!detailCollapsed">
|
||||||
<el-table :data="filteredDetails" border class="pre-settlement-editor__detail-table">
|
<el-table :data="pagedDetails" border class="pre-settlement-editor__detail-table">
|
||||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
width="64"
|
||||||
|
fixed="left"
|
||||||
|
align="center"
|
||||||
|
:index="detailIndexMethod"
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="column in visibleDetailColumns"
|
v-for="column in visibleDetailColumns"
|
||||||
:key="column.prop"
|
:key="column.prop"
|
||||||
@@ -300,6 +309,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="pre-settlement-editor__pagination">
|
||||||
|
<el-pagination
|
||||||
|
v-model:current-page="detailPage.current"
|
||||||
|
v-model:page-size="detailPage.size"
|
||||||
|
:total="filteredDetails.length"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleDetailPageSizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section-card>
|
</section-card>
|
||||||
|
|
||||||
@@ -313,13 +332,43 @@
|
|||||||
<el-table :data="attachments" border @selection-change="handleAttachmentSelectionChange">
|
<el-table :data="attachments" border @selection-change="handleAttachmentSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
<el-table-column label="文件名" min-width="260" show-overflow-tooltip>
|
<el-table-column label="附件类型" min-width="180" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-select
|
||||||
|
v-if="editable"
|
||||||
|
v-model="row.type"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="sortAttachments"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in attachmentTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<span v-else>{{ attachmentTypeName(row.type) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件名称" min-width="260" show-overflow-tooltip>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" @click="previewAttachment(row)">
|
<el-link type="primary" @click="previewAttachment(row)">
|
||||||
{{ attachmentName(row) }}
|
{{ attachmentName(row) }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="附件描述" min-width="220">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span v-if="!editable">{{ row.description || '-' }}</span>
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
v-model="row.description"
|
||||||
|
maxlength="200"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="文件大小" width="120" align="center">
|
<el-table-column label="文件大小" width="120" align="center">
|
||||||
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -425,7 +474,7 @@
|
|||||||
提交
|
提交
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="pageMode" class="pre-settlement-editor__page-actions">
|
<div v-if="pageMode && !publicMode" class="pre-settlement-editor__page-actions">
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button v-if="editable" type="primary" plain :loading="saving" @click="saveDraft(false)"
|
<el-button v-if="editable" type="primary" plain :loading="saving" @click="saveDraft(false)"
|
||||||
>保存</el-button
|
>保存</el-button
|
||||||
@@ -681,8 +730,6 @@
|
|||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-tabs v-model="adjustDialog.activeTab" class="pre-settlement-editor__adjust-tabs">
|
|
||||||
<el-tab-pane label="结算明细调整" name="adjust">
|
|
||||||
<el-table v-loading="adjustDialog.loading" :data="adjustRows" border>
|
<el-table v-loading="adjustDialog.loading" :data="adjustRows" border>
|
||||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||||
<el-table-column prop="cargoName" label="货物名称" min-width="140" align="center" />
|
<el-table-column prop="cargoName" label="货物名称" min-width="140" align="center" />
|
||||||
@@ -780,35 +827,16 @@
|
|||||||
class="pre-settlement-editor__adjust-reason"
|
class="pre-settlement-editor__adjust-reason"
|
||||||
>
|
>
|
||||||
<el-form-item label="调整原因">
|
<el-form-item label="调整原因">
|
||||||
<el-input v-model="adjustDialog.reason" maxlength="200" show-word-limit />
|
<el-input
|
||||||
|
v-model="adjustDialog.reason"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
maxlength="200"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="变更记录" name="records">
|
|
||||||
<el-table :data="changeRecords" border>
|
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
|
||||||
<el-table-column prop="changeTime" label="变更日期" min-width="170" align="center" />
|
|
||||||
<el-table-column prop="operatorName" label="经办人" min-width="140" align="center" />
|
|
||||||
<el-table-column prop="changeType" label="变更类型" min-width="160" align="center" />
|
|
||||||
<el-table-column
|
|
||||||
prop="changeReason"
|
|
||||||
label="变更原因"
|
|
||||||
min-width="240"
|
|
||||||
align="center"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column label="状态" min-width="120" align="center">
|
|
||||||
<template #default>已生效</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-link type="primary" @click="openAdjustChangeRecord(row)">查看详情</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-empty v-if="!adjustChangeRecords.length" description="暂无变更记录" :image-size="60" />
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="adjustDialog.visible = false">取消</el-button>
|
<el-button @click="adjustDialog.visible = false">取消</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -922,6 +950,7 @@
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { InfoFilled } from '@element-plus/icons-vue';
|
import { InfoFilled } from '@element-plus/icons-vue';
|
||||||
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import {
|
import {
|
||||||
adjustDetail,
|
adjustDetail,
|
||||||
getCandidateDetails,
|
getCandidateDetails,
|
||||||
@@ -982,6 +1011,10 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
publicMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'success'],
|
emits: ['update:modelValue', 'success'],
|
||||||
data() {
|
data() {
|
||||||
@@ -1054,9 +1087,14 @@ export default {
|
|||||||
batchNo: '',
|
batchNo: '',
|
||||||
cargoName: '',
|
cargoName: '',
|
||||||
},
|
},
|
||||||
|
detailPage: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
advances: [],
|
advances: [],
|
||||||
changeRecords: [],
|
changeRecords: [],
|
||||||
attachments: [],
|
attachments: [],
|
||||||
|
attachmentTypeOptions: [],
|
||||||
selectedAttachmentRows: [],
|
selectedAttachmentRows: [],
|
||||||
candidateDialog: {
|
candidateDialog: {
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -1079,7 +1117,6 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
saving: false,
|
saving: false,
|
||||||
readonly: false,
|
readonly: false,
|
||||||
activeTab: 'adjust',
|
|
||||||
detailId: '',
|
detailId: '',
|
||||||
sourceDetailId: '',
|
sourceDetailId: '',
|
||||||
detailLineNo: '',
|
detailLineNo: '',
|
||||||
@@ -1206,6 +1243,13 @@ export default {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
pagedDetails() {
|
||||||
|
const list = this.filteredDetails;
|
||||||
|
const size = Number(this.detailPage.size) || 10;
|
||||||
|
const current = Math.max(Number(this.detailPage.current) || 1, 1);
|
||||||
|
const start = (current - 1) * size;
|
||||||
|
return list.slice(start, start + size);
|
||||||
|
},
|
||||||
adjustFeeItemNames() {
|
adjustFeeItemNames() {
|
||||||
const names = new Set();
|
const names = new Set();
|
||||||
this.adjustRows.forEach(row => {
|
this.adjustRows.forEach(row => {
|
||||||
@@ -1232,6 +1276,16 @@ export default {
|
|||||||
this.form.settlementAmount = Number(value || 0).toFixed(2);
|
this.form.settlementAmount = Number(value || 0).toFixed(2);
|
||||||
this.recalculateLocalAmount();
|
this.recalculateLocalAmount();
|
||||||
},
|
},
|
||||||
|
filteredDetails: {
|
||||||
|
handler(list) {
|
||||||
|
const size = Number(this.detailPage.size) || 10;
|
||||||
|
const maxPage = Math.max(1, Math.ceil((list?.length || 0) / size) || 1);
|
||||||
|
if (this.detailPage.current > maxPage) {
|
||||||
|
this.detailPage.current = maxPage;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
@@ -1239,9 +1293,12 @@ export default {
|
|||||||
},
|
},
|
||||||
async initialize() {
|
async initialize() {
|
||||||
this.resetEditor();
|
this.resetEditor();
|
||||||
|
if (!this.publicMode) {
|
||||||
await this.loadFeeOptions();
|
await this.loadFeeOptions();
|
||||||
await this.loadFeeCategoryOptions();
|
await this.loadFeeCategoryOptions();
|
||||||
await this.loadTransportTypeOptions();
|
await this.loadTransportTypeOptions();
|
||||||
|
await this.loadAttachmentTypeOptions();
|
||||||
|
}
|
||||||
if (this.recordId) await this.loadDetail();
|
if (this.recordId) await this.loadDetail();
|
||||||
else if (this.initialData) await this.applyInitialData();
|
else if (this.initialData) await this.applyInitialData();
|
||||||
},
|
},
|
||||||
@@ -1281,6 +1338,7 @@ export default {
|
|||||||
localCurrency: first.localCurrency || 'RMB',
|
localCurrency: first.localCurrency || 'RMB',
|
||||||
});
|
});
|
||||||
this.details = rows.map(row => this.normalizeSourceDetail(row));
|
this.details = rows.map(row => this.normalizeSourceDetail(row));
|
||||||
|
this.detailPage.current = 1;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
await this.ensureSourceFeeSnapshots();
|
await this.ensureSourceFeeSnapshots();
|
||||||
@@ -1342,6 +1400,7 @@ export default {
|
|||||||
cargoName: '',
|
cargoName: '',
|
||||||
};
|
};
|
||||||
this.appliedDetailQuery = { ...this.detailQuery };
|
this.appliedDetailQuery = { ...this.detailQuery };
|
||||||
|
this.detailPage = { current: 1, size: 10 };
|
||||||
this.advances = [];
|
this.advances = [];
|
||||||
this.changeRecords = [];
|
this.changeRecords = [];
|
||||||
this.attachments = [];
|
this.attachments = [];
|
||||||
@@ -1350,7 +1409,6 @@ export default {
|
|||||||
this.pendingAdjustments = {};
|
this.pendingAdjustments = {};
|
||||||
this.sourceFeeSnapshots = {};
|
this.sourceFeeSnapshots = {};
|
||||||
this.detailFeeCache = {};
|
this.detailFeeCache = {};
|
||||||
this.adjustDialog.activeTab = 'adjust';
|
|
||||||
this.adjustDialog.detailId = '';
|
this.adjustDialog.detailId = '';
|
||||||
this.adjustDialog.sourceDetailId = '';
|
this.adjustDialog.sourceDetailId = '';
|
||||||
this.adjustDialog.detailLineNo = '';
|
this.adjustDialog.detailLineNo = '';
|
||||||
@@ -1370,11 +1428,14 @@ export default {
|
|||||||
async loadDetail() {
|
async loadDetail() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
const { data } = await getDetail(this.form.id || this.recordId);
|
const response = this.publicMode
|
||||||
const detail = data?.data || {};
|
? await getMkPublicDetail('pre-settlement', this.form.id || this.recordId)
|
||||||
|
: await getDetail(this.form.id || this.recordId);
|
||||||
|
const detail = response.data?.data || {};
|
||||||
this.form = { ...emptyPreSettlementForm(), ...detail };
|
this.form = { ...emptyPreSettlementForm(), ...detail };
|
||||||
this.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
|
this.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
|
||||||
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
|
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
|
||||||
|
this.detailPage.current = 1;
|
||||||
this.advances = (detail.advances || []).map(row => ({
|
this.advances = (detail.advances || []).map(row => ({
|
||||||
...row,
|
...row,
|
||||||
createUserName: row.createUserName || detail.createUserName,
|
createUserName: row.createUserName || detail.createUserName,
|
||||||
@@ -1382,6 +1443,7 @@ export default {
|
|||||||
}));
|
}));
|
||||||
this.changeRecords = detail.changeRecords || [];
|
this.changeRecords = detail.changeRecords || [];
|
||||||
this.attachments = this.parseAttachments(detail.attachmentsJson);
|
this.attachments = this.parseAttachments(detail.attachmentsJson);
|
||||||
|
this.sortAttachments();
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
if (
|
if (
|
||||||
detail.contractId &&
|
detail.contractId &&
|
||||||
@@ -1399,8 +1461,15 @@ export default {
|
|||||||
partyB: detail.payeeName,
|
partyB: detail.payeeName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 预加载所有明细的费用明细数据,用于拼接货物名称和类型
|
if (this.publicMode && detail.detailFees) {
|
||||||
|
Object.entries(detail.detailFees).forEach(([detailId, feeRows]) => {
|
||||||
|
if (Array.isArray(feeRows) && feeRows.length) {
|
||||||
|
this.detailFeeCache[detailId] = feeRows;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
await this.loadAllDetailFees();
|
await this.loadAllDetailFees();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
@@ -1566,6 +1635,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$message.success('保存成功');
|
this.$message.success('保存成功');
|
||||||
|
this.visible = false;
|
||||||
this.$emit('success', this.form.id);
|
this.$emit('success', this.form.id);
|
||||||
} finally {
|
} finally {
|
||||||
this[stateKey] = false;
|
this[stateKey] = false;
|
||||||
@@ -1895,6 +1965,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleDetailQuery() {
|
handleDetailQuery() {
|
||||||
this.appliedDetailQuery = { ...this.detailQuery };
|
this.appliedDetailQuery = { ...this.detailQuery };
|
||||||
|
this.detailPage.current = 1;
|
||||||
},
|
},
|
||||||
resetDetailQuery() {
|
resetDetailQuery() {
|
||||||
this.detailQuery = {
|
this.detailQuery = {
|
||||||
@@ -1904,6 +1975,13 @@ export default {
|
|||||||
cargoName: '',
|
cargoName: '',
|
||||||
};
|
};
|
||||||
this.appliedDetailQuery = { ...this.detailQuery };
|
this.appliedDetailQuery = { ...this.detailQuery };
|
||||||
|
this.detailPage.current = 1;
|
||||||
|
},
|
||||||
|
handleDetailPageSizeChange() {
|
||||||
|
this.detailPage.current = 1;
|
||||||
|
},
|
||||||
|
detailIndexMethod(index) {
|
||||||
|
return (this.detailPage.current - 1) * this.detailPage.size + index + 1;
|
||||||
},
|
},
|
||||||
normalizeAdjustRow(item, feeItemNames = []) {
|
normalizeAdjustRow(item, feeItemNames = []) {
|
||||||
const rawFeeItems =
|
const rawFeeItems =
|
||||||
@@ -2026,7 +2104,6 @@ export default {
|
|||||||
this.adjustDialog.visible = true;
|
this.adjustDialog.visible = true;
|
||||||
this.adjustDialog.loading = true;
|
this.adjustDialog.loading = true;
|
||||||
this.adjustDialog.readonly = readonly;
|
this.adjustDialog.readonly = readonly;
|
||||||
this.adjustDialog.activeTab = 'adjust';
|
|
||||||
this.adjustDialog.detailId = detailRow.id;
|
this.adjustDialog.detailId = detailRow.id;
|
||||||
this.adjustDialog.detailLineNo = detailRow.lineNo;
|
this.adjustDialog.detailLineNo = detailRow.lineNo;
|
||||||
this.adjustDialog.sourceDetailId =
|
this.adjustDialog.sourceDetailId =
|
||||||
@@ -2042,6 +2119,11 @@ export default {
|
|||||||
this.adjustRows = this.cloneAdjustRows(pending.rows);
|
this.adjustRows = this.cloneAdjustRows(pending.rows);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.publicMode) {
|
||||||
|
const cachedFees = this.detailFeeCache[detailRow.id] || [];
|
||||||
|
this.adjustRows = cachedFees.map(item => this.normalizeAdjustRow(item));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (sourceDetailId) {
|
if (sourceDetailId) {
|
||||||
if (!this.sourceFeeSnapshots[sourceDetailId]) {
|
if (!this.sourceFeeSnapshots[sourceDetailId]) {
|
||||||
this.sourceFeeSnapshots[sourceDetailId] = await this.loadSourceFeeRows(sourceDetailId);
|
this.sourceFeeSnapshots[sourceDetailId] = await this.loadSourceFeeRows(sourceDetailId);
|
||||||
@@ -2049,6 +2131,11 @@ export default {
|
|||||||
this.adjustRows = this.cloneAdjustRows(this.sourceFeeSnapshots[sourceDetailId]);
|
this.adjustRows = this.cloneAdjustRows(this.sourceFeeSnapshots[sourceDetailId]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const cachedFees = this.detailFeeCache[detailRow.id];
|
||||||
|
if (this.publicMode && Array.isArray(cachedFees)) {
|
||||||
|
this.adjustRows = cachedFees.map(item => this.normalizeAdjustRow(item));
|
||||||
|
return;
|
||||||
|
}
|
||||||
const response = await getDetailFees(detailRow.id);
|
const response = await getDetailFees(detailRow.id);
|
||||||
const rows = response.data?.data || response.data || [];
|
const rows = response.data?.data || response.data || [];
|
||||||
this.adjustRows = rows.map(item => this.normalizeAdjustRow(item));
|
this.adjustRows = rows.map(item => this.normalizeAdjustRow(item));
|
||||||
@@ -2237,10 +2324,6 @@ export default {
|
|||||||
return String(name || '').includes('运费') || String(name || '').includes('运输费');
|
return String(name || '').includes('运费') || String(name || '').includes('运输费');
|
||||||
},
|
},
|
||||||
async saveAdjustment() {
|
async saveAdjustment() {
|
||||||
if (!this.adjustDialog.reason.trim()) {
|
|
||||||
this.$message.warning('请输入调整原因');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.adjustRows.some(row => row.calculating)) {
|
if (this.adjustRows.some(row => row.calculating)) {
|
||||||
this.$message.warning('费用正在重新计算,请稍候');
|
this.$message.warning('费用正在重新计算,请稍候');
|
||||||
return;
|
return;
|
||||||
@@ -2419,13 +2502,92 @@ export default {
|
|||||||
handleAttachmentChange(list) {
|
handleAttachmentChange(list) {
|
||||||
const uploadUserName = this.userInfo?.realName || this.userInfo?.userName || '';
|
const uploadUserName = this.userInfo?.realName || this.userInfo?.userName || '';
|
||||||
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
this.attachments = (list || []).map(file => ({
|
const existingRows = this.attachments || [];
|
||||||
|
this.attachments = (list || []).map(file => {
|
||||||
|
const fileUrl = this.attachmentUrl(file);
|
||||||
|
const existing = existingRows.find(item => {
|
||||||
|
const sameUid = file.uid && item.uid && String(file.uid) === String(item.uid);
|
||||||
|
const sameUrl = fileUrl && this.attachmentUrl(item) === fileUrl;
|
||||||
|
return sameUid || sameUrl;
|
||||||
|
});
|
||||||
|
const originalName = this.attachmentName(file);
|
||||||
|
return {
|
||||||
...file,
|
...file,
|
||||||
uploadUserName: file.uploadUserName || uploadUserName,
|
type: existing?.type || file.type || this.resolveAttachmentType(originalName),
|
||||||
uploadTime: file.uploadTime || uploadTime,
|
description: existing?.description || file.description || '',
|
||||||
}));
|
uploadUserName: existing?.uploadUserName || file.uploadUserName || uploadUserName,
|
||||||
|
uploadTime: existing?.uploadTime || file.uploadTime || uploadTime,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.sortAttachments();
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
},
|
},
|
||||||
|
async loadAttachmentTypeOptions() {
|
||||||
|
try {
|
||||||
|
const response = await getDictionary({ code: 'pre_settlement_attachment_type' });
|
||||||
|
const data = response?.data?.data || [];
|
||||||
|
this.attachmentTypeOptions = data
|
||||||
|
.map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictValue,
|
||||||
|
}))
|
||||||
|
.filter(item => item.label && item.value);
|
||||||
|
} catch (error) {
|
||||||
|
this.attachmentTypeOptions = [];
|
||||||
|
}
|
||||||
|
this.sortAttachments();
|
||||||
|
},
|
||||||
|
resolveAttachmentType(fileName) {
|
||||||
|
const normalizedName = String(fileName || '').toLocaleLowerCase();
|
||||||
|
const matchedType = [...this.attachmentTypeOptions]
|
||||||
|
.filter(item => item?.label || item?.value)
|
||||||
|
.sort(
|
||||||
|
(a, b) =>
|
||||||
|
String(b.label || b.value || '').length - String(a.label || a.value || '').length
|
||||||
|
)
|
||||||
|
.find(item => {
|
||||||
|
const typeText = String(item.label || item.value || '').toLocaleLowerCase();
|
||||||
|
return typeText && normalizedName.includes(typeText);
|
||||||
|
});
|
||||||
|
if (matchedType?.value) return matchedType.value;
|
||||||
|
const otherType = this.attachmentTypeOptions.find(item => this.isOtherAttachmentType(item));
|
||||||
|
if (otherType?.value) return otherType.value;
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
isOtherAttachmentType(item) {
|
||||||
|
const typeText = String(item?.label || item?.value || '').trim();
|
||||||
|
return (
|
||||||
|
typeText === '其他' ||
|
||||||
|
typeText === '其它' ||
|
||||||
|
typeText === '其他附件' ||
|
||||||
|
typeText === '其它附件'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
getAttachmentTypeOrder(type) {
|
||||||
|
const normalizedType = String(type || '').trim();
|
||||||
|
const index = this.attachmentTypeOptions.findIndex(
|
||||||
|
item =>
|
||||||
|
String(item.value || '').trim() === normalizedType ||
|
||||||
|
String(item.label || '').trim() === normalizedType
|
||||||
|
);
|
||||||
|
return index === -1 ? Number.MAX_SAFE_INTEGER : index;
|
||||||
|
},
|
||||||
|
sortAttachments() {
|
||||||
|
this.attachments = (this.attachments || [])
|
||||||
|
.map((file, index) => ({ file, index }))
|
||||||
|
.sort((a, b) => {
|
||||||
|
const orderDifference =
|
||||||
|
this.getAttachmentTypeOrder(a.file.type) - this.getAttachmentTypeOrder(b.file.type);
|
||||||
|
return orderDifference || a.index - b.index;
|
||||||
|
})
|
||||||
|
.map(item => item.file);
|
||||||
|
},
|
||||||
|
attachmentTypeName(type) {
|
||||||
|
const option = this.attachmentTypeOptions.find(
|
||||||
|
item => String(item.value) === String(type) || String(item.label) === String(type)
|
||||||
|
);
|
||||||
|
return option?.label || type || '-';
|
||||||
|
},
|
||||||
handleAttachmentSelectionChange(rows) {
|
handleAttachmentSelectionChange(rows) {
|
||||||
this.selectedAttachmentRows = rows || [];
|
this.selectedAttachmentRows = rows || [];
|
||||||
},
|
},
|
||||||
@@ -2469,13 +2631,25 @@ export default {
|
|||||||
},
|
},
|
||||||
parseAttachments(value) {
|
parseAttachments(value) {
|
||||||
if (!value) return [];
|
if (!value) return [];
|
||||||
if (Array.isArray(value)) return value;
|
let list = [];
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
list = value;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(value);
|
const parsed = JSON.parse(value);
|
||||||
return Array.isArray(parsed) ? parsed : [];
|
list = Array.isArray(parsed) ? parsed : [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return list.map(file => {
|
||||||
|
const originalName = this.attachmentName(file);
|
||||||
|
return {
|
||||||
|
...file,
|
||||||
|
type: file?.type || this.resolveAttachmentType(originalName),
|
||||||
|
description: file?.description || '',
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
parseFeeItems(value) {
|
parseFeeItems(value) {
|
||||||
if (!value) return {};
|
if (!value) return {};
|
||||||
@@ -2512,6 +2686,11 @@ export default {
|
|||||||
if (!Number.isFinite(amount)) return '-';
|
if (!Number.isFinite(amount)) return '-';
|
||||||
return `${amount.toFixed(2)} ${currency || 'RMB'}`;
|
return `${amount.toFixed(2)} ${currency || 'RMB'}`;
|
||||||
},
|
},
|
||||||
|
formatCreateDate(value) {
|
||||||
|
if (value === undefined || value === null || value === '') return '-';
|
||||||
|
const parsed = this.$dayjs(value);
|
||||||
|
return parsed.isValid() ? parsed.format('YYYY-MM-DD') : this.displayValue(value);
|
||||||
|
},
|
||||||
formatQuantity(row) {
|
formatQuantity(row) {
|
||||||
const value = row.transportQuantity;
|
const value = row.transportQuantity;
|
||||||
if (value === undefined || value === null || value === '') return '-';
|
if (value === undefined || value === null || value === '') return '-';
|
||||||
@@ -2662,22 +2841,43 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__detail-filter {
|
&__detail-filter {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
|
||||||
gap: 0 24px;
|
align-items: center;
|
||||||
|
gap: 8px 16px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
|
padding: 12px 12px 4px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
:deep(.el-form-item) {
|
:deep(.el-form-item) {
|
||||||
|
display: flex;
|
||||||
|
min-width: 0;
|
||||||
|
margin-right: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item__content) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-input) {
|
:deep(.el-input) {
|
||||||
width: 220px;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__detail-filter-actions {
|
&__detail-filter-actions {
|
||||||
margin-left: auto;
|
width: auto;
|
||||||
|
margin-left: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
justify-self: end;
|
||||||
|
|
||||||
|
:deep(.el-form-item__content) {
|
||||||
|
flex: none;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__contract-filter {
|
&__contract-filter {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
goBack() {
|
goBack() {
|
||||||
removeSettlementTransfer(this.$route.query.transferToken);
|
removeSettlementTransfer(this.$route.query.transferToken);
|
||||||
|
this.$router.$avueRouter.closeTag();
|
||||||
this.$router.push('/settlement/formal-settlement');
|
this.$router.push('/settlement/formal-settlement');
|
||||||
},
|
},
|
||||||
syncTagTitle() {
|
syncTagTitle() {
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<mk-public-shell biz-type="formal-settlement" :get-form="getForm">
|
||||||
|
<basic-container>
|
||||||
|
<div class="mk-public-form-title">查看正式结算</div>
|
||||||
|
<formal-settlement-editor
|
||||||
|
ref="page"
|
||||||
|
:model-value="true"
|
||||||
|
page-mode
|
||||||
|
readonly
|
||||||
|
public-mode
|
||||||
|
:record-id="recordId"
|
||||||
|
/>
|
||||||
|
</basic-container>
|
||||||
|
</mk-public-shell>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
|
import FormalSettlementEditor from '@/views/settlement/components/formal-settlement-editor.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'FormalSettlementPublicView',
|
||||||
|
components: { MkPublicShell, FormalSettlementEditor },
|
||||||
|
computed: {
|
||||||
|
recordId() {
|
||||||
|
return this.$route.query.id || '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getForm() {
|
||||||
|
const form = this.$refs.page?.form || {};
|
||||||
|
return { ...form, subject: form.formalSettlementNo || form.contractName || '' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mk-public-form-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 24px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
width: 4px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background: #409eff;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -50,6 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
removeSettlementTransfer(this.$route.query.transferToken);
|
removeSettlementTransfer(this.$route.query.transferToken);
|
||||||
|
this.$router.$avueRouter.closeTag();
|
||||||
this.$router.push('/settlement/pre-settlement');
|
this.$router.push('/settlement/pre-settlement');
|
||||||
},
|
},
|
||||||
syncTagTitle() {
|
syncTagTitle() {
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<mk-public-shell biz-type="pre-settlement" :get-form="getForm">
|
||||||
|
<basic-container>
|
||||||
|
<div class="mk-public-form-title">查看预结算</div>
|
||||||
|
<pre-settlement-editor
|
||||||
|
ref="page"
|
||||||
|
:model-value="true"
|
||||||
|
page-mode
|
||||||
|
readonly
|
||||||
|
public-mode
|
||||||
|
:record-id="recordId"
|
||||||
|
/>
|
||||||
|
</basic-container>
|
||||||
|
</mk-public-shell>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
|
import PreSettlementEditor from '@/views/settlement/components/pre-settlement-editor.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PreSettlementPublicView',
|
||||||
|
components: { MkPublicShell, PreSettlementEditor },
|
||||||
|
computed: {
|
||||||
|
recordId() {
|
||||||
|
return this.$route.query.id || '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getForm() {
|
||||||
|
const form = this.$refs.page?.form || {};
|
||||||
|
return { ...form, subject: form.preSettlementNo || form.contractName || '' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mk-public-form-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 24px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
width: 4px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background: #409eff;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1153,8 +1153,7 @@ export default {
|
|||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
};
|
};
|
||||||
const dynamicColumns = this.isPayable
|
const dynamicColumns = [
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
label: '运输费',
|
label: '运输费',
|
||||||
prop: 'tableFreightAmount',
|
prop: 'tableFreightAmount',
|
||||||
@@ -1163,17 +1162,6 @@ export default {
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
},
|
},
|
||||||
otherFeeColumn,
|
otherFeeColumn,
|
||||||
]
|
|
||||||
: [
|
|
||||||
...this.tableFeeItemNames.map((name, index) => ({
|
|
||||||
label: name,
|
|
||||||
prop: `tableFeeItem${index}`,
|
|
||||||
feeItemName: name,
|
|
||||||
dynamic: true,
|
|
||||||
minWidth: 130,
|
|
||||||
align: 'right',
|
|
||||||
})),
|
|
||||||
otherFeeColumn,
|
|
||||||
];
|
];
|
||||||
if (totalIndex < 0) return [...columns, ...dynamicColumns];
|
if (totalIndex < 0) return [...columns, ...dynamicColumns];
|
||||||
columns.splice(totalIndex, 0, ...dynamicColumns);
|
columns.splice(totalIndex, 0, ...dynamicColumns);
|
||||||
@@ -1498,7 +1486,7 @@ export default {
|
|||||||
const res = await api.getList(this.page.current, this.page.size, params);
|
const res = await api.getList(this.page.current, this.page.size, params);
|
||||||
const data = this.unwrapPage(res);
|
const data = this.unwrapPage(res);
|
||||||
this.rows = (data.records || []).map(this.decorateRow);
|
this.rows = (data.records || []).map(this.decorateRow);
|
||||||
this.tableFeeItemNames = this.isPayable ? [] : this.collectFeeItemNames(this.rows);
|
this.tableFeeItemNames = [];
|
||||||
this.page.total = data.total || 0;
|
this.page.total = data.total || 0;
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -1738,7 +1726,7 @@ export default {
|
|||||||
});
|
});
|
||||||
const adjusted = {
|
const adjusted = {
|
||||||
...item,
|
...item,
|
||||||
transportQuantity: Number(item.transportQuantity || 0),
|
transportQuantity: this.normalizeAdjustTransportQuantity(item),
|
||||||
mileage:
|
mileage:
|
||||||
item.mileage === null || item.mileage === undefined || Number(item.mileage) === -1
|
item.mileage === null || item.mileage === undefined || Number(item.mileage) === -1
|
||||||
? null
|
? null
|
||||||
@@ -1767,6 +1755,21 @@ export default {
|
|||||||
feeSourceLabel(value) {
|
feeSourceLabel(value) {
|
||||||
return ['手动录入', '手动添加', '手工录入'].includes(value) ? '手动录入' : '自动生成';
|
return ['手动录入', '手动添加', '手工录入'].includes(value) ? '手动录入' : '自动生成';
|
||||||
},
|
},
|
||||||
|
normalizeAdjustTransportQuantity(item = {}) {
|
||||||
|
const value = item.transportQuantity;
|
||||||
|
if (value === undefined || value === null || value === '' || Number(value) === -1) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
const element = item.billingFactor;
|
||||||
|
// 按车辆/固定金额生成时运输量会被写成占位 1,调整弹窗无实际运输量时不展示
|
||||||
|
if (
|
||||||
|
(element === '按车辆' || element === '固定金额(整单一口价)') &&
|
||||||
|
Number(value) === 1
|
||||||
|
) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return Number(value);
|
||||||
|
},
|
||||||
adjustBillingTypes(row) {
|
adjustBillingTypes(row) {
|
||||||
return ADJUST_BILLING_TYPE_MAP[row.billingFactor] || [];
|
return ADJUST_BILLING_TYPE_MAP[row.billingFactor] || [];
|
||||||
},
|
},
|
||||||
@@ -1894,7 +1897,12 @@ export default {
|
|||||||
model: row.model,
|
model: row.model,
|
||||||
billingFactor: row.billingFactor,
|
billingFactor: row.billingFactor,
|
||||||
billingType: row.billingType,
|
billingType: row.billingType,
|
||||||
transportQuantity: row.transportQuantity,
|
transportQuantity:
|
||||||
|
row.transportQuantity === '' ||
|
||||||
|
row.transportQuantity === null ||
|
||||||
|
row.transportQuantity === undefined
|
||||||
|
? null
|
||||||
|
: Number(row.transportQuantity),
|
||||||
priceUnit: row.priceUnit,
|
priceUnit: row.priceUnit,
|
||||||
unitPrice: row.unitPrice,
|
unitPrice: row.unitPrice,
|
||||||
mileage: row.mileage,
|
mileage: row.mileage,
|
||||||
|
|||||||
+44
-16
@@ -143,7 +143,8 @@
|
|||||||
:status="oaSyncProgressStatus"
|
:status="oaSyncProgressStatus"
|
||||||
:stroke-width="12"
|
:stroke-width="12"
|
||||||
/>
|
/>
|
||||||
<div class="oa-sync-meta">
|
<div class="oa-sync-meta" v-if="oaSyncStage === 'clear'">当前阶段:{{ oaSyncStageLabel }}</div>
|
||||||
|
<div class="oa-sync-meta" v-else>
|
||||||
当前阶段:{{ oaSyncStageLabel }},第 {{ oaSyncProgress.current || 0 }} / {{ oaSyncTotalPage }} 页
|
当前阶段:{{ oaSyncStageLabel }},第 {{ oaSyncProgress.current || 0 }} / {{ oaSyncTotalPage }} 页
|
||||||
</div>
|
</div>
|
||||||
<div class="oa-sync-stats">
|
<div class="oa-sync-stats">
|
||||||
@@ -177,6 +178,7 @@ import {
|
|||||||
getDeptTree,
|
getDeptTree,
|
||||||
syncOaCompany,
|
syncOaCompany,
|
||||||
syncOaDepartment,
|
syncOaDepartment,
|
||||||
|
clearNonTopDept,
|
||||||
} from '@/api/system/dept';
|
} from '@/api/system/dept';
|
||||||
import { getLeaderList } from '@/api/system/user';
|
import { getLeaderList } from '@/api/system/user';
|
||||||
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
||||||
@@ -215,6 +217,7 @@ export default {
|
|||||||
oaSyncCancelled: false,
|
oaSyncCancelled: false,
|
||||||
oaSyncStatus: 'running',
|
oaSyncStatus: 'running',
|
||||||
oaSyncStage: 'company',
|
oaSyncStage: 'company',
|
||||||
|
oaSyncClearNonTop: false,
|
||||||
oaSyncController: null,
|
oaSyncController: null,
|
||||||
oaSyncProgress: {
|
oaSyncProgress: {
|
||||||
current: 0,
|
current: 0,
|
||||||
@@ -287,8 +290,9 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const parentId = this.normalizeParentId(this.form?.parentId);
|
const parentId = this.normalizeParentId(this.form?.parentId);
|
||||||
|
// 顶级组织不选择上级时,编码不依赖上级编码
|
||||||
if (!parentId) {
|
if (!parentId) {
|
||||||
callback(new Error('请先选择上级组织'));
|
callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.parentDept || String(this.parentDept.id) !== String(parentId)) {
|
if (!this.parentDept || String(this.parentDept.id) !== String(parentId)) {
|
||||||
@@ -429,13 +433,6 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
label: 'title',
|
label: 'title',
|
||||||
},
|
},
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择上级组织',
|
|
||||||
trigger: 'click',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '所属租户',
|
label: '所属租户',
|
||||||
@@ -520,6 +517,9 @@ export default {
|
|||||||
return '自动同步组织';
|
return '自动同步组织';
|
||||||
},
|
},
|
||||||
oaSyncStageLabel() {
|
oaSyncStageLabel() {
|
||||||
|
if (this.oaSyncStage === 'clear') {
|
||||||
|
return '清除非顶级组织';
|
||||||
|
}
|
||||||
return this.oaSyncStage === 'department' ? '同步部门' : '同步公司';
|
return this.oaSyncStage === 'department' ? '同步部门' : '同步公司';
|
||||||
},
|
},
|
||||||
oaSyncTotalPage() {
|
oaSyncTotalPage() {
|
||||||
@@ -555,21 +555,34 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleOaOrgSync() {
|
handleOaOrgSync() {
|
||||||
this.$confirm('确定从OA先同步公司、再同步部门?', '提示', {
|
this.$confirm(
|
||||||
confirmButtonText: '确定',
|
'是否清除非顶级组织?选择“是”将先删除顶级以外的组织后再同步;选择“否”则直接同步。',
|
||||||
cancelButtonText: '取消',
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '是',
|
||||||
|
cancelButtonText: '否',
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
closeOnClickModal: false,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}).then(() => {
|
}
|
||||||
this.startOaOrgSync();
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.startOaOrgSync(true);
|
||||||
|
})
|
||||||
|
.catch(action => {
|
||||||
|
if (action === 'cancel') {
|
||||||
|
this.startOaOrgSync(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
startOaOrgSync() {
|
startOaOrgSync(clearNonTop) {
|
||||||
this.oaSyncLoading = true;
|
this.oaSyncLoading = true;
|
||||||
this.oaSyncVisible = true;
|
this.oaSyncVisible = true;
|
||||||
this.oaSyncRunning = true;
|
this.oaSyncRunning = true;
|
||||||
this.oaSyncCancelled = false;
|
this.oaSyncCancelled = false;
|
||||||
this.oaSyncStatus = 'running';
|
this.oaSyncStatus = 'running';
|
||||||
this.oaSyncStage = 'company';
|
this.oaSyncClearNonTop = !!clearNonTop;
|
||||||
|
this.oaSyncStage = clearNonTop ? 'clear' : 'company';
|
||||||
this.oaSyncController = new AbortController();
|
this.oaSyncController = new AbortController();
|
||||||
this.oaSyncProgress = {
|
this.oaSyncProgress = {
|
||||||
current: 0,
|
current: 0,
|
||||||
@@ -607,6 +620,14 @@ export default {
|
|||||||
},
|
},
|
||||||
async runOaOrgSyncPages() {
|
async runOaOrgSyncPages() {
|
||||||
try {
|
try {
|
||||||
|
if (this.oaSyncClearNonTop) {
|
||||||
|
this.oaSyncStage = 'clear';
|
||||||
|
await clearNonTopDept(this.oaSyncController?.signal);
|
||||||
|
if (this.oaSyncCancelled) {
|
||||||
|
this.oaSyncStatus = 'cancelled';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.oaSyncStage = 'company';
|
this.oaSyncStage = 'company';
|
||||||
await this.runOaOrgSyncStage(syncOaCompany);
|
await this.runOaOrgSyncStage(syncOaCompany);
|
||||||
if (this.oaSyncCancelled) {
|
if (this.oaSyncCancelled) {
|
||||||
@@ -821,6 +842,11 @@ export default {
|
|||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
return result.length ? result.join('、') : '-';
|
return result.length ? result.join('、') : '-';
|
||||||
},
|
},
|
||||||
|
normalizeTopParent(row) {
|
||||||
|
if (!this.normalizeParentId(row?.parentId)) {
|
||||||
|
row.parentId = 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
isRootDept(row) {
|
isRootDept(row) {
|
||||||
return row && (row.parentId === 0 || String(row.parentId) === '0');
|
return row && (row.parentId === 0 || String(row.parentId) === '0');
|
||||||
},
|
},
|
||||||
@@ -836,6 +862,7 @@ export default {
|
|||||||
row.tenantId = row.tenantId || this.userInfo.tenantId || website.tenantId;
|
row.tenantId = row.tenantId || this.userInfo.tenantId || website.tenantId;
|
||||||
row.deptCode = String(row.deptCode || '').trim();
|
row.deptCode = String(row.deptCode || '').trim();
|
||||||
row.leaderId = func.join(row.leaderId);
|
row.leaderId = func.join(row.leaderId);
|
||||||
|
this.normalizeTopParent(row);
|
||||||
if (Number(row.deptCategory) === 6 && !row.carrierCustomerId) {
|
if (Number(row.deptCategory) === 6 && !row.carrierCustomerId) {
|
||||||
this.$message.warning('请选择承运商');
|
this.$message.warning('请选择承运商');
|
||||||
loading();
|
loading();
|
||||||
@@ -865,6 +892,7 @@ export default {
|
|||||||
row.tenantId = row.tenantId || this.userInfo.tenantId || website.tenantId;
|
row.tenantId = row.tenantId || this.userInfo.tenantId || website.tenantId;
|
||||||
row.deptCode = String(row.deptCode || '').trim();
|
row.deptCode = String(row.deptCode || '').trim();
|
||||||
row.leaderId = func.join(row.leaderId);
|
row.leaderId = func.join(row.leaderId);
|
||||||
|
this.normalizeTopParent(row);
|
||||||
if (Number(row.deptCategory) === 6 && !row.carrierCustomerId) {
|
if (Number(row.deptCategory) === 6 && !row.carrierCustomerId) {
|
||||||
this.$message.warning('请选择承运商');
|
this.$message.warning('请选择承运商');
|
||||||
loading();
|
loading();
|
||||||
|
|||||||
@@ -205,7 +205,7 @@
|
|||||||
type="password"
|
type="password"
|
||||||
show-password
|
show-password
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
placeholder="请输入登录密码"
|
placeholder="大于8位,含字母、数字、特殊字符.!@#$%^&*"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -332,7 +332,12 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="新密码" prop="password">
|
<el-form-item label="新密码" prop="password">
|
||||||
<el-input v-model="passwordForm.password" type="password" show-password />
|
<el-input
|
||||||
|
v-model="passwordForm.password"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
placeholder="大于8位,含字母、数字、特殊字符.!@#$%^&*"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@@ -424,6 +429,7 @@ import { mapGetters } from 'vuex';
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
|
import { validateLoginPassword } from '@/utils/validate';
|
||||||
import NProgress from 'nprogress';
|
import NProgress from 'nprogress';
|
||||||
import 'nprogress/nprogress.css';
|
import 'nprogress/nprogress.css';
|
||||||
import func from '@/utils/func';
|
import func from '@/utils/func';
|
||||||
@@ -487,8 +493,7 @@ export default {
|
|||||||
passwordForm: {},
|
passwordForm: {},
|
||||||
passwordRules: {
|
passwordRules: {
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
{ required: true, validator: validateLoginPassword, trigger: 'blur' },
|
||||||
{ min: 6, max: 32, message: '密码长度在6到32个字符', trigger: 'blur' },
|
|
||||||
],
|
],
|
||||||
password2: [
|
password2: [
|
||||||
{ required: true, message: '请再次输入新密码', trigger: 'blur' },
|
{ required: true, message: '请再次输入新密码', trigger: 'blur' },
|
||||||
@@ -497,6 +502,7 @@ export default {
|
|||||||
},
|
},
|
||||||
userRules: {
|
userRules: {
|
||||||
account: [{ required: true, message: '请输入账号名', trigger: 'blur' }],
|
account: [{ required: true, message: '请输入账号名', trigger: 'blur' }],
|
||||||
|
password: [{ required: true, validator: validateLoginPassword, trigger: 'blur' }],
|
||||||
realName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
realName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||||
phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
||||||
deptId: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
|
deptId: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="passwordForm.newPassword"
|
v-model="passwordForm.newPassword"
|
||||||
type="password"
|
type="password"
|
||||||
placeholder="请输入新密码"
|
placeholder="大于8位,含字母、数字、特殊字符.!@#$%^&*"
|
||||||
show-password
|
show-password
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
@@ -143,6 +143,7 @@
|
|||||||
import { getUserInfo, updateInfo, updatePassword } from '@/api/system/user';
|
import { getUserInfo, updateInfo, updatePassword } from '@/api/system/user';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import { sensitive } from '@/utils/sensitive';
|
import { sensitive } from '@/utils/sensitive';
|
||||||
|
import { isValidLoginPassword, LOGIN_PASSWORD_RULE_MESSAGE } from '@/utils/validate';
|
||||||
import {
|
import {
|
||||||
Plus,
|
Plus,
|
||||||
Bell,
|
Bell,
|
||||||
@@ -259,6 +260,18 @@ export default {
|
|||||||
},
|
},
|
||||||
// 提交密码修改
|
// 提交密码修改
|
||||||
submitPassword() {
|
submitPassword() {
|
||||||
|
if (!this.passwordForm.newPassword || !this.passwordForm.newPassword1) {
|
||||||
|
this.$message.warning('请输入新密码和确认密码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.passwordForm.newPassword !== this.passwordForm.newPassword1) {
|
||||||
|
this.$message.warning('两次输入的新密码不一致');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isValidLoginPassword(this.passwordForm.newPassword)) {
|
||||||
|
this.$message.warning(LOGIN_PASSWORD_RULE_MESSAGE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
updatePassword(
|
updatePassword(
|
||||||
md5(this.passwordForm.oldPassword),
|
md5(this.passwordForm.oldPassword),
|
||||||
|
|||||||
@@ -624,6 +624,7 @@
|
|||||||
<el-table-column label="开户人姓名" prop="accountHolderName" min-width="150" />
|
<el-table-column label="开户人姓名" prop="accountHolderName" min-width="150" />
|
||||||
<el-table-column label="收款账号" prop="bankAccount" min-width="180" />
|
<el-table-column label="收款账号" prop="bankAccount" min-width="180" />
|
||||||
<el-table-column label="开户行" prop="bankName" min-width="180" />
|
<el-table-column label="开户行" prop="bankName" min-width="180" />
|
||||||
|
<el-table-column label="联行号" prop="cnapsCode" min-width="160" />
|
||||||
<el-table-column label="备注" prop="remark" min-width="180" />
|
<el-table-column label="备注" prop="remark" min-width="180" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
@@ -1022,6 +1023,9 @@
|
|||||||
<el-form-item label="开户行" prop="bankName">
|
<el-form-item label="开户行" prop="bankName">
|
||||||
<el-input v-model="receiptForm.bankName" maxlength="100" />
|
<el-input v-model="receiptForm.bankName" maxlength="100" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="联行号" prop="cnapsCode">
|
||||||
|
<el-input v-model="receiptForm.cnapsCode" maxlength="32" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="收款账号" prop="bankAccount">
|
<el-form-item label="收款账号" prop="bankAccount">
|
||||||
<el-input v-model="receiptForm.bankAccount" maxlength="50" />
|
<el-input v-model="receiptForm.bankAccount" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -1500,7 +1504,7 @@ import {
|
|||||||
getDetail as getCreditScoreQuantificationDetail,
|
getDetail as getCreditScoreQuantificationDetail,
|
||||||
} from '@/api/vehicle/credit-score-quantification';
|
} from '@/api/vehicle/credit-score-quantification';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { processDelete, processSubmit } from '@/api/system/business-process';
|
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
import { getLazyTree } from '@/api/base/region';
|
import { getLazyTree } from '@/api/base/region';
|
||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
@@ -1539,6 +1543,12 @@ export default {
|
|||||||
OpenFileViewer,
|
OpenFileViewer,
|
||||||
PdfPreview,
|
PdfPreview,
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
embeddedPublicId: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
const nonNegativeLabelMap = {
|
const nonNegativeLabelMap = {
|
||||||
invoiceTaxRate: '开票税点',
|
invoiceTaxRate: '开票税点',
|
||||||
@@ -1779,6 +1789,7 @@ export default {
|
|||||||
accountName: [{ required: true, message: '请输入收款单位名称', trigger: 'blur' }],
|
accountName: [{ required: true, message: '请输入收款单位名称', trigger: 'blur' }],
|
||||||
accountHolderName: [{ required: true, message: '请输入开户人姓名', trigger: 'blur' }],
|
accountHolderName: [{ required: true, message: '请输入开户人姓名', trigger: 'blur' }],
|
||||||
bankName: [{ required: true, message: '请输入开户行', trigger: 'blur' }],
|
bankName: [{ required: true, message: '请输入开户行', trigger: 'blur' }],
|
||||||
|
cnapsCode: [{ required: true, message: '请输入联行号', trigger: 'blur' }],
|
||||||
bankAccount: [{ required: true, message: '请输入收款账号', trigger: 'blur' }],
|
bankAccount: [{ required: true, message: '请输入收款账号', trigger: 'blur' }],
|
||||||
remark: [{ max: 200, message: '备注最多200个字符', trigger: 'blur' }],
|
remark: [{ max: 200, message: '备注最多200个字符', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
@@ -1994,7 +2005,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
if (this.isPublicViewPage) {
|
if (this.isPublicViewPage) {
|
||||||
this.readonly = true;
|
this.readonly = true;
|
||||||
const id = this.$route.query.id;
|
const id = this.embeddedPublicId || this.$route.query.id;
|
||||||
if (!id) {
|
if (!id) {
|
||||||
this.archiveBox = true;
|
this.archiveBox = true;
|
||||||
this.$message.error('缺少客商ID');
|
this.$message.error('缺少客商ID');
|
||||||
@@ -2029,7 +2040,9 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
isPublicViewPage() {
|
isPublicViewPage() {
|
||||||
return this.$route.path === '/vehicle/customer-archive/public-view';
|
return (
|
||||||
|
this.$route.path === '/vehicle/customer-archive/public-view' || !!this.embeddedPublicId
|
||||||
|
);
|
||||||
},
|
},
|
||||||
archiveContainer() {
|
archiveContainer() {
|
||||||
return 'div';
|
return 'div';
|
||||||
@@ -2695,6 +2708,7 @@ export default {
|
|||||||
accountName: '',
|
accountName: '',
|
||||||
accountHolderName: '',
|
accountHolderName: '',
|
||||||
bankName: '',
|
bankName: '',
|
||||||
|
cnapsCode: '',
|
||||||
bankAccount: '',
|
bankAccount: '',
|
||||||
registeredPhone: '',
|
registeredPhone: '',
|
||||||
registeredAddress: '',
|
registeredAddress: '',
|
||||||
@@ -4079,7 +4093,7 @@ export default {
|
|||||||
.filter(item => item.contactName || item.contactPhone);
|
.filter(item => item.contactName || item.contactPhone);
|
||||||
archive.receiptAccounts = (archive.receiptAccounts || [])
|
archive.receiptAccounts = (archive.receiptAccounts || [])
|
||||||
.map(item => this.normalizeReceipt(item))
|
.map(item => this.normalizeReceipt(item))
|
||||||
.filter(item => item.accountName || item.accountHolderName || item.bankAccount);
|
.filter(item => item.accountName || item.accountHolderName || item.bankAccount || item.cnapsCode);
|
||||||
archive.invoices = (archive.invoices || [])
|
archive.invoices = (archive.invoices || [])
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const invoice = this.normalizeInvoice(item);
|
const invoice = this.normalizeInvoice(item);
|
||||||
@@ -4165,40 +4179,15 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 列表 / 新增 / 编辑提交共用:提交 MK 审核流并更新客商审批状态
|
* 列表 / 新增 / 编辑提交共用:开启 MK 时提交审核流,并更新客商审批状态
|
||||||
*/
|
*/
|
||||||
submitCustomerApproval(id, fullName = '', approvalStatus = '') {
|
submitCustomerApproval(id, fullName = '', approvalStatus = '') {
|
||||||
return this.submitMkApprovalFlow(id, fullName, approvalStatus).then(() => submitApproval(id));
|
return submitMkApprovalFlow({
|
||||||
},
|
bizType: 'customer-archive',
|
||||||
/**
|
formInstanceId: id,
|
||||||
* 提交 MK 审核流:templateCode 取业务字典 mk_template 中「提交客商审核流」的键值
|
subjectName: fullName,
|
||||||
* 提交人手机号由后端从用户表读取真实值(前端接口会脱敏)
|
approvalStatus,
|
||||||
* MK 驳回后再提交时,先删除旧流程再创建新流程
|
}).then(() => submitApproval(id));
|
||||||
*/
|
|
||||||
async submitMkApprovalFlow(formInstanceId, subjectName = '', approvalStatus = '') {
|
|
||||||
if (approvalStatus === 'rejected') {
|
|
||||||
await processDelete({ formInstanceId: String(formInstanceId) });
|
|
||||||
}
|
|
||||||
const templateCode = await this.resolveMkTemplateCode('提交客商审核流');
|
|
||||||
const subject = subjectName
|
|
||||||
? `客商准入审批:${subjectName}`
|
|
||||||
: `客商准入审批:${formInstanceId}`;
|
|
||||||
return processSubmit({
|
|
||||||
templateCode,
|
|
||||||
formInstanceId: String(formInstanceId),
|
|
||||||
subject,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async resolveMkTemplateCode(dictName = '提交客商审核流') {
|
|
||||||
const res = await getDictionary({ code: 'mk_template' });
|
|
||||||
const list = res?.data?.data || [];
|
|
||||||
const matched = list.find(item => String(item.dictValue || '').trim() === dictName);
|
|
||||||
const templateCode = matched?.dictKey;
|
|
||||||
if (!templateCode) {
|
|
||||||
this.$message.warning(`未配置业务字典 mk_template「${dictName}」,无法提交审核流`);
|
|
||||||
return Promise.reject(new Error(`未配置业务字典 mk_template「${dictName}」`));
|
|
||||||
}
|
|
||||||
return String(templateCode);
|
|
||||||
},
|
},
|
||||||
addScore() {
|
addScore() {
|
||||||
this.scoreRecordIndex = -1;
|
this.scoreRecordIndex = -1;
|
||||||
@@ -5309,6 +5298,16 @@ export default {
|
|||||||
|
|
||||||
.invoice-form {
|
.invoice-form {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
|
|
||||||
|
:deep(.el-input),
|
||||||
|
:deep(.el-cascader),
|
||||||
|
:deep(.el-select) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-cascader .el-input) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.invoice-contact-table {
|
.invoice-contact-table {
|
||||||
|
|||||||
@@ -564,8 +564,8 @@ export default {
|
|||||||
this.addressMapPickerVisible = true;
|
this.addressMapPickerVisible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAddressMapConfirm(address) {
|
handleAddressMapConfirm(payload) {
|
||||||
this.form.address = address;
|
this.form.address = typeof payload === 'string' ? payload : payload?.address || '';
|
||||||
},
|
},
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission[code], false);
|
||||||
|
|||||||
@@ -545,8 +545,8 @@ export default {
|
|||||||
this.addressMapPickerVisible = true;
|
this.addressMapPickerVisible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAddressMapConfirm(address) {
|
handleAddressMapConfirm(payload) {
|
||||||
this.form.address = address;
|
this.form.address = typeof payload === 'string' ? payload : payload?.address || '';
|
||||||
},
|
},
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission[code], false);
|
||||||
|
|||||||
@@ -288,8 +288,8 @@ export default {
|
|||||||
this.locationMapPickerVisible = true;
|
this.locationMapPickerVisible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleLocationMapConfirm(address) {
|
handleLocationMapConfirm(payload) {
|
||||||
this.form.location = address;
|
this.form.location = typeof payload === 'string' ? payload : payload?.address || '';
|
||||||
},
|
},
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission[code], false);
|
||||||
|
|||||||
Reference in New Issue
Block a user