Merge branch 'main' of http://xny.yj-3d.com:3000/taoge/new_project into ljx
This commit is contained in:
@ -7,7 +7,7 @@ VITE_APP_ENV = 'development'
|
|||||||
# 开发环境
|
# 开发环境
|
||||||
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
||||||
# 李陈杰 209
|
# 李陈杰 209
|
||||||
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
|
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||||
# 李陈杰 209
|
# 李陈杰 209
|
||||||
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
# VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
||||||
# 曾涛
|
# 曾涛
|
||||||
@ -25,7 +25,7 @@ VITE_APP_BASE_API = 'http://192.168.110.209:8899'
|
|||||||
# ws
|
# ws
|
||||||
VITE_APP_BASE_WS_API = 'ws://192.168.110.149:8899/resource/websocket'
|
VITE_APP_BASE_WS_API = 'ws://192.168.110.149:8899/resource/websocket'
|
||||||
# EARTH
|
# 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'
|
VITE_APP_BASE_DRONE_API = 'http://58.17.134.85:9512'
|
||||||
|
|||||||
@ -67,6 +67,17 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</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-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@ -82,11 +93,18 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="formalitiesAreConsolidatedList" @selection-change="handleSelectionChange" row-key="id" default-expand-all>
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:table-layout="'auto'"
|
||||||
|
:data="formalitiesAreConsolidatedList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
row-key="id"
|
||||||
|
default-expand-all
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="手续办理清单" align="left" prop="formalitiesName">
|
<el-table-column label="手续办理清单" align="left" prop="formalitiesName">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>{{ scope.row.formalitiesName }}</div>
|
{{ scope.row.formalitiesName }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="计划开始时间" align="center" prop="planTheStartTime" width="180">
|
<el-table-column label="计划开始时间" align="center" prop="planTheStartTime" width="180">
|
||||||
@ -123,7 +141,7 @@
|
|||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" fixed="right">
|
<el-table-column label="操作" align="center" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div v-if="scope.row.formalitiesPid">
|
<div v-if="scope.row.formalitiesPid && scope.row.processingStatus != '不需要办理'">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -144,6 +162,9 @@
|
|||||||
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
|
||||||
>修改状态</el-button
|
>修改状态</el-button
|
||||||
>
|
>
|
||||||
|
<!-- <el-button link type="danger" icon="Delete" v-if="scope.row.processingStatus == '待开始'" @click="handleDelete(scope.row)"
|
||||||
|
>删除</el-button
|
||||||
|
> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -235,6 +256,7 @@
|
|||||||
<el-option label="待开始" value="待开始" />
|
<el-option label="待开始" value="待开始" />
|
||||||
<el-option label="处理中" value="处理中" />
|
<el-option label="处理中" value="处理中" />
|
||||||
<el-option label="已完成" value="已完成" />
|
<el-option label="已完成" value="已完成" />
|
||||||
|
<el-option label="不需要办理" value="不需要办理" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -539,6 +561,16 @@ const handleUpdateStatus = async (row?: FormalitiesAreConsolidatedVO) => {
|
|||||||
updateStatusVisible.value = true;
|
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 () => {
|
const submitStatus = async () => {
|
||||||
statusFormRef.value?.validate(async (valid: boolean) => {
|
statusFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
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>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
<el-button icon="Download" type="warning" @click="onExport">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -234,6 +235,17 @@ const dialog = reactive<DialogOption>({
|
|||||||
details: false,
|
details: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
const now = new Date();
|
||||||
|
|
||||||
|
// 获取年份(4位数字)
|
||||||
|
const year = now.getFullYear();
|
||||||
|
|
||||||
|
// 获取月份(注意:getMonth() 返回 0-11,需要 +1 转换为 1-12)
|
||||||
|
const month = now.getMonth() + 1;
|
||||||
|
|
||||||
|
// 格式化月份为两位数(不足两位补0),拼接成年月字符串
|
||||||
|
const currentYearMonth = `${year}-${month.toString().padStart(2, '0')}`;
|
||||||
|
|
||||||
const echartsOption = ref<any>({});
|
const echartsOption = ref<any>({});
|
||||||
const initFormData: AttendanceForm = {
|
const initFormData: AttendanceForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@ -260,7 +272,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userName: undefined,
|
userName: undefined,
|
||||||
clockDate: undefined,
|
clockDate: currentYearMonth,
|
||||||
clockStatus: undefined,
|
clockStatus: undefined,
|
||||||
commuter: undefined,
|
commuter: undefined,
|
||||||
projectId: currentProject.value?.id,
|
projectId: currentProject.value?.id,
|
||||||
@ -454,7 +466,19 @@ const init = () => {
|
|||||||
handleQuery();
|
handleQuery();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const onExport = () => {
|
||||||
|
try {
|
||||||
|
console.log(queryParams.value.clockDate);
|
||||||
|
proxy?.download(
|
||||||
|
'project/attendance/exportList',
|
||||||
|
{ projectId: currentProject.value?.id, clockDate: queryParams.value.clockDate },
|
||||||
|
`考勤列表_${queryParams.value.clockDate}.xlsx`
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('导出失败,请重试');
|
||||||
|
console.error('文件导出错误:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
//监听项目id刷新数据
|
//监听项目id刷新数据
|
||||||
const listeningProject = watch(
|
const listeningProject = watch(
|
||||||
() => currentProject.value?.id,
|
() => currentProject.value?.id,
|
||||||
|
|||||||
102
src/views/project/busSalaryDetails/component/detail.vue
Normal file
102
src/views/project/busSalaryDetails/component/detail.vue
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 员工工资考核记录详情抽屉 -->
|
||||||
|
<div class="system-busSalaryDetails-detail">
|
||||||
|
<el-drawer v-model="isShowDialog" size="40%" direction="ltr">
|
||||||
|
<template #header>
|
||||||
|
<h4>员工工资考核记录详情</h4>
|
||||||
|
</template>
|
||||||
|
<el-table v-loading="loading" :data="tableData">
|
||||||
|
<el-table-column label="序号" align="center" type="index" width="60" />
|
||||||
|
<el-table-column label="工作日期" align="center" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.dateOfIssue + '-' + scope.row.working_date }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="工作时长" align="center" prop="duration" min-width="100px" />
|
||||||
|
<el-table-column label="发放年月" align="center" prop="dateOfIssue" min-width="100px" />
|
||||||
|
</el-table>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, getCurrentInstance } from 'vue';
|
||||||
|
// import { getByIdDetail } from '@/api/project/busSalaryDetails';
|
||||||
|
import { BusSalaryDetailsEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusSalaryDetailsEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
sfzNumber: undefined,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 50
|
||||||
|
},
|
||||||
|
tableData: [], //考勤数据
|
||||||
|
total: 0 //列表数量
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.formData.pageNum = 1; //重置
|
||||||
|
state.formData.sfzNumber = row.sfzNumber; //重置
|
||||||
|
state.isShowDialog = true;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
// 获取列表
|
||||||
|
const getList = () => {
|
||||||
|
state.loading = true;
|
||||||
|
// getByIdDetail(state.formData).then((res: any) => {
|
||||||
|
// state.loading = false;
|
||||||
|
// if (res.code == 0 && res.data.list) {
|
||||||
|
// state.tableData = res.data.list.reverse();
|
||||||
|
// state.total = res.data.total;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
menuRef,
|
||||||
|
getList,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.system-busSalaryDetails-detail :deep(.el-form-item--large .el-form-item__label) {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
146
src/views/project/busSalaryDetails/component/edit.vue
Normal file
146
src/views/project/busSalaryDetails/component/edit.vue
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busSalaryDetails-edit">
|
||||||
|
<!-- 添加或修改员工工资考核记录对话框 -->
|
||||||
|
<el-dialog v-model="isShowDialog" width="769px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busSalaryDetails-edit .el-dialog', '.system-busSalaryDetails-edit .el-dialog__header']">
|
||||||
|
{{ (!formData.id || formData.id == 0 ? '添加' : '修改') + '员工工资考核记录' }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="90px"> </el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
<el-button @click="onCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { reactive, toRefs, defineComponent, ref, unref, getCurrentInstance } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage, FormInstance, UploadProps } from 'element-plus';
|
||||||
|
import {
|
||||||
|
listBusSalaryDetails,
|
||||||
|
getBusSalaryDetails,
|
||||||
|
delBusSalaryDetails,
|
||||||
|
addBusSalaryDetails,
|
||||||
|
updateBusSalaryDetails
|
||||||
|
} from '@/api/project/busSalaryDetails';
|
||||||
|
import { BusSalaryDetailsTableColumns, BusSalaryDetailsInfoData, BusSalaryDetailsTableDataState, BusSalaryDetailsEditState } from './model';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'apiV1SystemBusSalaryDetailsEdit',
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive<BusSalaryDetailsEditState>({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
id: undefined,
|
||||||
|
sfzNumber: undefined,
|
||||||
|
name: undefined,
|
||||||
|
account: undefined,
|
||||||
|
sumDuration: undefined,
|
||||||
|
salary: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
teamId: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
teamName: undefined,
|
||||||
|
dateOfIssue: undefined,
|
||||||
|
lister: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (row?: BusSalaryDetailsInfoData) => {
|
||||||
|
resetForm();
|
||||||
|
if (row) {
|
||||||
|
getBusSalaryDetails(row.id!).then((res: any) => {
|
||||||
|
const data = res.data;
|
||||||
|
state.formData = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
state.isShowDialog = true;
|
||||||
|
};
|
||||||
|
// 关闭弹窗
|
||||||
|
const closeDialog = () => {
|
||||||
|
state.isShowDialog = false;
|
||||||
|
};
|
||||||
|
// 取消
|
||||||
|
const onCancel = () => {
|
||||||
|
closeDialog();
|
||||||
|
};
|
||||||
|
// 提交
|
||||||
|
const onSubmit = () => {
|
||||||
|
const formWrap = unref(formRef) as any;
|
||||||
|
if (!formWrap) return;
|
||||||
|
formWrap.validate((valid: boolean) => {
|
||||||
|
if (valid) {
|
||||||
|
state.loading = true;
|
||||||
|
if (!state.formData.id || state.formData.id === 0) {
|
||||||
|
//添加
|
||||||
|
addBusSalaryDetails(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busSalaryDetailsList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//修改
|
||||||
|
updateBusSalaryDetails(state.formData)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('修改成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busSalaryDetailsList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
id: undefined,
|
||||||
|
sfzNumber: undefined,
|
||||||
|
name: undefined,
|
||||||
|
account: undefined,
|
||||||
|
sumDuration: undefined,
|
||||||
|
salary: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
teamId: undefined,
|
||||||
|
projectName: undefined,
|
||||||
|
teamName: undefined,
|
||||||
|
dateOfIssue: undefined,
|
||||||
|
lister: undefined,
|
||||||
|
createdAt: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
deletedAt: undefined
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
||||||
57
src/views/project/busSalaryDetails/component/model.ts
Normal file
57
src/views/project/busSalaryDetails/component/model.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
export interface BusSalaryDetailsTableColumns {
|
||||||
|
id:number
|
||||||
|
sfzNumber:string; // 身份证
|
||||||
|
name:string; // 户名
|
||||||
|
account:string; // 账户
|
||||||
|
sumDuration:number; // 当月总时长
|
||||||
|
salary:number; // 薪水(天)
|
||||||
|
dateOfIssue:string; // 发放年月
|
||||||
|
lister:string; // 制表人
|
||||||
|
createdAt:string; // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusSalaryDetailsInfoData {
|
||||||
|
id:number|undefined; // 主键ID
|
||||||
|
sfzNumber:string|undefined; // 身份证
|
||||||
|
name:string|undefined; // 户名
|
||||||
|
account:string|undefined; // 账户
|
||||||
|
sumDuration:number|undefined; // 当月总时长
|
||||||
|
salary:number|undefined; // 薪水(天)
|
||||||
|
projectId:number|undefined; // 项目id
|
||||||
|
teamId:number|undefined; // 班组id
|
||||||
|
projectName:string|undefined; // 项目名称
|
||||||
|
teamName:string|undefined; // 班组名称
|
||||||
|
dateOfIssue:string|undefined; // 发放年月
|
||||||
|
lister:string|undefined; // 制表人
|
||||||
|
createdAt:string|undefined; // 创建时间
|
||||||
|
updatedAt:string|undefined; // 更新时间
|
||||||
|
deletedAt:string|undefined; // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusSalaryDetailsTableDataState {
|
||||||
|
ids:any[];
|
||||||
|
tableData: {
|
||||||
|
data: Array<BusSalaryDetailsTableColumns>;
|
||||||
|
total: number;
|
||||||
|
loading: boolean;
|
||||||
|
param: {
|
||||||
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
id: number|undefined;
|
||||||
|
sfzNumber: string|undefined;
|
||||||
|
projectId: number|undefined;
|
||||||
|
teamId: number|undefined;
|
||||||
|
dateRange: string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusSalaryDetailsEditState{
|
||||||
|
loading:boolean;
|
||||||
|
isShowDialog: boolean;
|
||||||
|
formData:BusSalaryDetailsInfoData;
|
||||||
|
rules: object;
|
||||||
|
}
|
||||||
563
src/views/project/busSalaryDetails/index.vue
Normal file
563
src/views/project/busSalaryDetails/index.vue
Normal file
@ -0,0 +1,563 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busSalaryDetails-container">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<div class="system-busSalaryDetails-search mb15">
|
||||||
|
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
|
||||||
|
<el-form-item label="身份证" prop="sfzNumber">
|
||||||
|
<el-input v-model="tableData.param.sfzNumber" placeholder="请输入身份证" clearable @keyup.enter.native="busSalaryDetailsList" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目选择" prop="projectId">
|
||||||
|
<el-select v-model="tableData.param.projectId" placeholder="请选择项目" @change="onChangeProject">
|
||||||
|
<el-option v-for="(item, i) of projectList" :key="i" :label="item.shortName" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="班组选择" prop="teamId">
|
||||||
|
<el-select v-model="tableData.param.teamId" @change="onChangeTeam" :disabled="!tableData.param.projectId" placeholder="请选择班组">
|
||||||
|
<el-option v-for="(item, i) of TeamList" :key="i" :label="item.name" :value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发放年月" prop="dateOfIssue">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="tableData.param.dateOfIssue"
|
||||||
|
@change="onChangeOfIssue"
|
||||||
|
value-format="YYYY-MM"
|
||||||
|
type="month"
|
||||||
|
placeholder="选择月份"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="busSalaryDetailsList"
|
||||||
|
><el-icon><Search /></el-icon>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="resetQuery(queryRef)"
|
||||||
|
><el-icon><Refresh /></el-icon>重置</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busSalaryDetails/delete'"
|
||||||
|
><el-icon><Delete /></el-icon>批量删除</el-button
|
||||||
|
>
|
||||||
|
<!-- <el-col :span="2">
|
||||||
|
<span>
|
||||||
|
<label for="file" class="input-button" title="选择您的excel表格进行上传">导入考勤表格</label>
|
||||||
|
<input type="file" id="file" placeholder="选择文件2" />
|
||||||
|
</span>
|
||||||
|
</el-col> -->
|
||||||
|
<el-button type="success" @click="exportSalary(null)"
|
||||||
|
><el-icon><Download /></el-icon>导出员工工资表</el-button
|
||||||
|
>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="loading" border height="72vh" :data="tableData.data" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" align="center" type="index" min-width="50px" />
|
||||||
|
<el-table-column label="身份证" align="center" prop="sfzNumber" min-width="120px" />
|
||||||
|
<el-table-column label="户名" align="center" prop="name" min-width="100px" />
|
||||||
|
<el-table-column label="账户" align="center" prop="account" min-width="100px" />
|
||||||
|
<el-table-column label="当月总天数" align="center" prop="sumDuration" min-width="100px" />
|
||||||
|
<el-table-column label="薪水(天)" align="center" prop="salary" min-width="100px" />
|
||||||
|
<el-table-column label="发放年月" align="center" prop="dateOfIssue" min-width="100px" />
|
||||||
|
<el-table-column label="总额(元)" align="center" prop="" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ (Number(scope.row.sumDuration) * Number(scope.row.salary)).toFixed(2) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="上传时间" align="center" prop="createdAt" min-width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.createdAt }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding" min-width="200px" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" link @click="handleView(scope.row)" v-auth="'api/v1/system/busSalaryDetails/view'"
|
||||||
|
><el-icon><View /></el-icon>详情</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" link @click="exportSalary(scope.row)"
|
||||||
|
><el-icon><Download /></el-icon>导出工资表</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busSalaryDetails/delete'"
|
||||||
|
><el-icon><DeleteFilled /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="tableData.total > 0"
|
||||||
|
:total="tableData.total"
|
||||||
|
v-model:page="tableData.param.pageNum"
|
||||||
|
v-model:limit="tableData.param.pageSize"
|
||||||
|
@pagination="busSalaryDetailsList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
<apiV1SystemBusSalaryDetailsDetail ref="detailRef" @busSalaryDetailsList="busSalaryDetailsList"></apiV1SystemBusSalaryDetailsDetail>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage, FormInstance, ElLoading } from 'element-plus';
|
||||||
|
// import { listBusSalaryDetails, delBusSalaryDetails, addBusSalaryDetails, salarySheet } from '@/api/project/busSalaryDetails';
|
||||||
|
import { BusSalaryDetailsTableColumns, BusSalaryDetailsTableDataState } from './component/model';
|
||||||
|
import apiV1SystemBusSalaryDetailsDetail from './component/detail.vue';
|
||||||
|
import * as xlsx from 'xlsx';
|
||||||
|
|
||||||
|
// import { exportDataToExcel } from '@/utils/exportDataToExcel.js';
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { listProjectTeam } from '@/api/project/projectTeam';
|
||||||
|
// import { listProject, listProjectGo } from '@/api/project/project';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
components: {
|
||||||
|
apiV1SystemBusSalaryDetailsDetail
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const stores = useUserStoreHook();
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const loading = ref(false);
|
||||||
|
const queryRef = ref();
|
||||||
|
const detailRef = ref();
|
||||||
|
// 是否显示所有搜索选项
|
||||||
|
const showAll = ref(false);
|
||||||
|
// 非单个禁用
|
||||||
|
const single = ref(true);
|
||||||
|
// 非多个禁用
|
||||||
|
const multiple = ref(true);
|
||||||
|
const word = computed(() => {
|
||||||
|
if (showAll.value === false) {
|
||||||
|
//对文字进行处理
|
||||||
|
return '展开搜索';
|
||||||
|
} else {
|
||||||
|
return '收起搜索';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 字典选项数据
|
||||||
|
const {} = proxy.useDict();
|
||||||
|
const state = reactive<BusSalaryDetailsTableDataState>({
|
||||||
|
ids: [],
|
||||||
|
projectList: [], //项目列表
|
||||||
|
projectListMap: new Map(),
|
||||||
|
TeamList: [], //班组列表
|
||||||
|
TeamListMap: new Map(), //班组列表
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
param: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sfzNumber: undefined,
|
||||||
|
projectId: stores.selectedProject.goId,
|
||||||
|
teamId: undefined,
|
||||||
|
dateRange: [],
|
||||||
|
dateOfIssue: proxy.parseTime(new Date(), '{y}-{m}') //默认当前工作年月
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 页面加载时
|
||||||
|
onMounted(() => {
|
||||||
|
initTableData();
|
||||||
|
sysProjectList();
|
||||||
|
document.querySelector('#file').addEventListener('change', function () {
|
||||||
|
//获取到选中的文件
|
||||||
|
var file = document.querySelector('#file').files[0];
|
||||||
|
onChange(file);
|
||||||
|
});
|
||||||
|
sysListSysProjectTeam(state.tableData.param.projectId); //默认项目
|
||||||
|
});
|
||||||
|
const onChangeProject = (val) => {
|
||||||
|
sysListSysProjectTeam(val);
|
||||||
|
// 切换项目后 班组默认未空
|
||||||
|
state.tableData.param.teamId = '';
|
||||||
|
// 获取数据
|
||||||
|
busSalaryDetailsList();
|
||||||
|
};
|
||||||
|
// 班组切换
|
||||||
|
const onChangeTeam = (val) => {
|
||||||
|
busSalaryDetailsList();
|
||||||
|
};
|
||||||
|
const onChangeOfIssue = () => {
|
||||||
|
busSalaryDetailsList();
|
||||||
|
};
|
||||||
|
// 获取项目列表数据
|
||||||
|
const sysProjectList = () => {
|
||||||
|
// listProjectGo({ pageNum: 1, pageSize: 1000 }).then((res: any) => {
|
||||||
|
// let list = res.data.list ?? [];
|
||||||
|
// if (list.length) {
|
||||||
|
// state.projectList = list;
|
||||||
|
// list.forEach((item) => {
|
||||||
|
// state.projectListMap.set(item.id, item.shortName);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
// 获取班组列表
|
||||||
|
const sysListSysProjectTeam = (projectId) => {
|
||||||
|
// listProjectTeam({ pageNum: 1, pageSize: 1000, projectId }).then((res: any) => {
|
||||||
|
// let list = res.data.list ?? [];
|
||||||
|
// if (list.length) {
|
||||||
|
// state.TeamList = list;
|
||||||
|
// list.forEach((item) => {
|
||||||
|
// state.TeamListMap.set(item.id, item.name);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
const onChange = async (file) => {
|
||||||
|
/**
|
||||||
|
* 1. 使用原生api去读取好的文件
|
||||||
|
* */
|
||||||
|
// console.log("原始上传的文件", file);
|
||||||
|
// 读取文件不是立马能够读取到的,所以是异步的,使用Promise
|
||||||
|
let dataBinary = await new Promise((resolve) => {
|
||||||
|
// Web API构造函数FileReader,可实例化对象,去调用其身上方法,去读取解析文件信息
|
||||||
|
let reader = new FileReader(); // https://developer.mozilla.org/zh-CN/docs/Web/API/FileReader
|
||||||
|
// console.log("实例化对象有各种方法", reader);
|
||||||
|
reader.readAsBinaryString(file); // 读取raw的File文件
|
||||||
|
reader.onload = (ev) => {
|
||||||
|
// console.log("文件解析流程进度事件", ev);
|
||||||
|
resolve(ev.target.result); // 将解析好的结果扔出去,以供使用
|
||||||
|
};
|
||||||
|
});
|
||||||
|
// console.log("读取出的流文件", dataBinary);
|
||||||
|
/**
|
||||||
|
* 2. 使用xlsx插件去解析已经读取好的二进制excel流文件
|
||||||
|
* */
|
||||||
|
let workBook = xlsx.read(dataBinary, { type: 'binary', cellDates: true });
|
||||||
|
// excel中有很多的sheet,这里取了第一个sheet:workBook.SheetNames[0]
|
||||||
|
let arr = [];
|
||||||
|
workBook.SheetNames.forEach((item) => {
|
||||||
|
let firstWorkSheet = workBook.Sheets[item];
|
||||||
|
const data = xlsx.utils.sheet_to_json(firstWorkSheet);
|
||||||
|
arr.push(data);
|
||||||
|
});
|
||||||
|
let dataList = []; //需提交数据
|
||||||
|
arr.forEach((item, i) => {
|
||||||
|
//截取数据
|
||||||
|
// 获取制表人
|
||||||
|
let detailObj = {};
|
||||||
|
let lister = ''; //制表人 单独读取
|
||||||
|
let listerObj = item[item.length - 3];
|
||||||
|
let year = 0; //年
|
||||||
|
let month = 0; //月
|
||||||
|
for (let key in listerObj) {
|
||||||
|
if (key.indexOf('建筑施工') != -1) {
|
||||||
|
//是否包含
|
||||||
|
lister = listerObj[key].substring(4).trim();
|
||||||
|
// 获取年月
|
||||||
|
let index = key.indexOf('年');
|
||||||
|
let index1 = key.indexOf('(');
|
||||||
|
month = parseInt(key.substring(index + 1, index + 10));
|
||||||
|
year = parseInt(key.substring(index1 + 1, index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取人员信息
|
||||||
|
let arr1 = item.slice(2, -3);
|
||||||
|
month = month < 10 ? '0' + month : month;
|
||||||
|
if (arr1.length) {
|
||||||
|
arr1.forEach((item) => {
|
||||||
|
let dates = []; //用户信息
|
||||||
|
let name = item.__EMPTY; //用户名
|
||||||
|
let sfzNumber = item.__EMPTY_1; //身份证
|
||||||
|
let sumDuration = 0; //工作总时长
|
||||||
|
let dateOfIssue = year + '-' + month; //发放年月
|
||||||
|
let days = new Date(year, month, 0).getDate();
|
||||||
|
for (let key in item) {
|
||||||
|
let ind = key.split('_')[3];
|
||||||
|
if (ind > 1 && ind <= days + 1) {
|
||||||
|
//后面数据
|
||||||
|
let working_date = ind - 1 < 10 ? '0' + (ind - 1) : ind - 1;
|
||||||
|
let obj = { working_date: working_date.toString(), duration: item[key] };
|
||||||
|
dates.push(obj);
|
||||||
|
sumDuration += item[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
detailObj = {
|
||||||
|
//用户
|
||||||
|
lister,
|
||||||
|
dates,
|
||||||
|
name,
|
||||||
|
sfzNumber,
|
||||||
|
dateOfIssue,
|
||||||
|
sumDuration
|
||||||
|
};
|
||||||
|
dataList.push(detailObj);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '正在上传中……',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
});
|
||||||
|
if (dataList.length) {
|
||||||
|
// addBusSalaryDetails({ dataList }).then((res: any) => {
|
||||||
|
// loading.close();
|
||||||
|
// if (res.code == 0) {
|
||||||
|
// ElMessage.success('上传成功');
|
||||||
|
// busSalaryDetailsList();
|
||||||
|
// } else {
|
||||||
|
// ElMessage.error(res.message);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
} else {
|
||||||
|
ElMessage.warning('表格数据为空');
|
||||||
|
}
|
||||||
|
event.target.value = '';
|
||||||
|
};
|
||||||
|
// 初始化表格数据
|
||||||
|
const initTableData = () => {
|
||||||
|
busSalaryDetailsList();
|
||||||
|
};
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
busSalaryDetailsList();
|
||||||
|
};
|
||||||
|
// 获取列表数据
|
||||||
|
const busSalaryDetailsList = () => {
|
||||||
|
loading.value = true;
|
||||||
|
// listBusSalaryDetails(state.tableData.param).then((res: any) => {
|
||||||
|
// let list = res.data.list ?? [];
|
||||||
|
// state.tableData.data = list;
|
||||||
|
// state.tableData.total = res.data.total;
|
||||||
|
// loading.value = false;
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
const toggleSearch = () => {
|
||||||
|
showAll.value = !showAll.value;
|
||||||
|
};
|
||||||
|
const handleDelete = (row: BusSalaryDetailsTableColumns) => {
|
||||||
|
let msg = '你确定要删除所选数据?';
|
||||||
|
let id: number[] = [];
|
||||||
|
if (row) {
|
||||||
|
msg = `此操作将永久删除数据,是否继续?`;
|
||||||
|
id = [row.id];
|
||||||
|
} else {
|
||||||
|
id = state.ids;
|
||||||
|
}
|
||||||
|
if (id.length === 0) {
|
||||||
|
ElMessage.error('请选择要删除的数据。');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(msg, '提示', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
// delBusSalaryDetails(id).then(() => {
|
||||||
|
// ElMessage.success('删除成功');
|
||||||
|
// busSalaryDetailsList();
|
||||||
|
// });
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
const handleView = (row: BusSalaryDetailsTableColumns) => {
|
||||||
|
detailRef.value.openDialog(toRaw(row));
|
||||||
|
};
|
||||||
|
const exportSalary = (row) => {
|
||||||
|
// 导出工资表
|
||||||
|
let obj = {};
|
||||||
|
let fileName = '';
|
||||||
|
let year = '';
|
||||||
|
let month = '';
|
||||||
|
let porjectName = '';
|
||||||
|
if (row) {
|
||||||
|
//个人
|
||||||
|
obj = {
|
||||||
|
project: state.tableData.param.projectId, //项目id
|
||||||
|
dateOfIssue: row.dateOfIssue, //工作年月
|
||||||
|
team: '', //班组id
|
||||||
|
sfzNumber: row.sfzNumber //施工人员身份证
|
||||||
|
};
|
||||||
|
year = obj.dateOfIssue.split('-')[0];
|
||||||
|
month = obj.dateOfIssue.split('-')[1];
|
||||||
|
fileName = row.name + '-' + year + '年' + month + '月工资表.xlsx';
|
||||||
|
} else {
|
||||||
|
// 导出工资表
|
||||||
|
obj = {
|
||||||
|
project: state.tableData.param.projectId,
|
||||||
|
dateOfIssue: state.tableData.param.dateOfIssue,
|
||||||
|
team: state.tableData.param.teamId,
|
||||||
|
sfzNumber: '' //施工人员身份证
|
||||||
|
};
|
||||||
|
porjectName = state.projectListMap.get(state.tableData.param.projectId);
|
||||||
|
year = obj.dateOfIssue.split('-')[0];
|
||||||
|
month = obj.dateOfIssue.split('-')[1];
|
||||||
|
if (state.tableData.param.teamId) {
|
||||||
|
let TeamName = state.TeamListMap.get(state.tableData.param.teamId);
|
||||||
|
fileName = porjectName + '-' + TeamName + '-' + year + '年' + month + '月员工工资表.xlsx';
|
||||||
|
} else {
|
||||||
|
fileName = porjectName + '-' + year + '年' + month + '月员工工资表.xlsx';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let time = year + '年' + month + '月';
|
||||||
|
getSalarySheet(obj, fileName, time);
|
||||||
|
};
|
||||||
|
const getSalarySheet = (obj, fileName, time) => {
|
||||||
|
salarySheet(obj).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
// 先根据
|
||||||
|
let array = setTeamList(res.data.list);
|
||||||
|
// 设置项目名称及班组
|
||||||
|
let excelList = [];
|
||||||
|
array.forEach((item) => {
|
||||||
|
let obj = item[0];
|
||||||
|
let excelName = obj.teamName; //班组
|
||||||
|
if (!obj.teamName) {
|
||||||
|
excelName = '暂未分组人员';
|
||||||
|
}
|
||||||
|
let config = exportConfig(item, excelName, time);
|
||||||
|
excelList.push(config);
|
||||||
|
});
|
||||||
|
exportDataToExcel(excelList, fileName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 把施工人员分组
|
||||||
|
const setTeamList = (list) => {
|
||||||
|
let team = new Map();
|
||||||
|
list.forEach((item) => {
|
||||||
|
// 判断班组id是否存在
|
||||||
|
if (!item.teamName) {
|
||||||
|
item.teamName = '暂无班组';
|
||||||
|
}
|
||||||
|
if (team.has(item.teamName)) {
|
||||||
|
let arr = team.get(item.teamName);
|
||||||
|
arr.push(item);
|
||||||
|
team.set(item.teamName, arr);
|
||||||
|
} else {
|
||||||
|
team.set(item.teamName, [item]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Array.from(team.values());
|
||||||
|
};
|
||||||
|
// excel表格样式设置
|
||||||
|
const exportConfig = (arr, sheetName, time) => {
|
||||||
|
let header = ['建筑施工企业现场人员工资表(' + time + ')'];
|
||||||
|
const header1 = [];
|
||||||
|
let obj = arr[0];
|
||||||
|
let projectName = '项目部名称:' + obj.projectName;
|
||||||
|
let teamName = '班组类别:' + obj.teamName;
|
||||||
|
const header2 = [projectName + ' ' + teamName];
|
||||||
|
const header3 = ['序号', '账号', '户名', '金额', '开户行', '签字'];
|
||||||
|
let columnsWidth = [8, 24, 12, 10, 35, 10]; //表格宽度
|
||||||
|
let fields = ['index', 'yhkNumber', 'userName', 'money', 'bankingHouse', ''];
|
||||||
|
arr.map((item, index) => {
|
||||||
|
item.index = index + 1;
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
// 单元格合并
|
||||||
|
const merges = [
|
||||||
|
{ row: 0, col: 0, rowspan: 1, colspan: 6 },
|
||||||
|
{ row: 2, col: 0, rowspan: 1, colspan: 6 },
|
||||||
|
{ row: arr.length + 5, col: 0, rowspan: 1, colspan: 3 },
|
||||||
|
{ row: arr.length + 5, col: 3, rowspan: 1, colspan: 3 }
|
||||||
|
];
|
||||||
|
arr.push({});
|
||||||
|
arr.push({
|
||||||
|
index: '班组长:',
|
||||||
|
money: '劳资员:'
|
||||||
|
});
|
||||||
|
const config = {
|
||||||
|
data: arr,
|
||||||
|
fields,
|
||||||
|
headers: [header, header1, header2, header3],
|
||||||
|
merges,
|
||||||
|
attrs: [],
|
||||||
|
view: [],
|
||||||
|
columnsWidth,
|
||||||
|
sheetName
|
||||||
|
};
|
||||||
|
// 设置表头字体加粗
|
||||||
|
config.attrs.push({
|
||||||
|
rowStart: 0,
|
||||||
|
rowEnd: 0,
|
||||||
|
colStart: 0,
|
||||||
|
colEnd: config.fields.length - 1,
|
||||||
|
attr: {
|
||||||
|
alignment: { vertical: 'middle', horizontal: 'center' },
|
||||||
|
font: {
|
||||||
|
bold: true,
|
||||||
|
size: '16'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
config.attrs.push({
|
||||||
|
rowStart: 2,
|
||||||
|
rowEnd: 2,
|
||||||
|
colStart: 0,
|
||||||
|
colEnd: config.fields.length - 1,
|
||||||
|
attr: {
|
||||||
|
alignment: { vertical: 'middle', horizontal: 'center' }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 设置全表单元格边框,居中布局
|
||||||
|
config.attrs.push({
|
||||||
|
rowStart: 3,
|
||||||
|
rowEnd: config.data.length + 1,
|
||||||
|
colStart: 0,
|
||||||
|
colEnd: config.fields.length - 1,
|
||||||
|
attr: {
|
||||||
|
alignment: { vertical: 'middle', horizontal: 'center' },
|
||||||
|
border: {
|
||||||
|
top: { style: 'thin' },
|
||||||
|
left: { style: 'thin' },
|
||||||
|
bottom: { style: 'thin' },
|
||||||
|
right: { style: 'thin' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
// 多选框选中数据
|
||||||
|
const handleSelectionChange = (selection) => {
|
||||||
|
state.ids = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
detailRef,
|
||||||
|
showAll,
|
||||||
|
loading,
|
||||||
|
single,
|
||||||
|
onChangeProject,
|
||||||
|
onChangeTeam,
|
||||||
|
multiple,
|
||||||
|
handleSelectionChange,
|
||||||
|
word,
|
||||||
|
onChangeOfIssue,
|
||||||
|
queryRef,
|
||||||
|
resetQuery,
|
||||||
|
busSalaryDetailsList,
|
||||||
|
exportSalary,
|
||||||
|
toggleSearch,
|
||||||
|
handleDelete,
|
||||||
|
handleView,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.colBlock {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.colNone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.system-busSalaryDetails-container {
|
||||||
|
input[type='file'] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #007bff; /*设置背景色*/
|
||||||
|
color: #fff; /*设置字体颜色*/
|
||||||
|
padding: 3px 10px; /*设置内边距*/
|
||||||
|
border-radius: 5px; /*设置圆角*/
|
||||||
|
cursor: pointer; /*将鼠标光标设置为手型*/
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -430,7 +430,14 @@
|
|||||||
<el-timeline-item color="rgb(255, 73, 73)">
|
<el-timeline-item color="rgb(255, 73, 73)">
|
||||||
<div class="mb">{{ '退场时间:' + item.entryDate }}</div>
|
<div class="mb">{{ '退场时间:' + item.entryDate }}</div>
|
||||||
<div class="pl-xl">
|
<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 />
|
><br />
|
||||||
<p class="mt text-coolgray">
|
<p class="mt text-coolgray">
|
||||||
备注:<span class="text-blue">{{ item.remark }}</span>
|
备注:<span class="text-blue">{{ item.remark }}</span>
|
||||||
@ -1060,7 +1067,7 @@ const submitForm = () => {
|
|||||||
const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||||
await addConstructionBlacklist({
|
await addConstructionBlacklist({
|
||||||
userId: row.id,
|
userId: row.sysUserId,
|
||||||
projectId: currentProject.value?.id
|
projectId: currentProject.value?.id
|
||||||
});
|
});
|
||||||
proxy?.$modal.msgSuccess('加入成功');
|
proxy?.$modal.msgSuccess('加入成功');
|
||||||
|
|||||||
@ -2,15 +2,16 @@
|
|||||||
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
<!-- <el-card v-loading="loading" body-class="printMe"> -->
|
||||||
<div class="w75% m-a">
|
<div class="w75% m-a">
|
||||||
<div id="printMe" class="pos-relative">
|
<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>
|
<h2 style="text-align: center; margin-top: 5px; font-weight: bold">整改通知单</h2>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" style="text-align: left">填报人:{{ safetyInspectionDetail?.createBy }}</el-col>
|
<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-col :span="12" style="text-align: right">填报时间:{{ safetyInspectionDetail?.createTime }}</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-descriptions :column="2" border style="margin-top: 8px" label-width="160px" size="large">
|
<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"
|
<el-descriptions-item label-align="center" label="检查项目" :span="2" class-name="zebra">{{
|
||||||
>{{ safetyInspectionDetail?.projectName }}
|
safetyInspectionDetail?.projectName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="巡检标题" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="巡检标题" :span="2" label-class-name="white">
|
||||||
{{ safetyInspectionDetail?.inspectionHeadline }}
|
{{ safetyInspectionDetail?.inspectionHeadline }}
|
||||||
@ -24,22 +25,22 @@
|
|||||||
<el-descriptions-item label-align="center" label="巡检类型" label-class-name="white">
|
<el-descriptions-item label-align="center" label="巡检类型" label-class-name="white">
|
||||||
<dict-tag :options="quality_inspection_check_type" :value="safetyInspectionDetail?.inspectionType" />
|
<dict-tag :options="quality_inspection_check_type" :value="safetyInspectionDetail?.inspectionType" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="填报人" label-class-name="white"
|
<el-descriptions-item label-align="center" label="填报人" label-class-name="white">{{
|
||||||
>{{ safetyInspectionDetail?.createBy }}
|
safetyInspectionDetail?.createBy }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="填报日期" class-name="zebra"
|
<el-descriptions-item label-align="center" label="填报日期" class-name="zebra">{{ safetyInspectionDetail?.createTime
|
||||||
>{{ safetyInspectionDetail?.createTime }}
|
}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="要求回复期限" class-name="zebra"
|
<el-descriptions-item label-align="center" label="要求回复期限" class-name="zebra">{{
|
||||||
>{{ parseTime(safetyInspectionDetail?.replyPeriodDate, '{y}-{m}-{d}') }}
|
parseTime(safetyInspectionDetail?.replyPeriodDate, '{y}-{m}-{d}') }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-descriptions border direction="vertical" size="large">
|
<el-descriptions border direction="vertical" size="large">
|
||||||
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
<el-descriptions-item label-align="center" label="巡检结果" class-name="none"></el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||||
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white"
|
<el-descriptions-item label-align="center" label="内容" :span="2" label-class-name="white">{{
|
||||||
>{{ safetyInspectionDetail?.inspectionResult }}
|
safetyInspectionDetail?.inspectionResult }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="检查附件" :span="2" label-class-name="white">
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
@ -56,7 +57,8 @@
|
|||||||
</el-space>
|
</el-space>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="检查状态" :span="2" label-class-name="white">
|
<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-step v-for="item in quality_inspection_status_type" :key="item.value" :title="item.label" />
|
||||||
</el-steps>
|
</el-steps>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@ -66,11 +68,11 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||||
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="整改措施及完成情况" :span="2" label-class-name="white">
|
||||||
{{ safetyInspectionDetail?.verificationResult }}
|
{{ safetyInspectionDetail?.rectificationResult }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
<el-descriptions-item label-align="center" label="整改附件" :span="2" label-class-name="white">
|
||||||
<el-space wrap>
|
<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)">
|
<span v-if="['.png', '.jpg', '.jpeg'].includes(item.fileSuffix)">
|
||||||
<image-preview :src="item.url" width="200px" />
|
<image-preview :src="item.url" width="200px" />
|
||||||
</span>
|
</span>
|
||||||
@ -87,8 +89,8 @@
|
|||||||
<el-descriptions-item label-align="center" label="验证" class-name="none"></el-descriptions-item>
|
<el-descriptions-item label-align="center" label="验证" class-name="none"></el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-descriptions :column="2" border label-width="160px" size="large">
|
<el-descriptions :column="2" border label-width="160px" size="large">
|
||||||
<el-descriptions-item label-align="center" label="验证结果" label-class-name="white"
|
<el-descriptions-item label-align="center" label="验证结果" label-class-name="white">{{
|
||||||
>{{ safetyInspectionDetail?.verificationResult }}
|
safetyInspectionDetail?.verificationResult }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
@ -140,14 +142,14 @@ const get = async () => {
|
|||||||
if (res.data && res.code === 200) {
|
if (res.data && res.code === 200) {
|
||||||
safetyInspectionDetail.value = res.data;
|
safetyInspectionDetail.value = res.data;
|
||||||
|
|
||||||
if (res.data.rectificationFileList) {
|
if (res.data.inspectionFile) {
|
||||||
const checkFileRes = await listByIds(res.data.inspectionFile.split(','));
|
const checkFileRes = await listByIds(res.data.inspectionFile.split(','));
|
||||||
checkFileList.value = checkFileRes.data;
|
checkFileList.value = checkFileRes.data;
|
||||||
}
|
}
|
||||||
if (res.data.rectificationFile) {
|
// if (res.data.rectificationImgFile) {
|
||||||
const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
|
// const rectificationFileRes = await listByIds(res.data.rectificationFile.split(','));
|
||||||
rectificationFileList.value = rectificationFileRes.data;
|
// rectificationFileList.value = rectificationFileRes.data;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -223,6 +225,7 @@ watch(
|
|||||||
z-index: 10;
|
z-index: 10;
|
||||||
width: 105px;
|
width: 105px;
|
||||||
height: 105px;
|
height: 105px;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 105px;
|
width: 105px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<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]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="巡检类型" prop="inspectionType">
|
<el-form-item label="巡检类型" prop="inspectionType">
|
||||||
<el-select v-model="queryParams.inspectionType" placeholder="全部" clearable>
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工单状态" prop="inspectionStatus">
|
<el-form-item label="工单状态" prop="inspectionStatus">
|
||||||
<el-select v-model="queryParams.inspectionStatus" placeholder="全部" clearable>
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -27,7 +30,8 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['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>
|
||||||
<!-- <el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityInspection:edit']"
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['quality:qualityInspection:edit']"
|
||||||
@ -35,18 +39,12 @@
|
|||||||
>
|
>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||||
type="danger"
|
v-hasPermi="['quality:qualityInspection:remove']">删除</el-button>
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete()"
|
|
||||||
v-hasPermi="['quality:qualityInspection:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<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>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -87,7 +85,7 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" /> -->
|
<!-- <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">
|
<template #default="scope">
|
||||||
<!-- <el-tooltip content="验证" placement="top">
|
<!-- <el-tooltip content="验证" placement="top">
|
||||||
<el-button
|
<el-button
|
||||||
@ -98,17 +96,29 @@
|
|||||||
v-hasPermi="['quality:qualityInspection:edit']"
|
v-hasPermi="['quality:qualityInspection:edit']"
|
||||||
></el-button>
|
></el-button>
|
||||||
</el-tooltip> -->
|
</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>
|
||||||
<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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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-card>
|
||||||
<!-- 添加或修改质量-检查工单对话框 -->
|
<!-- 添加或修改质量-检查工单对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="700px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="700px" append-to-body>
|
||||||
@ -121,23 +131,20 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="巡检类型" prop="inspectionType">
|
<el-form-item label="巡检类型" prop="inspectionType">
|
||||||
<el-select v-model="form.inspectionType" placeholder="请选择巡检类型">
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="整改单位" prop="rectificationUnit">
|
<el-form-item label="整改单位" prop="rectificationUnit">
|
||||||
<el-select v-model="form.rectificationUnit" placeholder="请选择整改单位">
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所在班组" prop="teamId">
|
<el-form-item label="所在班组" prop="teamId">
|
||||||
<el-select v-model="form.teamId" placeholder="请选择所在班组">
|
<el-select v-model="form.teamId" placeholder="请选择所在班组">
|
||||||
<el-option
|
<el-option v-for="dict in teamOpt" :key="dict.value" :label="dict.label" :value="dict.value"
|
||||||
v-for="dict in teamOpt"
|
@click="changeForeman(dict.value)"></el-option>
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
@click="changeForeman(dict.value)"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="整改人" prop="corrector">
|
<el-form-item label="整改人" prop="corrector">
|
||||||
@ -167,7 +174,30 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="质量工单详情" v-model="dialog.details" width="60vw">
|
<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>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -175,6 +205,7 @@
|
|||||||
<script setup name="QualityInspection" lang="ts">
|
<script setup name="QualityInspection" lang="ts">
|
||||||
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
import { listProjectTeamForeman } from '@/api/project/projectTeam';
|
||||||
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types';
|
||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
listQualityInspection,
|
listQualityInspection,
|
||||||
@ -187,8 +218,8 @@ import { QualityInspectionVO, QualityInspectionQuery, QualityInspectionForm } fr
|
|||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
|
import QualityInspectionDetail from './component/qualityInspectionDetail.vue';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { quality_inspection_check_type, quality_inspection_status_type, rectification_unit_type } = toRefs<any>(
|
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')
|
proxy?.useDict('quality_inspection_check_type', 'quality_inspection_status_type', 'rectification_unit_type', 'review_type')
|
||||||
);
|
);
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
@ -202,6 +233,7 @@ const ids = ref<Array<string | number>>([]);
|
|||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
const handleForm = ref({})
|
||||||
const isReply_type = ref([
|
const isReply_type = ref([
|
||||||
{
|
{
|
||||||
label: '是',
|
label: '是',
|
||||||
@ -215,12 +247,13 @@ const isReply_type = ref([
|
|||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const qualityInspectionFormRef = ref<ElFormInstance>();
|
const qualityInspectionFormRef = ref<ElFormInstance>();
|
||||||
|
const handleDialogVisible = ref(false)
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
details: false,
|
details: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
const handleType = ref("")
|
||||||
|
|
||||||
const initFormData: QualityInspectionForm = {
|
const initFormData: QualityInspectionForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@ -285,7 +318,39 @@ const getList = async () => {
|
|||||||
}));
|
}));
|
||||||
loading.value = false;
|
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 changeForeman = (value: string) => {
|
||||||
const team = teamList.value.filter((team) => team.id === value)[0];
|
const team = teamList.value.filter((team) => team.id === value)[0];
|
||||||
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({
|
||||||
|
|||||||
@ -104,8 +104,8 @@
|
|||||||
v-hasPermi="['safety:safetyInspection:query']">
|
v-hasPermi="['safety:safetyInspection:query']">
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="success" v-if="scope.row.status === '1'" icon="Pointer"
|
<el-button link type="success" v-if="scope.row.status === '1' || scope.row.reviewType === '2'"
|
||||||
@click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:rectification']">
|
icon="Pointer" @click="handleDialog(scope.row)" v-hasPermi="['safety:safetyInspection:rectification']">
|
||||||
整改
|
整改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="warning" icon="SuccessFilled" v-if="scope.row.status === '2'"
|
<el-button link type="warning" icon="SuccessFilled" v-if="scope.row.status === '2'"
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<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]">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
<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>
|
||||||
<el-form-item label="录入人" prop="creatorName">
|
<el-form-item label="录入人" prop="creatorName">
|
||||||
<el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" />
|
<el-input clearable v-model="queryParams.creatorName" placeholder="请输入录入人" />
|
||||||
@ -23,15 +25,18 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['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>
|
||||||
<el-col :span="1.5">
|
<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-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<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>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -56,23 +61,27 @@
|
|||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-space>
|
<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>
|
||||||
<!-- <el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyLog:edit']"> 修改 </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>
|
</el-space>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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-card>
|
||||||
<!-- 添加或修改安全日志对话框 -->
|
<!-- 添加或修改安全日志对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="950px" append-to-body>
|
<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 ref="safetyLogFormRef" :model="form" :rules="rules" label-width="250px">
|
||||||
<el-form-item label="发生日期" prop="dateOfOccurrence">
|
<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-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="最高气温" prop="airTemperatureMax">
|
<el-form-item label="最高气温" prop="airTemperatureMax">
|
||||||
@ -83,7 +92,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="气候" prop="weather">
|
<el-form-item label="气候" prop="weather">
|
||||||
<el-select v-model="form.weather" placeholder="请选择气候">
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工程施工部位及施工进展情况" prop="progress">
|
<el-form-item label="工程施工部位及施工进展情况" prop="progress">
|
||||||
@ -204,6 +214,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
|
|||||||
otherCondition: undefined,
|
otherCondition: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
creatorName: undefined,
|
creatorName: undefined,
|
||||||
|
|
||||||
params: {}
|
params: {}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|||||||
@ -94,7 +94,7 @@
|
|||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['safety:violationRecord:remove']"></el-button>
|
v-hasPermi="['safety:violationRecord:remove']"></el-button>
|
||||||
</el-tooltip>
|
</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)"
|
<el-button link type="success" icon="Pointer" @click="handleDialog(scope.row)"
|
||||||
v-hasPermi="['safety:violationRecord:rectification']">整改</el-button>
|
v-hasPermi="['safety:violationRecord:rectification']">整改</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|||||||
Reference in New Issue
Block a user