forked from integrated_whb/integrated_whb_vue
init
parent
2fe776a3f6
commit
6216d08511
|
@ -378,6 +378,38 @@ export default [
|
|||
path: "",
|
||||
component: "hazard_investigation/inspection_record/index",
|
||||
},
|
||||
{
|
||||
path: "/hazard_investigation/inspection_record/supplementary_recording",
|
||||
meta: {
|
||||
title: "补录",
|
||||
activeMenu: "/hazard_investigation/inspection_record",
|
||||
},
|
||||
component:
|
||||
"hazard_investigation/inspection_record/supplementary_recording",
|
||||
},
|
||||
{
|
||||
path: "/hazard_investigation/inspection_record/view",
|
||||
meta: {
|
||||
title: "检查记录",
|
||||
activeMenu: "/hazard_investigation/inspection_record",
|
||||
},
|
||||
component: "children",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
component: "hazard_investigation/inspection_record/view",
|
||||
},
|
||||
{
|
||||
path: "/hazard_investigation/inspection_record/view/hidden_danger",
|
||||
meta: {
|
||||
title: "隐患信息",
|
||||
activeMenu: "/hazard_investigation/inspection_record",
|
||||
},
|
||||
component:
|
||||
"hazard_investigation/inspection_record/hidden_danger",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -3,9 +3,10 @@ import { getDataType } from "@/assets/js/utils.js";
|
|||
|
||||
/**
|
||||
* @param api {Function} 接口函数
|
||||
* @param options {Object?: {callbackFn, otherParams, immediate, usePagination, key}} 配置项
|
||||
* @param options {Object?: {callbackFn, otherParams, defaultSearchForm, immediate, usePagination, key}} 配置项
|
||||
* @param options.callbackFn {Function?} 回调函数(返回值【第一个参数表格数据,第二个参数后台返回的所有数据】)
|
||||
* @param options.otherParams {Object?} 其它接口参数
|
||||
* @param options.defaultSearchForm {Object?} searchForm默认值
|
||||
* @param options.immediate {Boolean?} 是否立即执行接口函数(默认是)
|
||||
* @param options.usePagination {Boolean?} 是否使用分页(默认是)
|
||||
* @param options.key {String?} 返回的存放数组的key(默认varList)
|
||||
|
@ -22,26 +23,30 @@ export default function useListData(api, options = {}) {
|
|||
throw new Error("options.usePagination必须是一个布尔值");
|
||||
if (options.key && getDataType(options.key) !== "String")
|
||||
throw new Error("options.key必须是一个字符串");
|
||||
if (options.callbackFn && getDataType(options.callbackFn) !== "Function")
|
||||
throw new Error("options.callbackFn必须是一个函数");
|
||||
if (
|
||||
options.defaultSearchForm &&
|
||||
getDataType(options.defaultSearchForm) !== "Object"
|
||||
)
|
||||
throw new Error("options.defaultSearchForm必须是一个对象");
|
||||
const immediate = options.immediate ?? true;
|
||||
const usePagination = options.usePagination ?? true;
|
||||
const key = options.key ?? "varList";
|
||||
if (!immediate && options.otherParams)
|
||||
throw new Error("options.otherParams只有在immediate为true时才有效");
|
||||
const defaultSearchForm = options.defaultSearchForm ?? {};
|
||||
if (
|
||||
immediate &&
|
||||
options.otherParams &&
|
||||
getDataType(options.otherParams) !== "Object"
|
||||
)
|
||||
throw new Error("options.otherParams必须是一个对象");
|
||||
if (options.callbackFn && getDataType(options.callbackFn) !== "Function")
|
||||
throw new Error("options.callbackFn必须是一个函数");
|
||||
const list = ref([]);
|
||||
const pagination = ref({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
const searchForm = ref({});
|
||||
const searchForm = ref(defaultSearchForm);
|
||||
const tableRef = ref(null);
|
||||
const fnGetData = async (otherParams = {}) => {
|
||||
const resData = await api({
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
v-viewer
|
||||
v-for="item in data.hImgs"
|
||||
:key="item.IMGFILES_ID"
|
||||
:src="FILE_URL + item.FILEPATH"
|
||||
:src="VITE_FILE_URL + item.FILEPATH"
|
||||
alt=""
|
||||
width="100"
|
||||
height="100"
|
||||
|
@ -107,7 +107,7 @@
|
|||
v-viewer
|
||||
v-for="item in data.rImgs"
|
||||
:key="item.IMGFILES_ID"
|
||||
:src="FILE_URL + item.FILEPATH"
|
||||
:src="VITE_FILE_URL + item.FILEPATH"
|
||||
alt=""
|
||||
width="100"
|
||||
height="100"
|
||||
|
@ -126,7 +126,7 @@
|
|||
v-viewer
|
||||
v-for="item in data.pImgs"
|
||||
:key="item.IMGFILES_ID"
|
||||
:src="FILE_URL + item.FILEPATH"
|
||||
:src="VITE_FILE_URL + item.FILEPATH"
|
||||
alt=""
|
||||
width="100"
|
||||
height="100"
|
||||
|
@ -176,7 +176,7 @@
|
|||
v-viewer
|
||||
v-for="item in data.sImgs"
|
||||
:key="item.IMGFILES_ID"
|
||||
:src="FILE_URL + item.FILEPATH"
|
||||
:src="VITE_FILE_URL + item.FILEPATH"
|
||||
alt=""
|
||||
width="100"
|
||||
height="100"
|
||||
|
@ -211,7 +211,7 @@
|
|||
v-viewer
|
||||
v-for="item1 in item.cImgs"
|
||||
:key="item1.IMGFILES_ID"
|
||||
:src="FILE_URL + item1.FILEPATH"
|
||||
:src="VITE_FILE_URL + item1.FILEPATH"
|
||||
alt=""
|
||||
width="100"
|
||||
height="100"
|
||||
|
@ -226,15 +226,19 @@
|
|||
|
||||
<script setup>
|
||||
import { reactive } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { getFileSuffix } from "@/assets/js/utils";
|
||||
import { getFileSuffix } from "@/assets/js/utils.js";
|
||||
import { VideoPlay } from "@element-plus/icons-vue";
|
||||
import LayoutVideo from "@/components/video/index";
|
||||
import LayoutVideo from "@/components/video/index.vue";
|
||||
import { getHiddenDangerView } from "@/request/hazard_investigation.js";
|
||||
|
||||
const FILE_URL = import.meta.env.VITE_FILE_URL;
|
||||
const route = useRoute();
|
||||
const { HIDDEN_ID } = route.query;
|
||||
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
|
||||
const props = defineProps({
|
||||
hiddenId: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const data = reactive({
|
||||
info: {},
|
||||
hs: {},
|
||||
|
@ -248,14 +252,14 @@ const data = reactive({
|
|||
});
|
||||
const fnGetData = async () => {
|
||||
const resData = await getHiddenDangerView({
|
||||
HIDDEN_ID,
|
||||
HIDDEN_ID: props.hiddenId,
|
||||
});
|
||||
data.info = resData.pd;
|
||||
data.hs = resData.hs;
|
||||
data.checkList = resData.checkList;
|
||||
for (let i = 0; i < resData.hImgs.length; i++) {
|
||||
if (getFileSuffix(resData.hImgs[i].FILEPATH) === "mp4") {
|
||||
data.videoSrc = FILE_URL + resData.hImgs[i].FILEPATH;
|
||||
data.videoSrc = VITE_FILE_URL + resData.hImgs[i].FILEPATH;
|
||||
} else {
|
||||
data.hImgs.push(resData.hImgs[i]);
|
||||
}
|
|
@ -1,11 +1,15 @@
|
|||
<template>
|
||||
<layout-card>
|
||||
<hidden-view />
|
||||
<hidden-view :hidden-id="HIDDEN_ID" />
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import HiddenView from "./hidden_view.vue";
|
||||
import HiddenView from "./components/hidden_view.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
const { HIDDEN_ID } = route.query;
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -115,7 +115,6 @@
|
|||
DATESTART: row.DATESTART,
|
||||
DATEEND: row.DATEEND,
|
||||
LISTMANAGER_ID,
|
||||
type: 'supplementaryRecording',
|
||||
},
|
||||
})
|
||||
"
|
||||
|
@ -156,14 +155,14 @@ const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
|||
});
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({
|
||||
STARTINSPECTTIME: searchForm.value.dates?.[0],
|
||||
ENDINSPECTTIME: searchForm.value.dates?.[1],
|
||||
STARTTIME: searchForm.value.dates?.[0],
|
||||
ENDTIME: searchForm.value.dates?.[1],
|
||||
});
|
||||
};
|
||||
const fnResetPaginationTransfer = () => {
|
||||
fnResetPagination({
|
||||
STARTINSPECTTIME: searchForm.value.dates?.[0],
|
||||
ENDINSPECTTIME: searchForm.value.dates?.[1],
|
||||
STARTTIME: searchForm.value.dates?.[0],
|
||||
ENDTIME: searchForm.value.dates?.[1],
|
||||
});
|
||||
};
|
||||
const buttonJurisdiction = await useButtonJurisdiction("checkrecord");
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
link
|
||||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/checklist_inspection_status/inspection_record/view/hidden_danger',
|
||||
path: hiddenPath[entrance],
|
||||
query: { HIDDEN_ID: row.HIDDEN_ID },
|
||||
})
|
||||
"
|
||||
|
@ -161,7 +161,7 @@
|
|||
link
|
||||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/checklist_inspection_status/inspection_record/view/hidden_danger',
|
||||
path: hiddenPath[entrance],
|
||||
query: { HIDDEN_ID: row.HIDDEN_ID },
|
||||
})
|
||||
"
|
||||
|
@ -213,6 +213,18 @@ import { addingPrefixToFile } from "@/assets/js/utils.js";
|
|||
import Qualified from "./components/qualified.vue";
|
||||
import MapDialog from "./components/map.vue";
|
||||
|
||||
defineProps({
|
||||
entrance: {
|
||||
type: String,
|
||||
default: "checklist_inspection_status",
|
||||
},
|
||||
});
|
||||
const hiddenPath = {
|
||||
checklist_inspection_status:
|
||||
"/hazard_investigation/checklist_inspection_status/inspection_record/view/hidden_danger", // 清单检查情况
|
||||
inspection_record:
|
||||
"/hazard_investigation/inspection_record/view/hidden_danger", // 检查记录管理
|
||||
};
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { CHECKRECORD_ID } = route.query;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<inspection />
|
||||
<inspection entrance="supplementaryRecording" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<layout-card>
|
||||
<hidden-view :hiddenId="HIDDEN_ID" />
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import HiddenView from "../checklist_inspection_status/components/hidden_view.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
const { HIDDEN_ID } = route.query;
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -8,19 +8,28 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查周期" prop="dates">
|
||||
<el-form-item label="清单名称" prop="KEYWORDS">
|
||||
<el-input v-model="searchForm.KEYWORDS" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查时间" prop="dates">
|
||||
<el-date-picker
|
||||
v-model="searchForm.dates"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
range-separator="至"
|
||||
:disabled="searchForm.TYPE === '2'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检查状态" prop="TYPE">
|
||||
<el-select v-model="searchForm.TYPE">
|
||||
<el-select
|
||||
v-model="searchForm.TYPE"
|
||||
@change="searchForm.dates = []"
|
||||
>
|
||||
<el-option label="已检查" value="1" />
|
||||
<el-option label="超期未检查" value="2" />
|
||||
</el-select>
|
||||
|
@ -83,7 +92,7 @@
|
|||
link
|
||||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/checklist_inspection_status/inspection_record/view',
|
||||
path: '/hazard_investigation/inspection_record/view',
|
||||
query: {
|
||||
CHECKRECORD_ID: row.CHECKRECORD_ID,
|
||||
},
|
||||
|
@ -109,13 +118,12 @@
|
|||
link
|
||||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/checklist_inspection_status/inspection_record/supplementary_recording',
|
||||
path: '/hazard_investigation/inspection_record/supplementary_recording',
|
||||
query: {
|
||||
CHECKRECORD_ID: row.CHECKRECORD_ID,
|
||||
DATESTART: row.DATESTART,
|
||||
DATEEND: row.DATEEND,
|
||||
LISTMANAGER_ID,
|
||||
type: 'supplementaryRecording',
|
||||
LISTMANAGER_ID: row.LISTMANAGER_ID,
|
||||
},
|
||||
})
|
||||
"
|
||||
|
@ -151,6 +159,8 @@ const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
|||
useListData(getInspectionRecordList, {
|
||||
otherParams: {
|
||||
USER_ID: userStore.getUserInfo.USER_ID,
|
||||
},
|
||||
defaultSearchForm: {
|
||||
TYPE: "1",
|
||||
},
|
||||
callbackFn: (list, resData) => {
|
||||
|
@ -159,14 +169,14 @@ const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
|||
});
|
||||
const fnGetDataTransfer = () => {
|
||||
fnGetData({
|
||||
STARTINSPECTTIME: searchForm.value.dates?.[0],
|
||||
ENDINSPECTTIME: searchForm.value.dates?.[1],
|
||||
STARTTIME: searchForm.value.dates?.[0],
|
||||
ENDTIME: searchForm.value.dates?.[1],
|
||||
});
|
||||
};
|
||||
const fnResetPaginationTransfer = () => {
|
||||
fnResetPagination({
|
||||
STARTINSPECTTIME: searchForm.value.dates?.[0],
|
||||
ENDINSPECTTIME: searchForm.value.dates?.[1],
|
||||
STARTTIME: searchForm.value.dates?.[0],
|
||||
ENDTIME: searchForm.value.dates?.[1],
|
||||
});
|
||||
};
|
||||
const buttonJurisdiction = await useButtonJurisdiction("checkrecord");
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<template>
|
||||
<inspection entrance="supplementaryRecording" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Inspection from "../inventory_troubleshooting/inspect.vue";
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
|
@ -0,0 +1,9 @@
|
|||
<template>
|
||||
<inspection-record entrance="inspection_record" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import InspectionRecord from "../checklist_inspection_status/inspection_record_view.vue";
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -50,21 +50,21 @@
|
|||
<el-tooltip
|
||||
content="注意:补录时,不允许添加隐患"
|
||||
placement="top"
|
||||
v-if="type === 'supplementaryRecording'"
|
||||
v-if="entrance === 'supplementaryRecording'"
|
||||
>
|
||||
<el-icon><warning-filled /></el-icon>
|
||||
</el-tooltip>
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:label="1"
|
||||
:disabled="type === 'supplementaryRecording'"
|
||||
:disabled="entrance === 'supplementaryRecording'"
|
||||
@click.prevent="fnUnqualified($index, row)"
|
||||
>
|
||||
不合格
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:label="2"
|
||||
:disabled="type === 'supplementaryRecording'"
|
||||
:disabled="entrance === 'supplementaryRecording'"
|
||||
@click.prevent="fnNotInvolved($index, row)"
|
||||
>
|
||||
不涉及
|
||||
|
@ -78,7 +78,7 @@
|
|||
<el-button
|
||||
type="primary"
|
||||
@click="fnAddOrEditOtherHidden({}, 'add')"
|
||||
:disabled="type === 'supplementaryRecording'"
|
||||
:disabled="entrance === 'supplementaryRecording'"
|
||||
>
|
||||
添加
|
||||
</el-button>
|
||||
|
@ -195,7 +195,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="24" v-if="type === 'supplementaryRecording'">
|
||||
<el-col :span="24" v-if="entrance === 'supplementaryRecording'">
|
||||
<el-form-item label="补录原因" prop="REASON">
|
||||
<el-input v-model="data.form.REASON" type="textarea" autosize />
|
||||
</el-form-item>
|
||||
|
@ -265,9 +265,14 @@ import { WarningFilled } from "@element-plus/icons-vue";
|
|||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { LISTMANAGER_ID, type, CHECKRECORD_ID, DATEEND, DATESTART } =
|
||||
route.query;
|
||||
console.log(CHECKRECORD_ID);
|
||||
const { LISTMANAGER_ID, CHECKRECORD_ID, DATEEND, DATESTART } = route.query;
|
||||
// entrance: supplementaryRecording是补录,空值是正常录入
|
||||
const props = defineProps({
|
||||
entrance: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const rules = {
|
||||
CHECK_TIME: [
|
||||
{ required: true, message: "请选择检查时间", trigger: "change" },
|
||||
|
@ -367,7 +372,7 @@ const fnQualified = async (index, row) => {
|
|||
inspectionList.value[index].ISNORMAL = 0;
|
||||
};
|
||||
const fnNotInvolved = (index, row) => {
|
||||
if (row.HASHIDDEN > 0 || type === "supplementaryRecording") return;
|
||||
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
|
||||
fnRemoveUnqualified(index);
|
||||
inspectionList.value[index].ISNORMAL = 2;
|
||||
};
|
||||
|
@ -375,7 +380,7 @@ const fnRemoveUnqualified = (index) => {
|
|||
inspectionList.value[index].HIDDEN_ID = "";
|
||||
};
|
||||
const fnUnqualified = async (index, row) => {
|
||||
if (row.HASHIDDEN > 0 || type === "supplementaryRecording") return;
|
||||
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
|
||||
data.unQualifiedDialog.visible = true;
|
||||
await nextTick();
|
||||
if (
|
||||
|
@ -484,7 +489,7 @@ const fnSubmit = debounce(
|
|||
LONGITUDE: data.longitude,
|
||||
LATITUDE: data.latitude,
|
||||
};
|
||||
if (type === "supplementaryRecording") {
|
||||
if (props.entrance === "supplementaryRecording") {
|
||||
params.REASON = data.form.REASON;
|
||||
params.CHECKRECORD_ID = CHECKRECORD_ID;
|
||||
await setChecklistInspectionStatusRecordSupplementaryRecordingSubmit(
|
||||
|
|
Loading…
Reference in New Issue