Browse Source

项目计划校验

master
wbc 3 days ago
parent
commit
ca67c4b475
  1. 137
      src/views/informationSub/iconic/addAndModify.vue
  2. 23
      src/views/informationSub/iconic/iconic.api.ts
  3. 68
      src/views/informationSub/iconic/iconic.data.ts
  4. 115
      src/views/informationSub/iconic/index.vue
  5. 137
      src/views/informationSub/mechanism/addAndModify.vue
  6. 115
      src/views/informationSub/mechanism/index.vue
  7. 23
      src/views/informationSub/mechanism/mechanism.api.ts
  8. 68
      src/views/informationSub/mechanism/mechanism.data.ts
  9. 2
      src/views/informationSub/monthlyJournal/monthlyJournal.api.ts
  10. 351
      src/views/projectLib/projectPlan/index.vue
  11. 4
      src/views/projectLib/projectPlan/projectPlan.api.ts
  12. 4
      vite.config.ts

137
src/views/informationSub/iconic/addAndModify.vue

@ -0,0 +1,137 @@
<template>
<!-- 自定义表单 -->
<BasicModal v-bind="$attrs" @register="registerModal" title="月度期刊详情" width="1200px" :showOkBtn="false" :showCancelBtn="false">
<el-divider content-position="left">资料信息</el-divider>
<BasicForm @register="registerProjectForm" />
<el-divider content-position="left">上传期刊资料</el-divider>
<el-form ref="importFormRef" >
<el-form-item label="上传文件:">
<el-upload class="upload-demo" ref="upload" action :http-request="httpRequest" :before-upload="beforeUpload"
:on-exceed="handleExceed" :limit="1" :on-remove="removeFile">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitImportForm">上传</el-button>
<el-button type="info" @click="dialogVisible">关闭窗口</el-button>
</el-form-item>
</el-form>
</BasicModal>
</template>
<script lang="ts" name="addAndModify" setup>
import { ref, reactive, defineProps, watchEffect } from 'vue'
import { useForm, BasicForm } from '@/components/Form';
import { iconicformSchemas } from './iconic.data';
import { modifyPeriodicallab, addPeriodicallab, getperiodicallabById } from './iconic.api';
import { ElMessage } from 'element-plus'
import { useModalInner, BasicModal } from '@/components/Modal';
const [registerModal, { closeModal }] = useModalInner(init);
let fileList = reactive<Array<any>>([]);
let id = ref()
const emit = defineEmits(['close']);
async function init(data) {
fileList.pop()
if (data.id != null) {
id.value = data.id
let param: any = {
id: data.id
}
let res = await getperiodicallabById(param)
console.log("结果是", res)
setFieldsValue(res)
}
}
//
const [registerProjectForm, { setFieldsValue: setFieldsValue, getFieldsValue, validate }] = useForm({
//
schemas: iconicformSchemas,
showActionButtonGroup: false,
//
// autoSubmitOnEnter: true,
// //
// showResetButton: false,
//
// submitButtonOptions: { text: '', preIcon: '' },
// 24 0-24
// actionColOptions: { span: 17 },
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
});
// fileList,
function httpRequest(option) {
fileList.push(option)
}
function removeFile(option) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].file.name == option.name) {
fileList.splice(i, 1)
}
}
console.log(fileList, option)
}
//
function beforeUpload(file) {
let fileSize = file.size
const FIVE_M = 500 * 1024 * 1024;
//5M
if (fileSize > FIVE_M) {
ElMessage.error("最大上传500M")
return false
}
return true
}
//
function handleExceed() {
ElMessage.warning("最多只能上传一个文件")
}
//Excel
async function submitImportForm() {
if (await validate()) {
let data = await getFieldsValue()
console.log("data", data)
// 使form
const params = new FormData()
if (id.value != null) {
//
if(fileList.length>0){
params.append('file', fileList[0].file)
}
params.append("id", id.value)
params.append("name", data.name)
params.append("periods", data.periods)
params.append("publishTime", data.publishTime)
await modifyPeriodicallab(params)
} else {
if (fileList.length == 0) {
ElMessage.warning("请上传文件")
return;
}
params.append('file', fileList[0].file)
params.append("name", data.name)
params.append("periods", data.periods)
params.append("publishTime", data.publishTime)
await addPeriodicallab(params)
}
dialogVisible()
}
}
function dialogVisible() {
closeModal()
emit("close")
}
</script>
<style></style>

23
src/views/informationSub/iconic/iconic.api.ts

@ -0,0 +1,23 @@
import { defHttp } from '@/utils/http/axios';
import { downloadFile } from "../../../api/common/api"
export enum Api {
periodicallabPageList = '/huzhouPeriodicallab/periodicallabPageList',
addPeriodicallab="/huzhouPeriodicallab/addPeriodicallab",
modifyPeriodicallab = '/huzhouPeriodicallab/modifyPeriodicallab',
getperiodicallabById="/huzhouPeriodicallab/getperiodicallabById",
deletePeriodicallab = '/huzhouPeriodicallab/deletePeriodicallab',
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles",
}
export const periodicallabPageList = (params) => defHttp.get({ url: Api.periodicallabPageList, params })
export const getperiodicallabById = (params) => defHttp.get({ url: Api.getperiodicallabById, params })
export const batchdownloadPeriodicallabFiles = (params) => downloadFile(Api.batchdownloadPeriodicallabFiles,"批量导出.zip",params)
export const addPeriodicallab = (params?) =>defHttp.post({ url: Api.addPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params })
export const modifyPeriodicallab = (params?) =>defHttp.post({ url: Api.modifyPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params })
export const deletePeriodicallab = (params?) =>defHttp.post({ url: Api.deletePeriodicallab, params })

68
src/views/informationSub/iconic/iconic.data.ts

@ -0,0 +1,68 @@
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
export const iconiccolumns: BasicColumn[] = [
{
title: '文件名称',
width: 250,
dataIndex: 'name',
},
{
title: '文件类别',
width: 150,
dataIndex: 'periods',
},
{
title: '发布日期',
width: 200,
dataIndex: 'publishTime',
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '文件类别',
field: 'periods',
component: 'Input',
colProps: { span: 5 },
},
{
label: '发布日期',
field: 'publishTime',
component: 'Input',
colProps: { span: 5 },
},
];
export const iconicformSchemas: FormSchema[] = [
{
label: '文件名称',
field: 'name',
component: 'Input',
required: true,
colProps: { span: 12 },
},
{
label: '文件类别',
field: 'periods',
required: true,
component: 'Input',
colProps: { span: 6 },
}, {
label: '发布日期',
field: 'publishTime',
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
required: true,
colProps: { span: 6},
},
];

115
src/views/informationSub/iconic/index.vue

@ -0,0 +1,115 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<template #action="{ record }">
<!-- <TableAction :actions="getTableAction(record)" /> -->
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<template #tableTitle>
<el-button type="primary" round @click="handleAdd" v-if="isShowByRoles('manageOrg')">新增信息材料</el-button>
<el-button type="primary" round @click="handleBatchdownload"> 批量导出</el-button>
</template>
</BasicTable>
<addAndModify @register="registerSubmitProjectArchive" @close="closeModel" />
</div>
</template>
<script lang="ts" name="system-user" setup>
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { useModal } from '@/components/Modal';
import { downloadResource } from "../../../api/common/api"
import { isShowByRoles } from '@/views/projectLib/projectInfo/projectInfo.api';
import { iconiccolumns, searchFormSchema } from './iconic.data';
import addAndModify from "./addAndModify.vue"
import { periodicallabPageList, batchdownloadPeriodicallabFiles, deletePeriodicallab } from './iconic.api';
import { fi } from 'element-plus/es/locale';
const [registerSubmitProjectArchive, { openModal }] = useModal();
const [registerTable, { reload, getForm }] = useTable({
title: '月度期刊信息',
api: periodicallabPageList,
columns: iconiccolumns,
useSearchForm: true,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
//
formConfig: {
schemas: searchFormSchema,
}
});
function getTableAction(record): ActionItem[] {
return [
{
label: '下载',
onClick: handledown.bind(null, record),
}
];
}
function getDropDownAction(record): ActionItem[] {
return [
{
label: '修改',
ifShow: () => {
return isShowByRoles('manageOrg')
},
onClick: handleModify.bind(null, record)
},
{
label: '删除',
ifShow: () => {
return isShowByRoles('manageOrg')
},
popConfirm: {
title: '确定删除吗?',
confirm: handleDelete.bind(null, record),
},
}
];
}
function handleAdd() {
openModal(true, { id: null })
}
function handleModify(record) {
openModal(true, { id: record.id })
}
function handleSubmit(record) {
}
function handledown(record) {
let param = {
path: record.documentPath,
fileName: record.documentName
}
downloadResource("/huzhouUploadfileinfo/downloadfile", record.documentName, param)
}
async function handleDelete(record) {
await deletePeriodicallab({ id: record.id })
reload()
}
function handleBatchdownload() {
let { getFieldsValue } = getForm()
let fromData = getFieldsValue()
batchdownloadPeriodicallabFiles(fromData)
}
function closeModel() {
reload()
}
</script>
<style scoped></style>

137
src/views/informationSub/mechanism/addAndModify.vue

@ -0,0 +1,137 @@
<template>
<!-- 自定义表单 -->
<BasicModal v-bind="$attrs" @register="registerModal" title="月度期刊详情" width="1200px" :showOkBtn="false" :showCancelBtn="false">
<el-divider content-position="left">资料信息</el-divider>
<BasicForm @register="registerProjectForm" />
<el-divider content-position="left">上传期刊资料</el-divider>
<el-form ref="importFormRef" >
<el-form-item label="上传文件:">
<el-upload class="upload-demo" ref="upload" action :http-request="httpRequest" :before-upload="beforeUpload"
:on-exceed="handleExceed" :limit="1" :on-remove="removeFile">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitImportForm">上传</el-button>
<el-button type="info" @click="dialogVisible">关闭窗口</el-button>
</el-form-item>
</el-form>
</BasicModal>
</template>
<script lang="ts" name="addAndModify" setup>
import { ref, reactive, defineProps, watchEffect } from 'vue'
import { useForm, BasicForm } from '@/components/Form';
import { mechanismformSchemas } from './mechanism.data';
import { modifyPeriodicallab, addPeriodicallab, getperiodicallabById } from './mechanism.api';
import { ElMessage } from 'element-plus'
import { useModalInner, BasicModal } from '@/components/Modal';
const [registerModal, { closeModal }] = useModalInner(init);
let fileList = reactive<Array<any>>([]);
let id = ref()
const emit = defineEmits(['close']);
async function init(data) {
fileList.pop()
if (data.id != null) {
id.value = data.id
let param: any = {
id: data.id
}
let res = await getperiodicallabById(param)
console.log("结果是", res)
setFieldsValue(res)
}
}
//
const [registerProjectForm, { setFieldsValue: setFieldsValue, getFieldsValue, validate }] = useForm({
//
schemas: mechanismformSchemas,
showActionButtonGroup: false,
//
// autoSubmitOnEnter: true,
// //
// showResetButton: false,
//
// submitButtonOptions: { text: '', preIcon: '' },
// 24 0-24
// actionColOptions: { span: 17 },
labelCol: { style: { width: '120px' } },
wrapperCol: { style: { width: 'auto' } },
});
// fileList,
function httpRequest(option) {
fileList.push(option)
}
function removeFile(option) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].file.name == option.name) {
fileList.splice(i, 1)
}
}
console.log(fileList, option)
}
//
function beforeUpload(file) {
let fileSize = file.size
const FIVE_M = 500 * 1024 * 1024;
//5M
if (fileSize > FIVE_M) {
ElMessage.error("最大上传500M")
return false
}
return true
}
//
function handleExceed() {
ElMessage.warning("最多只能上传一个文件")
}
//Excel
async function submitImportForm() {
if (await validate()) {
let data = await getFieldsValue()
console.log("data", data)
// 使form
const params = new FormData()
if (id.value != null) {
//
if(fileList.length>0){
params.append('file', fileList[0].file)
}
params.append("id", id.value)
params.append("name", data.name)
params.append("periods", data.periods)
params.append("publishTime", data.publishTime)
await modifyPeriodicallab(params)
} else {
if (fileList.length == 0) {
ElMessage.warning("请上传文件")
return;
}
params.append('file', fileList[0].file)
params.append("name", data.name)
params.append("periods", data.periods)
params.append("publishTime", data.publishTime)
await addPeriodicallab(params)
}
dialogVisible()
}
}
function dialogVisible() {
closeModal()
emit("close")
}
</script>
<style></style>

115
src/views/informationSub/mechanism/index.vue

@ -0,0 +1,115 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<template #action="{ record }">
<!-- <TableAction :actions="getTableAction(record)" /> -->
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<template #tableTitle>
<el-button type="primary" round @click="handleAdd" v-if="isShowByRoles('manageOrg')">新增信息材料</el-button>
<el-button type="primary" round @click="handleBatchdownload"> 批量导出</el-button>
</template>
</BasicTable>
<addAndModify @register="registerSubmitProjectArchive" @close="closeModel" />
</div>
</template>
<script lang="ts" name="system-user" setup>
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { useModal } from '@/components/Modal';
import { downloadResource } from "../../../api/common/api"
import { isShowByRoles } from '@/views/projectLib/projectInfo/projectInfo.api';
import { mechanismcolumns, searchFormSchema } from './mechanism.data';
import addAndModify from "./addAndModify.vue"
import { periodicallabPageList, batchdownloadPeriodicallabFiles, deletePeriodicallab } from './mechanism.api';
import { fi } from 'element-plus/es/locale';
const [registerSubmitProjectArchive, { openModal }] = useModal();
const [registerTable, { reload, getForm }] = useTable({
title: '月度期刊信息',
api: periodicallabPageList,
columns: mechanismcolumns,
useSearchForm: true,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
//
formConfig: {
schemas: searchFormSchema,
}
});
function getTableAction(record): ActionItem[] {
return [
{
label: '下载',
onClick: handledown.bind(null, record),
}
];
}
function getDropDownAction(record): ActionItem[] {
return [
{
label: '修改',
ifShow: () => {
return isShowByRoles('manageOrg')
},
onClick: handleModify.bind(null, record)
},
{
label: '删除',
ifShow: () => {
return isShowByRoles('manageOrg')
},
popConfirm: {
title: '确定删除吗?',
confirm: handleDelete.bind(null, record),
},
}
];
}
function handleAdd() {
openModal(true, { id: null })
}
function handleModify(record) {
openModal(true, { id: record.id })
}
function handleSubmit(record) {
}
function handledown(record) {
let param = {
path: record.documentPath,
fileName: record.documentName
}
downloadResource("/huzhouUploadfileinfo/downloadfile", record.documentName, param)
}
async function handleDelete(record) {
await deletePeriodicallab({ id: record.id })
reload()
}
function handleBatchdownload() {
let { getFieldsValue } = getForm()
let fromData = getFieldsValue()
batchdownloadPeriodicallabFiles(fromData)
}
function closeModel() {
reload()
}
</script>
<style scoped></style>

23
src/views/informationSub/mechanism/mechanism.api.ts

@ -0,0 +1,23 @@
import { defHttp } from '@/utils/http/axios';
import { downloadFile } from "../../../api/common/api"
export enum Api {
periodicallabPageList = '/huzhouPeriodicallab/periodicallabPageList',
addPeriodicallab="/huzhouPeriodicallab/addPeriodicallab",
modifyPeriodicallab = '/huzhouPeriodicallab/modifyPeriodicallab',
getperiodicallabById="/huzhouPeriodicallab/getperiodicallabById",
deletePeriodicallab = '/huzhouPeriodicallab/deletePeriodicallab',
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles",
}
export const periodicallabPageList = (params) => defHttp.get({ url: Api.periodicallabPageList, params })
export const getperiodicallabById = (params) => defHttp.get({ url: Api.getperiodicallabById, params })
export const batchdownloadPeriodicallabFiles = (params) => downloadFile(Api.batchdownloadPeriodicallabFiles,"批量导出.zip",params)
export const addPeriodicallab = (params?) =>defHttp.post({ url: Api.addPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params })
export const modifyPeriodicallab = (params?) =>defHttp.post({ url: Api.modifyPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params })
export const deletePeriodicallab = (params?) =>defHttp.post({ url: Api.deletePeriodicallab, params })

68
src/views/informationSub/mechanism/mechanism.data.ts

@ -0,0 +1,68 @@
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
export const mechanismcolumns: BasicColumn[] = [
{
title: '文件名称',
width: 250,
dataIndex: 'name',
},
{
title: '文件类别',
width: 150,
dataIndex: 'periods',
},
{
title: '发布日期',
width: 200,
dataIndex: 'publishTime',
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '文件类别',
field: 'periods',
component: 'Input',
colProps: { span: 5 },
},
{
label: '发布日期',
field: 'publishTime',
component: 'Input',
colProps: { span: 5 },
},
];
export const mechanismformSchemas: FormSchema[] = [
{
label: '文件名称',
field: 'name',
component: 'Input',
required: true,
colProps: { span: 12 },
},
{
label: '文件类别',
field: 'periods',
required: true,
component: 'Input',
colProps: { span: 6 },
}, {
label: '发布日期',
field: 'publishTime',
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
required: true,
colProps: { span: 6},
},
];

2
src/views/informationSub/monthlyJournal/monthlyJournal.api.ts

@ -7,7 +7,7 @@ export enum Api {
modifyPeriodicallab = '/huzhouPeriodicallab/modifyPeriodicallab',
getperiodicallabById="/huzhouPeriodicallab/getperiodicallabById",
deletePeriodicallab = '/huzhouPeriodicallab/deletePeriodicallab',
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles"
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles",
}
export const periodicallabPageList = (params) => defHttp.get({ url: Api.periodicallabPageList, params })

351
src/views/projectLib/projectPlan/index.vue

@ -7,189 +7,218 @@
<TableAction :actions="getTableAction(record)" />
</template>
<template #tableTitle>
<el-button color="#626aef" :dark="true" round @click="openModfiyInfoPage()">项目计划修改记录</el-button>
<el-button color="#626aef" :dark="true" round @click="openModfiyInfoPage()"
>项目计划修改记录</el-button
>
</template>
</BasicTable>
<BasicModal @register="registeViewPlanDetail" title="项目计划详情" width="1200px" :showOkBtn="false">
<viewPlanDetail :projectId="projectId" :projectStage="projectStage" :projectName="projectName"/>
<BasicModal
@register="registeViewPlanDetail"
title="项目计划详情"
width="1200px"
:showOkBtn="false"
>
<viewPlanDetail
:projectId="projectId"
:projectStage="projectStage"
:projectName="projectName"
/>
</BasicModal>
<BasicModal @register="registeChildViewPlanDetail" title="子项目计划详情" width="1200px" :showOkBtn="false">
<childViewPlanDetail :projectId="projectId" :projectStage="projectStage" :projectName="projectName"/>
<BasicModal
@register="registeChildViewPlanDetail"
title="子项目计划详情"
width="1200px"
:showOkBtn="false"
>
<childViewPlanDetail
:projectId="projectId"
:projectStage="projectStage"
:projectName="projectName"
/>
</BasicModal>
<BasicModal @register="registerProjectPlan" title="发起项目计划审批" width="1200px" :showOkBtn="false"
:showCancelBtn="false">
<BasicModal
@register="registerProjectPlan"
title="发起项目计划审批"
width="1200px"
:showOkBtn="false"
:showCancelBtn="false"
>
<addPlan :type="type" :projectid="projectId" @close="closeProjectPlanModal()" />
</BasicModal>
</PageWrapper>
</template>
<script lang="ts" name="system-user" setup>
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useModal, BasicModal } from '@/components/Modal';
import addPlan from '@/views/projectLib/projectPlan/addPlan.vue'
import viewPlanDetail from "@/views/projectLib/projectPlan/viewPlanDetail.vue";
import childViewPlanDetail from "@/views/projectLib/projectPlan/childViewPlanDetail.vue";
import { isShowByRoles,queryIsSubProject } from '@/views/projectLib/projectInfo/projectInfo.api';
import { columns } from '@/views/projectLib/projectInfo/projectInfo.data';
import { searchFormSchema } from '@/views/projectLib/projectInfo/projectInfo.data';
import { projectPlanPageList } from '@/views/projectLib/projectPlan/projectPlan.api';
import { useRouter } from 'vue-router'; // useRouter
const router = useRouter();
let projectId = ref();
let type = ref();
let projectStage = ref();
let projectName= ref();
const [registeViewPlanDetail, { openModal: openViewPlanDetail }] = useModal();
const [registeChildViewPlanDetail, { openModal: openChildViewPlanDetail }] = useModal();
const [registerProjectPlan, { openModal: openProjectPlan, closeModal: closeProjectPlan }] = useModal();//
const [registerTable, { reload }] = useTable({
title: '项目信息',
api: projectPlanPageList,
columns: columns,
useSearchForm: true,
showIndexColumn: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
//
formConfig: {
schemas: searchFormSchema,
},
beforeFetch: (param) => {
if(param.stage == undefined||param.stage == null){
param.stage = "2"
}else{
param.newStage=param.stage
param.stage = "2"
}
},
});
function getTableAction(record): ActionItem[] {
return [
{
label: '详情',
ifShow: () => {
return record.stage >= 4
},
onClick: handleDetailpage.bind(null, record),
//ts
import { ref } from 'vue';
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useModal, BasicModal } from '@/components/Modal';
import addPlan from '@/views/projectLib/projectPlan/addPlan.vue';
import viewPlanDetail from '@/views/projectLib/projectPlan/viewPlanDetail.vue';
import childViewPlanDetail from '@/views/projectLib/projectPlan/childViewPlanDetail.vue';
import { isShowByRoles, queryIsSubProject } from '@/views/projectLib/projectInfo/projectInfo.api';
import { columns } from '@/views/projectLib/projectInfo/projectInfo.data';
import { searchFormSchema } from '@/views/projectLib/projectInfo/projectInfo.data';
import {
projectPlanPageList,
queryUpdatePlanFlagById,
} from '@/views/projectLib/projectPlan/projectPlan.api';
import { useRouter } from 'vue-router'; // useRouter
import { message } from 'ant-design-vue';
const router = useRouter();
let projectId = ref();
let type = ref();
let projectStage = ref();
let projectName = ref();
const [registeViewPlanDetail, { openModal: openViewPlanDetail }] = useModal();
const [registeChildViewPlanDetail, { openModal: openChildViewPlanDetail }] = useModal();
const [registerProjectPlan, { openModal: openProjectPlan, closeModal: closeProjectPlan }] =
useModal(); //
const [registerTable, { reload }] = useTable({
title: '项目信息',
api: projectPlanPageList,
columns: columns,
useSearchForm: true,
showIndexColumn: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
{
label: '设计项目计划',
ifShow: () => {
return record.stage == 2 && isShowByRoles("projectContact")
},
onClick: handlePlan.bind(null, record)
//
formConfig: {
schemas: searchFormSchema,
},
{
label: '修改项目计划',
ifShow: () => {
return record.stage == 5 && isShowByRoles("projectContact")
},
onClick: handlePlan.bind(null, record)
beforeFetch: (param) => {
if (param.stage == undefined || param.stage == null) {
param.stage = '2';
} else {
param.newStage = param.stage;
param.stage = '2';
}
},
];
}
async function handleDetailpage(record) {
projectId.value = record.id
projectStage.value = record.stage
projectName.value = record.projectName
let res = await queryIsSubProject({ projectid: record.id })
console.log("queryIsSubProject",res)
//
if(res){
//
openChildViewPlanDetail()
}else{
openViewPlanDetail()
});
function getTableAction(record): ActionItem[] {
return [
{
label: '详情',
ifShow: () => {
return record.stage >= 4;
},
onClick: handleDetailpage.bind(null, record),
},
{
label: '设计项目计划',
ifShow: () => {
return record.stage == 2 && isShowByRoles('projectContact');
},
onClick: handlePlan.bind(null, record),
},
{
label: '修改项目计划',
ifShow: () => {
return record.stage == 5 && isShowByRoles('projectContact');
},
onClick: handlePlan.bind(null, record),
},
];
}
async function handleDetailpage(record) {
projectId.value = record.id;
projectStage.value = record.stage;
projectName.value = record.projectName;
let res = await queryIsSubProject({ projectid: record.id });
console.log('queryIsSubProject', res);
//
if (res) {
//
openChildViewPlanDetail();
} else {
openViewPlanDetail();
}
}
async function handlePlan(record: any) {
if (record.stage == 5) {
const res = await queryUpdatePlanFlagById({projectid:record.id});
console.log(res)
if (res) {
type.value = '2';
projectId.value = record.id;
openProjectPlan();
} else {
message.warning('本条不支持项目计划修改');
}
} else {
type.value = '1';
projectId.value = record.id;
openProjectPlan();
}
}
function closeProjectPlanModal() {
closeProjectPlan();
reload();
}
function openModfiyInfoPage() {
router.push({ path: '/projectLib/planinfoHistory/index' });
}
</script>
<style scoped>
.timeline {
display: flex;
width: 100%;
margin-bottom: 100px;
.lineitem {
transform: translateX(50%);
width: 25%;
}
}
}
function handlePlan(record) {
type.value = record.stage == 5 ? "2" : "1"
projectId.value = record.id
openProjectPlan()
::v-deep .el-timeline-item__tail {
border-left: none;
width: 100%;
border-top: 2px solid #e4e7ed;
position: absolute;
top: 6px;
}
}
::v-deep .el-timeline-item__wrapper {
padding-left: 0;
position: absolute;
top: 20px;
transform: translateX(-50%);
text-align: center;
}
function closeProjectPlanModal() {
closeProjectPlan()
reload()
}
function openModfiyInfoPage() {
router.push({ path: '/projectLib/planinfoHistory/index' })
::v-deep .el-timeline-item__timestamp {
font-size: 14px;
}
}
.nested-timeline {
margin-left: 20px;
border-left: 1px dashed #ccc;
padding-left: 20px;
}
</script>
.nested-timeline-item {
margin-bottom: 10px;
}
<style scoped>
.timeline {
display: flex;
width: 100%;
margin-bottom: 100px;
.lineitem {
transform: translateX(50%);
width: 25%;
::v-deep .ant-table-expanded-row {
height: auto !important;
/* 其他样式 */
}
}
::v-deep .el-timeline-item__tail {
border-left: none;
width: 100%;
border-top: 2px solid #e4e7ed;
position: absolute;
top: 6px;
}
::v-deep .el-timeline-item__wrapper {
padding-left: 0;
position: absolute;
top: 20px;
transform: translateX(-50%);
text-align: center;
}
::v-deep .el-timeline-item__timestamp {
font-size: 14px;
}
.nested-timeline {
margin-left: 20px;
border-left: 1px dashed #ccc;
padding-left: 20px;
}
.nested-timeline-item {
margin-bottom: 10px;
}
::v-deep .ant-table-expanded-row {
height: auto !important;
/* 其他样式 */
}
</style>

4
src/views/projectLib/projectPlan/projectPlan.api.ts

@ -33,7 +33,8 @@ export enum Api {
getProcessDetailByPlaninfoid="/huzhouPlaninfofile/getProcessDetailByPlaninfoid",
setPlaninfoIsoffline="/huzhouPlaninfofile/setPlaninfoIsoffline",
queryTaskLevelDetail="/huzhouPlan/queryTaskLevelDetail",
getContractinfoByTaskName="/huzhouContractinfo/getContractinfoByTaskName"
getContractinfoByTaskName="/huzhouContractinfo/getContractinfoByTaskName",
queryUpdatePlanFlagById="/huzhouProject/queryUpdatePlanFlagById"
}
/**
*
@ -71,3 +72,4 @@ export const getProcessDetailByPlaninfoid=(params) => defHttp.get({ url:Api.getP
export const queryPlanInfoMainTimelineOffline = (params) => defHttp.get({ url: Api.queryPlanInfoMainTimelineOffline, params })
export const setPlaninfoIsoffline = (params) => defHttp.post({ url: Api.setPlaninfoIsoffline, params })
export const getContractinfoByTaskName = (params) => defHttp.get({ url: Api.getContractinfoByTaskName, params })
export const queryUpdatePlanFlagById = (params) =>defHttp.get({ url: Api.queryUpdatePlanFlagById, params })

4
vite.config.ts

@ -22,7 +22,7 @@ export default defineApplicationConfig({
hmr: true,
proxy: {
'/guoyan': {
target: 'http://localhost:8080/',
target: 'http://10.1.21.250:18081',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/guoyan`), ''),
@ -30,7 +30,7 @@ export default defineApplicationConfig({
// secure: false
},
'/upload': {
target: 'http://localhost:3300/upload',
target: 'http://10.1.21.250:18081:3300/upload',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),

Loading…
Cancel
Save