yxk-20260605-我为四所把把脉代码初始化
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
import {defHttp} from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/bqtakepulse/bgTakepulse/list',
|
||||
save='/bqtakepulse/bgTakepulse/add',
|
||||
edit='/bqtakepulse/bgTakepulse/edit',
|
||||
deleteOne = '/bqtakepulse/bgTakepulse/delete',
|
||||
deleteBatch = '/bqtakepulse/bgTakepulse/deleteBatch',
|
||||
importExcel = '/bqtakepulse/bgTakepulse/importExcel',
|
||||
exportXls = '/bqtakepulse/bgTakepulse/exportXls',
|
||||
queryDataById = '/bqtakepulse/bgTakepulse/queryById',
|
||||
bgTakepulseFeedbackList = '/bqtakepulse/bgTakepulse/queryBgTakepulseFeedbackByMainId',
|
||||
}
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 查询子表数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryBgTakepulseFeedbackListByMainId = (id) => defHttp.get({url: Api.bgTakepulseFeedbackList, params:{ id }});
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) =>
|
||||
defHttp.get({url: Api.list, params});
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
*/
|
||||
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
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({url: url, params});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询数据
|
||||
* @param params
|
||||
*/
|
||||
export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '密级',
|
||||
align:"center",
|
||||
dataIndex: 'secretLevel_dictText'
|
||||
},
|
||||
{
|
||||
title: '年份',
|
||||
align:"center",
|
||||
dataIndex: 'year_dictText'
|
||||
},
|
||||
{
|
||||
title: '序号',
|
||||
align:"center",
|
||||
dataIndex: 'number'
|
||||
},
|
||||
{
|
||||
title: '会议类型:行政线、技术线',
|
||||
align:"center",
|
||||
dataIndex: 'taskType_dictText'
|
||||
},
|
||||
{
|
||||
title: '类别:党的建设等其他',
|
||||
align:"center",
|
||||
dataIndex: 'type'
|
||||
},
|
||||
{
|
||||
title: '提出人',
|
||||
align:"center",
|
||||
dataIndex: 'proposer_dictText'
|
||||
},
|
||||
{
|
||||
title: '意见主题',
|
||||
align:"center",
|
||||
dataIndex: 'title'
|
||||
},
|
||||
{
|
||||
title: '具体意见',
|
||||
align:"center",
|
||||
dataIndex: 'content'
|
||||
},
|
||||
{
|
||||
title: '责任领导',
|
||||
align:"center",
|
||||
dataIndex: 'suoleader_dictText'
|
||||
},
|
||||
{
|
||||
title: '牵头部门',
|
||||
align:"center",
|
||||
dataIndex: 'responDeptid_dictText'
|
||||
},
|
||||
{
|
||||
title: '协办部门',
|
||||
align:"center",
|
||||
dataIndex: 'assistDeptid_dictText'
|
||||
},
|
||||
{
|
||||
title: '落实部门',
|
||||
align:"center",
|
||||
dataIndex: 'implementDeptid'
|
||||
},
|
||||
{
|
||||
title: '是否采纳',
|
||||
align:"center",
|
||||
dataIndex: 'isAdopt',
|
||||
customRender:({text}) => {
|
||||
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '落实措施/解释说明',
|
||||
align:"center",
|
||||
dataIndex: 'measure'
|
||||
},
|
||||
{
|
||||
title: '措施数量',
|
||||
align:"center",
|
||||
dataIndex: 'measureNumber'
|
||||
},
|
||||
{
|
||||
title: '成果形式',
|
||||
align:"center",
|
||||
dataIndex: 'achievement'
|
||||
},
|
||||
{
|
||||
title: '要求完成日期',
|
||||
align:"center",
|
||||
dataIndex: 'deadline',
|
||||
customRender:({text}) =>{
|
||||
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
return text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
align:"center",
|
||||
dataIndex: 'remark'
|
||||
},
|
||||
{
|
||||
title: '执行情况',
|
||||
align:"center",
|
||||
dataIndex: 'actualExect'
|
||||
},
|
||||
{
|
||||
title: '实际完成时间',
|
||||
align:"center",
|
||||
dataIndex: 'actualTime'
|
||||
},
|
||||
{
|
||||
title: '提出人确认',
|
||||
align:"center",
|
||||
dataIndex: 'proposerConfirm'
|
||||
},
|
||||
{
|
||||
title: '完成状态',
|
||||
align:"center",
|
||||
dataIndex: 'bpmStatus_dictText'
|
||||
},
|
||||
{
|
||||
title: '调整落实措施及执行情况',
|
||||
align:"center",
|
||||
dataIndex: 'actSt'
|
||||
},
|
||||
{
|
||||
title: '督办次数',
|
||||
align:"center",
|
||||
dataIndex: 'superviseCount'
|
||||
},
|
||||
{
|
||||
title: '紧急程度',
|
||||
align:"center",
|
||||
dataIndex: 'urgencyLevel'
|
||||
},
|
||||
{
|
||||
title: '是否需要所办领导审批',
|
||||
align:"center",
|
||||
dataIndex: 'isNeedAppro',
|
||||
customRender:({text}) => {
|
||||
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '所办领导',
|
||||
align:"center",
|
||||
dataIndex: 'supDeptleaderid_dictText'
|
||||
},
|
||||
];
|
||||
|
||||
//子表表格配置
|
||||
export const bgTakepulseFeedbackColumns: JVxeColumn[] = [
|
||||
{
|
||||
title: '责任部门id',
|
||||
key: 'responDeptid',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '责任部门名称',
|
||||
key: 'responDeptname',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '反馈人id',
|
||||
key: 'responPersonid',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '反馈人姓名',
|
||||
key: 'responPersonname',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '实际执行情况',
|
||||
key: 'actualExect',
|
||||
type: JVxeTypes.textarea,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '实际完成时间',
|
||||
key: 'actualTime',
|
||||
type: JVxeTypes.datetime,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '调整落实措施及执行情况',
|
||||
key: 'actSt',
|
||||
type: JVxeTypes.textarea,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '完成状态',
|
||||
key: 'bpmStatus',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '提出人确认',
|
||||
key: 'proposerConfirm',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
{
|
||||
title: '流程实例id',
|
||||
key: 'bpmProcessId',
|
||||
type: JVxeTypes.input,
|
||||
width:"200px",
|
||||
placeholder: '请输入${title}',
|
||||
defaultValue:'',
|
||||
},
|
||||
]
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
secretLevel: {title: '密级',order: 0,view: 'list', type: 'string',dictCode: 'secret_level',},
|
||||
year: {title: '年份',order: 1,view: 'list', type: 'string',dictCode: 'super_year',},
|
||||
number: {title: '序号',order: 2,view: 'text', type: 'string',},
|
||||
taskType: {title: '会议类型:行政线、技术线',order: 3,view: 'list', type: 'string',dictCode: 'super_takepulse_type',},
|
||||
type: {title: '类别:党的建设等其他',order: 4,view: 'text', type: 'string',},
|
||||
proposer: {title: '提出人',order: 5,view: 'sel_user', type: 'string',},
|
||||
title: {title: '意见主题',order: 6,view: 'text', type: 'string',},
|
||||
content: {title: '具体意见',order: 7,view: 'textarea', type: 'string',},
|
||||
suoleader: {title: '责任领导',order: 8,view: 'sel_user', type: 'string',},
|
||||
responDeptid: {title: '牵头部门',order: 9,view: 'sel_depart', type: 'string',},
|
||||
assistDeptid: {title: '协办部门',order: 10,view: 'sel_depart', type: 'string',},
|
||||
implementDeptid: {title: '落实部门',order: 11,view: 'text', type: 'string',},
|
||||
isAdopt: {title: '是否采纳',order: 12,view: 'switch', type: 'string',},
|
||||
measure: {title: '落实措施/解释说明',order: 13,view: 'textarea', type: 'string',},
|
||||
measureNumber: {title: '措施数量',order: 14,view: 'number', type: 'number',},
|
||||
achievement: {title: '成果形式',order: 15,view: 'textarea', type: 'string',},
|
||||
deadline: {title: '要求完成日期',order: 16,view: 'date', type: 'string',},
|
||||
remark: {title: '备注',order: 17,view: 'text', type: 'string',},
|
||||
actualExect: {title: '执行情况',order: 18,view: 'textarea', type: 'string',},
|
||||
actualTime: {title: '实际完成时间',order: 19,view: 'datetime', type: 'string',},
|
||||
proposerConfirm: {title: '提出人确认',order: 20,view: 'text', type: 'string',},
|
||||
bpmStatus: {title: '完成状态',order: 21,view: 'list', type: 'string',dictCode: 'super_status',},
|
||||
actSt: {title: '调整落实措施及执行情况',order: 22,view: 'textarea', type: 'string',},
|
||||
superviseCount: {title: '督办次数',order: 23,view: 'text', type: 'string',},
|
||||
urgencyLevel: {title: '紧急程度',order: 24,view: 'text', type: 'string',},
|
||||
isNeedAppro: {title: '是否需要所办领导审批',order: 25,view: 'switch', type: 'string',},
|
||||
supDeptleaderid: {title: '所办领导',order: 26,view: 'sel_user', type: 'string',},
|
||||
//子表高级查询
|
||||
bgTakepulseFeedback: {
|
||||
title: '执行情况反馈',
|
||||
view: 'table',
|
||||
fields: {
|
||||
responDeptid: {title: '责任部门id',order: 0,view: 'text', type: 'string',},
|
||||
responDeptname: {title: '责任部门名称',order: 1,view: 'text', type: 'string',},
|
||||
responPersonid: {title: '反馈人id',order: 2,view: 'text', type: 'string',},
|
||||
responPersonname: {title: '反馈人姓名',order: 3,view: 'text', type: 'string',},
|
||||
actualExect: {title: '实际执行情况',order: 4,view: 'textarea', type: 'string',},
|
||||
actualTime: {title: '实际完成时间',order: 5,view: 'datetime', type: 'string',},
|
||||
actSt: {title: '调整落实措施及执行情况',order: 6,view: 'textarea', type: 'string',},
|
||||
bpmStatus: {title: '完成状态',order: 7,view: 'text', type: 'string',},
|
||||
proposerConfirm: {title: '提出人确认',order: 8,view: 'text', type: 'string',},
|
||||
bpmProcessId: {title: '流程实例id',order: 9,view: 'text', type: 'string',},
|
||||
mainId: {title: '外键',order: 11,view: 'text', type: 'string',},
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,337 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="year">
|
||||
<template #label><span title="年份">年份</span></template>
|
||||
<j-select-multiple placeholder="请选择年份" v-model:value="queryParam.year" dictCode="super_year" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="taskType">
|
||||
<template #label><span title="会议类型:行政线、技术线">会议类型</span></template>
|
||||
<j-select-multiple placeholder="请选择会议类型:行政线、技术线" v-model:value="queryParam.taskType" dictCode="super_takepulse_type" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="type">
|
||||
<template #label><span title="类别:党的建设等其他">类别:党</span></template>
|
||||
<a-input placeholder="请输入类别:党的建设等其他" v-model:value="queryParam.type" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="responDeptid">
|
||||
<template #label><span title="牵头部门">牵头部门</span></template>
|
||||
<j-select-dept placeholder="请选择牵头部门" v-model:value="queryParam.responDeptid" checkStrictly allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="assistDeptid">
|
||||
<template #label><span title="协办部门">协办部门</span></template>
|
||||
<j-select-dept placeholder="请选择协办部门" v-model:value="queryParam.assistDeptid" checkStrictly allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<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="reload">查询</a-button>
|
||||
<a-button preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
</a>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'bqtakepulse:bg_takepulse:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'bqtakepulse:bg_takepulse:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<BgTakepulseModal @register="registerModal" @success="handleSuccess"></BgTakepulseModal>
|
||||
<!-- 审批记录 -->
|
||||
<BpmPictureModal @register="registerBpmModal" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="bqtakepulse-bgTakepulse" setup>
|
||||
import {ref, reactive, computed, unref} from 'vue';
|
||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import {useModal} from '/@/components/Modal';
|
||||
import BgTakepulseModal from './components/BgTakepulseModal.vue'
|
||||
import {columns, superQuerySchema} from './BgTakepulse.data';
|
||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './BgTakepulse.api';
|
||||
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
|
||||
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
//注册model
|
||||
const [registerModal, {openModal}] = useModal();
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册table数据
|
||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||
tableProps:{
|
||||
title: '我为四所把把脉',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed:'right'
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"我为四所把把脉",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
})
|
||||
|
||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
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: handleEdit.bind(null, record),
|
||||
auth: 'bqtakepulse:bg_takepulse:edit'
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record){
|
||||
let dropDownAction = [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record)
|
||||
},
|
||||
auth: 'bqtakepulse:bg_takepulse:delete'
|
||||
},
|
||||
{
|
||||
label: '审批进度',
|
||||
onClick: handlePreviewPic.bind(null, record),
|
||||
ifShow: !!record.bpmStatus && record.bpmStatus !== '1',
|
||||
}
|
||||
];
|
||||
if(record.bpmStatus == '1' || !record.bpmStatus){
|
||||
dropDownAction.push({
|
||||
label: '发起流程',
|
||||
popConfirm: {
|
||||
title: '确认提交流程吗?',
|
||||
confirm: handleProcess.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
}
|
||||
})
|
||||
}
|
||||
return dropDownAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交流程
|
||||
*/
|
||||
async function handleProcess(record) {
|
||||
let params = {
|
||||
flowCode: 'dev_bg_takepulse_001',
|
||||
id: record.id,
|
||||
formUrl: 'bqtakepulse/components/BgTakepulseForm',
|
||||
formUrlMobile: ''
|
||||
}
|
||||
await startProcess(params);
|
||||
handleSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批进度
|
||||
*/
|
||||
async function handlePreviewPic(record) {
|
||||
bpmPicModal(true, {
|
||||
flowCode: 'dev_bg_takepulse_001',
|
||||
dataId: record.id,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ----------------------以下为原生查询需要添加的-------------------------- */
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* form点击事件(以逗号分割)
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
function handleFormJoinChange(key, value) {
|
||||
if (typeof value != 'string') {
|
||||
queryParam[key] = value.join(',');
|
||||
}
|
||||
}
|
||||
</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,26 @@
|
||||
-- 注意:该页面对应的前台目录为views/bqtakepulse文件夹下
|
||||
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
|
||||
|
||||
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
|
||||
VALUES ('2026060503311050210', NULL, '我为四所把把脉', '/bg/bqtakepulse/bgTakepulseList', 'bg/bqtakepulse/BgTakepulseList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0);
|
||||
|
||||
-- 权限控制sql
|
||||
-- 新增
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060211', '2026060503311050210', '添加我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 编辑
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060212', '2026060503311050210', '编辑我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060213', '2026060503311050210', '删除我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 批量删除
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060214', '2026060503311050210', '批量删除我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导出excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060215', '2026060503311050210', '导出excel_我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
-- 导入excel
|
||||
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
|
||||
VALUES ('2026060503311060216', '2026060503311050210', '导入excel_我为四所把把脉', NULL, NULL, 0, NULL, NULL, 2, 'bqtakepulse:bg_takepulse:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2026-06-05 15:31:21', NULL, NULL, 0, 0, '1', 0);
|
||||
@@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<a-spin :spinning="loading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form v-bind="formItemLayout" name="BgTakepulseForm" ref="formRef">
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="密级" v-bind="validateInfos.secretLevel" id="BgTakepulseForm-secretLevel" name="secretLevel">
|
||||
<j-dict-select-tag v-model:value="formData.secretLevel" dictCode="secret_level" placeholder="请选择密级" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="年份" v-bind="validateInfos.year" id="BgTakepulseForm-year" name="year">
|
||||
<j-dict-select-tag v-model:value="formData.year" dictCode="super_year" placeholder="请选择年份" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="序号" v-bind="validateInfos.number" id="BgTakepulseForm-number" name="number">
|
||||
<a-input v-model:value="formData.number" placeholder="请输入序号" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="会议类型:行政线、技术线" v-bind="validateInfos.taskType" id="BgTakepulseForm-taskType" name="taskType">
|
||||
<j-dict-select-tag v-model:value="formData.taskType" dictCode="super_takepulse_type" placeholder="请选择会议类型:行政线、技术线" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="类别:党的建设等其他" v-bind="validateInfos.type" id="BgTakepulseForm-type" name="type">
|
||||
<a-input v-model:value="formData.type" placeholder="请输入类别:党的建设等其他" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="提出人" v-bind="validateInfos.proposer" id="BgTakepulseForm-proposer" name="proposer">
|
||||
<j-select-user v-model:value="formData.proposer" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="意见主题" v-bind="validateInfos.title" id="BgTakepulseForm-title" name="title">
|
||||
<a-input v-model:value="formData.title" placeholder="请输入意见主题" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="具体意见" v-bind="validateInfos.content" id="BgTakepulseForm-content" name="content">
|
||||
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入具体意见" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="责任领导" v-bind="validateInfos.suoleader" id="BgTakepulseForm-suoleader" name="suoleader">
|
||||
<j-select-user v-model:value="formData.suoleader" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="牵头部门" v-bind="validateInfos.responDeptid" id="BgTakepulseForm-responDeptid" name="responDeptid">
|
||||
<j-select-dept v-model:value="formData.responDeptid" :multiple="true" checkStrictly allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="协办部门" v-bind="validateInfos.assistDeptid" id="BgTakepulseForm-assistDeptid" name="assistDeptid">
|
||||
<j-select-dept v-model:value="formData.assistDeptid" :multiple="true" checkStrictly allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="落实部门" v-bind="validateInfos.implementDeptid" id="BgTakepulseForm-implementDeptid" name="implementDeptid">
|
||||
<a-input v-model:value="formData.implementDeptid" placeholder="请输入落实部门" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="是否采纳" v-bind="validateInfos.isAdopt" id="BgTakepulseForm-isAdopt" name="isAdopt">
|
||||
<j-switch v-model:value="formData.isAdopt" ></j-switch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="落实措施/解释说明" v-bind="validateInfos.measure" id="BgTakepulseForm-measure" name="measure">
|
||||
<a-textarea v-model:value="formData.measure" :rows="4" placeholder="请输入落实措施/解释说明" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="措施数量" v-bind="validateInfos.measureNumber" id="BgTakepulseForm-measureNumber" name="measureNumber">
|
||||
<a-input-number v-model:value="formData.measureNumber" placeholder="请输入措施数量" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="成果形式" v-bind="validateInfos.achievement" id="BgTakepulseForm-achievement" name="achievement">
|
||||
<a-textarea v-model:value="formData.achievement" :rows="4" placeholder="请输入成果形式" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="要求完成日期" v-bind="validateInfos.deadline" id="BgTakepulseForm-deadline" name="deadline">
|
||||
<a-date-picker placeholder="请选择要求完成日期" v-model:value="formData.deadline" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="备注" v-bind="validateInfos.remark" id="BgTakepulseForm-remark" name="remark">
|
||||
<a-input v-model:value="formData.remark" placeholder="请输入备注" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="执行情况" v-bind="validateInfos.actualExect" id="BgTakepulseForm-actualExect" name="actualExect">
|
||||
<a-textarea v-model:value="formData.actualExect" :rows="4" placeholder="请输入执行情况" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="实际完成时间" v-bind="validateInfos.actualTime" id="BgTakepulseForm-actualTime" name="actualTime">
|
||||
<a-date-picker placeholder="请选择实际完成时间" v-model:value="formData.actualTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="提出人确认" v-bind="validateInfos.proposerConfirm" id="BgTakepulseForm-proposerConfirm" name="proposerConfirm">
|
||||
<a-input v-model:value="formData.proposerConfirm" placeholder="请输入提出人确认" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="完成状态" v-bind="validateInfos.bpmStatus" id="BgTakepulseForm-bpmStatus" name="bpmStatus">
|
||||
<j-dict-select-tag v-model:value="formData.bpmStatus" dictCode="super_status" placeholder="请选择完成状态" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="调整落实措施及执行情况" v-bind="validateInfos.actSt" id="BgTakepulseForm-actSt" name="actSt">
|
||||
<a-textarea v-model:value="formData.actSt" :rows="4" placeholder="请输入调整落实措施及执行情况" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="督办次数" v-bind="validateInfos.superviseCount" id="BgTakepulseForm-superviseCount" name="superviseCount">
|
||||
<a-input v-model:value="formData.superviseCount" placeholder="请输入督办次数" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急程度" v-bind="validateInfos.urgencyLevel" id="BgTakepulseForm-urgencyLevel" name="urgencyLevel">
|
||||
<a-input v-model:value="formData.urgencyLevel" placeholder="请输入紧急程度" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="是否需要所办领导审批" v-bind="validateInfos.isNeedAppro" id="BgTakepulseForm-isNeedAppro" name="isNeedAppro">
|
||||
<j-switch v-model:value="formData.isNeedAppro" ></j-switch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="所办领导" v-bind="validateInfos.supDeptleaderid" id="BgTakepulseForm-supDeptleaderid" name="supDeptleaderid">
|
||||
<j-select-user v-model:value="formData.supDeptleaderid" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
|
||||
<!-- 子表单区域 -->
|
||||
<a-tabs v-model:activeKey="activeKey" animated style="overflow:hidden;">
|
||||
<a-tab-pane tab="执行情况反馈" key="bgTakepulseFeedback" :forceRender="true">
|
||||
<j-vxe-table
|
||||
:keep-source="true"
|
||||
resizable
|
||||
ref="bgTakepulseFeedbackTableRef"
|
||||
:loading="bgTakepulseFeedbackTable.loading"
|
||||
:columns="bgTakepulseFeedbackTable.columns"
|
||||
:dataSource="bgTakepulseFeedbackTable.dataSource"
|
||||
:height="340"
|
||||
:disabled="disabled"
|
||||
:rowNumber="true"
|
||||
:rowSelection="true"
|
||||
:toolbar="true"/>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<div v-if="showFlowSubmitButton" :span="24" style="width: 100%;text-align: center;margin-top: 10px">
|
||||
<a-button preIcon="ant-design:check-outlined" style="width: 126px" type="primary" @click="submitForm">提 交</a-button>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
|
||||
import { queryBgTakepulseFeedbackListByMainId, queryDataById, saveOrUpdate } from '../BgTakepulse.api';
|
||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
|
||||
import {bgTakepulseFeedbackColumns} from '../BgTakepulse.data';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { Form } from 'ant-design-vue';
|
||||
const useForm = Form.useForm;
|
||||
|
||||
export default defineComponent({
|
||||
name: "BgTakepulseForm",
|
||||
components:{
|
||||
JDictSelectTag,
|
||||
JSwitch,
|
||||
JSelectDept,
|
||||
JSelectUser,
|
||||
JVxeTable,
|
||||
JFormContainer,
|
||||
},
|
||||
props:{
|
||||
formDisabled:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
},
|
||||
emits:['success'],
|
||||
setup(props, {emit}) {
|
||||
const loading = ref(false);
|
||||
const formRef = ref();
|
||||
const bgTakepulseFeedbackTableRef = ref();
|
||||
const bgTakepulseFeedbackTable = reactive<Record<string, any>>({
|
||||
loading: false,
|
||||
columns: bgTakepulseFeedbackColumns,
|
||||
dataSource: []
|
||||
});
|
||||
const activeKey = ref('bgTakepulseFeedback');
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
secretLevel: '',
|
||||
year: '',
|
||||
number: '',
|
||||
taskType: '',
|
||||
type: '',
|
||||
proposer: '',
|
||||
title: '',
|
||||
content: '',
|
||||
suoleader: '',
|
||||
responDeptid: '',
|
||||
assistDeptid: '',
|
||||
implementDeptid: '',
|
||||
isAdopt: '',
|
||||
measure: '',
|
||||
measureNumber: undefined,
|
||||
achievement: '',
|
||||
deadline: '',
|
||||
remark: '',
|
||||
actualExect: '',
|
||||
actualTime: '',
|
||||
proposerConfirm: '',
|
||||
bpmStatus: '',
|
||||
actSt: '',
|
||||
superviseCount: '',
|
||||
urgencyLevel: '',
|
||||
isNeedAppro: '',
|
||||
supDeptleaderid: '',
|
||||
delFlag: '',
|
||||
});
|
||||
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
|
||||
const dbData = {};
|
||||
const formItemLayout = {
|
||||
labelCol: {xs: {span: 24}, sm: {span: 5}},
|
||||
wrapperCol: {xs: {span: 24}, sm: {span: 16}},
|
||||
};
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
onMounted(()=>{
|
||||
initFormData();
|
||||
});
|
||||
//渲染流程表单数据
|
||||
const queryByIdUrl = '/bqtakepulse/bgTakepulse/queryById';
|
||||
async function initFormData(){
|
||||
if(props.formBpm === true){
|
||||
let params = {id: props.formData.dataId};
|
||||
const row = await defHttp.get({url: queryByIdUrl, params});
|
||||
//设置表单的值
|
||||
Object.keys(row).map(k => {
|
||||
formData[k] = row[k];
|
||||
});
|
||||
//子表数据
|
||||
const bgTakepulseFeedbackDataList = await queryBgTakepulseFeedbackListByMainId(row['id']);
|
||||
bgTakepulseFeedbackTable.dataSource = [...bgTakepulseFeedbackDataList];
|
||||
}
|
||||
}
|
||||
// 是否显示提交按钮
|
||||
const showFlowSubmitButton = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
});
|
||||
|
||||
|
||||
function add() {
|
||||
resetFields();
|
||||
bgTakepulseFeedbackTable.dataSource = [];
|
||||
}
|
||||
|
||||
async function edit(row) {
|
||||
//主表数据
|
||||
await queryMainData(row.id);
|
||||
//子表数据
|
||||
const bgTakepulseFeedbackDataList = await queryBgTakepulseFeedbackListByMainId(row['id']);
|
||||
bgTakepulseFeedbackTable.dataSource = [...bgTakepulseFeedbackDataList];
|
||||
}
|
||||
|
||||
async function queryMainData(id) {
|
||||
const row = await queryDataById(id);
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(row.hasOwnProperty(key)){
|
||||
tmpData[key] = row[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData,tmpData);
|
||||
}
|
||||
|
||||
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
|
||||
'bgTakepulseFeedback': bgTakepulseFeedbackTableRef,
|
||||
});
|
||||
|
||||
async function getFormData() {
|
||||
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);
|
||||
}
|
||||
return transformData(toRaw(formData))
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
const mainData = await getFormData();
|
||||
const subData = await getSubFormAndTableData();
|
||||
const values = Object.assign({}, dbData, mainData, subData);
|
||||
console.log('表单提交数据', values)
|
||||
const isUpdate = values.id ? true : false
|
||||
await saveOrUpdate(values, isUpdate);
|
||||
//关闭弹窗
|
||||
emit('success');
|
||||
}
|
||||
|
||||
function setFieldsValue(values) {
|
||||
if(values){
|
||||
Object.keys(values).map(k=>{
|
||||
formData[k] = values[k];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 值改变事件触发-树控件回调
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
function handleFormChange(key, value) {
|
||||
formData[key] = value;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
bgTakepulseFeedbackTableRef,
|
||||
bgTakepulseFeedbackTable,
|
||||
validatorRules,
|
||||
validateInfos,
|
||||
activeKey,
|
||||
loading,
|
||||
formData,
|
||||
setFieldsValue,
|
||||
handleFormChange,
|
||||
formItemLayout,
|
||||
disabled,
|
||||
showFlowSubmitButton,
|
||||
getFormData,
|
||||
submitForm,
|
||||
add,
|
||||
edit,
|
||||
formRef,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-tabs-tabpane.sub-one-form {
|
||||
max-height: 340px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" :width="896" @ok="handleSubmit">
|
||||
<bg-takepulse-form ref="formComponent" :formDisabled="formDisabled" :formBpm="false" @success="submitSuccess"></bg-takepulse-form>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ref, unref } from 'vue';
|
||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||
import BgTakepulseForm from './BgTakepulseForm.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const { createMessage } = useMessage();
|
||||
export default {
|
||||
name: "TestCgMainVxeModal",
|
||||
components:{
|
||||
BasicModal,
|
||||
BgTakepulseForm
|
||||
},
|
||||
emits:['register','success'],
|
||||
setup(_p, {emit}){
|
||||
const formComponent = ref()
|
||||
const isUpdate = ref(true);
|
||||
const formDisabled = ref(false);
|
||||
const title = ref('')
|
||||
|
||||
//表单赋值
|
||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
formDisabled.value = !data?.showFooter;
|
||||
title.value = data?.isUpdate ? (unref(formDisabled) ? '详情' : '编辑') : '新增';
|
||||
if (unref(isUpdate)) {
|
||||
formComponent.value.edit(data.record)
|
||||
}else{
|
||||
formComponent.value.add()
|
||||
}
|
||||
});
|
||||
|
||||
function handleSubmit() {
|
||||
formComponent.value.submitForm();
|
||||
}
|
||||
|
||||
function submitSuccess(){
|
||||
emit('success');
|
||||
closeModal();
|
||||
}
|
||||
return {
|
||||
registerModal,
|
||||
title,
|
||||
formComponent,
|
||||
formDisabled,
|
||||
handleSubmit,
|
||||
submitSuccess,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
/** 时间和数字输入框样式 */
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-calendar-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user