设计完成
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.180:8898'
|
||||
|
||||
# 无人机接口地址
|
||||
|
||||
|
@ -24,3 +24,10 @@ export const extractDetail = (id) => {
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
// 获取提取资料
|
||||
export const getFileList = (id) => {
|
||||
return request({
|
||||
url: '/design/extract/fileList/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
@ -39,15 +39,16 @@
|
||||
<template #default="scope">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||
<el-button size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)">审核</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">审核</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="scope.row.status === 'finish'">
|
||||
<el-button size="small" type="primary" icon="Download" @click="handleDownload(scope.row)">导出</el-button>
|
||||
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" size="small" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button link type="warning" icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看流程</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button link type="warning" icon="View" v-if="scope.row.status != 'draft'" @click="handleFile(scope.row)">查看文件</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -55,6 +56,43 @@
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<el-dialog title="提取文件列表" v-model="viewVisible" width="500px">
|
||||
<el-table :loading="loadingFlie" :data="fileList" style="width: 100%" border>
|
||||
<el-table-column prop="fileName" label="文件名称" align="center">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
:key="scope.row.fileId"
|
||||
:href="scope.row.fileUrl"
|
||||
target="_blank"
|
||||
:type="scope.row.status == '1' ? 'primary' : 'info'"
|
||||
:underline="false"
|
||||
>
|
||||
{{ scope.row.fileName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否变更" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.type == 1 ? 'success' : 'info'">{{ scope.row.type == 1 ? '否' : '是' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="170" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="success" link icon="View" @click="handleViewFile(scope.row)"> 查看 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button type="primary" @click="viewVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -63,7 +101,7 @@ import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
import { extractList } from '@/api/design/Professional';
|
||||
import { extractList, getFileList } from '@/api/design/Professional';
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -73,6 +111,9 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
const professionalList = ref([]);
|
||||
const showSearch = ref(true);
|
||||
const loading = ref(false);
|
||||
const loadingFlie = ref(false);
|
||||
const viewVisible = ref(false); //文件列表展示
|
||||
const fileList = ref([]);
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -145,7 +186,19 @@ const handleDownload = (row) => {
|
||||
`互提资料.zip`
|
||||
);
|
||||
};
|
||||
|
||||
const handleViewFile = (row) => {
|
||||
window.open(row.docUrl, '_blank');
|
||||
};
|
||||
const handleFile = async (row) => {
|
||||
// 查看文件
|
||||
viewVisible.value = true;
|
||||
loadingFlie.value = true;
|
||||
let res = await getFileList(row.id);
|
||||
if (res.code == 200) {
|
||||
fileList.value = res.data;
|
||||
}
|
||||
loadingFlie.value = false;
|
||||
};
|
||||
// 页面挂载时初始化数据
|
||||
onMounted(() => {
|
||||
getList();
|
||||
|
@ -67,6 +67,7 @@
|
||||
>
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<span class="text-sm font-medium text-gray-600">资料 {{ index + 1 }}</span>
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@ -85,7 +86,22 @@
|
||||
:rules="[{ required: true, message: '请输入文件资料名称', trigger: 'blur' }]"
|
||||
class="mb-4"
|
||||
>
|
||||
<el-input placeholder="请输入文件资料名称" v-model="item.catalogueName" autocomplete="off" />
|
||||
<el-select
|
||||
id="projectSelect"
|
||||
v-model="item.volumeCatalogId"
|
||||
placeholder="请选择资料"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleSelect($event, item)"
|
||||
style="width: 150px; margin-right: 20px"
|
||||
>
|
||||
<el-option
|
||||
v-for="project in volumeCatalogList"
|
||||
:key="project.design"
|
||||
:label="project.documentName"
|
||||
:value="project.design"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" :prop="`documents.${index}.remark`" class="mb-4">
|
||||
<el-input placeholder="请输入备注" v-model="item.remark" autocomplete="off" />
|
||||
@ -142,6 +158,7 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { systemUserList } from '@/api/design/appointment';
|
||||
import { extractBatch, extractDetail } from '@/api/design/Professional';
|
||||
import { listVolumeCatalog } from '@/api/design/volumeCatalog';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -150,6 +167,8 @@ const { des_user_major } = toRefs<any>(proxy?.useDict('des_user_major'));
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const disableAll = ref(false);
|
||||
const volumeCatalogList = ref([]);
|
||||
let volumeMap = new Map();
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCodeOptions = [
|
||||
@ -206,13 +225,15 @@ const form = reactive({
|
||||
documents: [
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '', // 文件目录名称
|
||||
remark: '' // 备注
|
||||
catalogueName: '', // 卷册目录名称
|
||||
remark: '', // 备注
|
||||
volumeCatalogId: '' //卷册目录ID
|
||||
}
|
||||
] as Array<{
|
||||
id: number;
|
||||
catalogueName: string;
|
||||
remark: string;
|
||||
volumeCatalogId: string;
|
||||
}>
|
||||
});
|
||||
// 主表单验证规则
|
||||
@ -238,7 +259,8 @@ const reset = () => {
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
];
|
||||
leaveFormRef.value?.resetFields();
|
||||
@ -248,7 +270,8 @@ const addDocumentItem = () => {
|
||||
form.documents.push({
|
||||
id: Date.now(),
|
||||
catalogueName: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
});
|
||||
};
|
||||
|
||||
@ -262,7 +285,6 @@ const submitForm = (status1: string) => {
|
||||
buttonLoading.value = true;
|
||||
dialog.visible = false;
|
||||
// 验证表单数据
|
||||
// 验证表单数据(主要验证基本信息中的必填项)
|
||||
mainFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
console.log('验证成功');
|
||||
@ -397,7 +419,8 @@ const byProjectIdAll = async () => {
|
||||
form.documents.push({
|
||||
id: item.id || Date.now() + index, // 确保id唯一
|
||||
catalogueName: item.catalogueName || '',
|
||||
remark: item.remark || ''
|
||||
remark: item.remark || '',
|
||||
volumeCatalogId: item.volumeCatalogId
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@ -406,7 +429,8 @@ const byProjectIdAll = async () => {
|
||||
{
|
||||
id: Date.now(),
|
||||
catalogueName: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
volumeCatalogId: ''
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -414,11 +438,23 @@ const byProjectIdAll = async () => {
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
/** 查询卷册目录列表 */
|
||||
const getList = async () => {
|
||||
const res = await listVolumeCatalog({ projectId: currentProject.value?.id, auditStatus: 'finish' });
|
||||
volumeCatalogList.value = res.rows;
|
||||
volumeCatalogList.value.forEach((e) => {
|
||||
volumeMap.set(e.design, e);
|
||||
});
|
||||
};
|
||||
const handleSelect = (val, item) => {
|
||||
item.catalogueName = volumeMap.get(val).documentName;
|
||||
};
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
reset();
|
||||
loading.value = false;
|
||||
getList(); // 获取卷册目录
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
byProjectIdAll();
|
||||
|
@ -150,11 +150,9 @@ import { ref, reactive, computed, onMounted, toRefs } from 'vue';
|
||||
import { getCurrentInstance } from 'vue';
|
||||
import type { ComponentInternalInstance } from 'vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { listUserByDeptId } from '@/api/system/user';
|
||||
import { ElMessage, ElLoading } from 'element-plus';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { designUserAdd, designUserList, systemUserList } from '@/api/design/appointment';
|
||||
import { disable } from 'ol/rotationconstraint';
|
||||
|
||||
// 获取当前实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -194,7 +192,6 @@ const getDeptAllUser = async (deptId: any) => {
|
||||
userList.value = res.rows;
|
||||
} catch (error) {
|
||||
ElMessage.error('获取用户列表失败');
|
||||
} finally {
|
||||
}
|
||||
};
|
||||
|
||||
@ -374,10 +371,21 @@ const resetForm = () => {
|
||||
ElMessage.info('表单已重置');
|
||||
}
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
designUser();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
// 页面挂载时初始化数据
|
||||
onMounted(() => {
|
||||
console.log(userStore.deptId);
|
||||
// 先获取用户列表,再加载表单数据
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
designUser();
|
||||
|
@ -25,11 +25,16 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" icon="Download" @click="onExport(scope.row.fileUrl)">下载</el-button>
|
||||
<el-button type="success" icon="edit" v-show="scope.row.status == 'draft' || scope.row.status == 'waiting'" @click="onUpdate(scope.row)"
|
||||
<el-button link type="primary" icon="Download" @click="onExport(scope.row.fileUrl)">下载</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
link
|
||||
icon="edit"
|
||||
v-show="scope.row.status == 'draft' || scope.row.status == 'waiting'"
|
||||
@click="onUpdate(scope.row)"
|
||||
>审核</el-button
|
||||
>
|
||||
<el-button type="warning" v-show="scope.row.status != 'draft'" icon="View" @click="onView(scope.row)">查看流程</el-button>
|
||||
<el-button link type="warning" v-show="scope.row.status != 'draft'" icon="View" @click="onView(scope.row)">查看流程</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -44,10 +44,11 @@
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="designChangeList">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<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="specialtyName" width="120" />
|
||||
<el-table-column label="提出日期" align="center" prop="submitDate" width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.submitDate, '{y}-{m}-{d}') }}</span>
|
||||
@ -81,11 +82,12 @@
|
||||
<el-table-column label="操作" fixed="right" width="340">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link icon="Upload" @click="handleAddChange(scope.row)" v-if="!scope.row.fileId">上传</el-button>
|
||||
<el-button type="success" link icon="View" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||
<el-button type="success" link icon="View" v-if="scope.row.status != 'draft'" @click="handleViewInfo(scope.row)">查看</el-button>
|
||||
<el-button type="success" link icon="View" @click="handleViewDetail(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="warning" link icon="View" v-if="scope.row.status != 'draft'" @click="handleViewHistory(scope.row)">查看单据</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -120,6 +122,9 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="单据" v-model="viewDetailVisible" width="800px">
|
||||
<histroy ref="histroyRef"></histroy>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -128,7 +133,7 @@ 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';
|
||||
|
||||
import histroy from '../volumeCatalog/comm/histroy.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
// 获取用户 store
|
||||
@ -137,11 +142,9 @@ const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const designChangeList = ref<DesignChangeVO[]>([]);
|
||||
const wordDetialRef = ref<InstanceType<typeof wordDetial>>();
|
||||
const histroyRef = ref<InstanceType<typeof histroy>>();
|
||||
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>();
|
||||
@ -151,6 +154,7 @@ const uploadUrl = computed(() => {
|
||||
const viewVisible = ref(false);
|
||||
const fileList = ref([]);
|
||||
const ossid = ref(null);
|
||||
const viewDetailVisible = ref(false);
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -182,7 +186,6 @@ const getList = async () => {
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
console.log(ossid.value);
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
@ -192,7 +195,7 @@ const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
/** 新增按钮操作 */
|
||||
/** 下发通知 */
|
||||
const handleAdd = () => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
@ -202,7 +205,7 @@ const handleAdd = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 新增按钮操作 */
|
||||
/** 查看详情 */
|
||||
const handleViewDetail = (row) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
@ -213,7 +216,7 @@ const handleViewDetail = (row) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
// 变更图纸
|
||||
// 上传变更图纸
|
||||
const handleAddChange = (row) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
@ -224,7 +227,7 @@ const handleAddChange = (row) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 查看按钮操作 */
|
||||
/** 查看流程操作 */
|
||||
const handleViewInfo = (row) => {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.push({
|
||||
@ -240,9 +243,12 @@ const handleDesignView = async (row?: DesignChangeVO) => {
|
||||
fileList.value = row.ossVoList;
|
||||
viewVisible.value = true;
|
||||
};
|
||||
const handleView = (row) => {
|
||||
// 查看详情
|
||||
wordDetialRef.value?.openDialog(row, design_change_reason_type.value);
|
||||
const handleViewHistory = async (row) => {
|
||||
// 查看历史流程记录
|
||||
viewDetailVisible.value = true;
|
||||
nextTick(() => {
|
||||
histroyRef.value?.getList(row.id);
|
||||
});
|
||||
};
|
||||
// 预览
|
||||
const onOpen = (path: string) => {
|
||||
|
@ -2,9 +2,14 @@
|
||||
<div class="p-4 bg-gray-50 designChangeForm">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 表单区域 -->
|
||||
<div v-if="routeParams.type == 'view'" style="width: 100%; text-align: right; margin-bottom: 10px">
|
||||
<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"
|
||||
>返回</el-button
|
||||
>
|
||||
</div>
|
||||
<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>
|
||||
<h3 class="text-lg font-semibold text-gray-800">下发变更通知信息</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form ref="leaveFormRef" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="100px" class="space-y-4">
|
||||
@ -44,8 +49,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="specialty">
|
||||
<el-input disabled v-model="form.specialty" placeholder="请输入专业" />
|
||||
<el-form-item label="专业" prop="specialtyName">
|
||||
<el-input disabled v-model="form.specialtyName" placeholder="请输入专业" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -143,7 +148,11 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<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"
|
||||
<el-button
|
||||
v-if="routeParams.type != 'view'"
|
||||
@click="goBack"
|
||||
size="large"
|
||||
class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>返回</el-button
|
||||
>
|
||||
<el-button
|
||||
@ -191,6 +200,7 @@ const initFormData = {
|
||||
projectName: undefined,
|
||||
submitUnit: undefined,
|
||||
specialty: undefined,
|
||||
specialtyName: undefined,
|
||||
submitDate: undefined,
|
||||
volumeName: undefined,
|
||||
volumeNo: undefined,
|
||||
@ -279,6 +289,7 @@ const handleSelect = (val) => {
|
||||
fileVoList.value = obj.fileVoList;
|
||||
form.value.volumeName = obj.volumeName;
|
||||
form.value.specialty = obj.specialty;
|
||||
form.value.specialtyName = obj.specialtyName;
|
||||
form.value.extendDetail.subName = obj.designSubitem;
|
||||
};
|
||||
/** 获取详情 */
|
||||
|
@ -23,7 +23,7 @@
|
||||
<el-form ref="leaveFormRef" :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="fileId" class="mb-2 md:col-span-2">
|
||||
<file-upload :limit="10" :fileSize="100" v-model="form.fileId" class="w-full"></file-upload>
|
||||
<file-upload :fileType="['pdf']" :fileSize="''" v-model="form.fileId" class="w-full"></file-upload>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
|
@ -81,7 +81,7 @@
|
||||
<el-form-item label="校审时间" prop="proofreadingDate">
|
||||
<el-date-picker
|
||||
v-model="formData.proofreadingDate"
|
||||
type="datetime"
|
||||
type="date"
|
||||
placeholder="选择校审时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
@ -100,7 +100,7 @@
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="auditDate">
|
||||
<el-date-picker v-model="formData.auditDate" type="datetime" placeholder="选择审核时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
<el-date-picker v-model="formData.auditDate" type="date" placeholder="选择审核时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -115,13 +115,7 @@
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="执行时间" prop="executorDate">
|
||||
<el-date-picker
|
||||
v-model="formData.executorDate"
|
||||
type="datetime"
|
||||
placeholder="选择执行时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
/>
|
||||
<el-date-picker v-model="formData.executorDate" type="date" placeholder="选择执行时间" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
253
src/views/design/volumeCatalog/comm/histroy.vue
Normal file
253
src/views/design/volumeCatalog/comm/histroy.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="volume-catalog-container">
|
||||
<div class="history-selector">
|
||||
<span>选择历史退回记录:</span>
|
||||
<el-select v-model="hisId" placeholder="请选择" style="width: 240px" @change="handleShowInfo">
|
||||
<el-option v-for="item in hisList" :key="item.id" :label="item.createTime" :value="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div class="volumeCatalog_box" style="margin-top: 20px">
|
||||
<!-- <span style="color: #0d9df5">查看excel文件</span> -->
|
||||
<div class="table-content" id="table-content" style="margin-top: 20px">
|
||||
<el-row class="mb20" style="display: flex; justify-content: center">
|
||||
<h2>设计验证表</h2>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mb10" style="display: flex; justify-content: space-between">
|
||||
<div class="head-text">
|
||||
<span>编号:</span>
|
||||
<span>{{ examineForm.num }}</span>
|
||||
</div>
|
||||
<div class="head-text"></div>
|
||||
</el-row>
|
||||
|
||||
<table style="width: 100%" border="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">工程名称</th>
|
||||
<td class="th-bg" colspan="10">{{ examineForm.projectName }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">子项名称</th>
|
||||
<td class="th-bg" colspan="6">{{ examineForm.subprojectName }}</td>
|
||||
<th colspan="2">设计阶段</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.stage }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">专业</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.professional }}</td>
|
||||
<th colspan="2">卷册</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.volume }}</td>
|
||||
<th colspan="2">设计人</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.designer }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">验证内容</th>
|
||||
<td class="th-bg" colspan="10">{{ examineForm.verificationContent }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="6">验证意见</th>
|
||||
<th class="th-bg" colspan="6">执行意见</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<div style="height: 400px; padding: 8px; box-sizing: border-box">
|
||||
{{ examineForm.verificationOpinion }}
|
||||
</div>
|
||||
</td>
|
||||
<td class="th-bg" colspan="6">
|
||||
<div style="height: 400px; padding: 8px; box-sizing: border-box">
|
||||
{{ examineForm.executionOpinion }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; padding: 8px">
|
||||
<span>校审: {{ examineForm.proofreading }}</span>
|
||||
<span>{{ dateFormat(examineForm.proofreadingDate) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td rowspan="2" colspan="6" class="th-bg">
|
||||
<div style="padding: 8px">执行人: {{ examineForm.executor }}</div>
|
||||
<div style="display: flex; align-items: center; justify-content: flex-end; padding: 8px">
|
||||
{{ dateFormat(examineForm.executorDate) }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="th-bg" colspan="6">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; padding: 8px">
|
||||
<span>审核: {{ examineForm.audit }}</span>
|
||||
<span>{{ dateFormat(examineForm.auditDate) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="VolumeCatalog" lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElSelect, ElOption, ElRow } from 'element-plus';
|
||||
import { drawingreviewReceiptsDetail, drawingreviewReceiptsList } from '@/api/design/drawingreview';
|
||||
|
||||
// 定义历史记录项类型
|
||||
interface HistoryItem {
|
||||
id: string | number;
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
// 定义表单数据类型
|
||||
interface ExamineForm {
|
||||
num: string;
|
||||
projectName: string;
|
||||
subprojectName: string;
|
||||
stage: string;
|
||||
professional: string;
|
||||
volume: string;
|
||||
designer: string;
|
||||
verificationContent: string;
|
||||
verificationOpinion: string;
|
||||
executionOpinion: string;
|
||||
proofreading: string;
|
||||
proofreadingDate: string | Date | null;
|
||||
executor: string;
|
||||
executorDate: string | Date | null;
|
||||
audit: string;
|
||||
auditDate: string | Date | null;
|
||||
}
|
||||
|
||||
// 响应式变量
|
||||
const hisId = ref<string | number>('');
|
||||
const hisList = ref<HistoryItem[]>([]);
|
||||
|
||||
const examineForm = reactive<ExamineForm>({
|
||||
num: '',
|
||||
projectName: '',
|
||||
subprojectName: '',
|
||||
stage: '',
|
||||
professional: '',
|
||||
volume: '',
|
||||
designer: '',
|
||||
verificationContent: '',
|
||||
verificationOpinion: '',
|
||||
executionOpinion: '',
|
||||
proofreading: '',
|
||||
proofreadingDate: null,
|
||||
executor: '',
|
||||
executorDate: null,
|
||||
audit: '',
|
||||
auditDate: null
|
||||
});
|
||||
|
||||
// 处理历史记录选择变化
|
||||
const handleShowInfo = async (value: string | number) => {
|
||||
getDetails(value);
|
||||
};
|
||||
|
||||
// 日期格式化方法
|
||||
const dateFormat = (date: string | Date | null): string => {
|
||||
if (!date) return '';
|
||||
|
||||
// 处理字符串类型的日期
|
||||
if (typeof date === 'string') {
|
||||
date = new Date(date);
|
||||
}
|
||||
|
||||
// 检查日期是否有效
|
||||
if (isNaN(date.getTime())) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
};
|
||||
|
||||
// 获取详情
|
||||
const getList = async (drawingreviewId) => {
|
||||
let res = await drawingreviewReceiptsList({ drawingreviewId });
|
||||
hisList.value = res.rows;
|
||||
if (hisList.value.length > 0) {
|
||||
hisId.value = hisList.value[0].id;
|
||||
getDetails(hisId.value);
|
||||
}
|
||||
};
|
||||
const getDetails = async (id) => {
|
||||
let res = await drawingreviewReceiptsDetail(id);
|
||||
Object.assign(examineForm, res.data);
|
||||
};
|
||||
// 抛出
|
||||
defineExpose({ getList });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.volume-catalog-container {
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
table {
|
||||
border-collapse: collapse; //合并为一个单一的边框
|
||||
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
||||
}
|
||||
thead {
|
||||
tr {
|
||||
th {
|
||||
background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
td {
|
||||
text-align: left;
|
||||
height: 35px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
.th-bg {
|
||||
background-color: rgba(247, 247, 247, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
tr {
|
||||
td {
|
||||
text-align: left;
|
||||
height: 40px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
th {
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-content {
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -46,18 +46,15 @@
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="volumeCatalogList">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="子项名称" align="center" prop="designSubitem" />
|
||||
<el-table-column label="设计状态" align="center" prop="designState">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="design_state" :value="scope.row.designState" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业" align="center" prop="specialty">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="des_user_major" :value="scope.row.specialty" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设计人员" align="center" prop="principal" />
|
||||
<el-table-column label="专业" align="center" prop="specialtyName"> </el-table-column>
|
||||
<el-table-column label="设计人员" align="center" prop="principalName" />
|
||||
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
|
||||
<el-table-column label="资料名称" align="center" prop="documentName" />
|
||||
<el-table-column label="计划出图时间" align="center" prop="plannedCompletion" width="200" />
|
||||
@ -114,7 +111,7 @@
|
||||
v-hasPermi="['out:monthPlan:remove']"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button type="warning" link size="small" icon="View" v-if="scope.row.auditType != 'draft'" @click="handleViewHistory(scope.row)"
|
||||
<el-button type="warning" link icon="View" v-if="scope.row.auditType != 'draft'" @click="handleViewHistory(scope.row)"
|
||||
>查看单据</el-button
|
||||
>
|
||||
</template>
|
||||
@ -134,7 +131,9 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设计人员" prop="principal">
|
||||
<el-input v-model="form.principal" placeholder="请输入设计人员" />
|
||||
<el-select v-model="form.principal" placeholder="请选择设计人员" class="transition-all duration-300 border-gray-300">
|
||||
<el-option v-for="item in userAppList" :key="item.userId" :label="item.userName" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设计状态" prop="designState">
|
||||
<el-select v-model="form.designState" placeholder="请选择设计状态">
|
||||
@ -164,7 +163,7 @@
|
||||
<el-dialog draggable title="上传图纸卷册文件" v-model="uploadVisible" width="500px" append-to-body>
|
||||
<el-form :model="uploadForm" label-width="80px" :inline="false">
|
||||
<el-form-item label="上传文件" prop="fileId">
|
||||
<file-upload v-model="uploadForm.fileId"></file-upload>
|
||||
<file-upload :fileType="['pdf']" :fileSize="''" v-model="uploadForm.fileId"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit" :loading="buttonLoading">确定</el-button>
|
||||
@ -188,12 +187,12 @@
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="size" label="是否变更" align="center">
|
||||
<el-table-column prop="size" label="是否变更" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.type == 1 ? 'success' : 'info'">{{ scope.row.type == 1 ? '否' : '是' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="size" label="状态" width="170" align="center">
|
||||
<el-table-column prop="size" label="状态" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag>
|
||||
</template>
|
||||
@ -211,100 +210,8 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog draggable title="查看历史" v-model="dialogHistory" width="800px" append-to-body>
|
||||
<div>
|
||||
<span>选择历史退回记录:</span>
|
||||
<el-select v-model="hisId" placeholder="请选择" style="width: 240px" @change="handleShowInfo">
|
||||
<el-option v-for="item in hisList" :key="item.id" :label="item.createTime" :value="item.id" />
|
||||
</el-select>
|
||||
<div style="margin-top: 20px" class="volumeCatalog_box">
|
||||
<span style="color: #0d9df5">查看excel文件</span>
|
||||
<div style="margin-top: 20px" class="table-content" id="table-content">
|
||||
<el-row class="mb20" style="display: flex; justify-content: center">
|
||||
<h2>设计验证表</h2>
|
||||
</el-row>
|
||||
<el-row class="mb10" style="display: flex; justify-content: space-between">
|
||||
<div class="head-text">
|
||||
<span>编号:</span>
|
||||
<span>{{ examineForm.num }}</span>
|
||||
</div>
|
||||
<div class="head-text"></div>
|
||||
</el-row>
|
||||
<table style="width: 100%" border="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">工程名称</th>
|
||||
<td class="th-bg" colspan="10">{{ examineForm.projectName }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">子项名称</th>
|
||||
<td class="th-bg" colspan="6">{{ examineForm.subprojectName }}</td>
|
||||
<th colspan="2">设计阶段</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.stage }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">专业</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.professional }}</td>
|
||||
<th colspan="2">卷册</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.volume }}</td>
|
||||
<th colspan="2">设计人</th>
|
||||
<td class="th-bg" colspan="2">{{ examineForm.designer }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">验证内容</th>
|
||||
<td class="th-bg" colspan="10">{{ examineForm.verificationContent }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="6">验证意见</th>
|
||||
<th class="th-bg" colspan="6">执行意见</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<div style="height: 400px">{{ examineForm.verificationOpinion }}</div>
|
||||
</td>
|
||||
<td class="th-bg" colspan="6">
|
||||
<div style="height: 400px">{{ examineForm.executionOpinion }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||
<span> 校审: {{ examineForm.proofreading }} </span>
|
||||
<span> {{ dateFormat(examineForm.proofreadingDate) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td rowspan="2" colspan="6">
|
||||
<div>执行人: {{ examineForm.executor }}</div>
|
||||
<div style="display: flex; align-items: center; justify-content: flex-end">
|
||||
{{ dateFormat(examineForm.executorDate) }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="th-bg" colspan="6">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||
<span>审核 : {{ examineForm.audit }}</span>
|
||||
<span> {{ dateFormat(examineForm.auditDate) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="单据" v-model="dialogHistory" width="800px">
|
||||
<histroy ref="histroyRef"></histroy>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -322,7 +229,9 @@ import {
|
||||
} from '@/api/design/volumeCatalog';
|
||||
import { VolumeCatalogVO } from '@/api/design/volumeCatalog/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import histroy from './comm/histroy.vue';
|
||||
const fileList = ref([]);
|
||||
import { designUserList } from '@/api/design/appointment';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { design_state, wf_business_status, des_user_major } = toRefs(proxy?.useDict('design_state', 'wf_business_status', 'des_user_major'));
|
||||
import { drawingreviewReceiptsDetail, drawingreviewReceiptsList } from '@/api/design/drawingreview';
|
||||
@ -331,12 +240,11 @@ const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const histroyRef = ref<InstanceType<typeof histroy>>();
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const hisId = ref('');
|
||||
const dialogHistory = ref(false);
|
||||
const hisList = ref([]);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -382,7 +290,7 @@ const examineForm = ref({
|
||||
volume: ''
|
||||
});
|
||||
const userList = ref([]);
|
||||
|
||||
const userAppList = ref([]); //人事任命的用户
|
||||
const initFormData: any = {
|
||||
design: undefined,
|
||||
projectId: currentProject.value?.id || '',
|
||||
@ -425,26 +333,26 @@ const getList = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const dateFormat = (v) => {
|
||||
if (!v) return '-';
|
||||
let time = new Date(v);
|
||||
let y = time.getFullYear();
|
||||
let MM = time.getMonth() + 1;
|
||||
MM = MM < 10 ? '0' + MM : MM;
|
||||
let d = time.getDate();
|
||||
d = d < 10 ? '0' + d : d;
|
||||
return y + '年' + MM + '月' + d + '日';
|
||||
const getUserAppList = async () => {
|
||||
const res = await designUserList({ projectId: currentProject.value?.id });
|
||||
if (res.code === 200) {
|
||||
console.log(res.rows);
|
||||
|
||||
res.rows.forEach((item: any) => {
|
||||
if (item.userType == 2) {
|
||||
//设计人员
|
||||
userAppList.value.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleViewHistory = async (row) => {
|
||||
// 查看历史流程记录
|
||||
dialogHistory.value = true;
|
||||
hisId.value = '';
|
||||
let res = await drawingreviewReceiptsList({ drawingreviewId: row.design });
|
||||
hisList.value = res.rows;
|
||||
if (hisList.value.length > 0) {
|
||||
hisId.value = hisList.value[0].id;
|
||||
getDetails(hisId.value);
|
||||
}
|
||||
// 查看历史流程记录
|
||||
nextTick(() => {
|
||||
histroyRef.value?.getList(row.design);
|
||||
});
|
||||
};
|
||||
const handleShowInfo = (val) => {
|
||||
getDetails(val);
|
||||
@ -508,12 +416,6 @@ const handleUpload = async (row?: any) => {
|
||||
uploadForm.fileList = res.data.filter((item) => item.status == '1') || [];
|
||||
uploadVisible.value = true;
|
||||
};
|
||||
|
||||
/** 查看文件 */
|
||||
const lookFile = (fileId: string) => {
|
||||
// lookViewerFile(fileId);
|
||||
};
|
||||
|
||||
/** 重置上传表单 */
|
||||
const resetUploadForm = () => {
|
||||
uploadForm.userIds = [];
|
||||
@ -612,6 +514,7 @@ const handleUpdate = async (row?: VolumeCatalogVO) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getUserAppList();
|
||||
getList();
|
||||
});
|
||||
|
||||
@ -621,6 +524,7 @@ const listeningProject = watch(
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getUserAppList();
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
Before Width: | Height: | Size: 922 B After Width: | Height: | Size: 922 B |
Before Width: | Height: | Size: 922 B After Width: | Height: | Size: 922 B |
@ -1,498 +0,0 @@
|
||||
<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">
|
||||
<el-form-item label="表单编号" prop="formCode">
|
||||
<el-input v-model="queryParams.formCode" 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="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订货单位" prop="orderingUnit">
|
||||
<el-input v-model="queryParams.orderingUnit" placeholder="请输入订货单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货单位" prop="supplierUnit">
|
||||
<el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领料单位" prop="issueUnit">
|
||||
<el-input v-model="queryParams.issueUnit" placeholder="请输入领料单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="保管单位" prop="storageUnit">
|
||||
<el-input v-model="queryParams.storageUnit" placeholder="请输入保管单位" clearable @keyup.enter="handleQuery" />
|
||||
</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="Plus" @click="handleAdd" v-hasPermi="['materials:materialIssue:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['materials:materialIssue:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="materialIssueList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="表单编号" align="center" prop="formCode" />
|
||||
<el-table-column label="工程名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备材料名称" align="center" prop="materialName" />
|
||||
<el-table-column label="订货单位" align="center" prop="orderingUnit" />
|
||||
<el-table-column label="供货单位" align="center" prop="supplierUnit" />
|
||||
<el-table-column label="领料单位" align="center" prop="issueUnit" />
|
||||
<el-table-column label="保管单位" align="center" prop="storageUnit" />
|
||||
<el-table-column label="缺陷情况" align="center" prop="defectDescription" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialIssue:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['materials:materialIssue:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</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>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:title="dialog.title"
|
||||
v-model="dialog.visible"
|
||||
width="800px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="materialIssueFormRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="表单编号" prop="formCode">
|
||||
<el-input v-model="form.formCode" 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="materialName">
|
||||
<el-input v-model="form.materialName" placeholder="请输入设备材料名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订货单位" prop="orderingUnit">
|
||||
<el-input v-model="form.orderingUnit" placeholder="请输入订货单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供货单位" prop="supplierUnit">
|
||||
<el-input v-model="form.supplierUnit" placeholder="请输入供货单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="领料单位" prop="issueUnit">
|
||||
<el-input v-model="form.issueUnit" placeholder="请输入领料单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保管单位" prop="storageUnit">
|
||||
<el-input v-model="form.storageUnit" placeholder="请输入保管单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="缺陷情况" prop="defectDescription">
|
||||
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="detail">
|
||||
<div class="detail-header">
|
||||
<span>数量验收</span>
|
||||
<el-button type="primary" link @click="addItem" icon="Plus">添加一行</el-button>
|
||||
</div>
|
||||
<div v-for="(item, index) in form.itemList" :key="index" class="detail-item">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '名称' : ''"
|
||||
:prop="`itemList.${index}.name`"
|
||||
:rules="[{ required: true, message: '名称不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '规格' : ''"
|
||||
:prop="`itemList.${index}.specification`"
|
||||
:rules="[{ required: true, message: '规格不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '单位' : ''"
|
||||
:prop="`itemList.${index}.unit`"
|
||||
:rules="[{ required: true, message: '单位不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '库存' : ''"
|
||||
:prop="`itemList.${index}.stockQuantity`"
|
||||
:rules="[{ required: true, message: '库存不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.stockQuantity" placeholder="请输入库存" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '领取' : ''"
|
||||
:prop="`itemList.${index}.issuedQuantity`"
|
||||
:rules="[{ required: true, message: '领取数量不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.issuedQuantity" placeholder="请输入领取数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '剩余' : ''"
|
||||
:prop="`itemList.${index}.remainingQuantity`"
|
||||
:rules="[{ required: true, message: '剩余数量不能为空', trigger: 'blur' }]"
|
||||
>
|
||||
<el-input v-model="item.remainingQuantity" placeholder="请输入剩余数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="index === 0 ? '备注' : ''" prop="remark">
|
||||
<el-input v-model="item.remark" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.itemList.length > 1">
|
||||
<div class="item-actions">
|
||||
<el-button type="danger" link @click="removeItem(index)" icon="Delete">删除</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合格证文件" prop="certCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.certCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出厂报告文件" prop="reportCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.reportCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="技术资料文件" prop="techDocCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.techDocCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家资质文件" prop="licenseCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.licenseCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<span style="color: #ff0000ab; margin-bottom: 10px; display: block"
|
||||
>注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span
|
||||
> </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>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<wordllssue ref="wordllssueRef"></wordllssue>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MaterialIssue" lang="ts">
|
||||
import { listMaterialIssue, getMaterialIssue, delMaterialIssue, addMaterialIssue, updateMaterialIssue } from '@/api/materials/materialIssue';
|
||||
import { MaterialIssueVO, MaterialIssueQuery, MaterialIssueForm } from '@/api/materials/materialIssue/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import wordllssue from './word/index.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
const materialIssueList = ref<MaterialIssueVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
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 wordllssueRef = ref<InstanceType<typeof wordllssue>>();
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const materialIssueFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const getInitFormData = () => {
|
||||
return {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '2',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
issueUnit: undefined,
|
||||
storageUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
id: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
stockQuantity: undefined,
|
||||
issuedQuantity: undefined,
|
||||
remainingQuantity: undefined,
|
||||
name: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
const initFormData: MaterialIssueForm = {};
|
||||
const data = reactive<PageData<MaterialIssueForm, MaterialIssueQuery>>({
|
||||
form: getInitFormData(),
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '2',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
issueUnit: undefined,
|
||||
storageUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询物料领料单列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMaterialIssue(queryParams.value);
|
||||
materialIssueList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = getInitFormData();
|
||||
materialIssueFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MaterialIssueVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加物料领料单';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MaterialIssueVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMaterialIssue(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改物料领料单';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
materialIssueFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateMaterialIssue(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMaterialIssue(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 添加数量验收条目
|
||||
const addItem = () => {
|
||||
form.value.itemList.push({
|
||||
id: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
stockQuantity: undefined,
|
||||
issuedQuantity: undefined,
|
||||
remainingQuantity: undefined,
|
||||
name: undefined,
|
||||
remark: undefined
|
||||
});
|
||||
};
|
||||
|
||||
// 删除数量验收条目
|
||||
const removeItem = (index: number) => {
|
||||
if (form.value.itemList.length > 1) {
|
||||
form.value.itemList.splice(index, 1);
|
||||
} else {
|
||||
proxy?.$modal.msgWarning('至少需要保留一条数量验收记录');
|
||||
}
|
||||
};
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MaterialIssueVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除物料领料单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMaterialIssue(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
const handleView = (row) => {
|
||||
// 查看详情
|
||||
wordllssueRef.value?.openDialog(row);
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
border-bottom: 1px solid #ececec;
|
||||
border-top: 1px solid #ececec;
|
||||
margin: 10px 0;
|
||||
padding: 10px 0;
|
||||
|
||||
&-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
font-weight: bold;
|
||||
color: #1eaaff;
|
||||
}
|
||||
|
||||
&-item {
|
||||
padding: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
background-color: #f8f9fa;
|
||||
position: relative;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 6px;
|
||||
}
|
||||
</style>
|
Binary file not shown.
Before Width: | Height: | Size: 922 B |
@ -1,301 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-model="isShowDialog" title="变更单详情" draggable width="60vw" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<el-card :body-style="{ padding: '20px' }" style="border: none; box-shadow: none">
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="onLoad">
|
||||
<img src="./icon/down.png" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" id="formContent" style="width: 75%; margin-left: 10%">
|
||||
<div class="table-content" id="table-content">
|
||||
<el-row class="mb20" style="display: flex; justify-content: center">
|
||||
<h2>设计材料设备领料单</h2>
|
||||
</el-row>
|
||||
<el-row class="mb10" style="display: flex; justify-content: space-between">
|
||||
<div class="head-text">
|
||||
<span>工程名称:</span>
|
||||
<span>{{ formData.projectName }}</span>
|
||||
</div>
|
||||
<div class="head-text">
|
||||
<span>编号:</span>
|
||||
<span>{{ formData.formCode }}</span>
|
||||
</div>
|
||||
</el-row>
|
||||
<table style="width: 100%" border="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">设备材料名称</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.materialName }}</td>
|
||||
<th colspan="2">规格及数量</th>
|
||||
<td class="th-bg" colspan="2">见下表</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">供货单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.supplierUnit }}</td>
|
||||
<th colspan="2">订货单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.orderingUnit }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">领料单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.placeholder }}</td>
|
||||
<th colspan="2">保管单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.storageUnit }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150" colspan="8">数量验收</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">序号</th>
|
||||
<th width="150">名称</th>
|
||||
<th width="150">规格</th>
|
||||
<th width="150">单位</th>
|
||||
<th width="150">库存</th>
|
||||
<th width="150">领取</th>
|
||||
<th width="150">剩余</th>
|
||||
<th width="150">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, i) of formData.itemList" :key="i">
|
||||
<th width="150">{{ i + 1 }}</th>
|
||||
<th width="150">{{ item.name }}</th>
|
||||
<th width="150">{{ item.specification }}</th>
|
||||
<th width="150">{{ item.unit }}</th>
|
||||
<th width="150">{{ item.stockQuantity }}</th>
|
||||
<th width="150">{{ item.issuedQuantity }}</th>
|
||||
<th width="150">{{ item.remainingQuantity }}</th>
|
||||
<th width="150">{{ item.remark }}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<div style="margin-bottom: 10px;">缺陷情况:</div>
|
||||
{{ formData.defectDescription }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- <th width="150"></th> -->
|
||||
<td colspan="8">
|
||||
<span>是否附带以下随机资料</span>
|
||||
<div class="file_detail">
|
||||
<span>(1) 合格证 {{ formData.certCountFile ? formData.certCountFile.length : 0 }} 份</span>
|
||||
<span>(2) 出厂报告 {{ formData.reportCountFileId ? formData.reportCountFileId.length : 0 }} 份</span>
|
||||
<span>(3) 技术资料文件 {{ formData.techDocCountFileId ? formData.techDocCountFileId.length : 0 }} 份</span>
|
||||
<span>(4) 厂家资质文件 {{ formData.licenseCountFileId ? formData.licenseCountFileId.length : 0 }} 份</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue';
|
||||
import { getMaterialIssue } from '@/api/materials/materialIssue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { downLoadOss } from '@/api/system/oss';
|
||||
// 响应式状态
|
||||
const isShowDialog = ref(false);
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
materialSource: '1',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
issueUnit: undefined,
|
||||
storageUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
id: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
stockQuantity: undefined,
|
||||
issuedQuantity: undefined,
|
||||
remainingQuantity: undefined,
|
||||
name: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
const data = reactive({
|
||||
formData: { ...initFormData }
|
||||
});
|
||||
const design_change_reason_type = ref([]);
|
||||
const { formData } = toRefs(data);
|
||||
// 打开弹窗
|
||||
const openDialog = (row?: any, types) => {
|
||||
resetForm();
|
||||
design_change_reason_type.value = types;
|
||||
if (row?.id) {
|
||||
getInfos(row.id, types);
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
// 获取详情数据
|
||||
const getInfos = async (id: string, types) => {
|
||||
const res = await getMaterialIssue(id);
|
||||
Object.assign(formData.value, res.data);
|
||||
// 数据处理
|
||||
if (formData.value.changeReason) {
|
||||
let arr = formData.value.changeReason.split(',');
|
||||
var changeReason = types.filter((item) => arr.includes(item.value.toString())).map((item) => item.label);
|
||||
formData.value.changeReason = changeReason.join(',');
|
||||
}
|
||||
};
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.keys(formData.value).forEach((key) => {
|
||||
formData[key] = undefined;
|
||||
});
|
||||
};
|
||||
// 下载文件
|
||||
const onOpen = (path: string) => {
|
||||
window.open(path, '_blank');
|
||||
};
|
||||
// 导出
|
||||
const onLoad = async () => {
|
||||
await downLoadOss({ id: formData.value.id }, '/materials/materialIssue/export/word', '设计材料设备领料单.zip');
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
openDialog,
|
||||
closeDialog
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pic-block {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.file-block {
|
||||
width: 100%;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
margin-bottom: 5px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
::v-deep .el-icon svg {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
::v-deep .el-step__icon-inner {
|
||||
font-size: 14px !important;
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
.dialog-footer {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 10%;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
> span {
|
||||
padding-top: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.file_detail{
|
||||
|
||||
>span{
|
||||
width: 40%;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse; //合并为一个单一的边框
|
||||
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
||||
}
|
||||
thead {
|
||||
tr {
|
||||
th {
|
||||
background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
td {
|
||||
text-align: left;
|
||||
height: 35px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
.th-bg {
|
||||
background-color: rgba(247, 247, 247, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
tr {
|
||||
td {
|
||||
text-align: left;
|
||||
height: 40px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
th {
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-content {
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
@ -1,502 +0,0 @@
|
||||
<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">
|
||||
<el-form-item label="表单编号" prop="formCode">
|
||||
<el-input v-model="queryParams.formCode" 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="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="contractName">
|
||||
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订货单位" prop="orderingUnit">
|
||||
<el-input v-model="queryParams.orderingUnit" placeholder="请输入订货单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货单位" prop="supplierUnit">
|
||||
<el-input v-model="queryParams.supplierUnit" placeholder="请输入供货单位" clearable @keyup.enter="handleQuery" />
|
||||
</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="Plus" @click="handleAdd" v-hasPermi="['materials:materialReceive:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['materials:materialReceive:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="materialReceiveList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="表单编号" align="center" prop="formCode" />
|
||||
<el-table-column label="工程名称" align="center" prop="projectName" />
|
||||
<el-table-column label="设备材料名称" align="center" prop="materialName" />
|
||||
<el-table-column label="合同名称" align="center" prop="contractName" />
|
||||
<el-table-column label="订货单位" align="center" prop="orderingUnit" />
|
||||
<el-table-column label="供货单位" align="center" prop="supplierUnit" />
|
||||
<el-table-column label="设备材料入库/移交" align="center" prop="storageType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="storage_type" :value="scope.row.storageType ? scope.row.storageType.split(',') : []" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialReceive:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['materials:materialReceive:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</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>
|
||||
<!-- 添加或修改物料接收单对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
||||
<el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="表单编号" prop="formCode">
|
||||
<el-input v-model="form.formCode" 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="materialName">
|
||||
<el-input v-model="form.materialName" placeholder="请输入设备材料名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同名称" prop="contractName">
|
||||
<el-input v-model="form.contractName" placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="订货单位" prop="orderingUnit">
|
||||
<el-input v-model="form.orderingUnit" placeholder="请输入订货单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供货单位" prop="supplierUnit">
|
||||
<el-input v-model="form.supplierUnit" placeholder="请输入供货单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="缺陷情况" prop="defectDescription">
|
||||
<el-input v-model="form.defectDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="detail">
|
||||
<div class="detail-header">
|
||||
<span>数量验收</span>
|
||||
<el-button type="primary" link @click="addItem" icon="Plus">添加一行</el-button>
|
||||
</div>
|
||||
<div v-for="(item, index) in form.itemList" :key="index" class="detail-item">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '名称' : ''"
|
||||
:prop="`itemList.${index}.name`"
|
||||
:rules="{ required: true, message: '名称不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '规格' : ''"
|
||||
:prop="`itemList.${index}.specification`"
|
||||
:rules="{ required: true, message: '规格不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '单位' : ''"
|
||||
:prop="`itemList.${index}.unit`"
|
||||
:rules="{ required: true, message: '单位不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.unit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '数量' : ''"
|
||||
:prop="`itemList.${index}.quantity`"
|
||||
:rules="{ required: true, message: '数量不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.quantity" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '验收' : ''"
|
||||
:prop="`itemList.${index}.acceptedQuantity`"
|
||||
:rules="{ required: true, message: '验收数量不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.acceptedQuantity" placeholder="请输入验收" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="index === 0 ? '缺件' : ''"
|
||||
:prop="`itemList.${index}.shortageQuantity`"
|
||||
:rules="{ required: true, message: '缺件数量不能为空', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="item.shortageQuantity" placeholder="请输入缺件" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="index === 0 ? '备注' : ''" prop="remark">
|
||||
<el-input v-model="item.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.itemList.length > 1">
|
||||
<div class="item-actions">
|
||||
<el-button type="danger" link @click="removeItem(index)" icon="Delete">删除</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合格证文件" prop="certCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.certCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="出厂报告文件" prop="reportCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.reportCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="技术资料文件" prop="techDocCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.techDocCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家资质文件" prop="licenseCountFileId">
|
||||
<file-upload :isShowTip="false" v-model="form.licenseCountFileId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<span style="color: #ff0000ab; margin-bottom: 10px; display: block"
|
||||
>注意:请上传doc/xls/ppt/txt/pdf/png/jpg/jpeg/zip格式文件</span
|
||||
> </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>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<wordllReceive ref="wordllReceiveRef"></wordllReceive>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MaterialReceive" lang="ts">
|
||||
import {
|
||||
listMaterialReceive,
|
||||
getMaterialReceive,
|
||||
delMaterialReceive,
|
||||
addMaterialReceive,
|
||||
updateMaterialReceive
|
||||
} from '@/api/materials/materialReceive';
|
||||
import { MaterialReceiveVO, MaterialReceiveQuery, MaterialReceiveForm } from '@/api/materials/materialReceive/types';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import wordllReceive from './word/index.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { storage_type } = toRefs<any>(proxy?.useDict('storage_type'));
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const wordllReceiveRef = ref<InstanceType<typeof wordllReceive>>();
|
||||
const materialReceiveList = ref<MaterialReceiveVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
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 queryFormRef = ref<ElFormInstance>();
|
||||
const materialReceiveFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
const getInitFormData = () => {
|
||||
return {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '2',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
contractName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
storageType: [],
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
quantity: undefined,
|
||||
acceptedQuantity: undefined,
|
||||
shortageQuantity: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
const data = reactive<PageData<MaterialReceiveForm, MaterialReceiveQuery>>({
|
||||
form: getInitFormData(),
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '2',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
contractName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询物料接收单列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMaterialReceive(queryParams.value);
|
||||
materialReceiveList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = getInitFormData();
|
||||
materialReceiveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MaterialReceiveVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加物料接收单';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MaterialReceiveVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMaterialReceive(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
if (form.value.storageType.length) {
|
||||
form.value.storageType = form.value.storageType.split(',');
|
||||
} else {
|
||||
form.value.storageType = [];
|
||||
}
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改物料接收单';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
materialReceiveFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.storageType = form.value.storageType.join(',');
|
||||
if (form.value.id) {
|
||||
await updateMaterialReceive(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMaterialReceive(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MaterialReceiveVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除物料接收单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMaterialReceive(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
// 添加数量验收条目
|
||||
const addItem = () => {
|
||||
form.value.itemList.push({
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
quantity: undefined,
|
||||
acceptedQuantity: undefined,
|
||||
shortageQuantity: undefined,
|
||||
remark: undefined
|
||||
});
|
||||
};
|
||||
|
||||
// 删除数量验收条目
|
||||
const removeItem = (index: number) => {
|
||||
if (form.value.itemList.length > 1) {
|
||||
form.value.itemList.splice(index, 1);
|
||||
} else {
|
||||
proxy?.$modal.msgWarning('至少需要保留一条数量验收记录');
|
||||
}
|
||||
};
|
||||
const handleView = (row) => {
|
||||
// 查看详情
|
||||
wordllReceiveRef.value?.openDialog(row);
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.detail {
|
||||
border-bottom: 1px solid #ececec;
|
||||
border-top: 1px solid #ececec;
|
||||
margin: 10px 0;
|
||||
padding: 10px 0;
|
||||
|
||||
&-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
font-weight: bold;
|
||||
color: #1eaaff;
|
||||
}
|
||||
|
||||
&-item {
|
||||
padding: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
background-color: #f8f9fa;
|
||||
position: relative;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 6px;
|
||||
}
|
||||
</style>
|
Binary file not shown.
Before Width: | Height: | Size: 922 B |
@ -1,290 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-model="isShowDialog" title="变更单详情" draggable width="60vw" :close-on-click-modal="false" :destroy-on-close="true">
|
||||
<el-card :body-style="{ padding: '20px' }" style="border: none; box-shadow: none">
|
||||
<div class="dialog-footer">
|
||||
<div class="btn-item" @click="onLoad">
|
||||
<img src="./icon/down.png" />
|
||||
<span>导出</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="formRef" :model="formData" label-width="100px" id="formContent" style="width: 75%; margin-left: 10%">
|
||||
<div class="table-content" id="table-content">
|
||||
<el-row class="mb20" style="display: flex; justify-content: center">
|
||||
<h2>材料设备验收单</h2>
|
||||
</el-row>
|
||||
<el-row class="mb10" style="display: flex; justify-content: space-between">
|
||||
<div class="head-text">
|
||||
<span>工程名称:</span>
|
||||
<span>{{ formData.projectName }}</span>
|
||||
</div>
|
||||
<div class="head-text">
|
||||
<span>编号:</span>
|
||||
<span>{{ formData.formCode }}</span>
|
||||
</div>
|
||||
</el-row>
|
||||
<table style="width: 100%" border="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">设备材料名称</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.materialName }}</td>
|
||||
<th colspan="2">合同名称</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.contractName }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="2">订货单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.orderingUnit }}</td>
|
||||
<th colspan="2">供货单位</th>
|
||||
<td class="th-bg" colspan="2">{{ formData.supplierUnit }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="150" colspan="8">数量验收(验收、缺件数量由承包单位填写)</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="150">序号</th>
|
||||
<th width="150">名称</th>
|
||||
<th width="150">规格</th>
|
||||
<th width="150">单位</th>
|
||||
<th width="150">数量</th>
|
||||
<th width="150">验收</th>
|
||||
<th width="150">缺件</th>
|
||||
<th width="150">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, i) of formData.itemList" :key="i">
|
||||
<th width="150">{{ i + 1 }}</th>
|
||||
<th width="150">{{ item.name }}</th>
|
||||
<th width="150">{{ item.specification }}</th>
|
||||
<th width="150">{{ item.unit }}</th>
|
||||
<th width="150">{{ item.quantity }}</th>
|
||||
<th width="150">{{ item.acceptedQuantity }}</th>
|
||||
<th width="150">{{ item.shortageQuantity }}</th>
|
||||
<th width="150">{{ item.remark }}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<div style="margin-bottom: 10px">缺陷情况:</div>
|
||||
{{ formData.defectDescription }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<span>是否附带以下随机资料</span>
|
||||
<div class="file_detail">
|
||||
<span>(1) 合格证 {{ formData.certCountFile ? formData.certCountFile.length : 0 }} 份</span>
|
||||
<span>(2) 出厂报告 {{ formData.reportCountFileId ? formData.reportCountFileId.length : 0 }} 份</span>
|
||||
<span>(3) 技术资料文件 {{ formData.techDocCountFileId ? formData.techDocCountFileId.length : 0 }} 份</span>
|
||||
<span>(4) 厂家资质文件 {{ formData.licenseCountFileId ? formData.licenseCountFileId.length : 0 }} 份</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue';
|
||||
import { getMaterialReceive } from '@/api/materials/materialReceive';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { downLoadOss } from '@/api/system/oss';
|
||||
// 响应式状态
|
||||
const isShowDialog = ref(false);
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
materialSource: '1',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
contractName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
storageType: [],
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
name: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
quantity: undefined,
|
||||
acceptedQuantity: undefined,
|
||||
shortageQuantity: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
const data = reactive({
|
||||
formData: { ...initFormData }
|
||||
});
|
||||
const design_change_reason_type = ref([]);
|
||||
const { formData } = toRefs(data);
|
||||
// 打开弹窗
|
||||
const openDialog = (row?: any, types) => {
|
||||
resetForm();
|
||||
design_change_reason_type.value = types;
|
||||
if (row?.id) {
|
||||
getInfos(row.id, types);
|
||||
}
|
||||
isShowDialog.value = true;
|
||||
};
|
||||
// 获取详情数据
|
||||
const getInfos = async (id: string, types) => {
|
||||
const res = await getMaterialReceive(id);
|
||||
Object.assign(formData.value, res.data);
|
||||
// 数据处理
|
||||
if (formData.value.changeReason) {
|
||||
let arr = formData.value.changeReason.split(',');
|
||||
var changeReason = types.filter((item) => arr.includes(item.value.toString())).map((item) => item.label);
|
||||
formData.value.changeReason = changeReason.join(',');
|
||||
}
|
||||
};
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
Object.keys(formData.value).forEach((key) => {
|
||||
formData[key] = undefined;
|
||||
});
|
||||
};
|
||||
// 下载文件
|
||||
const onOpen = (path: string) => {
|
||||
window.open(path, '_blank');
|
||||
};
|
||||
// 导出
|
||||
const onLoad = async () => {
|
||||
await downLoadOss({ id: formData.value.id }, '/materials/materialReceive/export/word', '材料设备验收单.zip');
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
isShowDialog.value = false;
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
openDialog,
|
||||
closeDialog
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pic-block {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.file-block {
|
||||
width: 100%;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
margin-bottom: 5px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
::v-deep .el-icon svg {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
::v-deep .el-step__icon-inner {
|
||||
font-size: 14px !important;
|
||||
font-weight: 700 !important;
|
||||
}
|
||||
.dialog-footer {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 14%;
|
||||
right: 10%;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
text-align: center;
|
||||
padding: 20px 10px;
|
||||
.btn-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
> span {
|
||||
padding-top: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.file_detail {
|
||||
> span {
|
||||
width: 40%;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse; //合并为一个单一的边框
|
||||
border-color: rgba(199, 199, 199, 1); //边框颜色按实际自定义即可
|
||||
}
|
||||
thead {
|
||||
tr {
|
||||
th {
|
||||
background-color: rgba(247, 247, 247, 1); //设置表格标题背景色
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
td {
|
||||
text-align: left;
|
||||
height: 35px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
.th-bg {
|
||||
background-color: rgba(247, 247, 247, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
tr {
|
||||
td {
|
||||
text-align: left;
|
||||
height: 40px; //设置单元格最小高度
|
||||
padding: 15px;
|
||||
}
|
||||
th {
|
||||
height: 35px; //设置单元格最小高度
|
||||
text-align: center;
|
||||
letter-spacing: 5px;
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-content {
|
||||
box-shadow: 0px 0px 10px #ddd;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user