服务指令考核
This commit is contained in:
parent
ae3b66495a
commit
78fd4dbdbc
|
|
@ -0,0 +1,82 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/appraisal/directiveAppraisal/list',
|
||||
save = '/appraisal/directiveAppraisal/add',
|
||||
edit = '/appraisal/directiveAppraisal/edit',
|
||||
deleteOne = '/appraisal/directiveAppraisal/delete',
|
||||
deleteBatch = '/appraisal/directiveAppraisal/deleteBatch',
|
||||
importExcel = '/appraisal/directiveAppraisal/importExcel',
|
||||
exportXls = '/appraisal/directiveAppraisal/exportXls',
|
||||
revocation = '/appraisal/directiveAppraisal/revocation',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出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 });
|
||||
};
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const handleRevocation = (params) => {
|
||||
return defHttp.post({ url: Api.revocation, params }, { isTransformResponse: false });
|
||||
};
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
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: 'optNames',
|
||||
},
|
||||
{
|
||||
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: 'content'
|
||||
// },
|
||||
// {
|
||||
// title: '撤回人(汉字)',
|
||||
// align: "center",
|
||||
// dataIndex: 'revocation'
|
||||
// },
|
||||
// {
|
||||
// title: '撤回时间',
|
||||
// align: "center",
|
||||
// dataIndex: 'revocationTime'
|
||||
// },
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
nuName: { title: '护理单元名称', order: 1, view: 'text', type: 'string' },
|
||||
instructionTagName: { title: '分类标签名称', order: 4, view: 'text', type: 'string' },
|
||||
categoryName: { title: '服务类别名称', order: 6, view: 'text', type: 'string' },
|
||||
directiveName: { title: '服务指令名称', order: 10, view: 'text', type: 'string' },
|
||||
startTime: { title: '开始时间', order: 20, view: 'date', type: 'string' },
|
||||
optType: { title: '执行类型 1单人 2协助 3转单', order: 29, view: 'list', type: 'string', dictCode: 'directive_order_opt_type' },
|
||||
optStatus: { title: '执行状态 1正常 2未执行 3超时', order: 30, view: 'list', type: 'string', dictCode: 'directive_order_opt_status' },
|
||||
optNames: { title: '实际执行人名称(多个); 主要执行人+协助人', order: 31, view: 'text', type: 'string' },
|
||||
status: { title: '审核状态 0待审核 1通过 2未通过', order: 32, view: 'list', type: 'string', dictCode: 'appraisal_status' },
|
||||
content: { title: '驳回原因', order: 33, view: 'textarea', type: 'string' },
|
||||
revocation: { title: '撤回人(汉字)', order: 34, view: 'text', type: 'string' },
|
||||
revocationTime: { title: '撤回时间', order: 35, view: 'datetime', type: 'string' },
|
||||
};
|
||||
|
|
@ -0,0 +1,324 @@
|
|||
<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="optNames">
|
||||
<template #label><span title="员工">员工</span></template>
|
||||
<j-dict-select-tag v-model:value="queryParam.optNames"
|
||||
: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" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<DirectiveAppraisalModal ref="registerModal" @success="handleSuccess"></DirectiveAppraisalModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="appraisal-directiveAppraisal" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DirectiveAppraisal.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, handleRevocation } from './DirectiveAppraisal.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import DirectiveAppraisalModal from './components/DirectiveAppraisalModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({
|
||||
startTime: (() => {
|
||||
const d = new Date();
|
||||
d.setDate(d.getDate() - 1); // 减一天
|
||||
const dateStr = d.toISOString().split('T')[0];
|
||||
return [dateStr, dateStr];
|
||||
})()
|
||||
});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
watch(
|
||||
() => queryParam.instructionTagId,
|
||||
() => {
|
||||
queryParam.categoryId = ''
|
||||
queryParam.typeId = ''
|
||||
}
|
||||
)
|
||||
|
||||
// 当服务类别变动,清空服务类型
|
||||
watch(
|
||||
() => queryParam.categoryId,
|
||||
() => {
|
||||
queryParam.typeId = ''
|
||||
}
|
||||
)
|
||||
//注册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,
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* @param record
|
||||
*/
|
||||
function handleRevocationFunc(record) {
|
||||
handleRevocation({ id: record.id }).then(res => {
|
||||
createMessage.success('操作成功');
|
||||
reload()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '考核',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: record.status == '1' || record.status == '4'
|
||||
}, {
|
||||
label: '撤回',
|
||||
ifShow: record.status == '2' || record.status == '3',
|
||||
popConfirm: {
|
||||
title: '是否确认撤回',
|
||||
confirm: handleRevocationFunc.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,332 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DirectiveAppraisalForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="护理单元名称" v-bind="validateInfos.nuName" id="DirectiveAppraisalForm-nuName" name="nuName">
|
||||
<a-input v-model:value="formData.nuName" placeholder="请输入护理单元名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="员工姓名" v-bind="validateInfos.employeeName" id="DirectiveAppraisalForm-employeeName" name="employeeName">
|
||||
<a-input v-model:value="formData.employeeName" placeholder="请输入员工姓名" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="分类标签名称" v-bind="validateInfos.instructionTagName" id="DirectiveAppraisalForm-instructionTagName" name="instructionTagName">
|
||||
<a-input v-model:value="formData.instructionTagName" placeholder="请输入分类标签名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类别名称" v-bind="validateInfos.categoryName" id="DirectiveAppraisalForm-categoryName" name="categoryName">
|
||||
<a-input v-model:value="formData.categoryName" placeholder="请输入服务类别名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务属性 ds定时 js计时" v-bind="validateInfos.serviceAttribute" id="DirectiveAppraisalForm-serviceAttribute" name="serviceAttribute">
|
||||
<a-input v-model:value="formData.serviceAttribute" placeholder="请输入服务属性 ds定时 js计时" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务类型名称" v-bind="validateInfos.typeName" id="DirectiveAppraisalForm-typeName" name="typeName">
|
||||
<a-input v-model:value="formData.typeName" placeholder="请输入服务类型名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName" id="DirectiveAppraisalForm-directiveName" name="directiveName">
|
||||
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="周期类型ID" v-bind="validateInfos.cycleTypeId" id="DirectiveAppraisalForm-cycleTypeId" name="cycleTypeId">
|
||||
<a-input v-model:value="formData.cycleTypeId" placeholder="请输入周期类型ID" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="DirectiveAppraisalForm-cycleType" name="cycleType">
|
||||
<a-input v-model:value="formData.cycleType" placeholder="请输入周期类型" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="周期值" v-bind="validateInfos.cycleValue" id="DirectiveAppraisalForm-cycleValue" name="cycleValue">
|
||||
<a-input v-model:value="formData.cycleValue" placeholder="请输入周期值" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务时长(分钟)" v-bind="validateInfos.serviceDuration" id="DirectiveAppraisalForm-serviceDuration" name="serviceDuration">
|
||||
<a-input v-model:value="formData.serviceDuration" placeholder="请输入服务时长(分钟)" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务说明" v-bind="validateInfos.serviceContent" id="DirectiveAppraisalForm-serviceContent" name="serviceContent">
|
||||
<a-input v-model:value="formData.serviceContent" placeholder="请输入服务说明" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<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="24">
|
||||
<a-form-item label="应收提成价格" v-bind="validateInfos.ysComPrice" id="DirectiveAppraisalForm-ysComPrice" name="ysComPrice">
|
||||
<a-input-number v-model:value="formData.ysComPrice" placeholder="请输入应收提成价格" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="服务指令包名称" v-bind="validateInfos.packageName" id="DirectiveAppraisalForm-packageName" name="packageName">
|
||||
<a-input v-model:value="formData.packageName" placeholder="请输入服务指令包名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否是服务指令包 Y是 N否" v-bind="validateInfos.izPackage" id="DirectiveAppraisalForm-izPackage" name="izPackage">
|
||||
<a-input v-model:value="formData.izPackage" placeholder="请输入是否是服务指令包 Y是 N否" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开始时间" v-bind="validateInfos.startTime" id="DirectiveAppraisalForm-startTime" name="startTime">
|
||||
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.startTime" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="结束时间" v-bind="validateInfos.endTime" id="DirectiveAppraisalForm-endTime" name="endTime">
|
||||
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="实际开始时间" v-bind="validateInfos.beginTime" id="DirectiveAppraisalForm-beginTime" name="beginTime">
|
||||
<a-date-picker placeholder="请选择实际开始时间" v-model:value="formData.beginTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="实际结束时间" v-bind="validateInfos.finishTime" id="DirectiveAppraisalForm-finishTime" name="finishTime">
|
||||
<a-date-picker placeholder="请选择实际结束时间" v-model:value="formData.finishTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否开始 Y是 N否" v-bind="validateInfos.izStart" id="DirectiveAppraisalForm-izStart" name="izStart">
|
||||
<a-input v-model:value="formData.izStart" placeholder="请输入是否开始 Y是 N否" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否完成 Y是 N否" v-bind="validateInfos.izFinish" id="DirectiveAppraisalForm-izFinish" name="izFinish">
|
||||
<a-input v-model:value="formData.izFinish" placeholder="请输入是否完成 Y是 N否" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="tplink下载地址" v-bind="validateInfos.tplinkPath" id="DirectiveAppraisalForm-tplinkPath" name="tplinkPath">
|
||||
<a-input v-model:value="formData.tplinkPath" placeholder="请输入tplink下载地址" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="手动拍照" v-bind="validateInfos.manuallyPicPath" id="DirectiveAppraisalForm-manuallyPicPath" name="manuallyPicPath">
|
||||
<a-textarea v-model:value="formData.manuallyPicPath" :rows="4" placeholder="请输入手动拍照" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="手动录制" v-bind="validateInfos.manuallyMp4Path" id="DirectiveAppraisalForm-manuallyMp4Path" name="manuallyMp4Path">
|
||||
<a-textarea v-model:value="formData.manuallyMp4Path" :rows="4" placeholder="请输入手动录制" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="执行类型 1单人 2协助 3转单" v-bind="validateInfos.optType" id="DirectiveAppraisalForm-optType" name="optType">
|
||||
<j-dict-select-tag v-model:value="formData.optType" dictCode="directive_order_opt_type" placeholder="请选择执行类型 1单人 2协助 3转单" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="执行状态 1正常 2未执行 3超时" v-bind="validateInfos.optStatus" id="DirectiveAppraisalForm-optStatus" name="optStatus">
|
||||
<j-dict-select-tag v-model:value="formData.optStatus" dictCode="directive_order_opt_status" placeholder="请选择执行状态 1正常 2未执行 3超时" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="实际执行人名称(多个); 主要执行人+协助人" v-bind="validateInfos.optNames" id="DirectiveAppraisalForm-optNames" name="optNames">
|
||||
<a-input v-model:value="formData.optNames" placeholder="请输入实际执行人名称(多个); 主要执行人+协助人" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="审核状态 0待审核 1通过 2未通过" v-bind="validateInfos.status" id="DirectiveAppraisalForm-status" name="status">
|
||||
<j-dict-select-tag v-model:value="formData.status" dictCode="appraisal_status" placeholder="请选择审核状态 0待审核 1通过 2未通过" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="驳回原因" v-bind="validateInfos.content" id="DirectiveAppraisalForm-content" name="content">
|
||||
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入驳回原因" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="撤回人(汉字)" v-bind="validateInfos.revocation" id="DirectiveAppraisalForm-revocation" name="revocation">
|
||||
<a-input v-model:value="formData.revocation" placeholder="请输入撤回人(汉字)" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="撤回时间" v-bind="validateInfos.revocationTime" id="DirectiveAppraisalForm-revocationTime" name="revocationTime">
|
||||
<a-date-picker placeholder="请选择撤回时间" v-model:value="formData.revocationTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../DirectiveAppraisal.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
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,
|
||||
ysComPrice: undefined,
|
||||
packageName: '',
|
||||
izPackage: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
beginTime: '',
|
||||
finishTime: '',
|
||||
izStart: '',
|
||||
izFinish: '',
|
||||
tplinkPath: '',
|
||||
manuallyPicPath: '',
|
||||
manuallyMp4Path: '',
|
||||
optType: '',
|
||||
optStatus: '',
|
||||
optNames: '',
|
||||
status: '',
|
||||
content: '',
|
||||
revocation: '',
|
||||
revocationTime: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
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() {
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,494 @@
|
|||
<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.ysComPrice"
|
||||
id="DirectiveAppraisalForm-ysComPrice" name="ysComPrice">
|
||||
<a-input-number v-model:value="formData.ysComPrice" style="width: 100%" />
|
||||
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../DirectiveAppraisal.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.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,
|
||||
ysComPrice: undefined,
|
||||
packageName: '',
|
||||
izPackage: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
beginTime: '',
|
||||
finishTime: '',
|
||||
izStart: '',
|
||||
izFinish: '',
|
||||
tplinkPath: '',
|
||||
manuallyPicPath: '',
|
||||
manuallyMp4Path: '',
|
||||
optType: '',
|
||||
optStatus: '',
|
||||
optNames: '',
|
||||
status: '',
|
||||
content: '',
|
||||
revocation: '',
|
||||
revocationTime: '',
|
||||
});
|
||||
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;
|
||||
}
|
||||
|
||||
.bgdiv-class {
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
|
||||
}
|
||||
|
||||
.leftdiv {
|
||||
height: 84vh;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<template>
|
||||
<a-drawer :title="title" width="100%" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
|
||||
<DirectiveAppraisalForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||
:formBpm="false"></DirectiveAppraisalForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import DirectiveAppraisalForm from './DirectiveAppraisalForm.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