项目下发

hedong
zhufu 2025-12-26 08:59:03 +08:00
parent fb4bcccf27
commit 363d963572
3 changed files with 305 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import { defHttp } from '@/utils/http/axios';
enum Api {
// 判读-待审核列表
LoadCaseInfoLists = 'LoadCaseInfoCheckTuBanList',
LoadCaseInfoLists = '/api/DroneSsny/GetDronssnydShenheList',
// 判读-详情
GetCaseInfo = 'GetCaseInfo',
// 判读-关闭案件
@ -65,9 +65,9 @@ const closeCaseApi = {
'生态修复': 'CloseSTXFCaseInfo',
}
export function LoadCaseInfoLists(type, params){
export function LoadCaseInfoLists(params){
return defHttp.get({
url: typeObj[type] + Api.LoadCaseInfoLists,
url: Api.LoadCaseInfoLists,
params,
})
}

View File

@ -0,0 +1,198 @@
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="downloadTemplate"></a-button>
<a-upload
:accept="'.xlsx,.csv,.xls,.shp,.zip'"
:showUploadList="false"
:custom-request="customRequest"
>
<a-button type="primary">导入</a-button>
</a-upload>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
label: '下发',
onClick: () => {
handleIssued(record);
},
}
]"
/>
</template>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { nextTick, onMounted, ref, h } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import InfoModal from '@/components/Audit/InfoModal/index.vue'
import ImportDataModal from '@/components/Audit/ImportDataModal/index.vue'
import ProgressModal from '@/components/Audit/ProgressModal/index.vue'
import { columns, searchFormSchema } from './utils';
import { getDetail } from '@/api/sys/WFSchemeInfo';
import { LoadFormScheme } from '@/api/demo/formScheme';
import { useUserStore } from '@/store/modules/user';
import { create, saveDraft, GetDraft } from '@/api/sys/WFProcess';
import { message, Modal, Input } from 'ant-design-vue';
import { SaveReSubmitInfo } from '@/api/demo/resubmit';
import { uploadFile } from '@/api/formrender/index';
import { ImportCaseInfoShpDataSsny } from '@/api/earlywarning/index'
import {
LoadCaseInfoLists,
UpdateCaseNoBySubject,
} from '@/api/audit/index';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL } = getAppEnvConfig();
let type = '设施农业监管'
const code = '004'
const subjectKey = 'Subject_SSNY'
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const infoData = ref({})
const openModal = ref(false)
const openImportModal = ref(false)
const reSubmitRemark = ref("")
const closeCaseRemark = ref("")
const picihao = ref()
const openProgressModal = ref(false)
const modalLoading = ref(false)
const [registerTable, { reload, expandAll, getForm}] = useTable({
title: '项目下发',
api: LoadCaseInfoLists,
columns,
rowKey: 'id',
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
striped: false,
//
showIndexColumn: false,
// 使
useSearchForm: true,
//
showTableSetting: true,
bordered: true,
beforeFetch(data) {
let params = {...data}
return params
},
afterFetch(data) {
console.log('afterFetch', data);
},
actionColumn: {
width: 100,
title: '操作',
dataIndex: 'action',
},
handleSearchInfoFn(info) {
return info;
},
});
function handleIssued(record) {
Modal.confirm({
title: '确认下发该数据吗?',
onOk: () => handleOk(record),
onCancel() {
},
})
}
const handleOk = async (params) => {
try {
const { id, case_description } = params
const checkValue = await GetDraft({id})
if(checkValue.process == null){
// let resultParams = {
// ...params,
// subject: type,
// }
// await UpdateCaseInfoBySubject(resultParams)
let data = await getDetail({ code });
let content = JSON.parse(data.scheme.content);
const currentNode = content.wfData.find((t) => t.type == 'bpmn:StartEvent');
let formVerison = currentNode.formVerison
let keyValue = ''
const schemaData = await LoadFormScheme({
schemeId: formVerison
});
const scheme = JSON.parse(schemaData.scheme);
scheme.formInfo.tabList.forEach((tabElement) => {
tabElement.schemas.forEach((element) => {
if (element.field == currentNode.formRelationId) {
keyValue = element.componentProps.fieldName;
}
});
});
let commit = {
schemeId: currentNode.formVerison,
pkey: keyValue,
pkeyValue: id,
};
let resultQuery = {
schemeCode: code,
userId: userInfo.id,
title: case_description,
processId: id,
InstanceInfo: JSON.stringify(commit),
};
await saveDraft(resultQuery);
resultQuery.schemeCode = '';
const result = await create(resultQuery);
if(result){
await UpdateCaseNoBySubject({subject: type, id})
message.success('发起流程成功');
reload()
openModal.value = false
}else{
message.error('发起流程失败');
}
}else{
message.warning('该案件已发起流程');
}
} catch(err) {
console.log(err)
}
}
const customRequest = (file) => {
console.log('handleCustomRequest',file)
const formData = new FormData()
formData.append('files', file.file)
uploadFile(formData).then(res => {
ImportCaseInfoShpDataSsny({zipFilePath: res[0].filePath.replace(/\\/g, '/'), srid: '4326'}).then(resultRes => {
message.success('导入成功')
reload()
})
})
}
const downloadTemplate = () => {
window.open(VITE_GLOB_API_URL+'/templates/shptest.zip')
}
</script>
<style lang="scss">
.reSubmitInput{
border: 1px solid;
width: 100%;
height: 35px;
border-radius: 5px;
padding: 0px 10px;
border-color: #000;
transition: 0.2s;
&:focus{
border-color: #6db8ff;
}
}
</style>

View File

@ -0,0 +1,104 @@
import { BasicColumn, FormSchema } from '@/components/Table';
import { getChildrenTree } from '@/api/demo/system';
import { getLoad } from '@/api/sys/sysDataItemDetail';
import dayjs from 'dayjs';
export const columns: BasicColumn[] = [
{
title: '项目编号',
dataIndex: 'xiangmu_no',
},
{
title: '项目名称',
dataIndex: 'xiangmu_name',
width: 200,
},
{
title: '行政区划',
dataIndex: 'xingzhengquhua',
},
{
title: '备案编号',
dataIndex: 'beian_no',
},
{
title: '备案日期',
dataIndex: 'beianriqi',
width: 200,
customRender: ({ text }) => {
if (!text) return '';
return dayjs(text).format('YYYY-MM-DD');
},
},
{
title: '项目状态',
dataIndex: 'handle_status_name',
},
{
title: '项目开始时间',
dataIndex: 'start_time',
width: 200,
customRender: ({ text }) => {
if (!text) return '';
return dayjs(text).format('YYYY-MM-DD');
},
},
{
title: '项目结束时间',
dataIndex: 'end_time',
customRender: ({ text }) => {
if (!text) return '';
return dayjs(text).format('YYYY-MM-DD');
},
},
{
title: '项目当前用途',
dataIndex: 'xiangmu_yt',
width: 110,
},
{
title: '建筑结构',
dataIndex: 'jianzhujiegou',
width: 110,
},
{
title: '设施农业申请用地面积(公顷)',
dataIndex: 'shenqing_area',
width: 200,
},
{
title: '生产设施用地(公顷)',
dataIndex: 'shengchan_area',
width: 200,
},
{
title: '辅助设施用地(公顷)',
dataIndex: 'fuzhu_area',
width: 200,
},
];
export const searchFormSchema: FormSchema[] = [
{
field: 'xiangmuno',
component: 'Input',
colProps: { span: 5 },
label: '项目编号',
},
{
field: 'streetid',
label: '乡镇',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: getChildrenTree,
params: { parentId: 371312 },
// 接口参数
resultField: 'result',
labelField: 'name',
valueField: 'id',
};
},
},
];