安全通知功能优化

新增运单登记列表页,添加页
dev
WenShiJun 2024-02-28 19:30:39 +08:00
parent 69cfc999a2
commit a11e809c8c
9 changed files with 450 additions and 42 deletions

View File

@ -24,7 +24,7 @@ export default {
}, },
bgColor: { bgColor: {
type: String, type: String,
default: '#FFFFFF' default: ''
}, },
isCrop: { isCrop: {
type: Boolean, type: Boolean,

View File

View File

@ -0,0 +1,177 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="6">
<el-form-item label="通知标题" prop="TITLE">
<el-input v-model="searchForm.TITLE" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="回复状态" prop="REPLYSTATUS">
<el-select v-model="searchForm.REPLYSTATUS">
<el-option label="已回复" :value="1" />
<!-- 1代表已回复 -->
<el-option label="未回复" :value="0" />
<!-- 0代表未回复 -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="通知等级" prop="RISKUNITNAME">
<el-select v-model="searchForm.RISKUNITNAME">
<el-option
v-for="item in relatedClassificationList"
:key="item.BIANMA"
:label="item.name"
:value="item.BIANMA"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="TITLE" label="通知标题" width="250" />
<el-table-column prop="POSTSTATUS" label="发布状态" width="250">
<template #default="{ row }">
{{ row.POSTSTATUS === 0 ? "未发布" : "已发布" }}
</template>
</el-table-column>
<el-table-column prop="SIGNING" label="签收情况" width="120">
</el-table-column>
<el-table-column prop="REPLY" label="回复情况" />
<el-table-column prop="CREATETIME" label="创建时间" width="100" />
<el-table-column
prop="TRANSPORTATIONCOMPANY"
label="运输企业"
width="90"
>
</el-table-column>
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/notice_info',
query: {
NOTIFICATION_ID: row.NOTIFICATION_ID,
},
})
"
>
查看
</el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/add',
})
"
>
添加
</el-button>
<el-button
type="danger"
text
link
@click="deleteItem(row.NOTIFICATION_ID)"
>
删除
</el-button>
<!-- 阅读详情按钮 -->
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/details',
query: {
NOTIFIION_ID: row.NOTIFICATION_ID,
},
})
"
>
阅读详情
</el-button>
</template>
</el-table-column>
</layout-table>
</layout-card>
<edit
v-model:visible="data.analysisDialog.visible"
:info="data.analysisDialog.info"
@get-data="fnResetPagination"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import { onMounted, reactive, ref } from "vue";
import {
getSecurityNoticeList,
layoutFnGetNotificationsClassification,
dateteSecurityNotice,
} from "@/request/safety_production_related.js";
import router from "@/router/index.js";
import { ElMessageBox, ElMessage } from "element-plus";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSecurityNoticeList);
const data = reactive({
analysisDialog: {
visible: false,
info: {},
},
});
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await dateteSecurityNotice({ NOTIFICATION_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const relatedClassificationList = ref(null);
onMounted(async () => {
const data = await layoutFnGetNotificationsClassification();
relatedClassificationList.value = JSON.parse(data.value.zTreeNodes);
});
</script>
<style scoped></style>

View File

@ -0,0 +1,177 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="6">
<el-form-item label="通知标题" prop="TITLE">
<el-input v-model="searchForm.TITLE" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="回复状态" prop="REPLYSTATUS">
<el-select v-model="searchForm.REPLYSTATUS">
<el-option label="已回复" :value="1" />
<!-- 1代表已回复 -->
<el-option label="未回复" :value="0" />
<!-- 0代表未回复 -->
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="通知等级" prop="RISKUNITNAME">
<el-select v-model="searchForm.RISKUNITNAME">
<el-option
v-for="item in relatedClassificationList"
:key="item.BIANMA"
:label="item.name"
:value="item.BIANMA"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="TITLE" label="通知标题" width="250" />
<el-table-column prop="POSTSTATUS" label="发布状态" width="250">
<template #default="{ row }">
{{ row.POSTSTATUS === 0 ? "未发布" : "已发布" }}
</template>
</el-table-column>
<el-table-column prop="SIGNING" label="签收情况" width="120">
</el-table-column>
<el-table-column prop="REPLY" label="回复情况" />
<el-table-column prop="CREATETIME" label="创建时间" width="100" />
<el-table-column
prop="TRANSPORTATIONCOMPANY"
label="运输企业"
width="90"
>
</el-table-column>
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/notice_info',
query: {
NOTIFICATION_ID: row.NOTIFICATION_ID,
},
})
"
>
查看
</el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/add',
})
"
>
添加
</el-button>
<el-button
type="danger"
text
link
@click="deleteItem(row.NOTIFICATION_ID)"
>
删除
</el-button>
<!-- 阅读详情按钮 -->
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_production_related/security_notice/details',
query: {
NOTIFIION_ID: row.NOTIFICATION_ID,
},
})
"
>
阅读详情
</el-button>
</template>
</el-table-column>
</layout-table>
</layout-card>
<edit
v-model:visible="data.analysisDialog.visible"
:info="data.analysisDialog.info"
@get-data="fnResetPagination"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import { onMounted, reactive, ref } from "vue";
import {
getSecurityNoticeList,
layoutFnGetNotificationsClassification,
dateteSecurityNotice,
} from "@/request/safety_production_related.js";
import router from "@/router/index.js";
import { ElMessageBox, ElMessage } from "element-plus";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSecurityNoticeList);
const data = reactive({
analysisDialog: {
visible: false,
info: {},
},
});
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await dateteSecurityNotice({ NOTIFICATION_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const relatedClassificationList = ref(null);
onMounted(async () => {
const data = await layoutFnGetNotificationsClassification();
relatedClassificationList.value = JSON.parse(data.value.zTreeNodes);
});
</script>
<style scoped></style>

View File

@ -13,6 +13,21 @@
<el-input v-model="data.form.TITLE" placeholder="请输入内容" /> <el-input v-model="data.form.TITLE" placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="运输企业" prop="TRANSPORTATIONCOMPANY">
<el-select
v-model="data.form.TRANSPORTATIONCOMPANY"
placeholder="请选择运输企业"
>
<el-option
v-for="item in ClassificationPerson"
:key="item.CORPINFO_ID"
:label="item.CORP_NAME"
:value="item.CORP_NAME"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="通知等级" prop="LEVEL"> <el-form-item label="通知等级" prop="LEVEL">
<el-select v-model="data.form.LEVEL" placeholder="请选择通知等级"> <el-select v-model="data.form.LEVEL" placeholder="请选择通知等级">
@ -42,32 +57,41 @@
选择 选择
</el-button> </el-button>
</div> </div>
<!-- <el-select-->
<!-- v-model="data.form.UNITS_PIC"-->
<!-- clearable-->
<!-- placeholder="请选择人员"-->
<!-- @change="fnSelectUnitsUser($event)"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in relatedClassificationList"-->
<!-- :key="item.BIANMA"-->
<!-- :label="item.NAME"-->
<!-- :value="item.BIANMA"-->
<!-- />-->
<!-- </el-select>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-row>
<el-col :span="8">
<el-form-item label="通知附件" prop="fileList"> <el-form-item label="通知附件" prop="fileList">
<layout-upload <layout-upload
v-model:file-list="data.form.fileList" v-model:file-list="data.form.fileList"
accept=".pdf,.mp4" accept=".pdf"
delete-to-server delete-to-server
:limit="9" :limit="9"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="通知视频" prop="videoList">
<layout-upload
v-model:file-list="data.form.videoList"
accept=".mp4"
delete-to-server
:limit="9"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="回复状态" prop="REPLYSTATUS">
<el-switch
v-model="data.form.REPLYSTATUS"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#ff4949"
/>
</el-form-item>
</el-col>
</el-row>
<el-col :span="50"> <el-col :span="50">
<el-form-item label="通知内容" prop="NOTIFICATIONCONTENT"> <el-form-item label="通知内容" prop="NOTIFICATIONCONTENT">
<layout-editor <layout-editor
@ -99,8 +123,10 @@ import {
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import LayoutUpload from "@/components/upload/index.vue"; import LayoutUpload from "@/components/upload/index.vue";
import LayoutEditor from "@/components/editor/index.vue"; import LayoutEditor from "@/components/editor/index.vue";
import SelectRisk from "./components/select_risk.vue"; import SelectRisk from "./components/select_ person.vue";
import useFormValidate from "@/assets/js/useFormValidate.js"; import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
import { getSecurityWaybillrePerson } from "@/request/waybill_registration.js";
const formRef = ref(null); const formRef = ref(null);
const rules = { const rules = {
TITLE: [{ required: true, message: "请输入通知标题", trigger: "blur" }], TITLE: [{ required: true, message: "请输入通知标题", trigger: "blur" }],
@ -111,6 +137,7 @@ const rules = {
], ],
}; };
const ClassificationPerson = await getSecurityWaybillrePerson();
const fnGetUnitsList = async () => { const fnGetUnitsList = async () => {
const resData = await getUserListAll({}); const resData = await getUserListAll({});
data.unitsList = resData.varList; data.unitsList = resData.varList;
@ -126,11 +153,14 @@ JSON.parse(relatedClassificationTempList.value.zTreeNodes).forEach((e) => {
const data = reactive({ const data = reactive({
form: { form: {
TITLE: "", TITLE: "",
TRANSPORTATIONCOMPANY: "",
LEVEL: "", LEVEL: "",
PERSON: "", PERSON: "",
fileList: [], fileList: [],
videoList: [],
NOTIFICATIONCONTENT: "", NOTIFICATIONCONTENT: "",
allStatus: 0, // allStatus: 0, //
REPLYSTATUS: "",
}, },
}); });
@ -139,27 +169,51 @@ const fnSubmit = async () => {
const formData = new FormData(); const formData = new FormData();
Object.keys(data.form).forEach((key) => { Object.keys(data.form).forEach((key) => {
if (key !== "fileList" && key !== "videoList" && key !== "PERSON") {
formData.append(key, data.form[key]); formData.append(key, data.form[key]);
});
formData.delete("fileList");
for (let i = 0; i < data.form.fileList.length; i++) {
if (data.form.fileList[i].raw)
formData.append("FFILE", data.form.fileList[i].raw);
} }
await addSecurityNotice(formData);
};
const fnSelectRiskSubmit = (list) => {
console.log(list);
const nameList = list.map((val) => {
return val.USERNAME;
}); });
data.form.PERSON = nameList.join(","); formData.append("PERSON_ID", data.form.PERSON_ID);
data.form.allStatus = 0; data.form.fileList.forEach((file) => {
console.log(data.PERSON, 19); if (file.raw) {
console.log("是否全选", data.form.allStatus); formData.append("fileList", file.raw);
}
});
data.form.videoList.forEach((file) => {
if (file.raw) {
formData.append("videoList", file.raw);
}
});
try {
await addSecurityNotice(formData);
ElMessage({
message: "添加成功",
type: "success",
duration: 3000,
});
//
Object.keys(data.form).forEach((key) => {
if (Array.isArray(data.form[key])) {
data.form[key] = []; //
} else {
data.form[key] = ""; //
}
});
} catch (error) {
ElMessage.error("添加失败");
console.error(error);
}
};
const fnSelectRiskSubmit = (selectionData) => {
// const names = list.map((item) => item.NAME).join(", ");
// const userIds = list.map((item) => item.USER_ID).join(", ");
const userIds = selectionData.map((item) => item.USER_ID).join(", ");
const names = selectionData.map((item) => item.NAME).join(", ");
data.form.PERSON_ID = userIds;
data.form.PERSON = names;
}; };
const fnSelectAllRiskSubmit = () => { const fnSelectAllRiskSubmit = () => {