设计变更
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
|
VITE_APP_BASE_API = 'http://192.168.110.180:8898'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export const getDesignChange = (id: string | number): AxiosPromise<DesignChangeV
|
|||||||
* 新增设计变更管理
|
* 新增设计变更管理
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const addDesignChange = (data: DesignChangeForm) => {
|
export const addDesignChange = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/design/designChange',
|
url: '/design/designChange',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
@ -8,7 +8,7 @@ import { VolumeCatalogVO, VolumeCatalogForm, VolumeCatalogQuery } from '@/api/de
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const listVolumeCatalog = (query?: VolumeCatalogQuery): AxiosPromise<VolumeCatalogVO[]> => {
|
export const listVolumeCatalog = (query) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/design/volumeCatalog/list',
|
url: '/design/volumeCatalog/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -46,7 +46,12 @@
|
|||||||
tag="ul"
|
tag="ul"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
|
<li
|
||||||
|
style="margin-bottom: 10px"
|
||||||
|
v-for="(file, index) in fileList"
|
||||||
|
:key="file.uid"
|
||||||
|
class="el-upload-list__item ele-upload-list__item-content"
|
||||||
|
>
|
||||||
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
<el-link :href="`${file.url}`" :underline="false" target="_blank">
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
|
221
src/views/design/designChange/index copy.vue
Normal file
221
src/views/design/designChange/index copy.vue
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
|
||||||
|
<el-form-item label="申请单编号" prop="formNo">
|
||||||
|
<el-input v-model="queryParams.formNo" placeholder="请输入申请单编号" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工程名称" prop="projectName">
|
||||||
|
<el-input v-model="queryParams.projectName" placeholder="请输入工程名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提出单位" prop="submitUnit">
|
||||||
|
<el-input v-model="queryParams.submitUnit" placeholder="请输入提出单位" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="专业" prop="specialty">
|
||||||
|
<el-input v-model="queryParams.specialty" placeholder="请输入专业" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="卷册名称" prop="volumeName">
|
||||||
|
<el-input v-model="queryParams.volumeName" placeholder="请输入卷册名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="卷册号" prop="volumeNo">
|
||||||
|
<el-input v-model="queryParams.volumeNo" placeholder="请输入卷册号" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提出日期" prop="submitDate">
|
||||||
|
<el-date-picker clearable v-model="queryParams.submitDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择提出日期" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="ChatRound" @click="handleAdd" v-hasPermi="['design:designChange:add']">下发变更通知</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-table v-loading="loading" :data="designChangeList">
|
||||||
|
<el-table-column label="申请单编号" align="center" prop="formNo" />
|
||||||
|
<el-table-column label="工程名称" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="提出单位" align="center" prop="submitUnit" />
|
||||||
|
<el-table-column label="专业" align="center" prop="specialty" />
|
||||||
|
<el-table-column label="提出日期" align="center" prop="submitDate" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="卷册名称" align="center" prop="volumeName" />
|
||||||
|
<el-table-column label="卷册号" align="center" prop="volumeNo" />
|
||||||
|
<el-table-column label="变更原因" align="center" prop="changeReason">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="design_change_reason_type" :value="scope.row.changeReason ? scope.row.changeReason.split(',') : []" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="变更内容" align="center" prop="changeContent" />
|
||||||
|
<!-- <el-table-column label="变更费用估算" align="center" prop="costEstimation" /> -->
|
||||||
|
<!-- <el-table-column label="变更文件" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.file" style="color: rgb(41 145 255); cursor: pointer" @click="onOpen(scope.row.file.url)">
|
||||||
|
{{ scope.row.file.originalName }}</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="流程状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="wf_business_status" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="操作" fixed="right" width="300">
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- <el-button type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:designChange:edit']">审核</el-button> -->
|
||||||
|
<!-- <el-button type="success" icon="View" @click="handleViewInfo(scope.row)">查看</el-button> -->
|
||||||
|
<!-- <el-tooltip content="查看文档" placement="top">
|
||||||
|
<el-button link type="primary" icon="Document" @click="handleView(scope.row)"></el-button>
|
||||||
|
</el-tooltip> -->
|
||||||
|
<el-button type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['design:designChange:remove']">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
<wordDetial ref="wordDetialRef"></wordDetial>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="DesignChange" lang="ts">
|
||||||
|
import { listDesignChange, delDesignChange } from '@/api/design/designChange';
|
||||||
|
import { DesignChangeVO } from '@/api/design/designChange/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import wordDetial from '@/components/wordDetial/index';
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const designChangeList = ref<DesignChangeVO[]>([]);
|
||||||
|
const wordDetialRef = ref<InstanceType<typeof wordDetial>>();
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref<Array<string | number>>([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const data = reactive({
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
formNo: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
submitUnit: undefined,
|
||||||
|
specialty: undefined,
|
||||||
|
submitDate: undefined,
|
||||||
|
volumeName: undefined,
|
||||||
|
volumeNo: undefined,
|
||||||
|
changeReason: undefined,
|
||||||
|
status: undefined,
|
||||||
|
params: {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询设计变更管理列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
const res = await listDesignChange(queryParams.value);
|
||||||
|
designChangeList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
const handleAdd = () => {
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.push({
|
||||||
|
path: `/design-management/designChange/indexEdit`,
|
||||||
|
query: {
|
||||||
|
type: 'add'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = async (row?: DesignChangeVO) => {
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.push({
|
||||||
|
path: `/design-management/designChange/indexEdit`,
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
type: 'update'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/** 查看按钮操作 */
|
||||||
|
const handleViewInfo = (row) => {
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.push({
|
||||||
|
path: `/design-management/designChange/indexEdit`,
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
type: 'view'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (row?: DesignChangeVO) => {
|
||||||
|
const _ids = row?.id || ids.value;
|
||||||
|
await proxy?.$modal.confirm('是否确认删除设计变更管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||||
|
await delDesignChange(_ids);
|
||||||
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
|
await getList();
|
||||||
|
};
|
||||||
|
const handleView = (row) => {
|
||||||
|
// 查看详情
|
||||||
|
wordDetialRef.value?.openDialog(row, design_change_reason_type.value);
|
||||||
|
};
|
||||||
|
// 预览
|
||||||
|
const onOpen = (path: string) => {
|
||||||
|
window.open(path, '_blank');
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
@ -34,56 +34,58 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['design:designChange:add']">上传设计变更</el-button>
|
<el-button type="primary" plain icon="ChatRound" @click="handleAdd" v-hasPermi="['design:designChange:add']">下发变更通知</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
<el-table v-loading="loading" :data="designChangeList">
|
<el-table v-loading="loading" :data="designChangeList">
|
||||||
<el-table-column label="申请单编号" align="center" prop="formNo" />
|
<el-table-column label="申请单编号" align="center" prop="formNo" width="150" />
|
||||||
<el-table-column label="工程名称" align="center" prop="projectName" />
|
<el-table-column label="工程名称" align="center" prop="projectName" width="150" />
|
||||||
<el-table-column label="提出单位" align="center" prop="submitUnit" />
|
<el-table-column label="提出单位" align="center" prop="submitUnit" width="150" />
|
||||||
<el-table-column label="专业" align="center" prop="specialty" />
|
<el-table-column label="专业" align="center" prop="specialty" width="120" />
|
||||||
<el-table-column label="提出日期" align="center" prop="submitDate" width="180">
|
<el-table-column label="提出日期" align="center" prop="submitDate" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="卷册名称" align="center" prop="volumeName" />
|
<el-table-column label="卷册号" align="center" prop="volumeNo" width="150" />
|
||||||
<el-table-column label="卷册号" align="center" prop="volumeNo" />
|
<el-table-column label="流程状态" align="center">
|
||||||
<el-table-column label="变更原因" align="center" prop="changeReason">
|
<template #default="scope">
|
||||||
|
<dict-tag v-if="scope.row.fileId != null" :options="wf_business_status" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="变更文件" align="center" width="300">
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
v-if="scope.row.ossVoList.length > 0"
|
||||||
|
style="color: rgb(41 145 255); cursor: pointer"
|
||||||
|
:key="item"
|
||||||
|
v-for="item of scope.row.ossVoList"
|
||||||
|
@click="onOpen(item.url)"
|
||||||
|
>
|
||||||
|
{{ item.originalName + ',' }}</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="变更原因" align="center" prop="changeReason" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="design_change_reason_type" :value="scope.row.changeReason ? scope.row.changeReason.split(',') : []" />
|
<dict-tag :options="design_change_reason_type" :value="scope.row.changeReason ? scope.row.changeReason.split(',') : []" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="变更内容" align="center" prop="changeContent" />
|
<el-table-column label="变更内容" align="center" prop="changeContent" width="150" />
|
||||||
<!-- <el-table-column label="变更费用估算" align="center" prop="costEstimation" /> -->
|
<el-table-column label="备注" align="center" prop="remark" width="150" />
|
||||||
<el-table-column label="变更文件" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.file" style="color: rgb(41 145 255); cursor: pointer" @click="onOpen(scope.row.file.url)">
|
|
||||||
{{ scope.row.file.originalName }}</span
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="流程状态" align="center" prop="status">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="wf_business_status" :value="scope.row.status" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
|
||||||
<el-table-column label="操作" fixed="right" width="300">
|
<el-table-column label="操作" fixed="right" width="300">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['design:designChange:edit']">审核</el-button>
|
<el-button type="primary" icon="Upload" @click="handleAddChange(scope.row)" v-if="!scope.row.fileId">上传变更图</el-button>
|
||||||
<el-button type="success" icon="View" @click="handleViewInfo(scope.row)">查看</el-button>
|
<el-button type="success" icon="View" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||||
<!-- <el-tooltip content="查看文档" placement="top">
|
<!-- <el-tooltip content="查看文档" placement="top">
|
||||||
<el-button link type="primary" icon="Document" @click="handleView(scope.row)"></el-button>
|
<el-button link type="primary" icon="Document" @click="handleView(scope.row)"></el-button>
|
||||||
</el-tooltip> -->
|
</el-tooltip> -->
|
||||||
<el-button type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['design:designChange:remove']">删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -115,6 +117,10 @@ const multiple = ref(true);
|
|||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const uploadUrl = computed(() => {
|
||||||
|
return `/design/collectFile/upload`;
|
||||||
|
});
|
||||||
|
const ossid = ref(null);
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -146,6 +152,7 @@ const getList = async () => {
|
|||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
|
console.log(ossid.value);
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
@ -165,15 +172,14 @@ const handleAdd = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// 变更图纸
|
||||||
/** 修改按钮操作 */
|
const handleAddChange = (row) => {
|
||||||
const handleUpdate = async (row?: DesignChangeVO) => {
|
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy.$tab.closePage(proxy.$route);
|
||||||
proxy.$router.push({
|
proxy.$router.push({
|
||||||
path: `/design-management/designChange/indexEdit`,
|
path: `/design-management/drawing/indexEdit`,
|
||||||
query: {
|
query: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
type: 'update'
|
type: 'add'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -181,7 +187,7 @@ const handleUpdate = async (row?: DesignChangeVO) => {
|
|||||||
const handleViewInfo = (row) => {
|
const handleViewInfo = (row) => {
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy.$tab.closePage(proxy.$route);
|
||||||
proxy.$router.push({
|
proxy.$router.push({
|
||||||
path: `/design-management/designChange/indexEdit`,
|
path: `/design-management/drawing/indexEdit`,
|
||||||
query: {
|
query: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
type: 'view'
|
type: 'view'
|
||||||
@ -204,6 +210,7 @@ const handleView = (row) => {
|
|||||||
const onOpen = (path: string) => {
|
const onOpen = (path: string) => {
|
||||||
window.open(path, '_blank');
|
window.open(path, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
500
src/views/design/designChange/indexEdit copy.vue
Normal file
500
src/views/design/designChange/indexEdit copy.vue
Normal file
@ -0,0 +1,500 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4 bg-gray-50">
|
||||||
|
<div class="max-w-4xl mx-auto">
|
||||||
|
<!-- 顶部按钮区域 -->
|
||||||
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
|
<approvalButton
|
||||||
|
@submitForm="submitForm"
|
||||||
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.id"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-800">设计变更信息</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<el-form
|
||||||
|
ref="leaveFormRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:disabled="routeParams.type === 'view'"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
class="space-y-4"
|
||||||
|
>
|
||||||
|
<div class="grid grid-cols-1 gap-4">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="申请单编号" prop="formNo">
|
||||||
|
<el-input v-model="form.formNo" placeholder="请输入申请单编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工程名称" prop="projectName">
|
||||||
|
<el-input v-model="form.projectName" placeholder="请输入工程名称" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="提出单位" prop="submitUnit">
|
||||||
|
<el-input v-model="form.submitUnit" placeholder="请输入提出单位" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="专业" prop="specialty">
|
||||||
|
<el-input v-model="form.specialty" placeholder="请输入专业" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="提出日期" prop="submitDate">
|
||||||
|
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
||||||
|
</el-date-picker> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="卷册名称" prop="volumeName"> <el-input v-model="form.volumeName" placeholder="请输入卷册名称" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="原卷册号" prop="volumeNo"> <el-input v-model="form.volumeNo" placeholder="请输入卷册号" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="子项名称" prop="subName">
|
||||||
|
<el-input v-model="form.extendDetail.subName" placeholder="请输入子项名称" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="原设计处置" prop="designDisposal">
|
||||||
|
<el-radio-group v-model="form.extendDetail.designDisposal">
|
||||||
|
<el-radio value="1" size="large">原图作废</el-radio>
|
||||||
|
<el-radio value="2" size="large">原图保留,部分修改</el-radio>
|
||||||
|
<el-radio value="3" size="large">原图保留,补充设计</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设计阶段" prop="designPhase">
|
||||||
|
<el-input v-model="form.extendDetail.designPhase" placeholder="请输入设计阶段" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更类别" prop="changeCategory">
|
||||||
|
<el-radio-group v-model="form.extendDetail.changeCategory">
|
||||||
|
<el-radio value="1" size="large">重大设计变更</el-radio>
|
||||||
|
<el-radio value="2" size="large">一般设计变更</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="实施程序" prop="ImpProcedure">
|
||||||
|
<el-radio-group v-model="form.extendDetail.ImpProcedure">
|
||||||
|
<el-radio value="1" size="large">建设单位重新申报初步设计审批</el-radio>
|
||||||
|
<el-radio value="2" size="large">建设单位送原施工图审查机构审查、建设主管部分备案后交付实施</el-radio>
|
||||||
|
<el-radio value="3" size="large">建设单位确认后交付实施</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="更改相关专业" prop="involvingProfessions">
|
||||||
|
<el-input v-model="form.extendDetail.involvingProfessions" placeholder="请输入更改相关专业" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="附图" prop="attachmentPic"> <image-upload v-model="form.attachmentPic" :fileSize="100" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更原因" prop="changeReason">
|
||||||
|
<el-checkbox-group v-model="form.changeReason">
|
||||||
|
<el-checkbox v-for="dict in design_change_reason_type" :key="dict.value" :value="dict.value">
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item></el-col
|
||||||
|
>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更内容" prop="changeContent">
|
||||||
|
<el-input v-model="form.changeContent" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="费用" prop="costEstimation">
|
||||||
|
<el-input v-model="form.costEstimation" type="number" placeholder="请输入费用" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更费用估算表" label-width="110px" prop="costEstimationFile">
|
||||||
|
<file-upload v-model="form.costEstimationFile" :fileSize="100" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
<!-- <el-col :span="24">
|
||||||
|
<el-form-item label="变更文件" prop="fileId"> <file-upload v-model="form.fileId" :fileSize="100" /> </el-form-item
|
||||||
|
></el-col> -->
|
||||||
|
<el-col :span="24"
|
||||||
|
><el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> </el-form-item
|
||||||
|
></el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<!-- 提交组件 -->
|
||||||
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
|
<!-- 流程选择对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Leave" lang="ts">
|
||||||
|
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||||
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
|
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||||
|
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { getDesignChange, addDesignChange, updateDesignChange } from '@/api/design/designChange';
|
||||||
|
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||||
|
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
//路由参数
|
||||||
|
const routeParams = ref<Record<string, any>>({});
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_designchanged',
|
||||||
|
label: '设计变更审批'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const flowCode = ref<string>('');
|
||||||
|
const status = ref<string>('');
|
||||||
|
const dialogVisible = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
|
//提交组件
|
||||||
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
|
//审批记录组件
|
||||||
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
//按钮组件
|
||||||
|
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
||||||
|
|
||||||
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
const dialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
isEdit: false
|
||||||
|
});
|
||||||
|
const submitFormData = ref<StartProcessBo>({
|
||||||
|
businessId: '',
|
||||||
|
flowCode: '',
|
||||||
|
variables: {}
|
||||||
|
});
|
||||||
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
const initFormData = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
formNo: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
submitUnit: undefined,
|
||||||
|
specialty: undefined,
|
||||||
|
submitDate: undefined,
|
||||||
|
volumeName: undefined,
|
||||||
|
volumeNo: undefined,
|
||||||
|
attachmentPic: undefined,
|
||||||
|
changeReason: [],
|
||||||
|
changeContent: undefined,
|
||||||
|
costEstimation: undefined,
|
||||||
|
costEstimationFile: undefined,
|
||||||
|
fileId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
extendDetail: {
|
||||||
|
changeCategory: undefined,
|
||||||
|
ImpProcedure: undefined,
|
||||||
|
involvingProfessions: undefined,
|
||||||
|
subName: undefined,
|
||||||
|
designDisposal: undefined,
|
||||||
|
designPhase: undefined
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const data = reactive({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
fileName: undefined,
|
||||||
|
fileType: undefined,
|
||||||
|
fileSuffix: undefined,
|
||||||
|
fileStatus: undefined,
|
||||||
|
originalName: undefined,
|
||||||
|
newest: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
leaveFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取详情 */
|
||||||
|
const getInfo = () => {
|
||||||
|
loading.value = true;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
nextTick(async () => {
|
||||||
|
const res = await getDesignChange(routeParams.value.id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
if (form.value.changeReason.length > 0) {
|
||||||
|
form.value.changeReason = form.value.changeReason.split(',');
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = (status1: string) => {
|
||||||
|
status.value = status1;
|
||||||
|
var changeReason = '';
|
||||||
|
if (form.value.changeReason.length > 0) {
|
||||||
|
changeReason = form.value.changeReason.join(',');
|
||||||
|
}
|
||||||
|
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
var res;
|
||||||
|
if (form.value.id) {
|
||||||
|
res = await updateDesignChange({ ...form.value, changeReason }).finally(() => (buttonLoading.value = false));
|
||||||
|
} else {
|
||||||
|
res = await addDesignChange({ ...form.value, changeReason }).finally(() => (buttonLoading.value = false));
|
||||||
|
}
|
||||||
|
if (res.code == 200) {
|
||||||
|
dialog.visible = false;
|
||||||
|
if (res.data.extendDetail == null) {
|
||||||
|
res.data.extendDetail = {
|
||||||
|
'changeCategory': '',
|
||||||
|
'ImpProcedure': '',
|
||||||
|
'involvingProfessions': '',
|
||||||
|
'subName': '',
|
||||||
|
'designDisposal': '',
|
||||||
|
'designPhase': ''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
submit(status.value, res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
|
//提交申请
|
||||||
|
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||||
|
try {
|
||||||
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
|
submitFormData.value.businessId = data.id;
|
||||||
|
//流程变量
|
||||||
|
taskVariables.value = {
|
||||||
|
// leave4/5 使用的流程变量
|
||||||
|
userList: ['1', '3', '4'],
|
||||||
|
costEstimation: form.value.costEstimation
|
||||||
|
};
|
||||||
|
submitFormData.value.variables = taskVariables.value;
|
||||||
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
|
if (submitVerifyRef.value) {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//审批记录
|
||||||
|
const handleApprovalRecord = () => {
|
||||||
|
approvalRecordRef.value.init(form.value.id);
|
||||||
|
};
|
||||||
|
//提交回调
|
||||||
|
const submitCallback = async () => {
|
||||||
|
await proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
};
|
||||||
|
//审批
|
||||||
|
const approvalVerifyOpen = async () => {
|
||||||
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
|
};
|
||||||
|
const submit = async (status, data) => {
|
||||||
|
form.value = data;
|
||||||
|
if (status === 'draft') {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
|
await handleStartWorkFlow(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(async () => {
|
||||||
|
routeParams.value = proxy.$route.query;
|
||||||
|
reset();
|
||||||
|
loading.value = false;
|
||||||
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
|
getInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 全局样式 */
|
||||||
|
:root {
|
||||||
|
--primary: #409eff;
|
||||||
|
--primary-light: #66b1ff;
|
||||||
|
--primary-dark: #3a8ee6;
|
||||||
|
--success: #67c23a;
|
||||||
|
--warning: #e6a23c;
|
||||||
|
--danger: #f56c6c;
|
||||||
|
--info: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单样式优化 */
|
||||||
|
.el-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner,
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式优化 */
|
||||||
|
.el-button {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.is-primary {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: var(--primary-dark);
|
||||||
|
border-color: var(--primary-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-text {
|
||||||
|
color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-light);
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片样式优化 */
|
||||||
|
.el-card {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
/* transform: translateY(-2px); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 对话框样式优化 */
|
||||||
|
.el-dialog {
|
||||||
|
.el-dialog__header {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 15px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,33 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-4 bg-gray-50">
|
<div class="p-4 bg-gray-50 designChangeForm">
|
||||||
<div class="max-w-4xl mx-auto">
|
<div class="max-w-4xl mx-auto">
|
||||||
<!-- 顶部按钮区域 -->
|
|
||||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
|
||||||
<approvalButton
|
|
||||||
@submitForm="submitForm"
|
|
||||||
@approvalVerifyOpen="approvalVerifyOpen"
|
|
||||||
@handleApprovalRecord="handleApprovalRecord"
|
|
||||||
:buttonLoading="buttonLoading"
|
|
||||||
:id="form.id"
|
|
||||||
:status="form.status"
|
|
||||||
:pageType="routeParams.type"
|
|
||||||
/>
|
|
||||||
</el-card>
|
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
<h3 class="text-lg font-semibold text-gray-800">设计变更信息</h3>
|
<h3 class="text-lg font-semibold text-gray-800">设计变更信息</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<el-form
|
<el-form ref="leaveFormRef" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="100px" class="space-y-4">
|
||||||
ref="leaveFormRef"
|
|
||||||
v-loading="loading"
|
|
||||||
:disabled="routeParams.type === 'view'"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="100px"
|
|
||||||
class="space-y-4"
|
|
||||||
>
|
|
||||||
<div class="grid grid-cols-1 gap-4">
|
<div class="grid grid-cols-1 gap-4">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -39,6 +19,25 @@
|
|||||||
<el-form-item label="工程名称" prop="projectName">
|
<el-form-item label="工程名称" prop="projectName">
|
||||||
<el-input v-model="form.projectName" placeholder="请输入工程名称" /> </el-form-item
|
<el-input v-model="form.projectName" placeholder="请输入工程名称" /> </el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="原卷册号" prop="volumeNo">
|
||||||
|
<el-select
|
||||||
|
id="projectSelect"
|
||||||
|
v-model="form.volumeNo"
|
||||||
|
placeholder="请选择原卷册号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="handleSelect"
|
||||||
|
style="width: 150px; margin-right: 20px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="project in volumeCatalogList"
|
||||||
|
:key="project.volumeNumber"
|
||||||
|
:label="project.volumeNumber"
|
||||||
|
:value="project.volumeNumber"
|
||||||
|
/>
|
||||||
|
</el-select> </el-form-item
|
||||||
|
></el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="提出单位" prop="submitUnit">
|
<el-form-item label="提出单位" prop="submitUnit">
|
||||||
<el-input v-model="form.submitUnit" placeholder="请输入提出单位" />
|
<el-input v-model="form.submitUnit" placeholder="请输入提出单位" />
|
||||||
@ -46,7 +45,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="专业" prop="specialty">
|
<el-form-item label="专业" prop="specialty">
|
||||||
<el-input v-model="form.specialty" placeholder="请输入专业" />
|
<el-input disabled v-model="form.specialty" placeholder="请输入专业" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -54,15 +53,12 @@
|
|||||||
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
<el-date-picker clearable v-model="form.submitDate" type="date" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择提出日期">
|
||||||
</el-date-picker> </el-form-item
|
</el-date-picker> </el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="卷册名称" prop="volumeName"> <el-input v-model="form.volumeName" placeholder="请输入卷册名称" /> </el-form-item
|
<el-form-item label="卷册名称" prop="volumeName"> <el-input v-model="form.volumeName" placeholder="请输入卷册名称" /> </el-form-item
|
||||||
></el-col>
|
></el-col> -->
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="原卷册号" prop="volumeNo"> <el-input v-model="form.volumeNo" placeholder="请输入卷册号" /> </el-form-item
|
|
||||||
></el-col>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="子项名称" prop="subName">
|
<el-form-item label="子项名称" prop="subName">
|
||||||
<el-input v-model="form.extendDetail.subName" placeholder="请输入子项名称" /> </el-form-item
|
<el-input disabled v-model="form.extendDetail.subName" placeholder="请输入子项名称" /> </el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="原设计处置" prop="designDisposal">
|
<el-form-item label="原设计处置" prop="designDisposal">
|
||||||
@ -73,6 +69,19 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item></el-col
|
</el-form-item></el-col
|
||||||
>
|
>
|
||||||
|
<el-col :span="24" v-if="form.extendDetail.designDisposal == 2 && form.volumeNo">
|
||||||
|
<el-form-item label="选择保留文件" prop="designPhase">
|
||||||
|
<el-select
|
||||||
|
id="projectSelect"
|
||||||
|
v-model="form.saveFile"
|
||||||
|
placeholder="请选择保留文件"
|
||||||
|
multiple
|
||||||
|
style="width: 150px; margin-right: 20px"
|
||||||
|
>
|
||||||
|
<el-option v-for="project in fileVoList" :key="project.id" :label="project.fileName" :value="project.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="设计阶段" prop="designPhase">
|
<el-form-item label="设计阶段" prop="designPhase">
|
||||||
<el-input v-model="form.extendDetail.designPhase" placeholder="请输入设计阶段" /> </el-form-item
|
<el-input v-model="form.extendDetail.designPhase" placeholder="请输入设计阶段" /> </el-form-item
|
||||||
@ -133,91 +142,47 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
<div class="flex justify-center gap-4 mt-8">
|
||||||
<!-- 提交组件 -->
|
<el-button @click="goBack" size="large" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
>返回</el-button
|
||||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
|
||||||
<!-- 流程选择对话框 -->
|
|
||||||
<el-dialog
|
|
||||||
draggable
|
|
||||||
v-model="dialogVisible.visible"
|
|
||||||
:title="dialogVisible.title"
|
|
||||||
:before-close="handleClose"
|
|
||||||
width="500"
|
|
||||||
class="rounded-lg shadow-lg"
|
|
||||||
>
|
>
|
||||||
<div class="p-4">
|
<el-button
|
||||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
type="primary"
|
||||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
size="large"
|
||||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
@click="submitForm"
|
||||||
</el-select>
|
class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
|
||||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
|
||||||
>取消</el-button
|
|
||||||
>
|
|
||||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
|
||||||
>确认</el-button
|
>确认</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</el-card>
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Leave" lang="ts">
|
<script setup name="Leave" lang="ts">
|
||||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
|
||||||
import { startWorkFlow } from '@/api/workflow/task';
|
|
||||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
|
||||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
||||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
|
||||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { getDesignChange, addDesignChange, updateDesignChange } from '@/api/design/designChange';
|
import { addDesignChange } from '@/api/design/designChange';
|
||||||
|
import { listVolumeCatalog } from '@/api/design/volumeCatalog';
|
||||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const loading = ref(true);
|
const volumeCatalogList = ref([]);
|
||||||
|
let volumeMap = new Map();
|
||||||
//路由参数
|
//路由参数
|
||||||
const routeParams = ref<Record<string, any>>({});
|
const routeParams = ref<Record<string, any>>({});
|
||||||
const flowCodeOptions = [
|
|
||||||
{
|
|
||||||
value: currentProject.value?.id + '_designchanged',
|
|
||||||
label: '设计变更审批'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const flowCode = ref<string>('');
|
|
||||||
const status = ref<string>('');
|
|
||||||
const dialogVisible = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: '流程定义'
|
|
||||||
});
|
|
||||||
//提交组件
|
|
||||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
|
||||||
//审批记录组件
|
|
||||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
|
||||||
//按钮组件
|
|
||||||
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
|
||||||
|
|
||||||
const leaveFormRef = ref<ElFormInstance>();
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
const dialog = reactive({
|
const dialog = reactive({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: '',
|
title: '',
|
||||||
isEdit: false
|
isEdit: false
|
||||||
});
|
});
|
||||||
const submitFormData = ref<StartProcessBo>({
|
const fileVoList = ref([]);
|
||||||
businessId: '',
|
|
||||||
flowCode: '',
|
|
||||||
variables: {}
|
|
||||||
});
|
|
||||||
const taskVariables = ref<Record<string, any>>({});
|
|
||||||
const initFormData = {
|
const initFormData = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
@ -236,6 +201,7 @@ const initFormData = {
|
|||||||
fileId: undefined,
|
fileId: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
|
saveFile: undefined,
|
||||||
extendDetail: {
|
extendDetail: {
|
||||||
changeCategory: undefined,
|
changeCategory: undefined,
|
||||||
ImpProcedure: undefined,
|
ImpProcedure: undefined,
|
||||||
@ -262,11 +228,6 @@ const data = reactive({
|
|||||||
rules: {}
|
rules: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
dialogVisible.visible = false;
|
|
||||||
flowCode.value = '';
|
|
||||||
buttonLoading.value = false;
|
|
||||||
};
|
|
||||||
const { form, rules } = toRefs(data);
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
@ -275,126 +236,63 @@ const reset = () => {
|
|||||||
leaveFormRef.value?.resetFields();
|
leaveFormRef.value?.resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 获取详情 */
|
//返回
|
||||||
const getInfo = () => {
|
const goBack = () => {
|
||||||
loading.value = true;
|
proxy.$tab.closePage(route);
|
||||||
buttonLoading.value = false;
|
router.go(-1);
|
||||||
nextTick(async () => {
|
|
||||||
const res = await getDesignChange(routeParams.value.id);
|
|
||||||
Object.assign(form.value, res.data);
|
|
||||||
if (form.value.changeReason.length > 0) {
|
|
||||||
form.value.changeReason = form.value.changeReason.split(',');
|
|
||||||
}
|
|
||||||
loading.value = false;
|
|
||||||
buttonLoading.value = false;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = (status1: string) => {
|
const submitForm = () => {
|
||||||
status.value = status1;
|
|
||||||
var changeReason = '';
|
var changeReason = '';
|
||||||
if (form.value.changeReason.length > 0) {
|
if (form.value.changeReason && form.value.changeReason.length > 0) {
|
||||||
changeReason = form.value.changeReason.join(',');
|
changeReason = form.value.changeReason.join(',');
|
||||||
}
|
}
|
||||||
|
var saveFile = '';
|
||||||
|
if (form.value.saveFile && form.value.saveFile.length > 0) {
|
||||||
|
saveFile = form.value.saveFile.join(',');
|
||||||
|
}
|
||||||
leaveFormRef.value?.validate(async (valid: boolean) => {
|
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
|
||||||
var res;
|
var res;
|
||||||
if (form.value.id) {
|
res = await addDesignChange({ ...form.value, changeReason, saveFile }).finally(() => (buttonLoading.value = false));
|
||||||
res = await updateDesignChange({ ...form.value, changeReason }).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
res = await addDesignChange({ ...form.value, changeReason }).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
dialog.visible = false;
|
ElMessage.success('通知成功');
|
||||||
if (res.data.extendDetail == null) {
|
goBack();
|
||||||
res.data.extendDetail = {
|
} else {
|
||||||
'changeCategory': '',
|
ElMessage.error(res.msg);
|
||||||
'ImpProcedure': '',
|
|
||||||
'involvingProfessions': '',
|
|
||||||
'subName': '',
|
|
||||||
'designDisposal': '',
|
|
||||||
'designPhase': ''
|
|
||||||
};
|
|
||||||
}
|
|
||||||
submit(status.value, res.data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
/** 查询卷册目录列表 */
|
||||||
const submitFlow = async () => {
|
const getList = async () => {
|
||||||
handleStartWorkFlow(form.value);
|
const res = await listVolumeCatalog({ projectId: currentProject.value?.id, auditStatus: 'finish' });
|
||||||
dialogVisible.visible = false;
|
volumeCatalogList.value = res.rows;
|
||||||
|
volumeCatalogList.value.forEach((e) => {
|
||||||
|
volumeMap.set(e.volumeNumber, e);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
//提交申请
|
const handleSelect = (val) => {
|
||||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
let obj = volumeMap.get(val);
|
||||||
try {
|
console.log(obj);
|
||||||
submitFormData.value.flowCode = flowCode.value;
|
fileVoList.value = obj.fileVoList;
|
||||||
submitFormData.value.businessId = data.id;
|
form.value.volumeName = obj.volumeName;
|
||||||
//流程变量
|
form.value.specialty = obj.specialty;
|
||||||
taskVariables.value = {
|
form.value.extendDetail.subName = obj.designSubitem;
|
||||||
// leave4/5 使用的流程变量
|
|
||||||
userList: ['1', '3', '4'],
|
|
||||||
costEstimation: form.value.costEstimation
|
|
||||||
};
|
};
|
||||||
submitFormData.value.variables = taskVariables.value;
|
|
||||||
const resp = await startWorkFlow(submitFormData.value);
|
|
||||||
if (submitVerifyRef.value) {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//审批记录
|
|
||||||
const handleApprovalRecord = () => {
|
|
||||||
approvalRecordRef.value.init(form.value.id);
|
|
||||||
};
|
|
||||||
//提交回调
|
|
||||||
const submitCallback = async () => {
|
|
||||||
await proxy.$tab.closePage(proxy.$route);
|
|
||||||
proxy.$router.go(-1);
|
|
||||||
};
|
|
||||||
//审批
|
|
||||||
const approvalVerifyOpen = async () => {
|
|
||||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
|
||||||
};
|
|
||||||
const submit = async (status, data) => {
|
|
||||||
form.value = data;
|
|
||||||
if (status === 'draft') {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
proxy?.$modal.msgSuccess('暂存成功');
|
|
||||||
proxy.$tab.closePage(proxy.$route);
|
|
||||||
proxy.$router.go(-1);
|
|
||||||
} else {
|
|
||||||
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
|
||||||
flowCode.value = flowCodeOptions[0].value;
|
|
||||||
dialogVisible.visible = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//说明启动过先随意穿个参数
|
|
||||||
if (flowCode.value === '' || flowCode.value === null) {
|
|
||||||
flowCode.value = 'xx';
|
|
||||||
}
|
|
||||||
await handleStartWorkFlow(data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
routeParams.value = proxy.$route.query;
|
|
||||||
reset();
|
reset();
|
||||||
loading.value = false;
|
getList();
|
||||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
|
||||||
getInfo();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.designChangeForm {
|
||||||
|
.el-select {
|
||||||
|
width: 300px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* 全局样式 */
|
/* 全局样式 */
|
||||||
:root {
|
:root {
|
||||||
--primary: #409eff;
|
--primary: #409eff;
|
||||||
|
415
src/views/design/drawing/indexEdit copy.vue
Normal file
415
src/views/design/drawing/indexEdit copy.vue
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-4 bg-gray-50 ">
|
||||||
|
<div class="max-w-4xl mx-auto">
|
||||||
|
<!-- 顶部按钮区域 -->
|
||||||
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
|
<approvalButton
|
||||||
|
@submitForm="submitForm"
|
||||||
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.id"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
|
<h3 class="text-lg font-semibold text-gray-800">图纸信息</h3>
|
||||||
|
</div>
|
||||||
|
<div class="p-6">
|
||||||
|
<el-form
|
||||||
|
ref="leaveFormRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:disabled="routeParams.type === 'view'"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
class="space-y-4"
|
||||||
|
>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<el-form-item label="图纸类型" prop="fileType" class="mb-2">
|
||||||
|
<el-select v-model="form.fileType" placeholder="请选择图纸类型" class="w-full">
|
||||||
|
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本号" prop="versionNumber" class="mb-2">
|
||||||
|
<el-input v-model="form.versionNumber" placeholder="请输入版本号" class="w-full"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件名称" prop="fileName" class="mb-2 ">
|
||||||
|
<el-input v-model="form.fileName" placeholder="请输入文件名称" class="w-full"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="图纸文件" prop="fileUrl" class="mb-2 md:col-span-2">
|
||||||
|
<file-upload :limit="1" :fileType="['pdf']" :fileSize="100" v-model="form.fileUrl" class="w-full"></file-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark" class="mb-2 md:col-span-2">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :rows="4" class="w-full"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<!-- 提交组件 -->
|
||||||
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
|
<!-- 流程选择对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Leave" lang="ts">
|
||||||
|
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||||
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
|
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||||
|
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { DrawingForm } from '@/api/design/drawing/types';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { updateDrawing, getDrawing, addDrawing } from '@/api/design/drawing';
|
||||||
|
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const { drawing_file_type } = toRefs<any>(proxy?.useDict('drawing_file_type'));
|
||||||
|
const buttonLoading = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
//路由参数
|
||||||
|
const routeParams = ref<Record<string, any>>({});
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_changedrawing',
|
||||||
|
label: '变更图纸审批'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_blueprintdrawing',
|
||||||
|
label: '蓝图审批'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: currentProject.value?.id + '_processdrawing',
|
||||||
|
label: '过程图纸审批'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const flowCode = ref<string>('');
|
||||||
|
const status = ref<string>('');
|
||||||
|
const dialogVisible = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
|
//提交组件
|
||||||
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
|
//审批记录组件
|
||||||
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
//按钮组件
|
||||||
|
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
|
||||||
|
|
||||||
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
const dialog = reactive({
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
isEdit: false
|
||||||
|
});
|
||||||
|
const submitFormData = ref<StartProcessBo>({
|
||||||
|
businessId: '',
|
||||||
|
flowCode: '',
|
||||||
|
variables: {}
|
||||||
|
});
|
||||||
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
|
||||||
|
const initFormData: DrawingForm = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
versionNumber: undefined,
|
||||||
|
fileName: undefined,
|
||||||
|
fileUrl: undefined,
|
||||||
|
fileType: undefined,
|
||||||
|
fileSuffix: undefined,
|
||||||
|
originalName: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
file: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProject.value?.id,
|
||||||
|
fileName: undefined,
|
||||||
|
fileType: undefined,
|
||||||
|
fileSuffix: undefined,
|
||||||
|
fileStatus: undefined,
|
||||||
|
originalName: undefined,
|
||||||
|
newest: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
||||||
|
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
||||||
|
fileType: [{ required: true, message: '文件类型不能为空', trigger: 'change' }],
|
||||||
|
fileUrl: [
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 新增时必须上传文件
|
||||||
|
if (!form.value.fileUrl) {
|
||||||
|
callback(new Error('请上传图纸文件'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
const reset = () => {
|
||||||
|
form.value = { ...initFormData };
|
||||||
|
leaveFormRef.value?.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取详情 */
|
||||||
|
const getInfo = () => {
|
||||||
|
loading.value = true;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
nextTick(async () => {
|
||||||
|
const res = await getDrawing(routeParams.value.id);
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
|
loading.value = false;
|
||||||
|
buttonLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = (status1: string) => {
|
||||||
|
status.value = status1;
|
||||||
|
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
buttonLoading.value = true;
|
||||||
|
var res;
|
||||||
|
if (form.value.id) {
|
||||||
|
res = await updateDrawing(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
} else {
|
||||||
|
res = await addDrawing(form.value).finally(() => (buttonLoading.value = false));
|
||||||
|
}
|
||||||
|
if (res.code == 200) {
|
||||||
|
dialog.visible = false;
|
||||||
|
submit(status.value, res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
|
//提交申请
|
||||||
|
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||||
|
try {
|
||||||
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
|
submitFormData.value.businessId = data.id;
|
||||||
|
//流程变量
|
||||||
|
taskVariables.value = {
|
||||||
|
// leave4/5 使用的流程变量
|
||||||
|
userList: ['1', '3', '4']
|
||||||
|
};
|
||||||
|
submitFormData.value.variables = taskVariables.value;
|
||||||
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
|
if (submitVerifyRef.value) {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//审批记录
|
||||||
|
const handleApprovalRecord = () => {
|
||||||
|
approvalRecordRef.value.init(form.value.id);
|
||||||
|
};
|
||||||
|
//提交回调
|
||||||
|
const submitCallback = async () => {
|
||||||
|
await proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
};
|
||||||
|
//审批
|
||||||
|
const approvalVerifyOpen = async () => {
|
||||||
|
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||||
|
};
|
||||||
|
// 图纸上传成功之后 开始提交
|
||||||
|
const submit = async (status, data) => {
|
||||||
|
form.value = data;
|
||||||
|
if (status === 'draft') {
|
||||||
|
buttonLoading.value = false;
|
||||||
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
|
proxy.$tab.closePage(proxy.$route);
|
||||||
|
proxy.$router.go(-1);
|
||||||
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
await handleStartWorkFlow(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(async () => {
|
||||||
|
routeParams.value = proxy.$route.query;
|
||||||
|
reset();
|
||||||
|
|
||||||
|
loading.value = false;
|
||||||
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
|
getInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
/* 全局样式 */
|
||||||
|
:root {
|
||||||
|
--primary: #409eff;
|
||||||
|
--primary-light: #66b1ff;
|
||||||
|
--primary-dark: #3a8ee6;
|
||||||
|
--success: #67c23a;
|
||||||
|
--warning: #e6a23c;
|
||||||
|
--danger: #f56c6c;
|
||||||
|
--info: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单样式优化 */
|
||||||
|
.el-form-item {
|
||||||
|
.el-form-item__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner,
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition:
|
||||||
|
border-color 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式优化 */
|
||||||
|
.el-button {
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
|
||||||
|
&.is-primary {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
border-color: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background-color: var(--primary-dark);
|
||||||
|
border-color: var(--primary-dark);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-text {
|
||||||
|
color: var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--primary-light);
|
||||||
|
background-color: rgba(64, 158, 255, 0.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片样式优化 */
|
||||||
|
.el-card {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
/* transform: translateY(-2px); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 对话框样式优化 */
|
||||||
|
.el-dialog {
|
||||||
|
.el-dialog__header {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog__footer {
|
||||||
|
padding: 15px 20px;
|
||||||
|
border-top: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -17,35 +17,13 @@
|
|||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
<h3 class="text-lg font-semibold text-gray-800">图纸信息</h3>
|
<h3 class="text-lg font-semibold text-gray-800">变更图纸信息</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<el-form
|
<el-form ref="leaveFormRef" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="100px" class="space-y-4">
|
||||||
ref="leaveFormRef"
|
|
||||||
v-loading="loading"
|
|
||||||
:disabled="routeParams.type === 'view'"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
label-width="100px"
|
|
||||||
class="space-y-4"
|
|
||||||
>
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<el-form-item label="图纸类型" prop="fileType" class="mb-2">
|
<el-form-item label="图纸文件" prop="fileId" class="mb-2 md:col-span-2">
|
||||||
<el-select v-model="form.fileType" placeholder="请选择图纸类型" class="w-full">
|
<file-upload :limit="10" :fileSize="100" v-model="form.fileId" class="w-full"></file-upload>
|
||||||
<el-option v-for="dict in drawing_file_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="版本号" prop="versionNumber" class="mb-2">
|
|
||||||
<el-input v-model="form.versionNumber" placeholder="请输入版本号" class="w-full"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="文件名称" prop="fileName" class="mb-2 ">
|
|
||||||
<el-input v-model="form.fileName" placeholder="请输入文件名称" class="w-full"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="图纸文件" prop="fileUrl" class="mb-2 md:col-span-2">
|
|
||||||
<file-upload :limit="1" :fileType="['pdf']" :fileSize="100" v-model="form.fileUrl" class="w-full"></file-upload>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark" class="mb-2 md:col-span-2">
|
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :rows="4" class="w-full"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -85,38 +63,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Leave" lang="ts">
|
<script setup name="Leave" lang="ts">
|
||||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
import { LeaveForm } from '@/api/workflow/leave/types';
|
||||||
import { startWorkFlow } from '@/api/workflow/task';
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import { DrawingForm } from '@/api/design/drawing/types';
|
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { updateDrawing, getDrawing, addDrawing } from '@/api/design/drawing';
|
import { getDrawing } from '@/api/design/drawing';
|
||||||
|
import { updateDesignChange, getDesignChange } from '@/api/design/designChange';
|
||||||
|
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const { drawing_file_type } = toRefs<any>(proxy?.useDict('drawing_file_type'));
|
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
//路由参数
|
//路由参数
|
||||||
const routeParams = ref<Record<string, any>>({});
|
const routeParams = ref<Record<string, any>>({});
|
||||||
const flowCodeOptions = [
|
const flowCodeOptions = [
|
||||||
{
|
{
|
||||||
value: currentProject.value?.id + '_changedrawing',
|
value: currentProject.value?.id + '_designchanged',
|
||||||
label: '变更图纸审批'
|
label: '变更图纸审批'
|
||||||
},
|
|
||||||
{
|
|
||||||
value: currentProject.value?.id + '_blueprintdrawing',
|
|
||||||
label: '蓝图审批'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: currentProject.value?.id + '_processdrawing',
|
|
||||||
label: '过程图纸审批'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -146,7 +115,7 @@ const submitFormData = ref<StartProcessBo>({
|
|||||||
});
|
});
|
||||||
const taskVariables = ref<Record<string, any>>({});
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
|
||||||
const initFormData: DrawingForm = {
|
const initFormData = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
versionNumber: undefined,
|
versionNumber: undefined,
|
||||||
@ -156,9 +125,9 @@ const initFormData: DrawingForm = {
|
|||||||
fileSuffix: undefined,
|
fileSuffix: undefined,
|
||||||
originalName: undefined,
|
originalName: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
file: undefined
|
fileId: undefined
|
||||||
};
|
};
|
||||||
const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
const data = reactive({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -173,15 +142,12 @@ const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
|||||||
params: {}
|
params: {}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
versionNumber: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
|
fileId: [
|
||||||
fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
|
|
||||||
fileType: [{ required: true, message: '文件类型不能为空', trigger: 'change' }],
|
|
||||||
fileUrl: [
|
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
// 新增时必须上传文件
|
// 新增时必须上传文件
|
||||||
if (!form.value.fileUrl) {
|
if (!form.value.fileId) {
|
||||||
callback(new Error('请上传图纸文件'));
|
callback(new Error('请上传变更图纸文件'));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@ -210,7 +176,7 @@ const getInfo = () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
const res = await getDrawing(routeParams.value.id);
|
const res = await getDesignChange(routeParams.value.id);
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
@ -224,11 +190,9 @@ const submitForm = (status1: string) => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
var res;
|
var res;
|
||||||
if (form.value.id) {
|
// if (form.value.id) {
|
||||||
res = await updateDrawing(form.value).finally(() => (buttonLoading.value = false));
|
res = await updateDesignChange({ ...form.value, id: routeParams.value.id }).finally(() => (buttonLoading.value = false));
|
||||||
} else {
|
// }
|
||||||
res = await addDrawing(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
submit(status.value, res.data);
|
submit(status.value, res.data);
|
||||||
@ -301,7 +265,6 @@ onMounted(() => {
|
|||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
routeParams.value = proxy.$route.query;
|
routeParams.value = proxy.$route.query;
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
getInfo();
|
getInfo();
|
||||||
|
@ -325,8 +325,6 @@ onMounted(() => {
|
|||||||
.upload-demo {
|
.upload-demo {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-collapse: collapse; //合并为一个单一的边框
|
border-collapse: collapse; //合并为一个单一的边框
|
||||||
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
||||||
@ -370,4 +368,5 @@ tbody {
|
|||||||
padding: 20px;
|
padding: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user