员工薪资明细
This commit is contained in:
parent
6c9911f437
commit
64096c7f87
|
|
@ -205,12 +205,24 @@
|
||||||
<a-input v-model:value="formData.serviceDuration"></a-input>
|
<a-input v-model:value="formData.serviceDuration"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="标签总价(元)" v-bind="validateInfos.tagTotalPrice"
|
||||||
|
id="DirectiveAppraisalForm-tagTotalPrice" name="tagTotalPrice">
|
||||||
|
<a-input-number v-model:value="formData.tagTotalPrice"
|
||||||
|
style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="员工提成(元)" v-bind="validateInfos.ysComPrice"
|
<a-form-item label="员工提成(元)" v-bind="validateInfos.ysComPrice"
|
||||||
id="DirectiveAppraisalForm-ysComPrice" name="ysComPrice">
|
id="DirectiveAppraisalForm-ysComPrice" name="ysComPrice">
|
||||||
<a-input-number v-model:value="formData.ysComPrice" style="width: 100%" />
|
<a-input-number v-model:value="formData.ysComPrice" style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<!-- <a-col :span="12" v-if="formData.ysComPrice > (formData.comPrice + formData.tagTotalPrice)">
|
||||||
|
<a-form-item label="提醒">
|
||||||
|
<span>执行时长异常!</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -276,6 +288,7 @@ import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate } from '../DirectiveAppraisal.api';
|
import { saveOrUpdate } from '../DirectiveAppraisal.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
import { unwatchFile } from 'fs';
|
||||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
|
|
||||||
// 图片预览相关
|
// 图片预览相关
|
||||||
|
|
@ -307,7 +320,9 @@ const formData = reactive<Record<string, any>>({
|
||||||
serviceDuration: '',
|
serviceDuration: '',
|
||||||
serviceContent: '',
|
serviceContent: '',
|
||||||
comPrice: undefined,
|
comPrice: undefined,
|
||||||
|
tagTotalPrice: undefined,
|
||||||
ysComPrice: undefined,
|
ysComPrice: undefined,
|
||||||
|
realComPrice: undefined,
|
||||||
packageName: '',
|
packageName: '',
|
||||||
izPackage: '',
|
izPackage: '',
|
||||||
startTime: '',
|
startTime: '',
|
||||||
|
|
@ -321,11 +336,23 @@ const formData = reactive<Record<string, any>>({
|
||||||
manuallyMp4Path: '',
|
manuallyMp4Path: '',
|
||||||
optType: '',
|
optType: '',
|
||||||
optStatus: '',
|
optStatus: '',
|
||||||
|
optIds: '',
|
||||||
optNames: '',
|
optNames: '',
|
||||||
status: '',
|
status: '',
|
||||||
content: '',
|
content: '',
|
||||||
revocation: '',
|
revocation: '',
|
||||||
revocationTime: '',
|
revocationTime: '',
|
||||||
|
orderNo: '',
|
||||||
|
orderType: '',
|
||||||
|
nuId: '',
|
||||||
|
elderId: '',
|
||||||
|
elderName: '',
|
||||||
|
instructionTagId: '',
|
||||||
|
categoryId: '',
|
||||||
|
typeId: '',
|
||||||
|
directiveId: '',
|
||||||
|
tollPrice: '',
|
||||||
|
packageId: '',
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/salary/employeesSalaryInfo/list',
|
||||||
|
save='/salary/employeesSalaryInfo/add',
|
||||||
|
edit='/salary/employeesSalaryInfo/edit',
|
||||||
|
deleteOne = '/salary/employeesSalaryInfo/delete',
|
||||||
|
deleteBatch = '/salary/employeesSalaryInfo/deleteBatch',
|
||||||
|
importExcel = '/salary/employeesSalaryInfo/importExcel',
|
||||||
|
exportXls = '/salary/employeesSalaryInfo/exportXls',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出api
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getExportUrl = Api.exportXls;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入api
|
||||||
|
*/
|
||||||
|
export const getImportUrl = Api.importExcel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
|
*/
|
||||||
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
|
*/
|
||||||
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '确认删除',
|
||||||
|
content: '是否删除选中数据',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存或者更新
|
||||||
|
* @param params
|
||||||
|
* @param isUpdate
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '员工',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'employeeName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '区域名称',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'nuName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '分类标签',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'instructionTagName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务类别',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'categoryName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务类型',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'typeName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务指令',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'directiveName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '指令日期',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'startTime',
|
||||||
|
customRender: ({ text }) => {
|
||||||
|
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
||||||
|
return text;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '执行状态',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'optStatus_dictText',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '审核状态',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'status_dictText',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '提成',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'realComPrice',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 高级查询数据
|
||||||
|
export const superQuerySchema = {
|
||||||
|
mainId: {title: '主表ID,nu_bill_employees_main.id',order: 0,view: 'text', type: 'string',},
|
||||||
|
orderNo: {title: '单号',order: 1,view: 'text', type: 'string',},
|
||||||
|
orderType: {title: '工单类型 1护理;2医疗:3仓库;4行政',order: 2,view: 'text', type: 'string',},
|
||||||
|
nuId: {title: '护理单元ID,nu_base_info.id',order: 3,view: 'text', type: 'string',},
|
||||||
|
nuName: {title: '护理单元名称',order: 4,view: 'text', type: 'string',},
|
||||||
|
elderId: {title: '长者ID,nu_biz_elder_info.id',order: 5,view: 'text', type: 'string',},
|
||||||
|
elderName: {title: '长者名称',order: 6,view: 'text', type: 'string',},
|
||||||
|
employeeId: {title: '员工ID',order: 7,view: 'text', type: 'string',},
|
||||||
|
employeeName: {title: '员工姓名',order: 8,view: 'text', type: 'string',},
|
||||||
|
instructionTagId: {title: '分类标签',order: 9,view: 'text', type: 'string',},
|
||||||
|
instructionTagName: {title: '分类标签名称',order: 10,view: 'text', type: 'string',},
|
||||||
|
categoryId: {title: '服务类别ID,nu_config_service_category.id',order: 11,view: 'text', type: 'string',},
|
||||||
|
categoryName: {title: '服务类别名称',order: 12,view: 'text', type: 'string',},
|
||||||
|
typeId: {title: '服务类型ID,nu_config_service_type.id',order: 13,view: 'text', type: 'string',},
|
||||||
|
serviceAttribute: {title: '服务属性 ds定时 js计时',order: 14,view: 'text', type: 'string',},
|
||||||
|
typeName: {title: '服务类型名称',order: 15,view: 'text', type: 'string',},
|
||||||
|
directiveId: {title: '服务指令ID,nu_config_service_directive.id',order: 16,view: 'text', type: 'string',},
|
||||||
|
directiveName: {title: '服务指令名称',order: 17,view: 'text', type: 'string',},
|
||||||
|
cycleTypeId: {title: '周期类型ID',order: 18,view: 'text', type: 'string',},
|
||||||
|
cycleType: {title: '周期类型',order: 19,view: 'text', type: 'string',},
|
||||||
|
cycleValue: {title: '周期值',order: 20,view: 'text', type: 'string',},
|
||||||
|
serviceDuration: {title: '服务时长(分钟)',order: 21,view: 'text', type: 'string',},
|
||||||
|
serviceContent: {title: '服务说明',order: 22,view: 'text', type: 'string',},
|
||||||
|
tollPrice: {title: '收费价格',order: 23,view: 'number', type: 'number',},
|
||||||
|
tagTotalPrice: {title: '标签总价',order: 24,view: 'number', type: 'number',},
|
||||||
|
comPrice: {title: '提成价格',order: 25,view: 'number', type: 'number',},
|
||||||
|
ysComPrice: {title: '应收提成价格',order: 26,view: 'number', type: 'number',},
|
||||||
|
realComPrice: {title: '实收提成价格',order: 27,view: 'number', type: 'number',},
|
||||||
|
packageId: {title: '服务指令包ID',order: 28,view: 'text', type: 'string',},
|
||||||
|
packageName: {title: '服务指令包名称',order: 29,view: 'text', type: 'string',},
|
||||||
|
izPackage: {title: '是否是服务指令包 Y是 N否',order: 30,view: 'text', type: 'string',},
|
||||||
|
startTime: {title: '开始时间',order: 31,view: 'datetime', type: 'string',},
|
||||||
|
endTime: {title: '结束时间',order: 32,view: 'datetime', type: 'string',},
|
||||||
|
beginTime: {title: '实际开始时间',order: 33,view: 'datetime', type: 'string',},
|
||||||
|
finishTime: {title: '实际结束时间',order: 34,view: 'datetime', type: 'string',},
|
||||||
|
izStart: {title: '是否开始 Y是 N否',order: 35,view: 'text', type: 'string',},
|
||||||
|
izFinish: {title: '是否完成 Y是 N否',order: 36,view: 'text', type: 'string',},
|
||||||
|
tplinkPath: {title: 'tplink下载地址',order: 37,view: 'text', type: 'string',},
|
||||||
|
manuallyPicPath: {title: '手动拍照',order: 38,view: 'textarea', type: 'string',},
|
||||||
|
manuallyMp4Path: {title: '手动录制',order: 39,view: 'textarea', type: 'string',},
|
||||||
|
optType: {title: '执行类型 1单人 2协助 3转单',order: 40,view: 'text', type: 'string',},
|
||||||
|
optStatus: {title: '执行状态 1正常 2未执行 3超时',order: 41,view: 'text', type: 'string',},
|
||||||
|
optIds: {title: '实际执行人id(多个); 主要执行人+协助人',order: 42,view: 'text', type: 'string',},
|
||||||
|
optNames: {title: '实际执行人名称(多个); 主要执行人+协助人',order: 43,view: 'text', type: 'string',},
|
||||||
|
status: {title: '审核状态 1待审核 2通过 3未通过 4已撤回',order: 44,view: 'text', type: 'string',},
|
||||||
|
content: {title: '驳回原因',order: 45,view: 'textarea', type: 'string',},
|
||||||
|
revocation: {title: '撤回人(汉字)',order: 46,view: 'text', type: 'string',},
|
||||||
|
revocationTime: {title: '撤回时间',order: 47,view: 'datetime', type: 'string',},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,313 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||||
|
:wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="employeeName">
|
||||||
|
<template #label><span title="员工">员工</span></template>
|
||||||
|
<j-dict-select-tag v-model:value="queryParam.employeeName"
|
||||||
|
:dictCode="`nu_biz_employees_info,name,name, 1=1 order by entry_time desc`" placeholder="请选择员工"
|
||||||
|
allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="nuId">
|
||||||
|
<template #label><span title="区域名称">区域名称</span></template>
|
||||||
|
<j-dict-select-tag v-model:value="queryParam.nuId"
|
||||||
|
:dictCode="`nu_base_info,nu_name,nu_id,del_flag = 0 order by area_flag asc`" placeholder="请选择区域名称"
|
||||||
|
allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="instructionTagId">
|
||||||
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
|
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||||
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
placeholder="请选择分类标签" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="categoryId">
|
||||||
|
<template #label><span title="服务类别">服务类别</span></template>
|
||||||
|
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
||||||
|
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||||
|
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="typeId">
|
||||||
|
<template #label><span title="服务类型">服务类型</span></template>
|
||||||
|
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
|
||||||
|
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
|
||||||
|
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="directiveName">
|
||||||
|
<template #label><span title="服务指令">服务指令</span></template>
|
||||||
|
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="startTime">
|
||||||
|
<template #label><span title="指令日期">指令日期</span></template>
|
||||||
|
<a-range-picker value-format="YYYY-MM-DD" v-model:value="queryParam.startTime" class="query-group-cust" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :lg="6">
|
||||||
|
<a-form-item name="optType">
|
||||||
|
<template #label><span title="执行类型 1单人 2协助 3转单">执行类型</span></template>
|
||||||
|
<j-select-multiple placeholder="请选择执行类型 1单人 2协助 3转单" v-model:value="queryParam.optType"
|
||||||
|
dictCode="directive_order_opt_type" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="optStatus">
|
||||||
|
<template #label><span title="执行状态">执行状态</span></template>
|
||||||
|
<j-dict-select-tag v-model:value="queryParam.optStatus" dictCode="directive_order_opt_status"
|
||||||
|
placeholder="请选择执行状态" allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item name="status">
|
||||||
|
<template #label><span title="审核状态">审核状态</span></template>
|
||||||
|
<j-dict-select-tag v-model:value="queryParam.status" dictCode="appraisal_status" placeholder="请选择审核状态"
|
||||||
|
allowClear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
|
style="margin-left: 8px">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<EmployeesSalaryInfoModal ref="registerModal" @success="handleSuccess"></EmployeesSalaryInfoModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="salary-employeesSalaryInfo" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns, superQuerySchema } from './EmployeesSalaryInfo.data';
|
||||||
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './EmployeesSalaryInfo.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import EmployeesSalaryInfoModal from './components/EmployeesSalaryInfoModal.vue'
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const registerModal = ref();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '员工薪资明细',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
let rangerQuery = await setRangeQuery();
|
||||||
|
return Object.assign(params, rangerQuery);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name: "员工薪资明细",
|
||||||
|
url: getExportUrl,
|
||||||
|
params: queryParam,
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl,
|
||||||
|
success: handleSuccess
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 4,
|
||||||
|
xl: 6,
|
||||||
|
xxl: 4
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: 24,
|
||||||
|
sm: 20,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级查询事件
|
||||||
|
*/
|
||||||
|
function handleSuperQuery(params) {
|
||||||
|
Object.keys(params).map((k) => {
|
||||||
|
queryParam[k] = params[k];
|
||||||
|
});
|
||||||
|
searchQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.add();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let rangeField = 'startTime,'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置范围查询条件
|
||||||
|
*/
|
||||||
|
async function setRangeQuery() {
|
||||||
|
let queryParamClone = cloneDeep(queryParam);
|
||||||
|
if (rangeField) {
|
||||||
|
let fieldsValue = rangeField.split(',');
|
||||||
|
fieldsValue.forEach(item => {
|
||||||
|
if (queryParamClone[item]) {
|
||||||
|
let range = queryParamClone[item];
|
||||||
|
queryParamClone[item + '_begin'] = range[0];
|
||||||
|
queryParamClone[item + '_end'] = range[1];
|
||||||
|
delete queryParamClone[item];
|
||||||
|
} else {
|
||||||
|
queryParamClone[item + '_begin'] = '';
|
||||||
|
queryParamClone[item + '_end'] = '';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return queryParamClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-form-item:not(.ant-form-item-with-help) {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,509 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="14">
|
||||||
|
<JFormContainer :disabled="false">
|
||||||
|
<template #detail>
|
||||||
|
<div class="bgdiv-class leftdiv">
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="{ span: 3 }"
|
||||||
|
:wrapperCol="wrapperCol" name="DirectiveAppraisalForm">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
||||||
|
<SectionDivider :title="'考核佐证'" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="23" :push="1">
|
||||||
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
|
<a-tab-pane key="tplink" tab="TPLINK">
|
||||||
|
<a-form-item label="" id="DirectiveAppraisalForm-tplinkPath"
|
||||||
|
name="tplinkPath">
|
||||||
|
<video v-if="!!formData.tplinkPath" controls style="width: 120%;">
|
||||||
|
<source :src="opeMediaAddress + formData.tplinkPath"
|
||||||
|
type="video/mp4">
|
||||||
|
您的浏览器不支持视频播放
|
||||||
|
</video>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="sdpz" tab="手动拍照">
|
||||||
|
<a-form-item label="" id="DirectiveAppraisalForm-manuallyPicPath"
|
||||||
|
name="manuallyPicPath">
|
||||||
|
<div v-if="formData.manuallyPicPath"
|
||||||
|
style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||||
|
<div v-for="(pic, index) in formData.manuallyPicPath.split(',')"
|
||||||
|
:key="index">
|
||||||
|
<img :src="opeMediaAddress + pic"
|
||||||
|
@click="previewImage(opeMediaAddress + pic)"
|
||||||
|
style="width: 150px; height: 150px; object-fit: cover; border-radius: 8px; cursor: pointer;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-tab-pane>
|
||||||
|
|
||||||
|
<a-tab-pane key="sdlz" tab="手动录制">
|
||||||
|
<a-form-item label="" id="DirectiveAppraisalForm-manuallyMp4Path"
|
||||||
|
name="manuallyMp4Path">
|
||||||
|
<div v-if="formData.manuallyMp4Path"
|
||||||
|
style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||||
|
<div v-for="(video, index) in formData.manuallyMp4Path.split(',')"
|
||||||
|
:key="index">
|
||||||
|
<video controls style="width: 210px; border-radius: 8px;">
|
||||||
|
<source :src="opeMediaAddress + video" type="video/mp4">
|
||||||
|
您的浏览器不支持视频播放
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :span="10">
|
||||||
|
<div class="bgdiv-class">
|
||||||
|
<JFormContainer :disabled="true">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="DirectiveAppraisalForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
||||||
|
<SectionDivider :title="'基础信息'" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagName"
|
||||||
|
id="DirectiveAppraisalForm-instructionTagName" name="instructionTagName">
|
||||||
|
<a-input v-model:value="formData.instructionTagName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryName"
|
||||||
|
id="DirectiveAppraisalForm-categoryName" name="categoryName">
|
||||||
|
<a-input v-model:value="formData.categoryName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务类型" v-bind="validateInfos.typeName"
|
||||||
|
id="DirectiveAppraisalForm-typeName" name="typeName">
|
||||||
|
<a-input v-model:value="formData.typeName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务指令" v-bind="validateInfos.directiveName"
|
||||||
|
id="DirectiveAppraisalForm-directiveName" name="directiveName">
|
||||||
|
<a-input v-model:value="formData.directiveName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务指令描述" v-bind="validateInfos.serviceContent"
|
||||||
|
id="DirectiveAppraisalForm-serviceContent" name="serviceContent">
|
||||||
|
<a-input v-model:value="formData.serviceContent"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-show="formData.izPackage == 'Y'">
|
||||||
|
<a-form-item label="服务指令包" v-bind="validateInfos.packageName"
|
||||||
|
id="DirectiveAppraisalForm-packageName" name="packageName">
|
||||||
|
<a-input v-model:value="formData.packageName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</div>
|
||||||
|
<div class="bgdiv-class" style="margin-top: 14px;">
|
||||||
|
<JFormContainer :disabled="true">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="DirectiveAppraisalForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
||||||
|
<SectionDivider :title="'执行情况'" />
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :span="12">
|
||||||
|
<a-form-item label="区域名称" v-bind="validateInfos.nuName"
|
||||||
|
id="DirectiveAppraisalForm-nuName" name="nuName">
|
||||||
|
<a-input v-model:value="formData.nuName"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="执行人" v-bind="validateInfos.optNames"
|
||||||
|
id="DirectiveAppraisalForm-optNames" name="optNames">
|
||||||
|
<a-input v-model:value="formData.optNames"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="执行方式" v-bind="validateInfos.optType"
|
||||||
|
id="DirectiveAppraisalForm-optType" name="optType">
|
||||||
|
<j-dict-select-tag v-model:value="formData.optType"
|
||||||
|
dictCode="directive_order_opt_type" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="预计开始时间" v-bind="validateInfos.startTime"
|
||||||
|
id="DirectiveAppraisalForm-startTime" name="startTime">
|
||||||
|
<a-date-picker v-model:value="formData.startTime" showTime
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="预计结束时间" v-bind="validateInfos.endTime"
|
||||||
|
id="DirectiveAppraisalForm-endTime" name="endTime">
|
||||||
|
<a-date-picker v-model:value="formData.endTime" showTime
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="实际开始时间" v-bind="validateInfos.beginTime"
|
||||||
|
id="DirectiveAppraisalForm-beginTime" name="beginTime">
|
||||||
|
<a-date-picker v-model:value="formData.beginTime" showTime
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="实际结束时间" v-bind="validateInfos.finishTime"
|
||||||
|
id="DirectiveAppraisalForm-finishTime" name="finishTime">
|
||||||
|
<a-date-picker v-model:value="formData.finishTime" showTime
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="执行状态" v-bind="validateInfos.optStatus"
|
||||||
|
id="DirectiveAppraisalForm-optStatus" name="optStatus">
|
||||||
|
<j-dict-select-tag v-model:value="formData.optStatus"
|
||||||
|
dictCode="directive_order_opt_status" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务属性" v-bind="validateInfos.serviceAttribute"
|
||||||
|
id="DirectiveAppraisalForm-serviceAttribute" name="serviceAttribute">
|
||||||
|
<j-dict-select-tag v-model:value="formData.serviceAttribute"
|
||||||
|
dictCode="service_attribute" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration"
|
||||||
|
id="DirectiveAppraisalForm-serviceDuration" name="serviceDuration">
|
||||||
|
<a-input v-model:value="formData.serviceDuration"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="提成价格(元)" v-bind="validateInfos.comPrice"
|
||||||
|
id="DirectiveAppraisalForm-comPrice" name="comPrice">
|
||||||
|
<a-input-number v-model:value="formData.comPrice" placeholder="请输入提成价格"
|
||||||
|
style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="执行时长(分钟)" v-bind="validateInfos.serviceDuration"
|
||||||
|
id="DirectiveAppraisalForm-serviceDuration" name="serviceDuration">
|
||||||
|
<a-input v-model:value="formData.serviceDuration"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="标签总价(元)" v-bind="validateInfos.tagTotalPrice"
|
||||||
|
id="DirectiveAppraisalForm-tagTotalPrice" name="tagTotalPrice">
|
||||||
|
<a-input-number v-model:value="formData.tagTotalPrice"
|
||||||
|
style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="员工提成(元)" v-bind="validateInfos.realComPrice"
|
||||||
|
id="DirectiveAppraisalForm-realComPrice" name="realComPrice">
|
||||||
|
<a-input-number v-model:value="formData.realComPrice" style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :span="12" v-if="formData.ysComPrice > (formData.comPrice + formData.tagTotalPrice)">
|
||||||
|
<a-form-item label="提醒">
|
||||||
|
<span>执行时长异常!</span>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</div>
|
||||||
|
<div class="bgdiv-class" style="margin-top: 14px;">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<div class="bgdiv-class"></div>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
|
name="DirectiveAppraisalForm">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
||||||
|
<SectionDivider :title="'考核意见'" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="审核状态" v-bind="validateInfos.status"
|
||||||
|
id="DirectiveAppraisalForm-status" name="status">
|
||||||
|
<a-select v-model:value="formData.status" style="width: 200px"
|
||||||
|
placeholder="请选择审核状态">
|
||||||
|
<a-select-option value="1"
|
||||||
|
v-if="!formData.status || formData.status == '1' || formData.status == '2' || formData.status == '3'">待审核</a-select-option>
|
||||||
|
<a-select-option value="4"
|
||||||
|
v-if="formData.status == '4'">待审核</a-select-option>
|
||||||
|
<a-select-option value="2">审核通过</a-select-option>
|
||||||
|
<a-select-option value="3">审核驳回</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-show="formData.status == '3'">
|
||||||
|
<a-form-item label="驳回原因" v-bind="validateInfos.content"
|
||||||
|
id="DirectiveAppraisalForm-content" name="content">
|
||||||
|
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入驳回原因"
|
||||||
|
allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
<div class="bgdiv-class"></div>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-spin>
|
||||||
|
|
||||||
|
<!-- 图片预览模态框 -->
|
||||||
|
<a-modal :open="previewVisible" :width="modalWidth"
|
||||||
|
:bodyStyle="{ padding: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }" :footer="null"
|
||||||
|
@cancel="handlePreviewCancel">
|
||||||
|
<img ref="previewImgRef" class="preview-img" :src="previewImageUrl" @load="handleImageLoad"
|
||||||
|
style="max-width: 100%; max-height: 80vh; object-fit: contain;" />
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from '../EmployeesSalaryInfo.api';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
|
|
||||||
|
// 图片预览相关
|
||||||
|
const previewVisible = ref<boolean>(false);
|
||||||
|
const previewImageUrl = ref<string>('');
|
||||||
|
const previewImgRef = ref<HTMLImageElement | null>(null);
|
||||||
|
const modalWidth = ref<string>('auto');
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: () => ({}) },
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const activeKey = ref('tplink')
|
||||||
|
const formRef = ref();
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: '',
|
||||||
|
nuName: '',
|
||||||
|
employeeName: '',
|
||||||
|
instructionTagName: '',
|
||||||
|
categoryName: '',
|
||||||
|
serviceAttribute: '',
|
||||||
|
typeName: '',
|
||||||
|
directiveName: '',
|
||||||
|
cycleTypeId: '',
|
||||||
|
cycleType: '',
|
||||||
|
cycleValue: '',
|
||||||
|
serviceDuration: '',
|
||||||
|
serviceContent: '',
|
||||||
|
comPrice: undefined,
|
||||||
|
tagTotalPrice: undefined,
|
||||||
|
ysComPrice: undefined,
|
||||||
|
realComPrice: undefined,
|
||||||
|
packageName: '',
|
||||||
|
izPackage: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
beginTime: '',
|
||||||
|
finishTime: '',
|
||||||
|
izStart: '',
|
||||||
|
izFinish: '',
|
||||||
|
tplinkPath: '',
|
||||||
|
manuallyPicPath: '',
|
||||||
|
manuallyMp4Path: '',
|
||||||
|
optType: '',
|
||||||
|
optStatus: '',
|
||||||
|
optIds: '',
|
||||||
|
optNames: '',
|
||||||
|
status: '',
|
||||||
|
content: '',
|
||||||
|
revocation: '',
|
||||||
|
revocationTime: '',
|
||||||
|
orderNo: '',
|
||||||
|
orderType: '',
|
||||||
|
nuId: '',
|
||||||
|
elderId: '',
|
||||||
|
elderName: '',
|
||||||
|
instructionTagId: '',
|
||||||
|
categoryId: '',
|
||||||
|
typeId: '',
|
||||||
|
directiveId: '',
|
||||||
|
tollPrice: '',
|
||||||
|
packageId: '',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
watch(
|
||||||
|
() => formData.status,
|
||||||
|
(n, o) => {
|
||||||
|
if (o == '4') {
|
||||||
|
formData.content = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = reactive({
|
||||||
|
status: [{ required: true, message: '请选择审核状态!' }],
|
||||||
|
auditContent: [
|
||||||
|
{
|
||||||
|
validator: async (_rule, value) => {
|
||||||
|
if (formData.status === '3' && !value) {
|
||||||
|
return Promise.reject('请输入驳回原因!');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(() => {
|
||||||
|
if (props.formBpm === true) {
|
||||||
|
if (props.formData.disabled === false) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if (record.hasOwnProperty(key)) {
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, tmpData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
if (formData.status == 1 || formData.status == 4) {
|
||||||
|
formData.status = null
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
} catch ({ errorFields }) {
|
||||||
|
if (errorFields) {
|
||||||
|
const firstField = errorFields[0];
|
||||||
|
if (firstField) {
|
||||||
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.reject(errorFields);
|
||||||
|
}
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 预览图片
|
||||||
|
const previewImage = (url: string) => {
|
||||||
|
previewImageUrl.value = url;
|
||||||
|
previewVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭预览
|
||||||
|
const handlePreviewCancel = () => {
|
||||||
|
previewVisible.value = false;
|
||||||
|
previewImageUrl.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
// 图片加载完成后计算合适的模态框宽度
|
||||||
|
const handleImageLoad = () => {
|
||||||
|
if (!previewImgRef.value) return;
|
||||||
|
|
||||||
|
const img = previewImgRef.value;
|
||||||
|
const maxWidth = window.innerWidth * 0.9; // 最大宽度为屏幕90%
|
||||||
|
const maxHeight = window.innerHeight * 0.8; // 最大高度为屏幕80%
|
||||||
|
|
||||||
|
// 计算适应比例,确保图片不超过屏幕
|
||||||
|
const ratio = Math.min(maxWidth / img.naturalWidth, maxHeight / img.naturalHeight, 1);
|
||||||
|
modalWidth.value = `${img.naturalWidth * ratio}px`;
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<template>
|
||||||
|
<a-drawer :title="title" width="100%" v-model:visible="visible" :closable="true"
|
||||||
|
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||||
|
<EmployeesSalaryInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></EmployeesSalaryInfoForm>
|
||||||
|
</a-drawer >
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import EmployeesSalaryInfoForm from './EmployeesSalaryInfoForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(800);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
Loading…
Reference in New Issue