Compare commits
2 Commits
11a3db5b61
...
38dcbe7f7a
Author | SHA1 | Date | |
---|---|---|---|
38dcbe7f7a | |||
71ba51772d |
@ -22,9 +22,12 @@ export const listSafetyWeeklyReport = (query?: SafetyWeeklyReportQuery): AxiosPr
|
|||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export const getSafetyWeeklyReport = (id: string | number): AxiosPromise<SafetyWeeklyReportVO> => {
|
export const getSafetyWeeklyReport = (id: string | number): AxiosPromise<SafetyWeeklyReportVO> => {
|
||||||
return request({
|
return requestGo({
|
||||||
url: '/safety/safetyWeeklyReport/' + id,
|
url: '/zm/api/v1/system/busWeeklySecurityReport/get',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
const init = (obj) => {
|
const init = (obj) => {
|
||||||
let documentKey = obj.id.toString() + new Date().getTime();
|
let documentKey = obj.id.toString() + new Date().getTime();
|
||||||
window['$HOSTSRC'] = 'ws://xny.yj-3d.com:8899/ws';
|
window['$HOSTSRC'] = 'ws://58.17.134.85:8920/ws';
|
||||||
let baseURL = window['$HOSTSRC'].replace('ws:', 'http:').replace('/ws', '');
|
let baseURL = window['$HOSTSRC'].replace('ws:', 'http:').replace('/ws', '');
|
||||||
let url = baseURL + obj.filenPathCoding.replaceAll('+', ' ');
|
let url = baseURL + obj.filenPathCoding.replaceAll('+', ' ');
|
||||||
let type = obj.suffix;
|
let type = obj.suffix;
|
||||||
|
@ -52,7 +52,6 @@ import { getQualityConstructionLog } from '@/api/quality/qualityConstructionLog'
|
|||||||
import { QualityConstructionLogVO, QualityConstructionLogQuery, QualityConstructionLogForm } from '@/api/quality/qualityConstructionLog/types';
|
import { QualityConstructionLogVO, QualityConstructionLogQuery, QualityConstructionLogForm } from '@/api/quality/qualityConstructionLog/types';
|
||||||
import { dayjs } from 'element-plus';
|
import { dayjs } from 'element-plus';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
import { s } from 'node_modules/vite/dist/node/types.d-aGj9QkWt';
|
|
||||||
import { downLoadOss, listByIds } from '@/api/system/oss';
|
import { downLoadOss, listByIds } from '@/api/system/oss';
|
||||||
const safetyInspectionDetail = ref<QualityConstructionLogVO>();
|
const safetyInspectionDetail = ref<QualityConstructionLogVO>();
|
||||||
const checkFileList = ref<any[]>();
|
const checkFileList = ref<any[]>();
|
||||||
|
110
src/views/safety/safetyWeeklyReport/component/add.vue
Normal file
110
src/views/safety/safetyWeeklyReport/component/add.vue
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<template>
|
||||||
|
<div class="system-busWeeklySecurityReport-add">
|
||||||
|
<!-- 添加或修改安全周期对话框 -->
|
||||||
|
<el-dialog v-model="isShowDialog" width="500px" :close-on-click-modal="false" :destroy-on-close="true">
|
||||||
|
<template #header>
|
||||||
|
<div v-drag="['.system-busWeeklySecurityReport-add .el-dialog', '.system-busWeeklySecurityReport-add .el-dialog__header']">添加安全周期</div>
|
||||||
|
</template>
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="90px">
|
||||||
|
<el-form-item label="周期范围" prop="timeRange">
|
||||||
|
<el-date-picker
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
v-model="formData.timeRange"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
size="large"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</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 } from 'element-plus';
|
||||||
|
import { addSafetyWeeklyReport } from '@/api/safety/safetyWeeklyReport';
|
||||||
|
// 获取用户 store
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const formRef = ref<HTMLElement | null>(null);
|
||||||
|
const menuRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
loading: false,
|
||||||
|
isShowDialog: false,
|
||||||
|
formData: {
|
||||||
|
timeRange: [],
|
||||||
|
projectId: currentProject.value?.goId
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
timeRange: [{ required: true, message: '时间范围不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = () => {
|
||||||
|
resetForm();
|
||||||
|
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;
|
||||||
|
let timeRange = state.formData.timeRange.join(',');
|
||||||
|
addSafetyWeeklyReport({ projectId: state.formData.projectId, timeRange })
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功');
|
||||||
|
closeDialog(); // 关闭弹窗
|
||||||
|
emit('busWeeklySecurityReportList');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const resetForm = () => {
|
||||||
|
state.formData = {
|
||||||
|
timeRange: [],
|
||||||
|
projectId: currentProject.value?.goId
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
closeDialog,
|
||||||
|
onCancel,
|
||||||
|
onSubmit,
|
||||||
|
menuRef,
|
||||||
|
formRef,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
@ -0,0 +1,186 @@
|
|||||||
|
<template>
|
||||||
|
<div class="document_detail" id="document_detail">
|
||||||
|
<div class="move_pop" id="detial_pop">
|
||||||
|
<!-- <span>{{ title }}</span> -->
|
||||||
|
<div class="box">
|
||||||
|
<img v-if="type == 2" src="../icon/suo.png" @click="onFull(1)" />
|
||||||
|
<img v-else src="../icon/full.png" @click="onFull(2)" />
|
||||||
|
<span class="close" @click="onClose">✖</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box_app" id="box_app"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { toRefs, reactive, onMounted, defineComponent, getCurrentInstance } from 'vue';
|
||||||
|
import { setMove } from '@/utils/moveDiv';
|
||||||
|
import { getSafetyWeeklyReport } from '@/api/safety/safetyWeeklyReport';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const state = reactive({
|
||||||
|
title: '',
|
||||||
|
type: 2
|
||||||
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
setMove('detial_pop', 'document_detail');
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (obj) => {
|
||||||
|
// state.title = obj.name;
|
||||||
|
getSafetyWeeklyReport(obj.id).then((res: any) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.code == 0) {
|
||||||
|
init(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onError = function (event) {
|
||||||
|
//举例,强制保存后,判断文档内容是否保存成功
|
||||||
|
if (event.data) {
|
||||||
|
if (event.data.errorCode == 'forcesave') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//保存成功
|
||||||
|
} else {
|
||||||
|
//保存失败或异常
|
||||||
|
}
|
||||||
|
} else if (event.data.errorCode == 'setallcellvalue') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//填充成功
|
||||||
|
} else if (desc.error == -1) {
|
||||||
|
//当前文档正处于协同编辑中
|
||||||
|
} else {
|
||||||
|
//填充异常
|
||||||
|
}
|
||||||
|
} else if (event.data.errorCode == 'clearsheet') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//清除成功
|
||||||
|
} else if (desc.error == -1) {
|
||||||
|
//当前文档正处于协同编辑中
|
||||||
|
} else {
|
||||||
|
//清除异常
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onDocumentReady = function () {
|
||||||
|
// console.log('文档加载完成');
|
||||||
|
};
|
||||||
|
const init = (obj) => {
|
||||||
|
let documentKey = obj.id.toString() + new Date().getTime();
|
||||||
|
let baseURL = window['$HOSTSRC'].replace('ws:', 'http:').replace('/ws', '');
|
||||||
|
let url = baseURL + obj.path;
|
||||||
|
new CXO_API.CXEditor('box_app', {
|
||||||
|
document: {
|
||||||
|
fileType: 'docx',
|
||||||
|
key: documentKey,
|
||||||
|
title: '周报',
|
||||||
|
url
|
||||||
|
},
|
||||||
|
documentType: 'word',
|
||||||
|
editorConfig: {
|
||||||
|
mode: 'view',
|
||||||
|
callbackUrl: ''
|
||||||
|
},
|
||||||
|
height: '100%',
|
||||||
|
events: {
|
||||||
|
onDocumentReady: onDocumentReady,
|
||||||
|
onError: onError
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onClose = () => {
|
||||||
|
emit('onClose', false);
|
||||||
|
};
|
||||||
|
const onFull = (type) => {
|
||||||
|
// 全屏
|
||||||
|
let document_detail = document.getElementById('document_detail');
|
||||||
|
state.type = type;
|
||||||
|
if (type == 2) {
|
||||||
|
document_detail.style.width = '100%';
|
||||||
|
document_detail.style.height = '100%';
|
||||||
|
} else {
|
||||||
|
document_detail.style.width = '1200px';
|
||||||
|
document_detail.style.height = '80vh';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
openDialog,
|
||||||
|
onClose,
|
||||||
|
onFull,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.document_detail {
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid #9f9f9f;
|
||||||
|
.box_app {
|
||||||
|
// width: 1300px !important;
|
||||||
|
// height: 80vh !important;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
.move_pop {
|
||||||
|
width: 100%;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0;
|
||||||
|
// right: 0%;
|
||||||
|
height: 24px;
|
||||||
|
// background: linear-gradient(#2a5095, #213f7b, #111e48);
|
||||||
|
background-color: #f4f5f6;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
> span {
|
||||||
|
color: #000000;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
display: flex;
|
||||||
|
width: 60px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 10px;
|
||||||
|
// height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
img {
|
||||||
|
width: 22px;
|
||||||
|
margin-top: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
position: absolute;
|
||||||
|
right: 2px;
|
||||||
|
/* top: -8px; */
|
||||||
|
color: #8d8d8d;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
font-size: 20px;
|
||||||
|
//border: 2px solid #0ff;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div class="document_detail_eidt1" id="document_detail_eidt1">
|
||||||
|
<div class="move_pop" id="detial_edit1">
|
||||||
|
<!-- <span>{{ title }}</span> -->
|
||||||
|
<div class="box">
|
||||||
|
<img v-if="type == 2" src="../icon/full.png" @click="onFull(1)" />
|
||||||
|
<img v-else src="../icon/suo.png" @click="onFull(2)" />
|
||||||
|
<span class="close" @click="onClose">✖</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box_app" id="box_app_edit1"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { toRefs, reactive, onMounted, ref, defineComponent, watch, getCurrentInstance } from 'vue';
|
||||||
|
import { setMove } from '@/utils/moveDiv';
|
||||||
|
import { getSafetyWeeklyReport } from '@/api/safety/safetyWeeklyReport';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'index',
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
const state = reactive({
|
||||||
|
title: '',
|
||||||
|
type: 2
|
||||||
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
setMove('detial_edit1', 'document_detail_eidt1');
|
||||||
|
});
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (obj) => {
|
||||||
|
getSafetyWeeklyReport(obj.id).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
init(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onError = function (event) {
|
||||||
|
console.log('编辑器错误: code ' + event.data.errorCode + ', 描述' + event.data.errorDescription);
|
||||||
|
//举例,强制保存后,判断文档内容是否保存成功
|
||||||
|
if (event.data) {
|
||||||
|
if (event.data.errorCode == 'forcesave') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//保存成功
|
||||||
|
} else {
|
||||||
|
//保存失败或异常
|
||||||
|
}
|
||||||
|
} else if (event.data.errorCode == 'setallcellvalue') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//填充成功
|
||||||
|
} else if (desc.error == -1) {
|
||||||
|
//当前文档正处于协同编辑中
|
||||||
|
} else {
|
||||||
|
//填充异常
|
||||||
|
}
|
||||||
|
} else if (event.data.errorCode == 'clearsheet') {
|
||||||
|
var desc = event.data.errorDescription;
|
||||||
|
desc = JSON.parse(desc);
|
||||||
|
if (desc.error == 0) {
|
||||||
|
//清除成功
|
||||||
|
} else if (desc.error == -1) {
|
||||||
|
//当前文档正处于协同编辑中
|
||||||
|
} else {
|
||||||
|
//清除异常
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onDocumentReady = function () {
|
||||||
|
// console.log('文档加载完成');
|
||||||
|
};
|
||||||
|
const init = (obj) => {
|
||||||
|
let documentKey = obj.id.toString() + new Date().getTime();
|
||||||
|
window['$HOSTSRC'] = 'ws://58.17.134.85:8920/ws';
|
||||||
|
let baseURL = window['$HOSTSRC'].replace('ws:', 'http:').replace('/ws', '');
|
||||||
|
let url = baseURL + obj.path;
|
||||||
|
new CXO_API.CXEditor('box_app_edit1', {
|
||||||
|
document: {
|
||||||
|
fileType: 'docx',
|
||||||
|
key: documentKey,
|
||||||
|
title: '周报',
|
||||||
|
url
|
||||||
|
},
|
||||||
|
documentType: 'word',
|
||||||
|
editorConfig: {
|
||||||
|
callbackUrl: baseURL + '/zm/api/v1/system/busWeeklySecurityReport/securityReportAdd?path=' + obj.path
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
onDocumentReady: onDocumentReady,
|
||||||
|
onError: onError
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onClose = () => {
|
||||||
|
emit('onClose', false);
|
||||||
|
};
|
||||||
|
const onFull = (type) => {
|
||||||
|
// 全屏
|
||||||
|
let document_detail = document.getElementById('document_detail_eidt1');
|
||||||
|
state.type = type;
|
||||||
|
if (type == 2) {
|
||||||
|
// 弹框放大
|
||||||
|
document_detail.style.width = '100%';
|
||||||
|
document_detail.style.height = '100%';
|
||||||
|
} else {
|
||||||
|
// 弹框缩小
|
||||||
|
document_detail.style.width = '1200px';
|
||||||
|
document_detail.style.height = '80vh';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
proxy,
|
||||||
|
onFull,
|
||||||
|
openDialog,
|
||||||
|
onClose,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.document_detail_eidt1 {
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid #9f9f9f;
|
||||||
|
.box_app {
|
||||||
|
width: 1200px !important;
|
||||||
|
height: 80vh !important;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
margin-top: 100px;
|
||||||
|
}
|
||||||
|
.move_pop {
|
||||||
|
width: 100%;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 0;
|
||||||
|
// right: 0%;
|
||||||
|
height: 24px;
|
||||||
|
// background: linear-gradient(#2a5095, #213f7b, #111e48);
|
||||||
|
background-color: #f4f5f6;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
> span {
|
||||||
|
color: #000000;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
display: flex;
|
||||||
|
width: 60px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 10px;
|
||||||
|
// height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
img {
|
||||||
|
width: 22px;
|
||||||
|
margin-top: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
position: absolute;
|
||||||
|
right: 2px;
|
||||||
|
/* top: -8px; */
|
||||||
|
color: #8d8d8d;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
font-size: 20px;
|
||||||
|
//border: 2px solid #0ff;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
BIN
src/views/safety/safetyWeeklyReport/component/icon/full.png
Normal file
BIN
src/views/safety/safetyWeeklyReport/component/icon/full.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
src/views/safety/safetyWeeklyReport/component/icon/suo.png
Normal file
BIN
src/views/safety/safetyWeeklyReport/component/icon/suo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
58
src/views/safety/safetyWeeklyReport/component/model.ts
Normal file
58
src/views/safety/safetyWeeklyReport/component/model.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
export interface BusWeeklySecurityReportTableColumns {
|
||||||
|
id:number; // 主键ID
|
||||||
|
projectId:number; // 项目ID
|
||||||
|
projectName:string; // 项目名称
|
||||||
|
scope:string; // 周期范围
|
||||||
|
scopeEnd:string; // 周期范围结束
|
||||||
|
path:string; // 文件位置
|
||||||
|
createBy:string; // 创建者
|
||||||
|
updateBy:string; // 更新者
|
||||||
|
createdAt:string; // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusWeeklySecurityReportInfoData {
|
||||||
|
id:number|undefined; // 主键ID
|
||||||
|
projectId:number|undefined; // 项目ID
|
||||||
|
projectName:string|undefined; // 项目名称
|
||||||
|
scope:string|undefined; // 周期范围
|
||||||
|
scopeEnd:string|undefined; // 周期范围结束
|
||||||
|
path:string|undefined; // 文件位置
|
||||||
|
createBy:string|undefined; // 创建者
|
||||||
|
updateBy:string|undefined; // 更新者
|
||||||
|
createdAt:string|undefined; // 创建时间
|
||||||
|
updatedAt:string|undefined; // 更新时间
|
||||||
|
deletedAt:string|undefined; // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusWeeklySecurityReportTableDataState {
|
||||||
|
ids:any[];
|
||||||
|
tableData: {
|
||||||
|
data: Array<BusWeeklySecurityReportTableColumns>;
|
||||||
|
total: number;
|
||||||
|
loading: boolean;
|
||||||
|
param: {
|
||||||
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
id: number|undefined;
|
||||||
|
projectId: number|undefined;
|
||||||
|
projectName: string|undefined;
|
||||||
|
scope: string|undefined;
|
||||||
|
scopeEnd: string|undefined;
|
||||||
|
path: string|undefined;
|
||||||
|
createBy: string|undefined;
|
||||||
|
updateBy: string|undefined;
|
||||||
|
createdAt: string|undefined;
|
||||||
|
dateRange: string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BusWeeklySecurityReportEditState{
|
||||||
|
loading:boolean;
|
||||||
|
isShowDialog: boolean;
|
||||||
|
formData:BusWeeklySecurityReportInfoData;
|
||||||
|
rules: object;
|
||||||
|
}
|
@ -1,104 +1,95 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="system-busWeeklySecurityReport-container">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
<div class="system-busWeeklySecurityReport-search mb15">
|
||||||
<el-form-item label="周期范围" prop="scope">
|
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="100px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-form-item label="周期范围" prop="scopeDate">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
clearable
|
|
||||||
v-model="queryParams.scopeDate"
|
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
|
v-model="scopeDate"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始时间"
|
start-placeholder="开始时间"
|
||||||
end-placeholder="结束时间"
|
end-placeholder="结束时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" @click="onSearch"
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
><el-icon><ele-Search /></el-icon>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="resetQuery(queryRef)"
|
||||||
|
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card shadow="never">
|
|
||||||
<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:safetyWeeklyReport:add']">新增 </el-button>
|
<el-button type="primary" @click="handleAdd" v-auth="'api/v1/system/busWeeklySecurityReport/add'"
|
||||||
|
><el-icon><ele-Plus /></el-icon>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" :disabled="multiple" @click="handleDelete(null)" v-auth="'api/v1/system/busWeeklySecurityReport/delete'"
|
||||||
type="danger"
|
><el-icon><ele-Delete /></el-icon>删除</el-button
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete()"
|
|
||||||
v-hasPermi="['safety:safetyWeeklyReport:remove']"
|
|
||||||
>
|
>
|
||||||
批量删除
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</div>
|
||||||
|
<el-table v-loading="loading" :data="tableData.data" @selection-change="handleSelectionChange">
|
||||||
<el-table v-loading="loading" :data="safetyWeeklyReportList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
<el-table-column label="序号" align="center" type="index" min-width="50px" />
|
||||||
<el-table-column label="周期" align="center" prop="week" />
|
<el-table-column label="周" align="center" prop="week" min-width="100px" />
|
||||||
<el-table-column label="周期范围" align="center" prop="scope" width="260">
|
<el-table-column label="周期范围" align="center" prop="scope" min-width="200px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.scope, '{y}-{m}-{d}') }} 至 {{ parseTime(scope.row.scopeEnd, '{y}-{m}-{d}') }}</span>
|
<span>{{ scope.row.scope + '至' + scope.row.scopeEnd }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createdAt" />
|
<!-- <el-table-column label="文件位置" align="center" prop="path" min-width="100px" /> -->
|
||||||
<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
|
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="100px">
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-space>
|
<span>{{ scope.row.createdAt }}</span>
|
||||||
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['safety:safetyWeeklyReport:edit']">
|
</template>
|
||||||
修改
|
</el-table-column>
|
||||||
</el-button>
|
<el-table-column label="操作" align="center" class-name="small-padding" min-width="200px" fixed="right">
|
||||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['safety:safetyWeeklyReport:remove']">
|
<template #default="scope">
|
||||||
删除
|
<el-button type="primary" link @click="handleView(scope.row)"
|
||||||
</el-button>
|
><el-icon><ele-View /></el-icon>预览</el-button
|
||||||
</el-space>
|
>
|
||||||
|
<el-button type="success" link @click="handleUpdate(scope.row)" v-auth="'api/v1/system/busWeeklySecurityReport/edit'"
|
||||||
|
><el-icon><ele-EditPen /></el-icon>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" link @click="handleDelete(scope.row)" v-auth="'api/v1/system/busWeeklySecurityReport/delete'"
|
||||||
|
><el-icon><ele-DeleteFilled /></el-icon>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<pagination
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
v-show="tableData.total > 0"
|
||||||
</el-card>
|
:total="tableData.total"
|
||||||
<!-- 添加或修改安全周报对话框 -->
|
v-model:page="tableData.param.pageNum"
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
v-model:limit="tableData.param.pageSize"
|
||||||
<el-form ref="safetyWeeklyReportFormRef" :model="form" :rules="rules" label-width="120px">
|
@pagination="busWeeklySecurityReportList"
|
||||||
<el-form-item label="周期范围" prop="timeRange">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.timeRange"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="至"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
start-placeholder="开始时间"
|
|
||||||
end-placeholder="结束时间"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-card>
|
||||||
</el-form>
|
<apiV1SystemBusWeeklySecurityReportAdd
|
||||||
<template #footer>
|
ref="addRef"
|
||||||
<div class="dialog-footer">
|
@busWeeklySecurityReportList="busWeeklySecurityReportList"
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
></apiV1SystemBusWeeklySecurityReportAdd>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<documentsEdit ref="documentsEditRef" v-if="documentsEditShow" @onClose="documentsEditShow = false"></documentsEdit>
|
||||||
</div>
|
<documentsDetail ref="documentsDetailRef" v-if="documentsDetailShow" @onClose="documentsDetailShow = false"></documentsDetail>
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
<script setup name="SafetyWeeklyReport" lang="ts">
|
import { toRefs, reactive, onMounted, ref, defineComponent, computed, getCurrentInstance, toRaw, nextTick } from 'vue';
|
||||||
|
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
|
||||||
import {
|
import {
|
||||||
addSafetyWeeklyReport,
|
addSafetyWeeklyReport,
|
||||||
delSafetyWeeklyReport,
|
delSafetyWeeklyReport,
|
||||||
@ -106,175 +97,170 @@ import {
|
|||||||
listSafetyWeeklyReport,
|
listSafetyWeeklyReport,
|
||||||
updateSafetyWeeklyReport
|
updateSafetyWeeklyReport
|
||||||
} from '@/api/safety/safetyWeeklyReport';
|
} from '@/api/safety/safetyWeeklyReport';
|
||||||
import { SafetyWeeklyReportForm, SafetyWeeklyReportQuery, SafetyWeeklyReportVO } from '@/api/safety/safetyWeeklyReport/types';
|
import apiV1SystemBusWeeklySecurityReportAdd from './component/add.vue';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
// 预览文档
|
||||||
import { dayjs } from 'element-plus';
|
import documentsDetail from './component/documentsDetail/index.vue';
|
||||||
|
// 编辑文档
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
import documentsEdit from './component/documentsEdit/index.vue';
|
||||||
|
|
||||||
// 获取用户 store
|
// 获取用户 store
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
const userStore = useUserStoreHook();
|
const userStore = useUserStoreHook();
|
||||||
// 从 store 中获取项目列表和当前选中的项目
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
const currentProject = computed(() => userStore.selectedProject);
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
const safetyWeeklyReportList = ref<SafetyWeeklyReportVO[]>([]);
|
export default defineComponent({
|
||||||
const buttonLoading = ref(false);
|
name: 'index',
|
||||||
const loading = ref(true);
|
components: {
|
||||||
const showSearch = ref(true);
|
apiV1SystemBusWeeklySecurityReportAdd,
|
||||||
const ids = ref<Array<string | number>>([]);
|
documentsDetail,
|
||||||
const single = ref(true);
|
documentsEdit
|
||||||
const multiple = ref(true);
|
},
|
||||||
const total = ref(0);
|
setup() {
|
||||||
|
const { proxy } = <any>getCurrentInstance();
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const loading = ref(false);
|
||||||
const safetyWeeklyReportFormRef = ref<ElFormInstance>();
|
const queryRef = ref();
|
||||||
|
const addRef = ref();
|
||||||
const dialog = reactive<DialogOption>({
|
// 是否显示所有搜索选项
|
||||||
visible: false,
|
const showAll = ref(false);
|
||||||
title: ''
|
const documentsDetailRef = ref(false);
|
||||||
});
|
const documentsEditRef = ref(false);
|
||||||
|
// 非单个禁用
|
||||||
const initFormData: SafetyWeeklyReportForm = {
|
const single = ref(true);
|
||||||
id: undefined,
|
// 非多个禁用
|
||||||
projectId: currentProject.value?.goId,
|
const multiple = ref(true);
|
||||||
week: undefined,
|
// 字典选项数据
|
||||||
scope: undefined,
|
const state = reactive({
|
||||||
scopeEnd: undefined,
|
ids: [],
|
||||||
path: undefined,
|
documentsDetailShow: false,
|
||||||
remark: undefined
|
documentsEditShow: false,
|
||||||
};
|
tableData: {
|
||||||
const data = reactive<PageData<SafetyWeeklyReportForm, SafetyWeeklyReportQuery>>({
|
data: [],
|
||||||
form: { ...initFormData },
|
total: 0,
|
||||||
queryParams: {
|
loading: false,
|
||||||
|
param: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
id: undefined,
|
id: undefined,
|
||||||
projectId: currentProject.value?.goId,
|
projectId: currentProject.value?.goId,
|
||||||
week: undefined,
|
projectName: undefined,
|
||||||
scopeDate: undefined,
|
scope: undefined,
|
||||||
remark: undefined,
|
scopeEnd: undefined,
|
||||||
params: {}
|
path: undefined,
|
||||||
},
|
createBy: undefined,
|
||||||
rules: {
|
updateBy: undefined,
|
||||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
|
createdAt: undefined,
|
||||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
dateRange: [],
|
||||||
timeRange: [{ required: true, message: '周期范围不能为空', trigger: 'blur' }]
|
scopeDate: ''
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
projectList: [],
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
scopeDate: [] //时间范围
|
||||||
|
});
|
||||||
/** 查询安全周报列表 */
|
// 页面加载时
|
||||||
const getList = async () => {
|
onMounted(() => {
|
||||||
|
initTableData();
|
||||||
|
});
|
||||||
|
// 初始化表格数据
|
||||||
|
const initTableData = () => {
|
||||||
|
busWeeklySecurityReportList();
|
||||||
|
};
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
state.scopeDate = [];
|
||||||
|
state.tableData.param.scopeDate = '';
|
||||||
|
formEl.resetFields();
|
||||||
|
busWeeklySecurityReportList();
|
||||||
|
};
|
||||||
|
const onSearch = () => {
|
||||||
|
state.tableData.param.scopeDate = state.scopeDate.join(',');
|
||||||
|
busWeeklySecurityReportList();
|
||||||
|
};
|
||||||
|
// 获取列表数据
|
||||||
|
const busWeeklySecurityReportList = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listSafetyWeeklyReport(queryParams.value);
|
listSafetyWeeklyReport(state.tableData.param).then((res: any) => {
|
||||||
safetyWeeklyReportList.value = res.data.list;
|
let list = res.data.list ?? [];
|
||||||
total.value = res.data.total;
|
state.tableData.data = list;
|
||||||
|
state.tableData.total = res.data.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
});
|
||||||
|
};
|
||||||
/** 取消按钮 */
|
// 多选框选中数据
|
||||||
const cancel = () => {
|
const handleSelectionChange = (selection) => {
|
||||||
reset();
|
state.ids = selection.map((item) => item.id);
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
safetyWeeklyReportFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: SafetyWeeklyReportVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
|
const handleAdd = () => {
|
||||||
/** 新增按钮操作 */
|
addRef.value.openDialog();
|
||||||
const handleAdd = () => {
|
};
|
||||||
reset();
|
const handleUpdate = (row) => {
|
||||||
dialog.visible = true;
|
state.documentsEditShow = true;
|
||||||
dialog.title = '添加安全周报';
|
nextTick(() => {
|
||||||
};
|
documentsEditRef.value.openDialog(row);
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = async (row?: SafetyWeeklyReportVO) => {
|
|
||||||
return;
|
|
||||||
reset();
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
// const res = await getSafetyWeeklyReport(_id);
|
|
||||||
// Object.assign(form.value, res.data);
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = '修改安全周报';
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
form.value.projectId = currentProject.value?.goId;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
form.value.timeRange = form.value.timeRange.map((d) => dayjs(d).format('YYYY-MM-DD')).join(',');
|
|
||||||
await addSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const handleDelete = (row) => {
|
||||||
/** 删除按钮操作 */
|
let msg = '你确定要删除所选数据?';
|
||||||
const handleDelete = async (row?: SafetyWeeklyReportVO) => {
|
let id: number[] = [];
|
||||||
const _ids = row?.id || ids.value;
|
if (row) {
|
||||||
await proxy?.$modal.confirm('是否确认删除安全周报编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
msg = `此操作将永久删除数据,是否继续?`;
|
||||||
await delSafetyWeeklyReport(_ids);
|
id = [row.id];
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
} else {
|
||||||
await getList();
|
id = state.ids;
|
||||||
};
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
const handleExport = () => {
|
|
||||||
proxy?.download(
|
|
||||||
'safety/safetyWeeklyReport/export',
|
|
||||||
{
|
|
||||||
...queryParams.value
|
|
||||||
},
|
|
||||||
`safetyWeeklyReport_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
//监听项目id刷新数据
|
|
||||||
const listeningProject = watch(
|
|
||||||
() => currentProject.value?.goId,
|
|
||||||
(nid, oid) => {
|
|
||||||
queryParams.value.projectId = nid;
|
|
||||||
form.value.projectId = nid;
|
|
||||||
getList();
|
|
||||||
}
|
}
|
||||||
);
|
if (id.length === 0) {
|
||||||
|
ElMessage.error('请选择要删除的数据。');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(msg, '提示', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delSafetyWeeklyReport(id).then(() => {
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
busWeeklySecurityReportList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
const handleView = (row) => {
|
||||||
|
state.documentsDetailShow = true;
|
||||||
|
nextTick(() => {
|
||||||
|
documentsDetailRef.value.openDialog(row);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
return {
|
||||||
listeningProject();
|
proxy,
|
||||||
});
|
addRef,
|
||||||
|
showAll,
|
||||||
onMounted(() => {
|
loading,
|
||||||
getList();
|
single,
|
||||||
|
multiple,
|
||||||
|
documentsEditRef,
|
||||||
|
documentsDetailRef,
|
||||||
|
queryRef,
|
||||||
|
resetQuery,
|
||||||
|
onSearch,
|
||||||
|
busWeeklySecurityReportList,
|
||||||
|
handleSelectionChange,
|
||||||
|
handleAdd,
|
||||||
|
handleUpdate,
|
||||||
|
handleDelete,
|
||||||
|
handleView,
|
||||||
|
...toRefs(state)
|
||||||
|
};
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.colBlock {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.colNone {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Reference in New Issue
Block a user