Files
td_official/src/views/design/designChange/index.vue

242 lines
9.3 KiB
Vue
Raw Normal View History

2025-07-03 20:51:47 +08:00
<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>
2025-07-14 16:10:03 +08:00
2025-07-03 20:51:47 +08:00
<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>
2025-07-14 16:10:03 +08:00
<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>
2025-07-03 20:51:47 +08:00
<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">
2025-08-13 23:42:24 +08:00
<el-button type="primary" plain icon="ChatRound" @click="handleAdd" v-hasPermi="['design:designChange:add']">下发变更通知</el-button>
2025-07-03 20:51:47 +08:00
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
2025-08-12 21:07:12 +08:00
<el-table v-loading="loading" :data="designChangeList">
2025-08-13 23:42:24 +08:00
<el-table-column label="申请单编号" align="center" prop="formNo" width="150" />
<el-table-column label="工程名称" align="center" prop="projectName" width="150" />
<el-table-column label="提出单位" align="center" prop="submitUnit" width="150" />
<el-table-column label="专业" align="center" prop="specialty" width="120" />
<el-table-column label="提出日期" align="center" prop="submitDate" width="150">
2025-07-03 20:51:47 +08:00
<template #default="scope">
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
2025-08-13 23:42:24 +08:00
<el-table-column label="卷册号" align="center" prop="volumeNo" width="150" />
<el-table-column label="流程状态" align="center">
2025-07-03 20:51:47 +08:00
<template #default="scope">
2025-08-13 23:42:24 +08:00
<dict-tag v-if="scope.row.fileId != null" :options="wf_business_status" :value="scope.row.status" />
2025-07-03 20:51:47 +08:00
</template>
</el-table-column>
2025-08-13 23:42:24 +08:00
<el-table-column label="变更文件" align="center" width="300">
2025-07-10 15:16:44 +08:00
<template #default="scope">
2025-08-13 23:42:24 +08:00
<span
2025-08-14 01:50:21 +08:00
v-if="scope.row.ossVoList && scope.row.ossVoList.length > 0"
2025-08-13 23:42:24 +08:00
style="color: rgb(41 145 255); cursor: pointer"
:key="item"
v-for="item of scope.row.ossVoList"
@click="onOpen(item.url)"
>
{{ item.originalName + ',' }}</span
2025-07-11 11:18:01 +08:00
>
2025-07-10 15:16:44 +08:00
</template>
</el-table-column>
2025-08-13 23:42:24 +08:00
<el-table-column label="变更原因" align="center" prop="changeReason" width="150">
2025-07-03 20:51:47 +08:00
<template #default="scope">
2025-08-13 23:42:24 +08:00
<dict-tag :options="design_change_reason_type" :value="scope.row.changeReason ? scope.row.changeReason.split(',') : []" />
2025-07-03 20:51:47 +08:00
</template>
</el-table-column>
2025-08-13 23:42:24 +08:00
<el-table-column label="变更内容" align="center" prop="changeContent" width="150" />
<el-table-column label="备注" align="center" prop="remark" width="150" />
2025-08-14 02:26:01 +08:00
<el-table-column label="操作" fixed="right" width="340">
2025-07-03 20:51:47 +08:00
<template #default="scope">
2025-08-14 01:50:21 +08:00
<el-button type="primary" icon="Upload" @click="handleAddChange(scope.row)" v-if="!scope.row.fileId">上传</el-button>
2025-08-12 21:07:12 +08:00
<el-button type="success" icon="View" @click="handleViewInfo(scope.row)">查看</el-button>
2025-08-14 02:26:01 +08:00
<el-button type="success" icon="View" @click="handleViewDetail(scope.row)">通知单</el-button>
2025-08-12 21:07:12 +08:00
<!-- <el-tooltip content="查看文档" placement="top">
2025-07-14 16:10:03 +08:00
<el-button link type="primary" icon="Document" @click="handleView(scope.row)"></el-button>
2025-08-12 21:07:12 +08:00
</el-tooltip> -->
2025-07-03 20:51:47 +08:00
</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">
2025-07-11 11:18:01 +08:00
import { listDesignChange, delDesignChange } from '@/api/design/designChange';
import { DesignChangeVO } from '@/api/design/designChange/types';
2025-07-03 20:51:47 +08:00
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);
2025-07-10 15:16:44 +08:00
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
2025-07-03 20:51:47 +08:00
const queryFormRef = ref<ElFormInstance>();
2025-08-13 23:42:24 +08:00
const uploadUrl = computed(() => {
return `/design/collectFile/upload`;
});
const ossid = ref(null);
2025-07-10 15:16:44 +08:00
const data = reactive({
2025-07-03 20:51:47 +08:00
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: {}
2025-07-11 11:18:01 +08:00
}
2025-07-03 20:51:47 +08:00
});
2025-07-11 11:18:01 +08:00
const { queryParams } = toRefs(data);
2025-07-03 20:51:47 +08:00
/** 查询设计变更管理列表 */
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 = () => {
2025-08-13 23:42:24 +08:00
console.log(ossid.value);
2025-07-03 20:51:47 +08:00
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 新增按钮操作 */
const handleAdd = () => {
2025-07-10 15:16:44 +08:00
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
2025-07-14 16:10:03 +08:00
path: `/design-management/designChange/indexEdit`,
2025-07-10 15:16:44 +08:00
query: {
type: 'add'
}
});
2025-07-03 20:51:47 +08:00
};
2025-08-14 02:26:01 +08:00
/** 新增按钮操作 */
const handleViewDetail = (row) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `/design-management/designChange/indexEdit`,
query: {
id: row.id,
type: 'view'
}
});
};
2025-08-13 23:42:24 +08:00
// 变更图纸
const handleAddChange = (row) => {
2025-07-10 15:16:44 +08:00
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
2025-08-13 23:42:24 +08:00
path: `/design-management/drawing/indexEdit`,
2025-07-10 15:16:44 +08:00
query: {
id: row.id,
2025-08-13 23:42:24 +08:00
type: 'add'
2025-07-10 15:16:44 +08:00
}
});
2025-07-03 20:51:47 +08:00
};
2025-07-10 15:16:44 +08:00
/** 查看按钮操作 */
const handleViewInfo = (row) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
2025-08-13 23:42:24 +08:00
path: `/design-management/drawing/indexEdit`,
2025-07-10 15:16:44 +08:00
query: {
id: row.id,
type: 'view'
2025-07-03 20:51:47 +08:00
}
});
};
/** 删除按钮操作 */
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) => {
// 查看详情
2025-07-08 16:39:42 +08:00
wordDetialRef.value?.openDialog(row, design_change_reason_type.value);
2025-07-03 20:51:47 +08:00
};
// 预览
const onOpen = (path: string) => {
2025-07-08 16:39:42 +08:00
window.open(path, '_blank');
2025-07-03 20:51:47 +08:00
};
2025-08-13 23:42:24 +08:00
2025-07-03 20:51:47 +08:00
onMounted(() => {
getList();
});
2025-07-08 16:39:42 +08:00
//监听项目id刷新数据
const listeningProject = watch(
2025-08-14 01:58:00 +08:00
() => currentProject.value?.id,
2025-07-08 16:39:42 +08:00
(nid, oid) => {
queryParams.value.projectId = nid;
getList();
}
);
onUnmounted(() => {
listeningProject();
});
2025-07-03 20:51:47 +08:00
</script>