1
This commit is contained in:
@ -7,7 +7,7 @@ VITE_APP_ENV = 'development'
|
||||
# 开发环境
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
# 李陈杰 209
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||
# 李陈杰 209
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||
# 曾涛
|
||||
@ -15,7 +15,7 @@ VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||
# 罗成
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.188:8899'
|
||||
# 朱银
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||
#曾涛
|
||||
# VITE_APP_BASE_API = 'http://192.168.110.171:8899'
|
||||
# 屈展航
|
||||
@ -25,7 +25,7 @@ VITE_APP_BASE_API = 'http://192.168.110.149:8899'
|
||||
# ws
|
||||
VITE_APP_BASE_WS_API = 'ws://192.168.110.149:8899/resource/websocket'
|
||||
# EARTH
|
||||
VITE_APP_BASE_EARTH_API="http://192.168.110.2:8895"
|
||||
VITE_APP_BASE_EARTH_API = "http://192.168.110.2:8895"
|
||||
|
||||
# 无人机接口地址
|
||||
VITE_APP_BASE_DRONE_API = 'http://58.17.134.85:9512'
|
||||
|
||||
@ -67,6 +67,17 @@
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['formalities:formalitiesAreConsolidated:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
@ -130,7 +141,7 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.formalitiesPid">
|
||||
<div v-if="scope.row.formalitiesPid && scope.row.processingStatus != '不需要办理'">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@ -151,6 +162,9 @@
|
||||
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
||||
>修改状态</el-button
|
||||
>
|
||||
<!-- <el-button link type="danger" icon="Delete" v-if="scope.row.processingStatus == '待开始'" @click="handleDelete(scope.row)"
|
||||
>删除</el-button
|
||||
> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -242,6 +256,7 @@
|
||||
<el-option label="待开始" value="待开始" />
|
||||
<el-option label="处理中" value="处理中" />
|
||||
<el-option label="已完成" value="已完成" />
|
||||
<el-option label="不需要办理" value="不需要办理" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -546,6 +561,16 @@ const handleUpdateStatus = async (row?: FormalitiesAreConsolidatedVO) => {
|
||||
updateStatusVisible.value = true;
|
||||
};
|
||||
|
||||
const handleDelete = async (row?: any) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除数据项?').finally(() => (fileLoading.value = false));
|
||||
fileLoading.value = true;
|
||||
|
||||
await delFormalitiesAreConsolidated(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
const submitStatus = async () => {
|
||||
statusFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
|
||||
@ -1,3 +1,792 @@
|
||||
<!-- <template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
<el-col style="" :span="5">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" :offset="0">
|
||||
<el-button type="primary" v-hasPermi="['cailiaoshebei:mrpBase:addbatch']" size="default" @click="handleAdd" icon="FolderAdd" plain
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5" :offset="0">
|
||||
<el-button
|
||||
type="danger"
|
||||
size="default"
|
||||
v-hasPermi="['cailiaoshebei:mrpBase:remove']"
|
||||
@click="handleDeleteBatch"
|
||||
:disabled="form.mrpBaseBo.status != 'draft'"
|
||||
icon="FolderDelete"
|
||||
plain
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
|
||||
<el-tree
|
||||
ref="batchTreeRef"
|
||||
class="mt-2"
|
||||
node-key="id"
|
||||
:data="batchOptions"
|
||||
:props="{ label: 'planCode', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node">
|
||||
{{ node.label }}
|
||||
<dict-tag :options="wf_business_status" :value="data.status" />
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.batchData.pageNum"
|
||||
v-model:limit="queryParams.batchData.pageSize"
|
||||
@pagination="getList"
|
||||
layout="prev, pager, next,jumper"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
|
||||
<el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:mrpBase:addbatch']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
|
||||
<el-button plain type="primary" icon="Finished" @click="handleAudit()">审核</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="form.mrpBaseBo.status != 'draft'">
|
||||
<el-button type="warning" icon="View" @click="handleAudit()">查看流程</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="cailiaoshebeiList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="所属上级" align="center" prop="suppliespricePname" />
|
||||
<el-table-column label="物资名称" align="center" prop="name" />
|
||||
<el-table-column label="质量标准" align="center" prop="qs" />
|
||||
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||
<el-table-column label="计量单位" align="center" prop="unit" width="80" />
|
||||
<el-table-column label="需求数量" align="center" prop="demandQuantity" />
|
||||
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="mainTotal > 0"
|
||||
:total="mainTotal"
|
||||
v-model:page="queryParams.mainData.pageNum"
|
||||
v-model:limit="queryParams.mainData.pageSize"
|
||||
@pagination="getMainList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog :close-on-click-modal="false" draggable :title="dialog.title" v-model="dialog.visible" width="1500px" append-to-body>
|
||||
<el-form :model="form" ref="cailiaoshebeiFormRef" :rules="rules" label-width="80px" :inline="false">
|
||||
<el-divider>基础信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="物资类别" prop="mrpBaseBo.matCat">
|
||||
<el-input v-model="form.mrpBaseBo.matCat" placeholder="请输入物资类别" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="编制日期" prop="mrpBaseBo.preparedDate">
|
||||
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择编制日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="计划编号" prop="mrpBaseBo.planCode">
|
||||
<el-input v-model="form.mrpBaseBo.planCode" placeholder="请输入计划编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider>主要信息</el-divider>
|
||||
<el-table :data="form.planList" border>
|
||||
<el-table-column prop="batchNumber" align="center" label="版本号 " width="200">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.batchNumber" placeholder="请选择" @change="(val) => selectNameVersion(val, scope.row, scope.$index)">
|
||||
<el-option v-for="item in versionList" :key="item.versions" :label="item.versions" :value="item.versions" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="物资名称" width="160">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.name" v-if="scope.row.mrpBaseId" placeholder="请输入物资名称" disabled />
|
||||
<el-cascader
|
||||
v-else
|
||||
:disabled="!scope.row.batchNumber"
|
||||
v-model="scope.row.suppliespriceId"
|
||||
:show-all-levels="false"
|
||||
:options="getAvailableNameList(scope.$index)"
|
||||
placeholder="请选择"
|
||||
@change="(val) => selectName(val, scope.row, scope.$index)"
|
||||
:props="{
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
emitPath: false
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="剩余量" width="80">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.Remaining }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="specification" align="center" label="规格型号" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.specification }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" align="center" label="单位" width="80">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="demandQuantity" align="center" label="数量" width="140">
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model.number="scope.row.demandQuantity"
|
||||
@input="validateDemandQuantity(scope.row, scope.$index)"
|
||||
@blur="validateDemandQuantity(scope.row, scope.$index)"
|
||||
:max="scope.row.Remaining"
|
||||
placeholder="请输入数量"
|
||||
type="number"
|
||||
min="0"
|
||||
/>
|
||||
<div v-if="scope.row.quantityError" class="text-red-500 text-xs mt-1">{{ scope.row.quantityError }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qs" align="center" label="质量标准" width="140">
|
||||
<template #header> <span class="text-red-500">*</span> 质量标准 </template>
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.qs" placeholder="请输入质量标准" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="arrivalTime" align="center" label="需求到货时间" width="180">
|
||||
<template #header> <span class="text-red-500">*</span> 需求到货时间 </template>
|
||||
<template #default="scope">
|
||||
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择" style="width: 140px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" align="center" label="备注">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入备注" disabled />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" align="center" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button @click="addRow" type="primary" icon="Plus" size="small" />
|
||||
<el-button @click="delRow(scope.$index)" type="danger" icon="Delete" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitTransferForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template> -->
|
||||
|
||||
<!-- <script setup name="Cailiaoshebei" lang="ts">
|
||||
// import {
|
||||
// getCailiaoshebei,
|
||||
// updateCailiaoshebei,
|
||||
// listBatch,
|
||||
// getBatch,
|
||||
// delBatch,
|
||||
// listSelectCailiaoshebei,
|
||||
// obtainTheVersion,
|
||||
// getDictList,
|
||||
// coryEngineeringList,
|
||||
// mrpBaseRemaining
|
||||
// } from '@/api/materials/batchPlan';
|
||||
// import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
|
||||
// import { useUserStoreHook } from '@/store/modules/user';
|
||||
// import { getCurrentInstance, ComponentInternalInstance, watch, onMounted, onUnmounted, computed } from 'vue';
|
||||
// import type { ElFormInstance } from 'element-plus';
|
||||
|
||||
// // 类型定义补充
|
||||
// interface DialogOption {
|
||||
// visible: boolean;
|
||||
// title: string;
|
||||
// }
|
||||
|
||||
// interface PlanListItem {
|
||||
// id?: number | undefined;
|
||||
// name?: string | undefined;
|
||||
// specification?: string | undefined;
|
||||
// unit?: string | undefined;
|
||||
// suppliespriceId?: number | undefined;
|
||||
// demandQuantity?: number | undefined;
|
||||
// qs?: string | undefined;
|
||||
// arrivalTime?: string | undefined;
|
||||
// remark?: string | undefined;
|
||||
// Remaining: number; // 剩余量(必存在)
|
||||
// quantityError: string; // 数量错误提示
|
||||
// batchNumber?: string | undefined; // 版本号
|
||||
// duplicateError: string; // 重复错误提示
|
||||
// mrpBaseId?: number | undefined;
|
||||
// }
|
||||
|
||||
// interface FormData {
|
||||
// mrpBaseBo: {
|
||||
// id?: number | undefined;
|
||||
// preparedDate?: string | undefined;
|
||||
// planCode?: string | undefined;
|
||||
// matCat?: string | undefined;
|
||||
// status?: string | undefined;
|
||||
// projectId?: number | undefined;
|
||||
// };
|
||||
// planList: PlanListItem[];
|
||||
// }
|
||||
|
||||
// const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// // 获取用户 store
|
||||
// const userStore = useUserStoreHook();
|
||||
// // 从 store 中获取项目列表和当前选中的项目
|
||||
// const currentProject = computed(() => userStore.selectedProject);
|
||||
// const batchTreeRef = ref<any>(null);
|
||||
// const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
|
||||
// const buttonLoading = ref(false);
|
||||
// const loading = ref(false);
|
||||
// const showSearch = ref(true);
|
||||
// const ids = ref<Array<string | number>>([]);
|
||||
// const single = ref(true);
|
||||
// const multiple = ref(true);
|
||||
// const total = ref(0);
|
||||
// const mainTotal = ref(0);
|
||||
// const batchOptions = ref<any[]>([]);
|
||||
// const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status') || {});
|
||||
// const route = useRoute();
|
||||
// const queryFormRef = ref<ElFormInstance>();
|
||||
// const cailiaoshebeiFormRef = ref<ElFormInstance>();
|
||||
// const dialog = reactive<DialogOption>({
|
||||
// visible: false,
|
||||
// title: ''
|
||||
// });
|
||||
|
||||
// // 初始化表单数据
|
||||
// const initFormData: FormData = {
|
||||
// mrpBaseBo: {
|
||||
// id: undefined,
|
||||
// preparedDate: undefined,
|
||||
// planCode: undefined,
|
||||
// matCat: undefined,
|
||||
// status: undefined,
|
||||
// projectId: currentProject.value?.id
|
||||
// },
|
||||
// planList: [
|
||||
// {
|
||||
// id: undefined,
|
||||
// name: undefined,
|
||||
// specification: undefined,
|
||||
// unit: undefined,
|
||||
// suppliespriceId: undefined,
|
||||
// demandQuantity: undefined,
|
||||
// qs: undefined,
|
||||
// arrivalTime: undefined,
|
||||
// remark: undefined,
|
||||
// Remaining: 0,
|
||||
// quantityError: '',
|
||||
// batchNumber: undefined,
|
||||
// duplicateError: '',
|
||||
// mrpBaseId: undefined
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
|
||||
// const data = reactive({
|
||||
// form: { ...initFormData } as FormData,
|
||||
// queryParams: {
|
||||
// batchData: {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
// planCode: undefined,
|
||||
// projectId: currentProject.value?.id
|
||||
// },
|
||||
// mainData: {
|
||||
// pageNum: 1,
|
||||
// pageSize: 10,
|
||||
// mrpBaseId: undefined,
|
||||
// projectId: currentProject.value?.id
|
||||
// }
|
||||
// },
|
||||
// rules: {
|
||||
// id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
// 'mrpBaseBo.preparedDate': [{ required: true, message: '计划日期不能为空', trigger: 'blur' }],
|
||||
// 'mrpBaseBo.planCode': [{ required: true, message: '计划编码不能为空', trigger: 'blur' }],
|
||||
// 'mrpBaseBo.matCat': [{ required: true, message: '物资分类不能为空', trigger: 'blur' }]
|
||||
// }
|
||||
// });
|
||||
|
||||
// const batchNumber = ref('');
|
||||
// const { queryParams, form, rules } = toRefs(data);
|
||||
// const nameList = ref<any[]>([]);
|
||||
// const versionList = ref<any[]>([]);
|
||||
|
||||
// /** 查询物资-材料设备列表 */
|
||||
// const getList = async (type?: string) => {
|
||||
// loading.value = true;
|
||||
// try {
|
||||
// const res = await listBatch(queryParams.value.batchData);
|
||||
// batchOptions.value = res.rows || [];
|
||||
// // 自动选中第一条数据(如果存在且未选中)
|
||||
// if (batchOptions.value.length > 0 && !queryParams.value.mainData.mrpBaseId) {
|
||||
// batchTreeRef.value?.setCurrentKey(batchOptions.value[0].id);
|
||||
// queryParams.value.mainData.mrpBaseId = batchOptions.value[0].id;
|
||||
// form.value.mrpBaseBo.status = batchOptions.value[0].status;
|
||||
// }
|
||||
// total.value = res.total || 0;
|
||||
// } catch (error) {
|
||||
// proxy?.$modal.msgError('获取批次列表失败');
|
||||
// } finally {
|
||||
// loading.value = false;
|
||||
// // 非搜索场景下同步加载主列表
|
||||
// if (type !== 'search') {
|
||||
// getMainList();
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// /** 数量校验:必须≤剩余量,且为合法数字 */
|
||||
// const validateDemandQuantity = (row: PlanListItem, index: number) => {
|
||||
// // 1. 清除之前的错误信息
|
||||
// row.quantityError = '';
|
||||
|
||||
// // 2. 处理空值
|
||||
// if (row.demandQuantity === null || row.demandQuantity === undefined || row.demandQuantity === '') {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 3. 处理非数字
|
||||
// if (typeof row.demandQuantity !== 'number' || isNaN(row.demandQuantity)) {
|
||||
// row.quantityError = '请输入合法数字';
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 4. 处理负数
|
||||
// if (row.demandQuantity < 0) {
|
||||
// row.quantityError = '数量不能为负数';
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 5. 核心校验:数量≤剩余量
|
||||
// if (row.demandQuantity > row.Remaining) {
|
||||
// row.quantityError = `数量不能超过剩余量${row.Remaining}`;
|
||||
// }
|
||||
// };
|
||||
|
||||
// /** 获取剩余量 */
|
||||
// const getMrpBaseRemaining = async (suppliespriceId: number, row: PlanListItem) => {
|
||||
// try {
|
||||
// const res = await mrpBaseRemaining({ suppliespriceId });
|
||||
// const selected = res.data;
|
||||
// console.log('🚀 ~ getMrpBaseRemaining ~ selected:', selected);
|
||||
// row.Remaining = selected.remainingQuantity || 0;
|
||||
// row.name = selected.name;
|
||||
// row.specification = selected.specification;
|
||||
// row.unit = selected.unit;
|
||||
// row.qs = selected.qs || '';
|
||||
// row.remark = selected.remark || '';
|
||||
// row.arrivalTime = selected.arrivalTime || '';
|
||||
// // 剩余量更新后,重新校验当前数量
|
||||
// validateDemandQuantity(row, 0);
|
||||
// } catch (error) {
|
||||
// proxy?.$modal.msgError('获取剩余量失败');
|
||||
// row.Remaining = 0;
|
||||
// }
|
||||
// };
|
||||
|
||||
// /** 获取可用物资列表(过滤已选选项) */
|
||||
// const getAvailableNameList = (currentIndex: number) => {
|
||||
// // 收集除当前行外已选中的物资ID
|
||||
// const selectedIds = form.value.planList
|
||||
// .filter((_, index) => index !== currentIndex)
|
||||
// .map((item) => item.suppliespriceId)
|
||||
// .filter((id) => id !== undefined && id !== null);
|
||||
|
||||
// // 过滤掉已选中的物资
|
||||
// return nameList.value.filter((item) => !selectedIds.includes(item.id));
|
||||
// };
|
||||
|
||||
// /** 选择物资名称触发 */
|
||||
// const selectName = (val: number, row: PlanListItem, index: number) => {
|
||||
// // 1. 获取剩余量并更新基础信息
|
||||
// getMrpBaseRemaining(val, row);
|
||||
// };
|
||||
|
||||
// /** 节点单击事件 */
|
||||
// const handleNodeClick = (data: any) => {
|
||||
// queryParams.value.mainData.mrpBaseId = data.id;
|
||||
// form.value.mrpBaseBo.status = data.status;
|
||||
// getMainList();
|
||||
// };
|
||||
|
||||
// /** 获取主列表数据 */
|
||||
// const getMainList = async () => {
|
||||
// if (!queryParams.value.mainData.mrpBaseId) return;
|
||||
|
||||
// loading.value = true;
|
||||
// try {
|
||||
// const res = await getBatch(queryParams.value.mainData);
|
||||
// cailiaoshebeiList.value = res.rows || [];
|
||||
// mainTotal.value = res.total || 0;
|
||||
// } catch (error) {
|
||||
// proxy?.$modal.msgError('获取物资列表失败');
|
||||
// } finally {
|
||||
// loading.value = false;
|
||||
// }
|
||||
// };
|
||||
|
||||
// /** 搜索批次列表 */
|
||||
// const searchBatchList = async () => {
|
||||
// queryParams.value.batchData.planCode = batchNumber.value;
|
||||
// getList('search');
|
||||
// };
|
||||
|
||||
// /** 删除表格行 */
|
||||
// const delRow = (index: number) => {
|
||||
// if (form.value.planList.length <= 1) {
|
||||
// return proxy?.$modal.msgWarning('请至少保留一项物资数据');
|
||||
// }
|
||||
// form.value.planList.splice(index, 1);
|
||||
// };
|
||||
|
||||
// /** 新增表格行 */
|
||||
// const addRow = () => {
|
||||
// const newRow: PlanListItem = {
|
||||
// name: undefined,
|
||||
// specification: undefined,
|
||||
// unit: undefined,
|
||||
// suppliespriceId: undefined,
|
||||
// demandQuantity: undefined,
|
||||
// qs: undefined,
|
||||
// arrivalTime: undefined,
|
||||
// remark: undefined,
|
||||
// Remaining: 0,
|
||||
// quantityError: '',
|
||||
// batchNumber: undefined,
|
||||
// duplicateError: '',
|
||||
// mrpBaseId: undefined
|
||||
// };
|
||||
// form.value.planList.push(newRow);
|
||||
// };
|
||||
|
||||
// /** 取消按钮 */
|
||||
// const cancel = () => {
|
||||
// reset();
|
||||
// dialog.visible = false;
|
||||
// };
|
||||
|
||||
// /** 表单重置 */
|
||||
// const reset = () => {
|
||||
// const status = form.value.mrpBaseBo.status;
|
||||
// // 重置表单(保留状态字段)
|
||||
// form.value = {
|
||||
// ...JSON.parse(JSON.stringify(initFormData)),
|
||||
// mrpBaseBo: { ...initFormData.mrpBaseBo, status }
|
||||
// };
|
||||
// // 重置表单验证状态
|
||||
// cailiaoshebeiFormRef.value?.resetFields();
|
||||
// // 重置项目ID
|
||||
// form.value.mrpBaseBo.projectId = currentProject.value?.id;
|
||||
// };
|
||||
|
||||
// /** 多选框选中数据 */
|
||||
// const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
|
||||
// ids.value = selection.map((item) => item.id);
|
||||
// single.value = selection.length !== 1;
|
||||
// multiple.value = selection.length === 0;
|
||||
// };
|
||||
|
||||
// /** 新增按钮操作 */
|
||||
// const handleAdd = () => {
|
||||
// reset();
|
||||
// dialog.visible = true;
|
||||
// dialog.title = '新增物资-需求';
|
||||
// };
|
||||
|
||||
// /** 修改按钮操作 */
|
||||
// const handleUpdata = () => {
|
||||
// if (!queryParams.value.mainData.mrpBaseId) {
|
||||
// return proxy?.$modal.msgError('请先选择批次');
|
||||
// }
|
||||
// // 获取对应版本的物资列表
|
||||
// reset();
|
||||
// loading.value = true;
|
||||
// getCailiaoshebei(queryParams.value.mainData.mrpBaseId)
|
||||
// .then((res: any) => {
|
||||
// // 更新基础信息
|
||||
// form.value.mrpBaseBo = res.data.mrpBaseBo || initFormData.mrpBaseBo;
|
||||
|
||||
// // 更新表格数据(补充缺失字段)
|
||||
// form.value.planList = (res.data.planList || []).map((item: any) => ({
|
||||
// id: item.id,
|
||||
// name: item.name,
|
||||
// specification: item.specification,
|
||||
// unit: item.unit,
|
||||
// suppliespriceId: item.suppliespriceId,
|
||||
// demandQuantity: item.demandQuantity,
|
||||
// qs: item.qs,
|
||||
// arrivalTime: item.arrivalTime,
|
||||
// remark: item.remark,
|
||||
// Remaining: Number(item.remaining) || 0,
|
||||
// quantityError: '',
|
||||
// batchNumber: item.batchNumber,
|
||||
// duplicateError: '',
|
||||
// mrpBaseId: item.mrpBaseId
|
||||
// }));
|
||||
// // 打开对话框
|
||||
// dialog.visible = true;
|
||||
// dialog.title = '修改物资-需求';
|
||||
// })
|
||||
// .catch(() => {
|
||||
// proxy?.$modal.msgError('获取详情失败');
|
||||
// })
|
||||
// .finally(() => {
|
||||
// loading.value = false;
|
||||
// });
|
||||
// };
|
||||
|
||||
// /** 提交数据(整合所有校验) */
|
||||
// const submitTransferForm = async () => {
|
||||
// // 1. 校验数量合法性(检查是否有数量错误)
|
||||
// const hasQuantityError = form.value.planList.some((row) => row.quantityError);
|
||||
// if (hasQuantityError) {
|
||||
// return proxy?.$modal.msgError('存在非法数量,请修正后提交');
|
||||
// }
|
||||
|
||||
// // 2. 执行表单基础验证
|
||||
// const result = validateAndClean(form.value.planList);
|
||||
// if (!result.valid) {
|
||||
// return proxy?.$modal.msgError(result.message);
|
||||
// }
|
||||
|
||||
// // 3. 表单组件验证
|
||||
// cailiaoshebeiFormRef.value?.validate(async (valid: boolean) => {
|
||||
// if (!valid) return;
|
||||
|
||||
// buttonLoading.value = true;
|
||||
// try {
|
||||
// // 4. 提交数据
|
||||
// await updateCailiaoshebei({
|
||||
// ...form.value,
|
||||
// planList: result.data // 使用清洗后的数据
|
||||
// });
|
||||
// proxy?.$modal.msgSuccess('操作成功');
|
||||
// dialog.visible = false;
|
||||
// // 5. 刷新列表
|
||||
// await getList();
|
||||
// } catch (error) {
|
||||
// proxy?.$modal.msgError('操作失败,请重试');
|
||||
// } finally {
|
||||
// buttonLoading.value = false;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// /** 删除批次 */
|
||||
// const handleDeleteBatch = async () => {
|
||||
// const _id = batchTreeRef.value?.getCurrentNode()?.id;
|
||||
// if (!_id) {
|
||||
// return proxy?.$modal.msgError('请先选择批次');
|
||||
// }
|
||||
|
||||
// try {
|
||||
// await proxy?.$modal.confirm('是否确认删除该批次?删除后不可恢复!');
|
||||
// await delBatch(_id);
|
||||
// proxy?.$modal.msgSuccess('删除成功');
|
||||
// // 重置选中状态并刷新列表
|
||||
// queryParams.value.mainData.mrpBaseId = undefined;
|
||||
// form.value.mrpBaseBo.status = undefined;
|
||||
// await getList();
|
||||
// } catch (error) {
|
||||
// // 取消确认时不提示错误
|
||||
// if (error !== 'cancel') {
|
||||
// proxy?.$modal.msgError('删除失败');
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// /** 数据清洗与基础校验 */
|
||||
// function validateAndClean(arr: PlanListItem[]) {
|
||||
// // 1. 过滤掉全空的数据项
|
||||
// const cleanedArr = arr.filter((item) => !Object.values(item).every((v) => v === '' || v == null || v === undefined));
|
||||
|
||||
// let hasFullItem = false; // 是否有至少一条完整数据
|
||||
|
||||
// // 2. 逐行校验必填项
|
||||
// for (let idx = 0; idx < cleanedArr.length; idx++) {
|
||||
// const item = cleanedArr[idx];
|
||||
|
||||
// // 校验版本号
|
||||
// if (!item.batchNumber) {
|
||||
// return { valid: false, message: `第${idx + 1}行:版本号不能为空`, data: cleanedArr };
|
||||
// }
|
||||
|
||||
// // 校验物资选择
|
||||
// if (!item.suppliespriceId) {
|
||||
// return { valid: false, message: `第${idx + 1}行:请选择物资名称`, data: cleanedArr };
|
||||
// }
|
||||
|
||||
// // 校验质量标准
|
||||
// if (!item.qs) {
|
||||
// return { valid: false, message: `第${idx + 1}行:质量标准不能为空`, data: cleanedArr };
|
||||
// }
|
||||
|
||||
// // 校验需求到货时间
|
||||
// if (!item.arrivalTime) {
|
||||
// return { valid: false, message: `第${idx + 1}行:需求到货时间不能为空`, data: cleanedArr };
|
||||
// }
|
||||
|
||||
// // 校验数量(必填且≥0)
|
||||
// if (item.demandQuantity === null || item.demandQuantity === undefined || item.demandQuantity < 0) {
|
||||
// return { valid: false, message: `第${idx + 1}行:请输入合法的需求数量`, data: cleanedArr };
|
||||
// }
|
||||
|
||||
// hasFullItem = true;
|
||||
// }
|
||||
|
||||
// // 3. 检查是否至少有一条完整数据
|
||||
// if (!hasFullItem) {
|
||||
// return { valid: false, message: '至少需要填写一条完整的物资数据', data: cleanedArr };
|
||||
// }
|
||||
|
||||
// return { valid: true, message: '', data: cleanedArr };
|
||||
// }
|
||||
|
||||
// /** 审核按钮操作 */
|
||||
// const handleAudit = async () => {
|
||||
// if (!form.value.mrpBaseBo.status) {
|
||||
// return proxy?.$modal.msgError('请选择批次号');
|
||||
// }
|
||||
// if (!queryParams.value.mainData.mrpBaseId) {
|
||||
// return proxy?.$modal.msgError('请选择批次号');
|
||||
// }
|
||||
|
||||
// // 关闭当前页并打开审核页
|
||||
// proxy?.$tab.closePage(route);
|
||||
// proxy?.$tab.openPage('/approval/batchPlan/indexEdit', '审核物资设备批次需求计划', {
|
||||
// id: queryParams.value.mainData.mrpBaseId,
|
||||
// status: `${form.value.mrpBaseBo.status}_batchRequirements`,
|
||||
// type: 'update'
|
||||
// });
|
||||
// };
|
||||
|
||||
// /** 获取物资列表(按版本号筛选) */
|
||||
// const getNameList = (versions: string) => {
|
||||
// coryEngineeringList({
|
||||
// projectId: currentProject.value?.id,
|
||||
// versions
|
||||
// })
|
||||
// .then((res: any) => {
|
||||
// nameList.value = res.data || [];
|
||||
// })
|
||||
// .catch(() => {
|
||||
// nameList.value = [];
|
||||
// proxy?.$modal.msgError('获取物资列表失败');
|
||||
// });
|
||||
// };
|
||||
|
||||
// /** 获取版本号列表 */
|
||||
// const getVersion = () => {
|
||||
// obtainTheVersion({ projectId: currentProject.value?.id })
|
||||
// .then((res: any) => {
|
||||
// versionList.value = res.data || [];
|
||||
// })
|
||||
// .catch(() => {
|
||||
// versionList.value = [];
|
||||
// proxy?.$modal.msgError('获取版本号失败');
|
||||
// });
|
||||
// };
|
||||
|
||||
// /** 选择版本号触发 */
|
||||
// const selectNameVersion = (val: string, row: PlanListItem, index: number) => {
|
||||
// row.batchNumber = val;
|
||||
// row.suppliespriceId = undefined; // 切换版本号时清空物资选择
|
||||
// row.name = undefined;
|
||||
// row.specification = undefined;
|
||||
// row.unit = undefined;
|
||||
// row.qs = undefined;
|
||||
// row.remark = undefined;
|
||||
// row.arrivalTime = undefined;
|
||||
// row.demandQuantity = undefined;
|
||||
// row.quantityError = '';
|
||||
// row.duplicateError = '';
|
||||
// row.mrpBaseId = '';
|
||||
|
||||
// // 获取对应版本的物资列表
|
||||
// getNameList(val);
|
||||
// };
|
||||
|
||||
// /** 页面挂载时初始化 */
|
||||
// onMounted(() => {
|
||||
// getList();
|
||||
// getVersion();
|
||||
// });
|
||||
|
||||
// /** 监听项目ID变化,刷新数据 */
|
||||
// const listeningProject = watch(
|
||||
// () => currentProject.value?.id,
|
||||
// (newId, oldId) => {
|
||||
// if (newId !== oldId && newId) {
|
||||
// queryParams.value.mainData.projectId = newId;
|
||||
// queryParams.value.batchData.projectId = newId;
|
||||
// form.value.mrpBaseBo.projectId = newId;
|
||||
// getList();
|
||||
// getVersion(); // 重新获取对应项目的版本号
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
// /** 页面卸载时清理监听 */
|
||||
// onUnmounted(() => {
|
||||
// listeningProject();
|
||||
// });
|
||||
// </script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
/* 错误提示样式补充 */
|
||||
.text-red-500 {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.text-xs {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
|
||||
@ -430,7 +430,14 @@
|
||||
<el-timeline-item color="rgb(255, 73, 73)">
|
||||
<div class="mb">{{ '退场时间:' + item.entryDate }}</div>
|
||||
<div class="pl-xl">
|
||||
<span class="text-coolgray font-bold">退场文件:<image-preview v-for="itm in item.pathUrl" :src="itm" width="100px" class="mr" /></span
|
||||
<span class="text-coolgray font-bold"
|
||||
>退场文件:<el-link
|
||||
v-for="itm in [...item.salaryConfirmationFileUrl, ...item.salaryVoucherFileUrl]"
|
||||
:href="itm"
|
||||
target="_blank"
|
||||
type="primary"
|
||||
>{{ itm }}</el-link
|
||||
></span
|
||||
><br />
|
||||
<p class="mt text-coolgray">
|
||||
备注:<span class="text-blue">{{ item.remark }}</span>
|
||||
@ -1060,7 +1067,7 @@ const submitForm = () => {
|
||||
const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||
await addConstructionBlacklist({
|
||||
userId: row.id,
|
||||
userId: row.sysUserId,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
proxy?.$modal.msgSuccess('加入成功');
|
||||
|
||||
@ -2,15 +2,16 @@
|
||||
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
||||
<div class="w75% m-a">
|
||||
<div id="printMe" class="pos-relative">
|
||||
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" /></div>
|
||||
<div class="resultIcon"><img :src="'../../../../../src/assets/icons/svg/' + inspectionType + '.png'" alt="" />
|
||||
</div>
|
||||
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">整改通知单</h2>
|
||||
<el-row>
|
||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.createBy }}</el-col>
|
||||
<el-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||
</el-row>
|
||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.projectName }}
|
||||
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{
|
||||
safetyInspectionDetail?.projectName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="巡检标题" :span="2" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.inspectionHeadline }}
|
||||
@ -24,22 +25,22 @@
|
||||
<el-descriptions-item label-align="center" label="巡检类型" label-class-name="white">
|
||||
<dict-tag :options="quality_inspection_check_type" :value="safetyInspectionDetail?.inspectionType" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="填报人" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.createBy }}
|
||||
<el-descriptions-item label-align="center" label="填报人" label-class-name="white">{{
|
||||
safetyInspectionDetail?.createBy }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="填报日期" class-name="zebra"
|
||||
>{{ safetyInspectionDetail?.createTime }}
|
||||
<el-descriptions-item label-align="center" label="填报日期" class-name="zebra">{{ safetyInspectionDetail?.createTime
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="要求回复期限" class-name="zebra"
|
||||
>{{ parseTime(safetyInspectionDetail?.replyPeriodDate, '{y}-{m}-{d}') }}
|
||||
<el-descriptions-item label-align="center" label="要求回复期限" class-name="zebra">{{
|
||||
parseTime(safetyInspectionDetail?.replyPeriodDate, '{y}-{m}-{d}') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions border direction="vertical" size="large">
|
||||
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.inspectionResult }}
|
||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white">{{
|
||||
safetyInspectionDetail?.inspectionResult }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
@ -56,7 +57,8 @@
|
||||
</el-space>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.inspectionStatus)" finish-status="finish">
|
||||
<el-steps style="max-width: 200px" :active="Number(safetyInspectionDetail?.inspectionStatus)"
|
||||
finish-status="finish">
|
||||
<el-step v-for="item in quality_inspection_status_type" :key="item.value" :title="item.label" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
@ -66,11 +68,11 @@
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
||||
{{ safetyInspectionDetail?.verificationResult }}
|
||||
{{ safetyInspectionDetail?.rectificationResult }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||
<el-space wrap>
|
||||
<div v-for="item in rectificationFileList" :key="item.ossId">
|
||||
<div v-for="item in safetyInspectionDetail?.rectificationImgFileList" :key="item.ossId">
|
||||
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||
<image-preview :src="item.url" width="200px" />
|
||||
</span>
|
||||
@ -87,8 +89,8 @@
|
||||
<el-descriptions-item label-align="center" label="验证" class-name="none"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||
<el-descriptions-item label-align="center" label="验证结果" label-class-name="white"
|
||||
>{{ safetyInspectionDetail?.verificationResult }}
|
||||
<el-descriptions-item label-align="center" label="验证结果" label-class-name="white">{{
|
||||
safetyInspectionDetail?.verificationResult }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
@ -140,14 +142,14 @@ const get = async () => {
|
||||
if (res.data && res.code === 200) {
|
||||
safetyInspectionDetail.value = res.data;
|
||||
|
||||
if (res.data.rectificationFileList) {
|
||||
if (res.data.inspectionFile) {
|
||||
const checkFileRes = await listByIds(res.data.inspectionFile.split(','));
|
||||
checkFileList.value = checkFileRes.data;
|
||||
}
|
||||
if (res.data.rectificationFile) {
|
||||
const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
|
||||
rectificationFileList.value = rectificationFileRes.data;
|
||||
}
|
||||
// if (res.data.rectificationImgFile) {
|
||||
// const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
|
||||
// rectificationFileList.value = rectificationFileRes.data;
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
@ -223,6 +225,7 @@ watch(
|
||||
z-index: 10;
|
||||
width: 105px;
|
||||
height: 105px;
|
||||
|
||||
img {
|
||||
width: 105px;
|
||||
}
|
||||
|
||||
@ -1,17 +1,20 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<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="inspectionType">
|
||||
<el-select v-model="queryParams.inspectionType" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单状态" prop="inspectionStatus">
|
||||
<el-select v-model="queryParams.inspectionStatus" placeholder="全部" clearable>
|
||||
<el-option v-for="dict in quality_inspection_status_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in quality_inspection_status_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -27,7 +30,8 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['quality:qualityInspection:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['quality:qualityInspection:add']">新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityInspection:edit']"
|
||||
@ -35,18 +39,12 @@
|
||||
>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['quality:qualityInspection:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||
v-hasPermi="['quality:qualityInspection:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['quality:qualityInspection:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['quality:qualityInspection:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -87,7 +85,7 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" /> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
|
||||
<template #default="scope">
|
||||
<!-- <el-tooltip content="验证" placement="top">
|
||||
<el-button
|
||||
@ -98,17 +96,29 @@
|
||||
v-hasPermi="['quality:qualityInspection:edit']"
|
||||
></el-button>
|
||||
</el-tooltip> -->
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)" v-hasPermi="['quality:qualityInspection:edit']">
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)"
|
||||
v-hasPermi="['quality:qualityInspection:edit']">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['quality:qualityInspection:remove']">
|
||||
<el-button link type="success"
|
||||
v-if="scope.row.inspectionStatus === '1' || scope.row.verificationType === '2'" icon="Pointer"
|
||||
@click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:rectification']">
|
||||
整改
|
||||
</el-button>
|
||||
<el-button link type="warning" icon="SuccessFilled" v-if="scope.row.inspectionStatus === '2'"
|
||||
@click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:review']">
|
||||
复查
|
||||
</el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['quality:qualityInspection:remove']">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<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="700px" append-to-body>
|
||||
@ -121,23 +131,20 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检类型" prop="inspectionType">
|
||||
<el-select v-model="form.inspectionType" placeholder="请选择巡检类型">
|
||||
<el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
<el-option v-for="dict in quality_inspection_check_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="整改单位" prop="rectificationUnit">
|
||||
<el-select v-model="form.rectificationUnit" placeholder="请选择整改单位">
|
||||
<el-option v-for="dict in rectification_unit_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
<el-option v-for="dict in rectification_unit_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在班组" prop="teamId">
|
||||
<el-select v-model="form.teamId" placeholder="请选择所在班组">
|
||||
<el-option
|
||||
v-for="dict in teamOpt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@click="changeForeman(dict.value)"
|
||||
></el-option>
|
||||
<el-option v-for="dict in teamOpt" :key="dict.value" :label="dict.label" :value="dict.value"
|
||||
@click="changeForeman(dict.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="整改人" prop="corrector">
|
||||
@ -167,7 +174,30 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="质量工单详情" v-model="dialog.details" width="60vw">
|
||||
<quality-inspection-detail :quality-inspection-detail-id="currentId" />
|
||||
<quality-inspection-detail :qualityInspectionDetailId="currentId" />
|
||||
</el-dialog>
|
||||
<el-dialog :title="handleType === 'rectification' ? '处理整改工单' : '处理复查工单'" v-model="handleDialogVisible"
|
||||
width="500px">
|
||||
<el-form ref="handleFormRef" :model="handleForm" :rules="rules" label-width="120px">
|
||||
<el-form-item label="整改反馈" prop="rectificationResult" v-if="handleType === 'rectification'">
|
||||
<el-input v-model="handleForm.rectificationResult" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="整改附件" prop="rectificationFile" v-if="handleType === 'rectification'">
|
||||
<image-upload v-model="handleForm.qualityInspection" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验证结果" prop="review" v-if="handleType === 'review'">
|
||||
<el-input v-model="handleForm.verificationResult" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验证类型" prop="reviewType" v-if="handleType === 'review'">
|
||||
<el-select v-model="handleForm.verificationType" placeholder="请选择复查类型">
|
||||
<el-option v-for="dict in review_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -175,6 +205,7 @@
|
||||
<script setup name="QualityInspection" lang="ts">
|
||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||
import { dayjs } from 'element-plus';
|
||||
|
||||
import {
|
||||
listQualityInspection,
|
||||
@ -187,8 +218,8 @@ import { QualityInspectionVO, QualityInspectionQuery, QualityInspectionForm } fr
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { quality_inspection_check_type, quality_inspection_status_type, rectification_unit_type } = toRefs<any>(
|
||||
proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type', 'rectification_unit_type')
|
||||
const { quality_inspection_check_type, quality_inspection_status_type, rectification_unit_type, review_type } = toRefs<any>(
|
||||
proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type', 'rectification_unit_type', 'review_type')
|
||||
);
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
@ -202,6 +233,7 @@ const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const handleForm = ref({})
|
||||
const isReply_type = ref([
|
||||
{
|
||||
label: '是',
|
||||
@ -215,12 +247,13 @@ const isReply_type = ref([
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const qualityInspectionFormRef = ref<ElFormInstance>();
|
||||
|
||||
const handleDialogVisible = ref(false)
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
details: false,
|
||||
title: ''
|
||||
});
|
||||
const handleType = ref("")
|
||||
|
||||
const initFormData: QualityInspectionForm = {
|
||||
id: undefined,
|
||||
@ -285,7 +318,39 @@ const getList = async () => {
|
||||
}));
|
||||
loading.value = false;
|
||||
};
|
||||
const handleSubmit = async () => {
|
||||
let flag = false;
|
||||
if (handleType.value == "rectification") {
|
||||
handleForm.value.inspectionStatus = "2";
|
||||
handleForm.value.rectificationTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
||||
const { code } = await updateQualityInspection(handleForm.value)
|
||||
if (code == 200) flag = true
|
||||
} else {
|
||||
handleForm.value.inspectionStatus = "3";
|
||||
handleForm.value.verificationTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
||||
const { code } = await updateQualityInspection(handleForm.value)
|
||||
if (code == 200) flag = true
|
||||
}
|
||||
if (flag) {
|
||||
ElMessage.success("处理成功")
|
||||
handleDialogVisible.value = false;
|
||||
getList()
|
||||
reset()
|
||||
} else {
|
||||
ElMessage.error("处理失败")
|
||||
}
|
||||
|
||||
}
|
||||
const handleDialog = (row) => {
|
||||
handleForm.value = {};
|
||||
if (row.inspectionStatus == '1') {
|
||||
handleType.value = "rectification"
|
||||
} else {
|
||||
handleType.value = "review"
|
||||
}
|
||||
handleForm.value.id = row.id;
|
||||
handleDialogVisible.value = true;
|
||||
};
|
||||
const changeForeman = (value: string) => {
|
||||
const team = teamList.value.filter((team) => team.id === value)[0];
|
||||
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||
|
||||
@ -104,8 +104,8 @@
|
||||
v-hasPermi="['safety:safetyInspection:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button link type="success" v-if="scope.row.status === '1'" icon="Pointer"
|
||||
@click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:rectification']">
|
||||
<el-button link type="success" v-if="scope.row.status === '1' || scope.row.reviewType === '2'"
|
||||
icon="Pointer" @click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:rectification']">
|
||||
整改
|
||||
</el-button>
|
||||
<el-button link type="warning" icon="SuccessFilled" v-if="scope.row.status === '2'"
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<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="dateOfOccurrence">
|
||||
<el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期" />
|
||||
<el-date-picker clearable v-model="queryParams.dateOfOccurrence" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择发生日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="录入人" prop="creatorName">
|
||||
<el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" />
|
||||
@ -23,15 +25,18 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">新增 </el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['safety:safetyLog:add']">新1增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['safety:safetyLog:remove']">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||
v-hasPermi="['safety:safetyLog:remove']">
|
||||
批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['safety:safetyLog:export']">导出 </el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['safety:safetyLog:export']">导出 </el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -56,23 +61,27 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-space>
|
||||
<el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)" v-hasPermi="['safety:safetyLog:query']">
|
||||
<el-button link type="primary" icon="View" @click="handleShowDialog(scope.row)"
|
||||
v-hasPermi="['safety:safetyLog:query']">
|
||||
详情
|
||||
</el-button>
|
||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyLog:edit']"> 修改 </el-button> -->
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyLog:remove']"> 删除 </el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['safety:safetyLog:remove']"> 删除 </el-button>
|
||||
</el-space>
|
||||
</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" />
|
||||
<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="950px" append-to-body>
|
||||
<el-form ref="safetyLogFormRef" :model="form" :rules="rules" label-width="250px">
|
||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
||||
<el-date-picker clearable v-model="form.dateOfOccurrence" type="date" value-format="YYYY-MM-DD" placeholder="请选择发生日期">
|
||||
<el-date-picker clearable v-model="form.dateOfOccurrence" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择发生日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="最高气温" prop="airTemperatureMax">
|
||||
@ -83,7 +92,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="气候" prop="weather">
|
||||
<el-select v-model="form.weather" placeholder="请选择气候">
|
||||
<el-option v-for="dict in weather_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
<el-option v-for="dict in weather_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工程施工部位及施工进展情况" prop="progress">
|
||||
@ -204,6 +214,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
|
||||
otherCondition: undefined,
|
||||
remark: undefined,
|
||||
creatorName: undefined,
|
||||
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['safety:violationRecord:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="整改" placement="top" v-if="scope.row.status == 1">
|
||||
<el-tooltip content="整改" placement="top" v-if="scope.row.status === '1' || scope.row.reviewType === '2'">
|
||||
<el-button link type="success" icon="Pointer" @click="handleDialog(scope.row)"
|
||||
v-hasPermi="['safety:violationRecord:rectification']">整改</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
Reference in New Issue
Block a user