forked from integrated_whb/integrated_whb_vue
parent
69cfc999a2
commit
a11e809c8c
|
@ -24,7 +24,7 @@ export default {
|
|||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: '#FFFFFF'
|
||||
default: ''
|
||||
},
|
||||
isCrop: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -13,6 +13,21 @@
|
|||
<el-input v-model="data.form.TITLE" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</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-form-item label="通知等级" prop="LEVEL">
|
||||
<el-select v-model="data.form.LEVEL" placeholder="请选择通知等级">
|
||||
|
@ -42,32 +57,41 @@
|
|||
选择
|
||||
</el-button>
|
||||
</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-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="通知附件" prop="fileList">
|
||||
<layout-upload
|
||||
v-model:file-list="data.form.fileList"
|
||||
accept=".pdf,.mp4"
|
||||
delete-to-server
|
||||
:limit="9"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="通知附件" prop="fileList">
|
||||
<layout-upload
|
||||
v-model:file-list="data.form.fileList"
|
||||
accept=".pdf"
|
||||
delete-to-server
|
||||
:limit="9"
|
||||
/>
|
||||
</el-form-item>
|
||||
</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-form-item label="通知内容" prop="NOTIFICATIONCONTENT">
|
||||
<layout-editor
|
||||
|
@ -99,8 +123,10 @@ import {
|
|||
import { reactive, ref } from "vue";
|
||||
import LayoutUpload from "@/components/upload/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 { ElMessage } from "element-plus";
|
||||
import { getSecurityWaybillrePerson } from "@/request/waybill_registration.js";
|
||||
const formRef = ref(null);
|
||||
const rules = {
|
||||
TITLE: [{ required: true, message: "请输入通知标题", trigger: "blur" }],
|
||||
|
@ -111,6 +137,7 @@ const rules = {
|
|||
],
|
||||
};
|
||||
|
||||
const ClassificationPerson = await getSecurityWaybillrePerson();
|
||||
const fnGetUnitsList = async () => {
|
||||
const resData = await getUserListAll({});
|
||||
data.unitsList = resData.varList;
|
||||
|
@ -126,11 +153,14 @@ JSON.parse(relatedClassificationTempList.value.zTreeNodes).forEach((e) => {
|
|||
const data = reactive({
|
||||
form: {
|
||||
TITLE: "",
|
||||
TRANSPORTATIONCOMPANY: "",
|
||||
LEVEL: "",
|
||||
PERSON: "",
|
||||
fileList: [],
|
||||
videoList: [],
|
||||
NOTIFICATIONCONTENT: "",
|
||||
allStatus: 0, // 是否全选
|
||||
REPLYSTATUS: "",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -139,27 +169,51 @@ const fnSubmit = async () => {
|
|||
const formData = new FormData();
|
||||
|
||||
Object.keys(data.form).forEach((key) => {
|
||||
formData.append(key, data.form[key]);
|
||||
if (key !== "fileList" && key !== "videoList" && key !== "PERSON") {
|
||||
formData.append(key, data.form[key]);
|
||||
}
|
||||
});
|
||||
formData.append("PERSON_ID", data.form.PERSON_ID);
|
||||
data.form.fileList.forEach((file) => {
|
||||
if (file.raw) {
|
||||
formData.append("fileList", file.raw);
|
||||
}
|
||||
});
|
||||
|
||||
formData.delete("fileList");
|
||||
data.form.videoList.forEach((file) => {
|
||||
if (file.raw) {
|
||||
formData.append("videoList", file.raw);
|
||||
}
|
||||
});
|
||||
|
||||
for (let i = 0; i < data.form.fileList.length; i++) {
|
||||
if (data.form.fileList[i].raw)
|
||||
formData.append("FFILE", data.form.fileList[i].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);
|
||||
}
|
||||
|
||||
await addSecurityNotice(formData);
|
||||
};
|
||||
const fnSelectRiskSubmit = (list) => {
|
||||
console.log(list);
|
||||
const nameList = list.map((val) => {
|
||||
return val.USERNAME;
|
||||
});
|
||||
data.form.PERSON = nameList.join(",");
|
||||
data.form.allStatus = 0;
|
||||
console.log(data.PERSON, 19);
|
||||
console.log("是否全选", data.form.allStatus);
|
||||
|
||||
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 = () => {
|
||||
|
|
Loading…
Reference in New Issue