已修改27个文件
已添加43个文件
已删除29个文件
| | |
| | | "sortablejs": "^1.15.0", |
| | | "splitpanes": "^3.1.1", |
| | | "vue": "^3.2.36", |
| | | "vue-baidu-map-3x": "^1.0.35", |
| | | "vue-clipboard3": "^2.0.0", |
| | | "vue-grid-layout": "^3.0.0-beta1", |
| | | "vue-i18n": "^9.1.10", |
| | | "vue-router": "^4.0.15", |
| | | "vuedraggable": "^4.1.0", |
| | | "wangeditor": "^4.7.15", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | |
| | | "@types/sortablejs": "^1.13.0", |
| | | "@typescript-eslint/eslint-plugin": "^5.27.0", |
| | | "@typescript-eslint/parser": "^5.27.0", |
| | | "@vitejs/plugin-vue": "^2.3.3", |
| | | "@vitejs/plugin-vue": "^2.3.4", |
| | | "@vue/compiler-sfc": "^3.2.36", |
| | | "dotenv": "^16.0.1", |
| | | "eslint": "^8.17.0", |
对比新文件 |
| | |
| | | import request from '/@/utils/request'; |
| | | |
| | | export function contractorApi() { |
| | | return { |
| | | getContractorList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addContractor: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delContractor: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getContractorUserList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addContractorUser: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delContractorUser: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getContractorEnterList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user/enter/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addContractorEnter: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user/enter`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delContractorEnter: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/user/enter/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
对比新文件 |
| | |
| | | import request from '/@/utils/request'; |
| | | |
| | | export function educateTrainApi() { |
| | | return { |
| | | getEducateList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/resource/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addEducate: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/resource`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delEducate: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/resource/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getTrainList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/info/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addTrain: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/info`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delTrain: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/train/info/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
对比新文件 |
| | |
| | | import request from '/@/utils/request'; |
| | | |
| | | export function judgeReportApi() { |
| | | return { |
| | | getCardList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/certificate/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addCard: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/certificate`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delCard: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/certificate/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getJudgeList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/assessment/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addJudge: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/assessment`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delJudge: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/assessment/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getProductList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/craft/manage/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addProduct: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/craft/manage`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delProduct: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/craft/manage/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getParkingList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/start/stop/manage/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addParking: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/start/stop/manage`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delParking: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/start/stop/manage/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getCrowList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addCrow: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delCrow: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getEquipList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/device/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addEquip: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/device`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delEquip: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/device/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getPositionList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person/position/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addPosition: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person/position`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delPosition: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/person/position/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | url: import.meta.env.VITE_API_URL_SOCKET + `/ws/namesrv/get/one?srv=safeplatform-websocket`, |
| | | method: 'get' |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | uploadMission: (data: object) => { |
| | | return request({ |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | url: import.meta.env.VITE_API_URL + `/SafeCheckTaskUnit/import`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | uploadRfid: (data: object) => { |
| | | return request({ |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | url: import.meta.env.VITE_API_URL + `/SafeCheckRfid/import`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | uploadRegion: (data: object) => { |
| | | return request({ |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | url: import.meta.env.VITE_API_URL + `/safeCheckRegion/import`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | uploadPoint: (data: object) => { |
| | | return request({ |
| | | headers: { |
| | | "Content-Type": "multipart/form-data", |
| | | }, |
| | | url: import.meta.env.VITE_API_URL + `/safeCheckPoint/import`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | }; |
| | | } |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | pwdMod: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/auth/pwd-change`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | pwdModSelf: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/auth/pwd-change/self`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | }; |
| | | } |
| | |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item command="/newMenu">{{ $t('message.user.dropdown1') }}</el-dropdown-item> |
| | | <el-dropdown-item @click="showPwdDialog = true">修改密码</el-dropdown-item> |
| | | <!-- <el-dropdown-item command="wareHouse">{{ $t('message.user.dropdown6') }}</el-dropdown-item>--> |
| | | <!-- <el-dropdown-item command="/personal">{{ $t('message.user.dropdown2') }}</el-dropdown-item>--> |
| | | <!-- <el-dropdown-item command="/404">{{ $t('message.user.dropdown3') }}</el-dropdown-item>--> |
| | |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | | <el-dialog title="修改密码" v-model="showPwdDialog" width="500px"> |
| | | <el-form :model="pwdForm" size="default" ref="pwdRef" :rules="pwdFormRules" label-width="110px"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="新密码" prop="newPassword"> |
| | | <el-input v-model.trim="pwdForm.newPassword" placeholder="请输入" type="password" show-password> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="确认新密码" prop="rePassword"> |
| | | <el-input v-model.trim="pwdForm.rePassword" placeholder="请输入" type="password" show-password> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="showPwdDialog = !showPwdDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onPwdSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <Search ref="searchRef" /> |
| | | </div> |
| | | </div> |
| | |
| | | import { dynamicRoutes } from '/@/router/route'; |
| | | import Cookies from 'js-cookie'; |
| | | import {useRoutesList} from "/@/stores/routesList"; |
| | | import {verifyPwd} from "/@/utils/toolsValidate"; |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | |
| | | export default defineComponent({ |
| | | name: 'layoutBreadcrumbUser', |
| | |
| | | const { userInfos } = storeToRefs(stores); |
| | | const { themeConfig } = storeToRefs(storesThemeConfig); |
| | | const searchRef = ref(); |
| | | const pwdRef = ref(); |
| | | const validatePwd = (rule: any, value: any, callback: any)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入密码')) |
| | | }else{ |
| | | if(!verifyPwd(value)){ |
| | | callback(new Error('密码须包含字母、数字、特殊字符,长度在6-16之间')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | const equalToPassword = (rule: any, value: any, callback: any) => { |
| | | if(value == ''){ |
| | | callback(new Error("请再次确认密码")) |
| | | }else if (state.pwdForm.newPassword !== value) { |
| | | callback(new Error("两次输入的密码不一致")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const state = reactive({ |
| | | isScreenfull: false, |
| | | disabledI18n: 'zh-cn', |
| | | disabledSize: 'large', |
| | | systemName: '' |
| | | systemName: '', |
| | | showPwdDialog: false, |
| | | pwdForm: { |
| | | uid: Cookies.get('uid'), |
| | | newPassword: '', |
| | | rePassword: '' |
| | | }, |
| | | pwdFormRules: { |
| | | newPassword: [{ required: true, validator: validatePwd, trigger: 'blur' }], |
| | | rePassword: [{ required: true, validator: equalToPassword, trigger: "blur" }] |
| | | } |
| | | }); |
| | | // 设置分割样式 |
| | | const layoutUserFlexNum = computed(() => { |
| | |
| | | else num = ''; |
| | | return num; |
| | | }); |
| | | |
| | | const onPwdSubmit = async () => { |
| | | pwdRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const {rePassword,...data} = state.pwdForm |
| | | let res = await userApi().pwdModSelf(data); |
| | | if (res.data.code === '200') { |
| | | state.showPwdDialog = false |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '密码修改成功,请重新登录', |
| | | duration: 2000 |
| | | }) |
| | | setTimeout(()=>{ |
| | | useLoginApi() |
| | | .signOut() |
| | | .then(() => { |
| | | Session.clear() |
| | | window.location.href = '/' |
| | | }) |
| | | },2000) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 全屏点击时 |
| | | const onScreenfullClick = () => { |
| | | if (!screenfull.isEnabled) { |
| | |
| | | }); |
| | | return { |
| | | userInfos, |
| | | pwdRef, |
| | | onPwdSubmit, |
| | | backToMenu, |
| | | onLayoutSetingClick, |
| | | onHandleCommandClick, |
| | |
| | | // 配置新建一个 axios 实例 |
| | | const service = axios.create({ |
| | | // baseURL: import.meta.env.VITE_API_URL as any, |
| | | timeout: 50000, |
| | | timeout: 500000, |
| | | headers: { 'Content-Type': 'application/json' } |
| | | }); |
| | | |
| | |
| | | */ |
| | | export function verifyPhone(val: string) { |
| | | // false: 手机号码不正确 |
| | | if (!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(val)) return false; |
| | | if (!/^\d{11}$/.test(val)) return false; |
| | | // true: 手机号码正确 |
| | | else return true; |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="人员" prop="userId"> |
| | | <el-select v-model="form.userId" filterable placeholder="请选择人员" clearable> |
| | | <el-option v-for="(item,index) in userList" :key="index" :label="item.userName" :value="item.uuid"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | companyCode: string |
| | | userId: string |
| | | userName: string |
| | | contractorId: string |
| | | contractorName: string |
| | | deleted: string |
| | | } |
| | | rules:{} |
| | | contractorList: [] |
| | | userList: [] |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | contractorName: '', |
| | | userId: '', |
| | | userName: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | userId: [{ required: true, message: '请选择人员', trigger: 'blur' }] |
| | | }, |
| | | contractorList: [], |
| | | userList: [] |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true |
| | | getDataList() |
| | | getUserList() |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | contractorName: '', |
| | | userId: '', |
| | | userName: '', |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | contractorName: '', |
| | | userId: '', |
| | | userName: '', |
| | | deleted: '0' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | state.form.contractorId = state.userList.find(i=>i.uuid == state.form.userId)?.contractorId |
| | | state.form.contractorName = state.contractorList.find(i=>i.uuid == state.form.contractorId)?.contractorName |
| | | const res = await contractorApi().addContractorEnter([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const getDataList = async ()=>{ |
| | | const res = await contractorApi().getContractorList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.contractorList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | const getUserList = async ()=>{ |
| | | const res = await contractorApi().getContractorUserList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.userList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="companyCode" label="企业编码" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorId" label="承包商Id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createBy" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateBy" label="最新修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'contractorEnter', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getContractorEnterList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条数据,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delContractorEnter({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商名称" prop="contractorName"> |
| | | <el-input v-model.trim="form.contractorName" placeholder="承包商名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商统一信用码" prop="contractorNumber"> |
| | | <el-input v-model.trim="form.contractorNumber" placeholder="承包商统一信用码" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商法人" prop="contractorPerson"> |
| | | <el-input v-model.trim="form.contractorPerson" placeholder="承包商法人" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="合作状态" prop="contractorState"> |
| | | <el-select v-model="form.contractorState" placeholder="请选择合作状态"> |
| | | <el-option :key="1" label="合作中" :value="1"/> |
| | | <el-option :key="2" label="曾合作" :value="2"/> |
| | | <el-option :key="3" label="不合作" :value="3"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商类型" prop="contractorType"> |
| | | <el-input v-model.trim="form.contractorType" placeholder="承包商类型" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> |
| | | <!-- <el-form-item label="创建人姓名" prop="createBy">--> |
| | | <!-- <el-input v-model.trim="form.createBy" placeholder="创建人姓名" clearable></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> |
| | | <!-- <el-form-item label="修改人姓名" prop="updateBy">--> |
| | | <!-- <el-input v-model.trim="form.updateBy" placeholder="修改人姓名" clearable></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | companyCode: string |
| | | contractorName: string |
| | | contractorNumber: string |
| | | contractorPerson: string |
| | | contractorState: null | number |
| | | contractorType: string |
| | | deleted: string |
| | | // createBy: string |
| | | // updateBy: string |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | companyCode: '652310082', |
| | | contractorName: '', |
| | | contractorNumber: '', |
| | | contractorPerson: '', |
| | | contractorState: null, |
| | | contractorType: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | contractorName: [{ required: true, message: '请填写承包商名称', trigger: 'blur' }], |
| | | contractorNumber: [{ required: true, message: '请填写承包商统一信用码', trigger: 'blur' }], |
| | | contractorPerson: [{ required: true, message: '请填写承包商法人', trigger: 'blur' }], |
| | | contractorState: [{ required: true, message: '请选择合作状态', trigger: 'blur' }], |
| | | contractorType: [{ required: true, message: '请填写承包商类型', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | companyCode: '652310082', |
| | | contractorName: '', |
| | | contractorNumber: '', |
| | | contractorPerson: '', |
| | | contractorState: null, |
| | | contractorType: '', |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | companyCode: '652310082', |
| | | contractorName: '', |
| | | contractorNumber: '', |
| | | contractorPerson: '', |
| | | contractorState: null, |
| | | contractorType: '', |
| | | deleted: '0' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await contractorApi().addContractor([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <!-- <el-table-column prop="createDate" label="上报时间" show-overflow-tooltip></el-table-column>--> |
| | | <el-table-column prop="contractorName" label="承包商名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorNumber" label="承包商统一信用码" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorPerson" label="承包商法人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorState" label="合作状态" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.contractorState == 1?'合作中':scope.row.contractorState == 2?'曾合作':'不合作'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="contractorType" label="承包商类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createBy" label="创建人姓名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateBy" label="最新修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateTime" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'contractorInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getContractorList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除:“${row.contractorName}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delContractor({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="身份证号" prop="cardNumber"> |
| | | <el-input v-model.trim="form.cardNumber" placeholder="身份证号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商" prop="contractorId"> |
| | | <el-select v-model="form.contractorId" filterable placeholder="请选择承包商" clearable> |
| | | <el-option v-for="(item,index) in contractorList" :key="index" :label="item.contractorName" :value="item.uuid"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="电话" prop="phone"> |
| | | <el-input v-model.trim="form.phone" placeholder="电话" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="岗位" prop="post"> |
| | | <el-input v-model.trim="form.post" placeholder="岗位" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="项目名" prop="projectName"> |
| | | <el-input v-model.trim="form.projectName" placeholder="项目名" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-radio-group v-model="form.sex"> |
| | | <el-radio label="男">男</el-radio> |
| | | <el-radio label="女">女</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="用户姓名" prop="userName"> |
| | | <el-input v-model.trim="form.userName" placeholder="用户姓名" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="用户状态" prop="userState"> |
| | | <el-radio-group v-model="form.userState"> |
| | | <el-radio :label="1">正常</el-radio> |
| | | <el-radio :label="0">不合格</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | cardNumber: string |
| | | companyCode: string |
| | | contractorId: string |
| | | phone: string |
| | | post: string |
| | | projectName: string |
| | | sex: string |
| | | userName: string |
| | | userState: null | number |
| | | deleted: string |
| | | } |
| | | rules:{}, |
| | | contractorList: [] |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | cardNumber: '', |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | phone: '', |
| | | post: '', |
| | | projectName: '', |
| | | sex: '', |
| | | userName: '', |
| | | userState: null, |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | cardNumber: [{ required: true, message: '请填写身份证号', trigger: 'blur' }], |
| | | contractorId: [{ required: true, message: '请选择承包商', trigger: 'blur' }], |
| | | phone: [{ required: true, message: '请填写电话', trigger: 'blur' }], |
| | | post: [{ required: true, message: '请填写岗位', trigger: 'blur' }], |
| | | projectName: [{ required: true, message: '请填写项目名', trigger: 'blur' }], |
| | | sex: [{ required: true, message: '请选择性别', trigger: 'blur' }], |
| | | userName: [{ required: true, message: '请填写用户姓名', trigger: 'blur' }], |
| | | userState: [{ required: true, message: '请选择用户状态', trigger: 'blur' }] |
| | | }, |
| | | contractorList: [] |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true |
| | | getDataList() |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | cardNumber: '', |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | phone: '', |
| | | post: '', |
| | | projectName: '', |
| | | sex: '', |
| | | userName: '', |
| | | userState: null, |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | cardNumber: '', |
| | | companyCode: '652310082', |
| | | contractorId: '', |
| | | phone: '', |
| | | post: '', |
| | | projectName: '', |
| | | sex: '', |
| | | userName: '', |
| | | userState: null, |
| | | deleted: '0' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await contractorApi().addContractorUser([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const getDataList = async ()=>{ |
| | | const res = await contractorApi().getContractorList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.contractorList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="cardNumber" label="身份证号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="companyCode" label="企业编码" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorId" label="承包商Id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createBy" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="phone" label="电话" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="post" label="岗位" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="projectName" label="项目名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="sex" label="性别" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userName" label="用户姓名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userState" label="用户状态" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.userState == 1? '正常': scope.row.userState == 0? '不合格': ''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="updateBy" label="最新修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'contractorUser', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getContractorUserList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条数据,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delContractorUser({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="课程数量" prop="courseNum"> |
| | | <el-input v-model.trim.number="form.courseNum" placeholder="课程数量" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="课件数量" prop="coursewareNum"> |
| | | <el-input v-model.trim.number="form.coursewareNum" placeholder="课件数量" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="试题数量" prop="questionsNum"> |
| | | <el-input v-model.trim.number="form.questionsNum" placeholder="试题数量" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {educateTrainApi} from "/@/api/dataUpload/educateTrain"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | courseNum: number | null |
| | | coursewareNum: number | null |
| | | questionsNum: number | null |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | courseNum: null, |
| | | coursewareNum: null, |
| | | questionsNum: null |
| | | }, |
| | | rules:{ |
| | | courseNum: [{ required: true, message: '请填写课程数量', trigger: 'blur' }], |
| | | coursewareNum: [{ required: true, message: '请填写课件数量', trigger: 'blur' }], |
| | | questionsNum: [{ required: true, message: '请填写试题数量', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | courseNum: null, |
| | | coursewareNum: null, |
| | | questionsNum: null |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await educateTrainApi().addEducate([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="courseNum" label="课程数量" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="coursewareNum" label="课件数量" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="questionsNum" label="试题数量" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <!-- <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button>--> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {educateTrainApi} from "/@/api/dataUpload/educateTrain"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'educateResource', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await educateTrainApi().getEducateList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该记录,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await educateTrainApi().delEducate({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="考试参与率" prop="examJoinRate"> |
| | | <el-input v-model.trim="form.examJoinRate" placeholder="考试参与率" type="number" clearable> |
| | | <template #append>%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="考试合格率" prop="examPassRate"> |
| | | <el-input v-model.trim="form.examPassRate" placeholder="考试合格率" type="number" clearable> |
| | | <template #append>%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="缺考总数" prop="missExam"> |
| | | <el-input v-model.trim="form.missExam" placeholder="缺考总数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="待补课总数" prop="repairNum"> |
| | | <el-input v-model.trim="form.repairNum" placeholder="待补课总数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="人均学时" prop="studyAverage"> |
| | | <el-input v-model.trim="form.studyAverage" placeholder="人均学时" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="学时达标率" prop="studyQualifyRate"> |
| | | <el-input v-model.trim="form.studyQualifyRate" placeholder="学时达标率" type="number" clearable> |
| | | <template #append>%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="培训人数" prop="trainPerson"> |
| | | <el-input v-model.trim.number="form.trainPerson" placeholder="培训人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="培训参与率" prop="trainJoinRate"> |
| | | <el-input v-model.trim="form.trainJoinRate" placeholder="培训参与率" type="number" clearable> |
| | | <template #append>%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {educateTrainApi} from "/@/api/dataUpload/educateTrain"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | examJoinRate: string |
| | | examPassRate: string |
| | | missExam: string |
| | | rankWeek: string |
| | | repairNum: string |
| | | studyAverage: string |
| | | studyQualifyRate: string |
| | | trainPerson: null | number |
| | | trainJoinRate: string |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | examJoinRate: '', |
| | | examPassRate: '', |
| | | missExam: '', |
| | | rankWeek: '', |
| | | repairNum: '', |
| | | studyAverage: '', |
| | | studyQualifyRate: '', |
| | | trainPerson: null, |
| | | trainJoinRate: '' |
| | | }, |
| | | rules:{ |
| | | examJoinRate: [{ required: true, message: '请填写考试参与率', trigger: 'blur' }], |
| | | examPassRate: [{ required: true, message: '请填写考试合格率', trigger: 'blur' }], |
| | | missExam: [{ required: true, message: '请填写缺考总数', trigger: 'blur' }], |
| | | repairNum: [{ required: true, message: '请填写待补课总数', trigger: 'blur' }], |
| | | studyAverage: [{ required: true, message: '请填写人均学时', trigger: 'blur' }], |
| | | studyQualifyRate: [{ required: true, message: '请填写学时达标率', trigger: 'blur' }], |
| | | trainPerson: [{ required: true, message: '请填写培训人数', trigger: 'blur' }], |
| | | trainJoinRate: [{ required: true, message: '请填写培训参与率', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | examJoinRate: '', |
| | | examPassRate: '', |
| | | missExam: '', |
| | | rankWeek: getWeekNumber(), |
| | | repairNum: '', |
| | | studyAverage: '', |
| | | studyQualifyRate: '', |
| | | trainPerson: null, |
| | | trainJoinRate: '' |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await educateTrainApi().addTrain([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function getWeekNumber() { |
| | | // 获取当前日期 |
| | | const today = new Date(); |
| | | |
| | | // 获取当前年的第一天 |
| | | const firstDayOfYear = new Date(today.getFullYear(), 0, 1); |
| | | |
| | | // 计算当前日期与第一天之间的时间差(毫秒) |
| | | const timeDiff = today - firstDayOfYear; |
| | | |
| | | // 计算经过的天数,并将其转换为周数 |
| | | const weekNumber = Math.ceil((timeDiff / (24 * 60 * 60 * 1000) + 1) / 7); |
| | | |
| | | return weekNumber.toString() |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createDate" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="examJoinRate" label="考试参与率" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="examPassRate" label="考试合格率" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="missExam" label="缺考总数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="rankWeek" label="第几周" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="repairNum" label="待补课总数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="studyAverage" label="人均学时" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="studyQualifyRate" label="学时达标率" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="trainPerson" label="培训人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="trainJoinRate" label="培训参与率" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <!-- <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button>--> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {educateTrainApi} from "/@/api/dataUpload/educateTrain"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'trainInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await educateTrainApi().getTrainList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该记录,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await educateTrainApi().delTrain({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="序号" prop="serialNumber"> |
| | | <el-input v-model.trim="form.serialNumber" placeholder="序号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="卡号" prop="cardNo"> |
| | | <el-input v-model.trim="form.cardNo" placeholder="卡号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警人员名称" prop="realName"> |
| | | <el-input v-model.trim="form.realName" placeholder="报警人员名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警状态" prop="alarmStatus"> |
| | | <el-radio-group v-model="form.alarmStatus"> |
| | | <el-radio label="1">报警</el-radio> |
| | | <el-radio label="2">已处理</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警时间" prop="alarmTime"> |
| | | <el-date-picker v-model="form.alarmTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择报警时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警信息" prop="alarmInfo"> |
| | | <el-input v-model.trim="form.alarmInfo" :autosize="{ minRows: 1 }" type="textarea" placeholder="报警信息" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警类型" prop="alarmType"> |
| | | <el-select v-model="form.alarmType" placeholder="请选择报警类型"> |
| | | <el-option v-for="(item,index) in alarmTypeList" :key="index" :label="item.name" :value="item.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报警位置" prop="alarmLocation"> |
| | | <el-input v-model.trim="form.alarmLocation" :autosize="{ minRows: 1 }" type="textarea" placeholder="报警地点所在区域" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label=""> |
| | | <el-button type="primary" v-throttle @click="showMapLocation" size="default">获取经纬度</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="经度"> |
| | | <el-input v-model.trim="form.longitude" placeholder="经度(支持手动输入)" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="纬度"> |
| | | <el-input v-model.trim="form.latitude" placeholder="纬度(支持手动输入)" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="楼层号" prop="floorNo"> |
| | | <el-input v-model.trim="form.floorNo" placeholder="楼层号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="form.alarmStatus == '2'"> |
| | | <el-form-item label="销警时间" prop="handleTime"> |
| | | <el-date-picker v-model="form.handleTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择销警时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="form.alarmStatus == '1'"> |
| | | <el-form-item label="销警时间"> |
| | | <el-date-picker v-model="form.handleTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择销警时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="form.alarmStatus == '2'"> |
| | | <el-form-item label="处理信息" prop="handleInfo"> |
| | | <el-input v-model.trim="form.handleInfo" :autosize="{ minRows: 1 }" type="textarea" placeholder="处理信息" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="form.alarmStatus == '1'"> |
| | | <el-form-item label="处理信息"> |
| | | <el-input v-model.trim="form.handleInfo" :autosize="{ minRows: 1 }" type="textarea" placeholder="处理信息" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="跳转地址"> |
| | | <el-input v-model.trim="form.thirdAddress" :autosize="{ minRows: 1 }" type="textarea" placeholder="跳转地址" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <mapLocation ref="mapLocation" @giveLatLng="achieveLatLng"></mapLocation> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import mapLocation from "./mapLocation.vue" |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | serialNumber: string |
| | | cardNo: string |
| | | realName: string |
| | | alarmStatus: string |
| | | alarmTime: string |
| | | alarmInfo: string |
| | | alarmType: string |
| | | alarmLocation: string |
| | | longitude: string |
| | | latitude: string |
| | | floorNo: string |
| | | handleTime: string |
| | | handleInfo: string |
| | | thirdAddress: string |
| | | } |
| | | rules:{} |
| | | alarmTypeList: Array<alarmType> |
| | | } |
| | | |
| | | interface alarmType { |
| | | value: string |
| | | name: string |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | components: {mapLocation }, |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const mapLocation = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | serialNumber: '', |
| | | cardNo: '', |
| | | realName: '', |
| | | alarmStatus: '', |
| | | alarmTime: '', |
| | | alarmInfo: '', |
| | | alarmType: '', |
| | | alarmLocation: '', |
| | | longitude: '', |
| | | latitude: '', |
| | | floorNo: '', |
| | | handleTime: '', |
| | | handleInfo: '', |
| | | thirdAddress: 'http://124.88.37.66:8081/location_system_5.4.9/map3d/index.html' |
| | | }, |
| | | rules:{ |
| | | serialNumber: [{ required: true, message: '请填写序号', trigger: 'blur' }], |
| | | cardNo: [{ required: true, message: '请填写卡号', trigger: 'blur' }], |
| | | realName: [{ required: true, message: '请填写报警人员名称', trigger: 'blur' }], |
| | | alarmStatus: [{ required: true, message: '请选择报警状态', trigger: 'blur' }], |
| | | alarmTime: [{ required: true, message: '请选择报警时间', trigger: 'blur' }], |
| | | alarmInfo: [{ required: true, message: '请填写报警信息', trigger: 'blur' }], |
| | | alarmType: [{ required: true, message: '请选择报警类型', trigger: 'blur' }], |
| | | alarmLocation: [{ required: true, message: '请填写报警位置', trigger: 'blur' }], |
| | | floorNo: [{ required: true, message: '请填写楼层号', trigger: 'blur' }], |
| | | handleTime: [{ required: true, message: '请选择销警时间', trigger: 'blur' }], |
| | | handleInfo: [{ required: true, message: '请填写处理信息', trigger: 'blur' }] |
| | | }, |
| | | alarmTypeList: [ |
| | | {value: '01', name: '一键求救报警'}, |
| | | {value: '02', name: '滞留预警'}, |
| | | {value: '03', name: '越界报警'}, |
| | | {value: '04', name: '超员预警'}, |
| | | {value: '05', name: '缺员预警'}, |
| | | {value: '06', name: '静止预警'}, |
| | | {value: '07', name: '作业人员离开报警'}, |
| | | {value: '08', name: '非作业人员闯入报警'} |
| | | ] |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | serialNumber: '', |
| | | cardNo: '', |
| | | realName: '', |
| | | alarmStatus: '', |
| | | alarmTime: '', |
| | | alarmInfo: '', |
| | | alarmType: '', |
| | | alarmLocation: '', |
| | | longitude: '', |
| | | latitude: '', |
| | | floorNo: '', |
| | | handleTime: '', |
| | | handleInfo: '', |
| | | thirdAddress: 'http://124.88.37.66:8081/location_system_5.4.9/map3d/index.html' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | serialNumber: '', |
| | | cardNo: '', |
| | | realName: '', |
| | | alarmStatus: '', |
| | | alarmTime: '', |
| | | alarmInfo: '', |
| | | alarmType: '', |
| | | alarmLocation: '', |
| | | longitude: '', |
| | | latitude: '', |
| | | floorNo: '', |
| | | handleTime: '', |
| | | handleInfo: '', |
| | | thirdAddress: 'http://124.88.37.66:8081/location_system_5.4.9/map3d/index.html' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addPosition([state.form]) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | const showMapLocation=()=>{ |
| | | mapLocation.value.openMapLocation(state.form.longitude,state.form.latitude) |
| | | } |
| | | |
| | | const achieveLatLng=(lng: string,lat: string)=>{ |
| | | state.form.longitude = lng |
| | | state.form.latitude = lat |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | mapLocation, |
| | | open, |
| | | onSubmit, |
| | | showMapLocation, |
| | | achieveLatLng, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="mapLocationVisible" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | width="75%" |
| | | :title="title" |
| | | > |
| | | <div class="mapLocation_head"> |
| | | <div> |
| | | <el-alert |
| | | title="点击地点获取经纬度信息" |
| | | type="info" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | <div class="mapLocation_latlng"> |
| | | <span>经度:</span> |
| | | <el-input class="mapLocation_latlng_input" id="lng" v-model="longitude"></el-input> |
| | | </div> |
| | | <div class="mapLocation_latlng"> |
| | | <span>纬度:</span> |
| | | <el-input class="mapLocation_latlng_input" id="lat" v-model="latitude"></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="mapLocation_body"> |
| | | <baidu-map class="map" ak="BkZdiHBj9aGrMdVFM48r2njNiMzsekga" v="3.0" type="API" :center="center" :zoom="15" scroll-wheel-zoom @ready="initMap" @click="getPosition"> |
| | | <bm-marker :position="{lng: longitude, lat: latitude}" :dragging="true" animation="BMAP_ANIMATION_BOUNCE"> |
| | | <bm-label content="选择地点" :labelStyle="{color: 'red', fontSize : '24px'}" :offset="{width: -35, height: 30}"/> |
| | | </bm-marker> |
| | | </baidu-map> |
| | | </div> |
| | | <div align="right" style="margin-top: 10px"> |
| | | <el-button @click="mapLocationVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitLatLng()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {ref, onMounted, reactive, toRefs, defineComponent} from 'vue'; |
| | | import { BaiduMap,BmMarker } from 'vue-baidu-map-3x' |
| | | interface DataState{ |
| | | title: string |
| | | longitude: string |
| | | latitude: string |
| | | mapLocationVisible: boolean |
| | | center: { |
| | | |
| | | } |
| | | } |
| | | export default defineComponent({ |
| | | name: "mapLocation", |
| | | components: {BaiduMap,BmMarker}, |
| | | setup(props,context) { |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | longitude: '', |
| | | latitude: '', |
| | | mapLocationVisible: false, |
| | | center: { |
| | | lng: '116.404', |
| | | lat: '39.915' |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | onMounted(() => { |
| | | // ...(mounted钩子中的代码不变) |
| | | }); |
| | | const map = reactive({}) |
| | | |
| | | const getPosition = ({type, target, point, pixel, overlay})=>{ |
| | | state.longitude = point.lng |
| | | state.latitude = point.lat |
| | | } |
| | | |
| | | const openMapLocation=(longitude:string,latitude:string)=>{ |
| | | state.longitude = longitude |
| | | state.latitude = latitude |
| | | state.mapLocationVisible = true |
| | | } |
| | | |
| | | const submitLatLng=()=>{ |
| | | state.mapLocationVisible = false |
| | | context.emit('giveLatLng',state.longitude,state.latitude); |
| | | } |
| | | |
| | | const initMap=()=>{ |
| | | |
| | | } |
| | | |
| | | return { |
| | | map, |
| | | getPosition, |
| | | submitLatLng, |
| | | initMap, |
| | | openMapLocation, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .map { |
| | | width: 100%; |
| | | height: 500px; |
| | | |
| | | :deep(.BMap_cpyCtrl){ |
| | | display: none!important; |
| | | visibility: hidden!important; |
| | | } |
| | | |
| | | :deep(.anchorBL) { |
| | | display: none!important; |
| | | visibility: hidden!important; |
| | | } |
| | | } |
| | | .mapLocation_head{ |
| | | width:100%; |
| | | height:100px; |
| | | } |
| | | .mapLocation_body{ |
| | | width:100%; |
| | | height:500px |
| | | } |
| | | .mapLocation_latlng{ |
| | | padding-top:10px; |
| | | display:inline-block; |
| | | margin-right: 20px; |
| | | } |
| | | .mapLocation_latlng_input{ |
| | | width:250px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="cardNo" label="卡号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="realName" label="报警人员名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="alarmStatus" label="报警状态" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.alarmStatus == '1'?'报警':scope.row.alarmStatus == '2'?'报警已处理':'--'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="alarmTime" label="报警时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="alarmInfo" label="报警信息" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="alarmType" label="报警类型" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{getAlarmType(scope.row.alarmType)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="alarmLocation" label="报警位置" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="longitude" label="经度" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="latitude" label="纬度" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="floorNo" label="楼层号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="handleTime" label="销警时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="handleInfo" label="处理信息" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | alarmTypeList: Array<alarmType> |
| | | } |
| | | interface alarmType { |
| | | value: string |
| | | name: string |
| | | } |
| | | export default defineComponent({ |
| | | name: 'contractorInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null, |
| | | alarmTypeList: [ |
| | | {value: '01', name: '一键求救报警'}, |
| | | {value: '02', name: '滞留预警'}, |
| | | {value: '03', name: '越界报警'}, |
| | | {value: '04', name: '超员预警'}, |
| | | {value: '05', name: '缺员预警'}, |
| | | {value: '06', name: '静止预警'}, |
| | | {value: '07', name: '作业人员离开报警'}, |
| | | {value: '08', name: '非作业人员闯入报警'} |
| | | ] |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getPositionList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条数据,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delPosition({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | const getAlarmType = (type: string)=>{ |
| | | return state.alarmTypeList.find(i=>i.value == type)?.name |
| | | } |
| | | return { |
| | | reportRef, |
| | | getAlarmType, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="证书名称" prop="name"> |
| | | <el-input v-model.trim="form.name" placeholder="证书名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="分类名称" prop="cateName"> |
| | | <el-input v-model.trim="form.cateName" placeholder="分类名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="发证机构" prop="orgName"> |
| | | <el-input v-model.trim="form.orgName" placeholder="发证机构" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="发证日期"> |
| | | <el-date-picker v-model="form.pusTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择发证日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="有效期至"> |
| | | <el-date-picker v-model="form.effectiveTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择有效期至" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="到期提醒时间"> |
| | | <el-date-picker v-model="form.dueTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择到期提醒时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="提醒人" prop="notifyUser"> |
| | | <el-input v-model.trim="form.notifyUser" placeholder="提醒人" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | name: string |
| | | cateName: string |
| | | orgName: string |
| | | pusTime: string |
| | | effectiveTime: string |
| | | dueTime: string |
| | | notifyUser: string |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid:'', |
| | | name: '', |
| | | cateName: '', |
| | | orgName: '', |
| | | pusTime: '', |
| | | effectiveTime: '', |
| | | dueTime: '', |
| | | notifyUser: '' |
| | | }, |
| | | rules:{ |
| | | name: [{ required: true, message: '请填写证书名称', trigger: 'blur' }], |
| | | cateName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], |
| | | orgName: [{ required: true, message: '请填写发证机构', trigger: 'blur' }], |
| | | notifyUser: [{ required: true, message: '请填写提醒人', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid:'', |
| | | name: '', |
| | | cateName: '', |
| | | orgName: '', |
| | | pusTime: '', |
| | | effectiveTime: '', |
| | | dueTime: '', |
| | | notifyUser: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | name: '', |
| | | cateName: '', |
| | | orgName: '', |
| | | pusTime: '', |
| | | effectiveTime: '', |
| | | dueTime: '', |
| | | notifyUser: '' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addCard([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="证书名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="cateName" label="分类名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="orgName" label="发证机构" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="pusTime" label="发证日期" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="effectiveTime" label="有效期至" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="dueTime" label="到期提醒时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="notifyUser" label="提醒人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'cardInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getCardList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除:“${row.name}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delCard({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-role-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="769px"> |
| | | <el-form :model="roleForm" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="证书名称"> |
| | | <el-input v-model="roleForm.name" placeholder="请输入证书名称" clearable style="width: 100%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmit" v-throttle size="default">{{ buttonName }}</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { ElMessage } from 'element-plus'; |
| | | import { reactive, toRefs, defineComponent } from 'vue'; |
| | | import {certApi} from "/@/api/systemManage/certificate"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface MenuDataTree { |
| | | id: number; |
| | | label: string; |
| | | children?: MenuDataTree[]; |
| | | } |
| | | interface RoleState { |
| | | title: string; |
| | | buttonName: string; |
| | | isShowDialog: boolean; |
| | | roleForm: { |
| | | id: null | number |
| | | name: string; |
| | | }; |
| | | menuData: Array<MenuDataTree>; |
| | | menuProps: { |
| | | children: string; |
| | | label: string; |
| | | }; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'certificateDialog', |
| | | setup(prop, context) { |
| | | const state = reactive<RoleState>({ |
| | | isShowDialog: false, |
| | | title: '', |
| | | buttonName: '', |
| | | roleForm: { |
| | | id: null, |
| | | name: '', // 证书名称 |
| | | }, |
| | | menuData: [], |
| | | menuProps: { |
| | | children: 'children', |
| | | label: 'label' |
| | | } |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any) => { |
| | | state.isShowDialog = true; |
| | | if (type === '新增') { |
| | | state.title = '新增证书'; |
| | | state.buttonName = '新增'; |
| | | state.roleForm = { |
| | | id: null, |
| | | name: '' |
| | | }; |
| | | } else { |
| | | state.title = '修改证书'; |
| | | state.buttonName = '修改'; |
| | | state.roleForm.id = JSON.parse(JSON.stringify(value)).id |
| | | state.roleForm.name = JSON.parse(JSON.stringify(value)).name |
| | | } |
| | | }; |
| | | // 新增 |
| | | const onSubmit = async () => { |
| | | if (state.title === '新增证书') { |
| | | let res = await certApi().addCerttype({name: state.roleForm.name}); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '证书新增成功', |
| | | duration: 2000 |
| | | }); |
| | | state.isShowDialog = false; |
| | | context.emit('refreshCertList'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | let res = await certApi().modCerttype(state.roleForm); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '证书修改成功', |
| | | duration: 2000 |
| | | }); |
| | | state.isShowDialog = false; |
| | | context.emit('refreshCertList'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | // 获取菜单结构数据 |
| | | return { |
| | | onSubmit, |
| | | openDialog, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .system-add-role-container { |
| | | .menu-data-tree { |
| | | width: 100%; |
| | | border: 1px solid var(--el-border-color); |
| | | border-radius: var(--el-input-border-radius, var(--el-border-radius-base)); |
| | | padding: 5px; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogCertificate" :title="title"> |
| | | <div class="system-user-search mb15"> |
| | | <el-input size="default" v-model.trim="listQuery.searchParams.userName" placeholder="请输入用户名" style="max-width: 180px"> </el-input> |
| | | <el-button size="default" type="primary" class="ml10" @click="handleSearch"> |
| | | <el-icon> |
| | | <ele-Search /> |
| | | </el-icon> |
| | | 查询 |
| | | </el-button> |
| | | </div> |
| | | <el-table |
| | | :data="tableData" |
| | | highlight-current-row |
| | | style="width: 100%;margin-top: 20px" |
| | | border |
| | | :header-cell-style="{background: '#fafafa'}" |
| | | > |
| | | <el-table-column property="userName" label="姓名"/> |
| | | <el-table-column property="depName" label="所属部门"/> |
| | | <el-table-column property="certTypeName" label="证书类型"/> |
| | | <el-table-column property="certExpiredAt" label="到期时间"/> |
| | | </el-table> |
| | | <br /> |
| | | <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | <br /> |
| | | <br /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Delete, Edit, View, Plus } from '@element-plus/icons-vue' |
| | | import {ElMessage, ElMessageBox, ElTable} from 'element-plus' |
| | | import {certApi} from "/@/api/systemManage/certificate"; |
| | | |
| | | |
| | | interface stateType { |
| | | title: string |
| | | dialogCertificate: boolean |
| | | tableData: Array<any> |
| | | listQuery: { |
| | | pageIndex: number |
| | | pageSize: number |
| | | searchParams: { |
| | | userName: string |
| | | certTypeId: number | null |
| | | } |
| | | } |
| | | total: number | null |
| | | } |
| | | export default defineComponent({ |
| | | name: 'certificateMember', |
| | | components: {}, |
| | | props:[], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | title: '', |
| | | dialogCertificate: false, |
| | | tableData: [], |
| | | total: null, |
| | | listQuery: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | searchParams: { |
| | | userName:'', |
| | | certTypeId: null |
| | | } |
| | | } |
| | | }); |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | const ctfRef = ref() |
| | | const openDialog = (type:string,value: any) => { |
| | | state.tableData = [] |
| | | state.total = null |
| | | state.listQuery.searchParams.certTypeId = value.id |
| | | state.dialogCertificate = true |
| | | if(type == '人员'){ |
| | | state.title = '证书人员' |
| | | getUserData() |
| | | }else{ |
| | | state.title = '证书即将到期' |
| | | getUnvalidData() |
| | | } |
| | | } |
| | | |
| | | const getUserData = async () => { |
| | | let res = await certApi().getCertUsers(state.listQuery); |
| | | if (res.data.code === '200') { |
| | | state.tableData = res.data.data |
| | | state.total = res.data.total |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const getUnvalidData = async () => { |
| | | let res = await certApi().getCertUnvalid(state.listQuery); |
| | | if (res.data.code === '200') { |
| | | state.tableData = res.data.data |
| | | state.total = res.data.total |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | if(state.title == '证书人员'){ |
| | | getUserData(); |
| | | }else{ |
| | | getUnvalidData() |
| | | } |
| | | } |
| | | |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | if(state.title == '证书人员'){ |
| | | getUserData(); |
| | | }else{ |
| | | getUnvalidData() |
| | | } |
| | | } |
| | | |
| | | const handleSearch = () => { |
| | | state.listQuery.pageIndex = 1 |
| | | if(state.title == '证书人员'){ |
| | | getUserData(); |
| | | }else{ |
| | | getUnvalidData() |
| | | } |
| | | } |
| | | |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | openDialog, |
| | | ctfRef, |
| | | Search, |
| | | Delete, |
| | | Edit, |
| | | View, |
| | | Plus, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | handleSearch, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 0 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogMes" :title="title"> |
| | | <el-table |
| | | :data="tableData" |
| | | highlight-current-row |
| | | style="width: 100%;margin-top: 20px" |
| | | border |
| | | :header-cell-style="{background: '#fafafa'}" |
| | | > |
| | | <el-table-column property="id" label="发送时间"/> |
| | | <el-table-column property="roleId" label="预警信息内容"/> |
| | | <el-table-column property="workTypeDesc" label="预警级别"/> |
| | | <el-table-column property="roleId" label="接收人"> |
| | | <template #default="scope"> |
| | | {{ roleList.find(i=>i.roleId == scope.row.roleId)?.roleName }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search, Delete, Edit, View, Plus } from '@element-plus/icons-vue' |
| | | import {ElMessage, ElMessageBox, ElTable} from 'element-plus' |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | |
| | | |
| | | interface stateType { |
| | | title: string |
| | | dialogMes: boolean |
| | | tableData: Array<any> |
| | | roleList: Array<any> |
| | | uid: number | null |
| | | } |
| | | export default defineComponent({ |
| | | name: 'historyMessages', |
| | | components: {}, |
| | | props:[], |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | title: '', |
| | | dialogMes: false, |
| | | tableData: [], |
| | | roleList: [], |
| | | uid: null |
| | | }); |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | const ctfRef = ref() |
| | | const openDialog = (value: any) => { |
| | | state.dialogMes = true |
| | | } |
| | | |
| | | // const getRoleData = async () => { |
| | | // let res = await useRoleApi().getRoleList(); |
| | | // if (res.data.code === '200') { |
| | | // state.roleList = res.data.data; |
| | | // } else { |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: res.data.msg |
| | | // }); |
| | | // } |
| | | // }; |
| | | // |
| | | // const getCtf = async()=>{ |
| | | // let res = await userApi().getCtf({uid: state.uid}) |
| | | // if(res.data.code == 200){ |
| | | // state.tableData = res.data.data |
| | | // }else{ |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: res.data.msg |
| | | // }) |
| | | // } |
| | | // } |
| | | |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | openDialog, |
| | | ctfRef, |
| | | Search, |
| | | Delete, |
| | | Edit, |
| | | View, |
| | | Plus, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 0 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-role-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <el-input size="default" v-model.trim="listQuery.searchParams.name" placeholder="请输入证书类型" style="max-width: 180px"> </el-input> |
| | | <el-button size="default" type="primary" class="ml10" @click="handleSearch"> |
| | | <el-icon> |
| | | <ele-Search /> |
| | | </el-icon> |
| | | 查询 |
| | | </el-button> |
| | | <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> |
| | | <el-icon> |
| | | <ele-FolderAdd /> |
| | | </el-icon> |
| | | 新增 |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="tableData.data" style="width: 100%"> |
| | | <el-table-column prop="name" label="证书类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="personCount" label="关联证书人员" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.personCount && scope.row.personCount>0" link type="primary" @click="openMembers('人员',scope.row)">{{scope.row.personCount}}</el-button> |
| | | <span v-else>0</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unValidCount" label="三个月证书到期" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.unValidCount && scope.row.unValidCount>0" link type="danger" @click="openMembers('到期',scope.row)">{{scope.row.unValidCount}}</el-button> |
| | | <span v-else>0</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="warnCount" label="历史预警信息" show-overflow-tooltip>--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button v-if="scope.row.warnCount && scope.row.warnCount>0" link type="danger" @click="openMes(scope.row)">{{scope.row.warnCount}}</el-button>--> |
| | | <!-- <span v-else>0</span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="操作" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> |
| | | <el-button size="small" style="color: red" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br /> |
| | | <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total"> </el-pagination> |
| | | <br /> |
| | | <br /> |
| | | </el-card> |
| | | <certificateDialog ref="certificateRef" @refreshCertList="initRoleTableData" /> |
| | | <certificate-member ref="certificateMemRef"></certificate-member> |
| | | <messages ref="mesRef"></messages> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import certificateDialog from '/@/views/system/certificate/component/certificateDialog.vue' |
| | | import certificateMember from '/@/views/system/certificate/component/certificateMember.vue' |
| | | import messages from '/@/views/system/certificate/component/messages.vue' |
| | | import { certApi } from '/@/api/systemManage/certificate'; |
| | | import { useMenuApi } from '/@/api/systemManage/menu'; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import {storeToRefs} from "pinia"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableData { |
| | | roleName: string; |
| | | roleSign: string; |
| | | describe: string; |
| | | sort: number; |
| | | status: boolean; |
| | | createTime: string; |
| | | } |
| | | interface TableDataState { |
| | | tableData: { |
| | | data: Array<TableData>; |
| | | total: number; |
| | | loading: boolean; |
| | | }; |
| | | listQuery: { |
| | | pageIndex: number |
| | | pageSize: number |
| | | searchParams: { |
| | | name: string |
| | | } |
| | | }; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'certificate', |
| | | components: {messages, certificateMember, certificateDialog }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const certificateRef = ref(); |
| | | const certificateMemRef = ref(); |
| | | const mesRef = ref(); |
| | | const state = reactive<TableDataState>({ |
| | | tableData: { |
| | | data: [], |
| | | total: 0, |
| | | loading: false, |
| | | }, |
| | | listQuery: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | searchParams: { |
| | | name:'' |
| | | } |
| | | } |
| | | }); |
| | | // 初始化表格数据 |
| | | const initRoleTableData = async () => { |
| | | let res = await certApi().getCerttypeList(state.listQuery); |
| | | if (res.data.code === '200') { |
| | | state.tableData.data = res.data.data; |
| | | state.tableData.total = res.data.total |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const onOpenDialogRef = (type: string, value: any) => { |
| | | certificateRef.value.openDialog(type, value); |
| | | }; |
| | | |
| | | const openMembers = (type: string, value: any) => { |
| | | certificateMemRef.value.openDialog(type,value) |
| | | } |
| | | |
| | | const openMes = (value: any) => { |
| | | mesRef.value.openDialog(value) |
| | | } |
| | | const onRowDel = (row: any) => { |
| | | ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.name}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | let res = await certApi().deleteCerttype(row.id); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | duration: 2000, |
| | | message: '删除成功' |
| | | }); |
| | | await initRoleTableData(); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | const handleSearch = () => { |
| | | state.listQuery.pageIndex = 1 |
| | | initRoleTableData(); |
| | | }; |
| | | |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | initRoleTableData(); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | initRoleTableData(); |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initRoleTableData(); |
| | | }); |
| | | return { |
| | | onRowDel, |
| | | handleSearch, |
| | | certificateRef, |
| | | certificateMemRef, |
| | | mesRef, |
| | | onOpenDialogRef, |
| | | openMembers, |
| | | openMes, |
| | | initRoleTableData, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="200px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="从业人数" prop="cyrs"> |
| | | <el-input v-model.trim.number="form.cyrs" placeholder="从业人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="主要负责人" prop="zyfzr"> |
| | | <el-input v-model.trim="form.zyfzr" placeholder="主要负责人" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="安全负责人" prop="aqfzr"> |
| | | <el-input v-model.trim="form.aqfzr" placeholder="安全负责人" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="生产/经营地址" prop="scjydz"> |
| | | <el-input v-model.trim="form.scjydz" :autosize="{ minRows: 1 }" type="textarea" placeholder="生产/经营地址" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="特殊作业人数" prop="specialNum"> |
| | | <el-input v-model.trim.number="form.specialNum" placeholder="特殊作业人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="特殊作业证书到期人数" prop="specialCertExpireNum"> |
| | | <el-input v-model.trim.number="form.specialCertExpireNum" placeholder="特殊作业证书到期人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="专职安全人员人数" prop="proSafeNum"> |
| | | <el-input v-model.trim.number="form.proSafeNum" placeholder="专职安全人员人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="专职安全人员证书到期人数" prop="proSafeCertExpireNum"> |
| | | <el-input v-model.trim.number="form.proSafeCertExpireNum" placeholder="专职安全人员证书到期人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="专职安全人员复审培训到期人数" prop="proSafeCheckTrainExpireNum"> |
| | | <el-input v-model.trim.number="form.proSafeCheckTrainExpireNum" placeholder="专职安全人员复审培训到期人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="注册安全工程师人数" prop="registSafeNum"> |
| | | <el-input v-model.trim.number="form.registSafeNum" placeholder="注册安全工程师人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="注册安全工程师证书到期人数" prop="registSafeCertExpireNum"> |
| | | <el-input v-model.trim.number="form.registSafeCertExpireNum" placeholder="注册安全工程师证书到期人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="注册安全工程师复审培训到期人数" prop="registSafeCheckTrainExpireNum"> |
| | | <el-input v-model.trim.number="form.registSafeCheckTrainExpireNum" placeholder="注册安全工程师复审培训到期人数" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | cyrs: number | null |
| | | zyfzr: string |
| | | aqfzr: string |
| | | scjydz: string |
| | | specialNum: number | null |
| | | specialCertExpireNum: number | null |
| | | proSafeNum: number | null |
| | | proSafeCertExpireNum: number | null |
| | | proSafeCheckTrainExpireNum: number | null |
| | | registSafeNum: number | null |
| | | registSafeCertExpireNum: number | null |
| | | registSafeCheckTrainExpireNum: number | null |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | cyrs: null, |
| | | zyfzr: '', |
| | | aqfzr: '', |
| | | scjydz: '', |
| | | specialNum: null, |
| | | specialCertExpireNum: null, |
| | | proSafeNum: null, |
| | | proSafeCertExpireNum: null, |
| | | proSafeCheckTrainExpireNum: null, |
| | | registSafeNum: null, |
| | | registSafeCertExpireNum: null, |
| | | registSafeCheckTrainExpireNum: null |
| | | }, |
| | | rules:{ |
| | | cyrs: [{ required: true, message: '请填写从业人数', trigger: 'blur' }], |
| | | zyfzr: [{ required: true, message: '请填写主要负责人', trigger: 'blur' }], |
| | | aqfzr: [{ required: true, message: '请填写安全负责人', trigger: 'blur' }], |
| | | scjydz: [{ required: true, message: '请填写生产/经营地址', trigger: 'blur' }], |
| | | specialNum: [{ required: true, message: '请填写特殊作业人数', trigger: 'blur' }], |
| | | specialCertExpireNum: [{ required: true, message: '请填写特殊作业证书到期人数', trigger: 'blur' }], |
| | | proSafeNum: [{ required: true, message: '请填写专职安全人员人数', trigger: 'blur' }], |
| | | proSafeCertExpireNum: [{ required: true, message: '请填写专职安全人员证书到期人数', trigger: 'blur' }], |
| | | proSafeCheckTrainExpireNum: [{ required: true, message: '请填写专职安全人员复审培训到期人数', trigger: 'blur' }], |
| | | registSafeNum: [{ required: true, message: '请填写注册安全工程师人数', trigger: 'blur' }], |
| | | registSafeCertExpireNum: [{ required: true, message: '请填写注册安全工程师证书到期人数', trigger: 'blur' }], |
| | | registSafeCheckTrainExpireNum: [{ required: true, message: '请填写注册安全工程师复审培训到期人数', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | cyrs: null, |
| | | zyfzr: '', |
| | | aqfzr: '', |
| | | scjydz: '', |
| | | specialNum: null, |
| | | specialCertExpireNum: null, |
| | | proSafeNum: null, |
| | | proSafeCertExpireNum: null, |
| | | proSafeCheckTrainExpireNum: null, |
| | | registSafeNum: null, |
| | | registSafeCertExpireNum: null, |
| | | registSafeCheckTrainExpireNum: null |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addCrow(state.form) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="cyrs" label="从业人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="zyfzr" label="主要负责人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="aqfzr" label="安全负责人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="scjydz" label="生产/经营地址" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="specialNum" label="特种作业人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="specialCertExpireNum" label="特种作业证书到期人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="proSafeNum" label="专职安全人员人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="proSafeCertExpireNum" label="专职安全人员证书到期人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="proSafeCheckTrainExpireNum" label="专职安全人员复审培训到期人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="registSafeNum" label="注册安全工程师人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="registSafeCertExpireNum" label="注册安全工程师证书到期人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="registSafeCheckTrainExpireNum" label="注册安全工程师复审培训到期人数" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'crowInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getCrowList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条数据,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delCrow({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="编号" prop="no"> |
| | | <el-input v-model.trim="form.no" placeholder="编号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="设备名称" prop="name"> |
| | | <el-input v-model.trim="form.name" placeholder="设备名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="分类" prop="cateName"> |
| | | <el-input v-model.trim="form.cateName" placeholder="分类名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="型号" prop="model"> |
| | | <el-input v-model.trim="form.model" placeholder="型号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="出厂时间"> |
| | | <el-date-picker v-model="form.productionTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择出厂时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="是否特种设备"> |
| | | <el-radio-group v-model="form.isSpecial"> |
| | | <el-radio :label="0">是</el-radio> |
| | | <el-radio :label="1">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="是否注册登记"> |
| | | <el-radio-group v-model="form.isRegister"> |
| | | <el-radio :label="0">是</el-radio> |
| | | <el-radio :label="1">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="注册登记编号" prop="registerNo"> |
| | | <el-input v-model.trim="form.registerNo" placeholder="注册登记编号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="设备状况"> |
| | | <el-select v-model="form.status" placeholder="请选择设备状况"> |
| | | <el-option :key="1" label="1" :value="1"/> |
| | | <el-option :key="2" label="2" :value="2"/> |
| | | <el-option :key="3" label="3" :value="3"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="注册登记表"> |
| | | <el-input v-model.trim="form.registerTable" placeholder="注册登记表" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="检验状态"> |
| | | <el-select v-model="form.checkStatus" placeholder="请选择检验状态"> |
| | | <el-option :key="1" label="1" :value="1"/> |
| | | <el-option :key="2" label="2" :value="2"/> |
| | | <el-option :key="3" label="3" :value="3"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="下次检验时间"> |
| | | <el-date-picker v-model="form.nextCheckTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择下次检验时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="上次校验时间"> |
| | | <el-date-picker v-model="form.lastCheckTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择上次校验时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="附件"> |
| | | <el-upload accept=".pdf" :action="uploadUrl" :headers="header" method="post" :on-exceed="showTip" :on-success="handleAvatarSuccess" :limit='1' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">仅支持上传pdf文件,尺寸小于2M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | no: string |
| | | name: string |
| | | cateName: string |
| | | model: string |
| | | productionTime: string |
| | | isSpecial: number | null |
| | | isRegister: number | null |
| | | registerNo: string |
| | | status: number | null |
| | | registerTable: string |
| | | checkStatus: number | null |
| | | nextCheckTime: string |
| | | lastCheckTime: string |
| | | files: string |
| | | } |
| | | rules:{} |
| | | fileList: [], |
| | | uploadUrl: string, |
| | | header: {} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | no: '', |
| | | name: '', |
| | | cateName: '', |
| | | model: '', |
| | | productionTime: '', |
| | | isSpecial: null, |
| | | isRegister: null, |
| | | registerNo: '', |
| | | status: null, |
| | | registerTable: '', |
| | | checkStatus: null, |
| | | nextCheckTime: '', |
| | | lastCheckTime: '', |
| | | files: '' |
| | | }, |
| | | rules:{ |
| | | no: [{ required: true, message: '请填写编号', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请填写设备名称', trigger: 'blur' }], |
| | | cateName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], |
| | | model: [{ required: true, message: '请填写型号', trigger: 'blur' }], |
| | | registerNo: [{ required: true, message: '请填写注册登记编号', trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid:'', |
| | | no: '', |
| | | name: '', |
| | | cateName: '', |
| | | model: '', |
| | | productionTime: '', |
| | | isSpecial: null, |
| | | isRegister: null, |
| | | registerNo: '', |
| | | status: null, |
| | | registerTable: '', |
| | | checkStatus: null, |
| | | nextCheckTime: '', |
| | | lastCheckTime: '', |
| | | files: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | no: '', |
| | | name: '', |
| | | cateName: '', |
| | | model: '', |
| | | productionTime: '', |
| | | isSpecial: null, |
| | | isRegister: null, |
| | | registerNo: '', |
| | | status: null, |
| | | registerTable: '', |
| | | checkStatus: null, |
| | | nextCheckTime: '', |
| | | lastCheckTime: '', |
| | | files: '' |
| | | } |
| | | } |
| | | state.fileList = [] |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addEquip([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | state.fileList = [] |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res:any, uploadFile: any) => { |
| | | if(res){ |
| | | uploadFile.name = res |
| | | state.form.files = res |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.form.files = '' |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | showTip, |
| | | picSize, |
| | | handleAvatarSuccess, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="no" label="编号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="设备名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="cateName" label="分类" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="model" label="型号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="productionTime" label="出厂时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="isSpecial" label="是否特种设备" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.isSpecial == 0?'是':scope.row.isSpecial == 1?'否':''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="isRegister" label="是否注册登记" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{scope.row.isSpecial == 0?'是':scope.row.isSpecial == 1?'否':''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="registerNo" label="注册登记编号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="status" label="设备状况" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="files" label="附件" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.files !== ''" size="small" text type="primary" @click="openFile(scope.row.files)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="registerTable" label="注册等级表" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="checkStatus" label="检验状态" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="nextCheckTime" label="下次检验时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="lastCheckTime" label="上次校验时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import axios from "axios"; |
| | | import Cookies from "js-cookie"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'equipInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getEquipList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除:“${row.name}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delEquip({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | const openFile=(file: string)=>{ |
| | | axios.get(import.meta.env.VITE_API_URL + file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | window.open(link.href) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | openFile, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="报告名称" prop="name"> |
| | | <el-input v-model.trim="form.name" placeholder="报告名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model.trim="form.remarks" :autosize="{ minRows: 1 }" type="textarea" placeholder="备注" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="评价时间" prop="evaluateTime"> |
| | | <el-date-picker v-model="form.evaluateTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择评价时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="附件"> |
| | | <el-upload accept=".pdf" :action="uploadUrl" :headers="header" method="post" :on-exceed="showTip" :on-success="handleAvatarSuccess" :limit='1' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">仅支持上传pdf文件,尺寸小于2M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {userApi} from '/@/api/systemManage/user' |
| | | import Cookies from "js-cookie"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string; |
| | | isShowDialog: boolean; |
| | | form: { |
| | | uuid: string |
| | | name: string |
| | | remarks: string |
| | | evaluateTime: string |
| | | files: string |
| | | } |
| | | rules:{}, |
| | | fileList: [], |
| | | uploadUrl: string, |
| | | header: {} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | }, |
| | | rules:{ |
| | | name: [{ required: true, message: '请填写报告名称', trigger: 'blur'}], |
| | | remarks: [{ required: true, message: '请填写备注', trigger: 'blur'}], |
| | | evaluateTime: [{ required: true, message: '请选择评价时间', trigger: 'blur'}] |
| | | }, |
| | | fileList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '' |
| | | } |
| | | } |
| | | state.fileList = [] |
| | | }; |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res:any, uploadFile: any) => { |
| | | if(res){ |
| | | uploadFile.name = res |
| | | state.form.files = res |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.form.files = '' |
| | | } |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addJudge([state.form]) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | state.fileList = [] |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | showTip, |
| | | picSize, |
| | | handleAvatarSuccess, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="报告名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="evaluateTime" label="评价时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="files" label="附件" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.files !== ''" size="small" text type="primary" @click="openFile(scope.row.files)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import axios from "axios"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | id: number|null |
| | | reportTime: string |
| | | name: string |
| | | remarks: string |
| | | evaluateTime: string |
| | | files: string |
| | | } |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'judgeReport', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getJudgeList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | const openFile=(file: string)=>{ |
| | | axios.get(import.meta.env.VITE_API_URL + file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | window.open(link.href) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除报告名称:“${row.name}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delJudge({ids: [row.id]}) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openFile, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="方案名称" prop="programmeName"> |
| | | <el-input v-model.trim="form.programmeName" placeholder="方案名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="开始时间" prop="startTime"> |
| | | <el-date-picker v-model="form.startTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择开始时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="结束时间" prop="endTime"> |
| | | <el-date-picker v-model="form.endTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择开始时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="开停车类型" prop="programmeType"> |
| | | <el-radio-group v-model="form.programmeType"> |
| | | <el-radio :label="1">开车</el-radio> |
| | | <el-radio :label="2">停车</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="负责部门"> |
| | | <el-input v-model.trim="form.responsibleDept" placeholder="负责部门" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="负责人"> |
| | | <el-input v-model.trim="form.responsiblePerson" placeholder="负责人" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="危险工艺"> |
| | | <el-input v-model.trim="form.craftName" :autosize="{ minRows: 1 }" type="textarea" placeholder="危险工艺" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="顺序"> |
| | | <el-input v-model.trim="form.seq" placeholder="顺序" type="number" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="准备"> |
| | | <el-input v-model.trim="form.preparation" placeholder="准备" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="方案"> |
| | | <el-input v-model.trim="form.programme" placeholder="方案" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | programmeName: string |
| | | startTime: string |
| | | endTime: string |
| | | programmeType: number | null |
| | | responsibleDept: string |
| | | responsiblePerson: string |
| | | craftName: string |
| | | seq: string |
| | | preparation: string |
| | | programme: string |
| | | } |
| | | rules:{} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid:'', |
| | | programmeName: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | programmeType: null, |
| | | responsibleDept: '', |
| | | responsiblePerson: '', |
| | | craftName: '', |
| | | seq: '', |
| | | preparation: '', |
| | | programme: '' |
| | | }, |
| | | rules:{ |
| | | programmeName: [{ required: true, message: '请填写方案名称', trigger: 'blur' }], |
| | | startTime: [{ required: true, message: '请选择开始时间', trigger: 'blur' }], |
| | | endTime: [{ required: true, message: '请选择结束时间', trigger: 'blur' }], |
| | | programmeType: [{ required: true, message: '请选择开停车类型', trigger: 'blur' }] |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid:'', |
| | | programmeName: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | programmeType: null, |
| | | responsibleDept: '', |
| | | responsiblePerson: '', |
| | | craftName: '', |
| | | seq: '', |
| | | preparation: '', |
| | | programme: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | programmeName: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | programmeType: null, |
| | | responsibleDept: '', |
| | | responsiblePerson: '', |
| | | craftName: '', |
| | | seq: '', |
| | | preparation: '', |
| | | programme: '' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await judgeReportApi().addParking([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="reportTime" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="programmeName" label="方案名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="startTime" label="开始时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="endTime" label="结束时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="programmeType" label="开停车类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="responsibleDept" label="负责部门" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="responsiblePerson" label="负责人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="craftName" label="危险工艺" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="seq" label="顺序" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="preparation" label="准备" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="programme" label="方案" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'parkingInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getParkingList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除:“${row.programmeName}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delParking({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="160px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="工艺名称" prop="craftName"> |
| | | <el-input v-model.trim="form.craftName" placeholder="工艺名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="工艺简介" prop="craftContent"> |
| | | <el-input v-model.trim="form.craftContent" :autosize="{ minRows: 1 }" type="textarea" placeholder="工艺简介" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="主要生产设备" prop="mainProdEquip"> |
| | | <el-input v-model.trim="form.mainProdEquip" :autosize="{ minRows: 1 }" type="textarea" placeholder="主要生产设备" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="重点部位" prop="keyParts"> |
| | | <el-input v-model.trim="form.keyParts" placeholder="重点部位" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="重大危险源" prop="hazardCode"> |
| | | <el-input v-model.trim="form.hazardCode" :autosize="{ minRows: 1 }" type="textarea" placeholder="重大危险源" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="涉及的危险化学品"> |
| | | <el-input v-model.trim="form.msds" :autosize="{ minRows: 1 }" type="textarea" placeholder="涉及的危险化学品" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="工艺危险特点"> |
| | | <el-input v-model.trim="form.hazardCharacter" placeholder="工艺危险特点" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="重点监控工艺参数指标"> |
| | | <el-input v-model.trim="form.parameterIndex" placeholder="重点监控工艺参数指标" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="现有安全控制手段"> |
| | | <el-input v-model.trim="form.controlMean" placeholder="现有安全控制手段" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="反应类型"> |
| | | <el-input v-model.trim="form.reactionType" placeholder="反应类型" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="重点监控单元"> |
| | | <el-input v-model.trim="form.keyMonitorUnit" placeholder="重点监控单元" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="工艺图纸"> |
| | | <el-upload accept="image/*" multiple list-type="picture-card" :action="uploadUrl" :headers="header" method="post" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :on-success="handleAvatarSuccess" :limit='2' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传图片尺寸小于2M,最多可上传2张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-dialog v-model="imgDialog"> |
| | | <img width="100%" :src="imageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import Cookies from "js-cookie"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | craftName: string |
| | | craftContent: string |
| | | mainProdEquip: string |
| | | keyParts: string |
| | | hazardCode: string |
| | | msds: string |
| | | hazardCharacter: string |
| | | parameterIndex: string |
| | | controlMean: string |
| | | craftDraw: string |
| | | reactionType: string |
| | | keyMonitorUnit: string |
| | | } |
| | | rules:{}, |
| | | fileList: [], |
| | | uploadUrl: string, |
| | | header: {}, |
| | | imgDialog: boolean, |
| | | imageUrl: string |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | craftName: '', |
| | | craftContent: '', |
| | | mainProdEquip: '', |
| | | keyParts: '', |
| | | hazardCode: '', |
| | | msds: '', |
| | | hazardCharacter: '', |
| | | parameterIndex: '', |
| | | controlMean: '', |
| | | craftDraw: '', |
| | | reactionType: '', |
| | | keyMonitorUnit: '' |
| | | }, |
| | | rules:{ |
| | | craftName: [{ required: true, message: '请填写工艺名称', trigger: 'blur' }], |
| | | craftContent: [{ required: true, message: '请填写工艺简介', trigger: 'blur' }], |
| | | mainProdEquip: [{ required: true, message: '请填写主要生产设备', trigger: 'blur' }], |
| | | keyParts: [{ required: true, message: '请填写重点部位', trigger: 'blur' }], |
| | | hazardCode: [{ required: true, message: '请填写重大危险源', trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | }, |
| | | imgDialog: false, |
| | | imageUrl: '' |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | if (type === 'add') { |
| | | state.title = '新增上报' |
| | | state.form = { |
| | | uuid: '', |
| | | craftName: '', |
| | | craftContent: '', |
| | | mainProdEquip: '', |
| | | keyParts: '', |
| | | hazardCode: '', |
| | | msds: '', |
| | | hazardCharacter: '', |
| | | parameterIndex: '', |
| | | controlMean: '', |
| | | craftDraw: '', |
| | | reactionType: '', |
| | | keyMonitorUnit: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报' |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | craftName: '', |
| | | craftContent: '', |
| | | mainProdEquip: '', |
| | | keyParts: '', |
| | | hazardCode: '', |
| | | msds: '', |
| | | hazardCharacter: '', |
| | | parameterIndex: '', |
| | | controlMean: '', |
| | | craftDraw: '', |
| | | reactionType: '', |
| | | keyMonitorUnit: '' |
| | | } |
| | | } |
| | | state.fileList=[] |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | state.form.craftDraw = state.fileList.map(i=>i.name).join(',') |
| | | const res = await judgeReportApi().addProduct([state.form]) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | state.fileList = [] |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res:any, uploadFile: any) => { |
| | | if(res){ |
| | | uploadFile.name = res |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const handlePictureCardPreview = (uploadFile) => { |
| | | state.imageUrl = uploadFile.url |
| | | state.imgDialog = true; |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.fileList = uploadFiles |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | showTip, |
| | | picSize, |
| | | handleAvatarSuccess, |
| | | handlePictureCardPreview, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="上报时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="craftName" label="工艺名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="craftContent" label="工艺简介" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="mainProdEquip" label="主要生产设备" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="keyParts" label="重点部位" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="hazardCode" label="重大危险源" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="msds" label="涉及的危险化学品" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="hazardCharacteristic" label="工艺危险特点" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="parameterIndex" label="重点监控工艺参数指标" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="controlMean" label="现有安全控制手段" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="craftDraw" label="工艺图纸" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.craftDraw !== ''" v-for="item in scope.row.craftDraw.split(',')" size="small" text type="primary" @click="openFile(item)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="reactionType" label="反应类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="keyMonitorUnit" label="重点监控单元" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',scope.row)">重新上报</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import axios from "axios"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | id: number|null |
| | | reportTime: string |
| | | craftName: string |
| | | craftContent: string |
| | | mainProdEquip: string |
| | | keyParts: string |
| | | hazardCode: string |
| | | msds: string |
| | | hazardCharacter: string |
| | | parameterIndex: string |
| | | controlMean: string |
| | | craftDraw: string |
| | | reactionType: string |
| | | keyMonitorUnit: string |
| | | } |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | baseUrl: string |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'productionInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null, |
| | | baseUrl: import.meta.env.VITE_API_URL |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | console.log(state.baseUrl) |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await judgeReportApi().getProductList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除账户名称:“${row.craftName}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await judgeReportApi().delProduct({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | const openFile=(file: string)=>{ |
| | | axios.get(import.meta.env.VITE_API_URL + file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | window.open(link.href) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | openFile, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .homeCard { |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | .mainCardBtn { |
| | | margin: 0; |
| | | } |
| | | } |
| | | .pageBtn { |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | |
| | | .demo-pagination-block + .demo-pagination-block { |
| | | margin-top: 10px; |
| | | } |
| | | .demo-pagination-block .demonstration { |
| | | margin-bottom: 16px; |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | height: calc(100% - 100px); |
| | | } |
| | | } |
| | | .el-row { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .grid-content { |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | |
| | | & > div { |
| | | white-space: nowrap; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="处理人所属车间" prop="exceptionHandlerDepId"> |
| | | <el-cascader @change="getUser" :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm.exceptionHandlerDepId"> </el-cascader> |
| | | <el-form-item label="处理人所属车间"> |
| | | <el-cascader @change="getUser" :options="departmentData" filterable :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName'}" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm.exceptionHandlerDepId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="异常处理人" prop="exceptionHandlerId"> |
| | | <el-form-item label="异常处理人"> |
| | | <el-select v-model="RFIDForm.exceptionHandlerId" filterable class="input-add" placeholder="请输入异常处理人"> |
| | | <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> |
| | | </el-select> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="RFID所属车间" prop="rfidDepartmentId"> |
| | | <el-cascader :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm. rfidDepartmentId"> </el-cascader> |
| | | <el-cascader :options="departmentData" filterable :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm. rfidDepartmentId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | |
| | | rfid: [{ required: true, message: '请填写RFID编码', trigger: 'blur' }], |
| | | rfidName: [{ required: true, message: '请填写RFID名称', trigger: 'change' }], |
| | | rfidDepartmentId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | exceptionHandlerDepId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | exceptionHandlerId: [{ required: true, message: '请选择', trigger: 'change' }] |
| | | // exceptionHandlerDepId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | // exceptionHandlerId: [{ required: true, message: '请选择', trigger: 'change' }] |
| | | }, |
| | | |
| | | fileList: [], |
| | |
| | | </el-icon> |
| | | 新增RFID |
| | | </el-button> |
| | | <el-button type="primary" :icon="Upload" size="default" @click="openUploadDialog('id')">导入</el-button> |
| | | </div> |
| | | <el-table :data="RFIDData.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | |
| | | <br /> |
| | | </el-card> |
| | | <RFIDDialog ref="RFIDDialogRef" @refreshRFID="initRFIDTableData" /> |
| | | <upload-dialog ref="uploadRef" @refresh="initRFIDTableData"></upload-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import RFIDDialog from './components/RFIDDialog.vue'; |
| | | import uploadDialog from '/@/views/intellectInspect/inspectTaskManage/inspectTask/components/upload.vue' |
| | | import { RFIDApi } from '/@/api/intellectInspectSystem/RFID'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download, Upload } from '@element-plus/icons-vue'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus' |
| | | import {departmentApi} from "/@/api/systemManage/department"; |
| | | // 定义接口来定义对象的类型 |
| | |
| | | |
| | | export default defineComponent({ |
| | | name: 'RFID', |
| | | components: { RFIDDialog, Edit, Delete }, |
| | | components: { RFIDDialog, uploadDialog }, |
| | | setup() { |
| | | const RFIDDialogRef = ref(); |
| | | const uploadRef = ref() |
| | | const state = reactive<TableDataState>({ |
| | | RFIDData: { |
| | | data: [], |
| | |
| | | } |
| | | }; |
| | | |
| | | const openUploadDialog = (type: string)=>{ |
| | | uploadRef.value.open(type) |
| | | } |
| | | |
| | | const handleSearch = () => { |
| | | initRFIDTableData(); |
| | | }; |
| | |
| | | return { |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | uploadRef, |
| | | openUploadDialog, |
| | | handleSearch, |
| | | onOpenDialogRef, |
| | | onHandleSizeChange, |
| | | onDelProductionDevice, |
| | | onHandleCurrentChange, |
| | | RFIDDialog, |
| | | RFIDDialogRef, |
| | | |
| | | initRFIDTableData, |
| | | ...toRefs(state) |
| | | }; |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="所属部门" prop="regionDepartmentId"> |
| | | <el-cascader :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="facilityAreaForm.regionDepartmentId"> </el-cascader> |
| | | <el-cascader :options="departmentData" filterable :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择所属部门" clearable class="input-add" v-model="facilityAreaForm.regionDepartmentId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-icon> |
| | | 新增设备区域 |
| | | </el-button> |
| | | <el-button type="primary" :icon="Upload" size="default" @click="openUploadDialog('区域')">导入</el-button> |
| | | </div> |
| | | <el-table :data="facilityAreaData.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | |
| | | <br /> |
| | | </el-card> |
| | | <facilityAreaDialog ref="facilityAreaDialogRef" @refreshFacilityArea="initFacilityAreaTableData" /> |
| | | <upload-dialog ref="uploadRef" @refresh="initFacilityAreaTableData"></upload-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import facilityAreaDialog from './components/facilityAreaDialog.vue'; |
| | | import uploadDialog from '/@/views/intellectInspect/inspectTaskManage/inspectTask/components/upload.vue' |
| | | import { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download, Upload } from '@element-plus/icons-vue'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableData { |
| | |
| | | |
| | | export default defineComponent({ |
| | | name: 'facilityArea', |
| | | components: { facilityAreaDialog, Edit, Delete }, |
| | | components: { facilityAreaDialog, Edit, Delete, uploadDialog }, |
| | | setup() { |
| | | const facilityAreaDialogRef = ref(); |
| | | const uploadRef = ref() |
| | | const state = reactive<TableDataState>({ |
| | | facilityAreaData: { |
| | | data: [], |
| | |
| | | const onOpenDialogRef = (type: string, value: any) => { |
| | | facilityAreaDialogRef.value.openFacilityAreaDialog(type, value, state.facilityAreaTypeList); |
| | | }; |
| | | |
| | | const openUploadDialog = (type: string)=>{ |
| | | uploadRef.value.open(type) |
| | | } |
| | | |
| | | // 删除 |
| | | const onDelProductionDevice = (row: any) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该条设备区域:“${row.region}”,是否继续?`, '提示', { |
| | |
| | | return { |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | uploadRef, |
| | | openUploadDialog, |
| | | handleSearch, |
| | | onOpenDialogRef, |
| | | onHandleSizeChange, |
| | |
| | | </el-icon> |
| | | 新增巡检点 |
| | | </el-button> |
| | | <el-button type="primary" :icon="Upload" size="default" @click="openUploadDialog('点')">导入</el-button> |
| | | </div> |
| | | <el-table :data="inspectPointData.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | |
| | | <br /> |
| | | </el-card> |
| | | <inspectPointDialog ref="inspectPointDialogRef" @refreshInspectPoint="initInspectPointTableData" /> |
| | | <upload-dialog ref="uploadRef" @refresh="initInspectPointTableData"></upload-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import inspectPointDialog from './components/inspectPointDialog.vue'; |
| | | import uploadDialog from '/@/views/intellectInspect/inspectTaskManage/inspectTask/components/upload.vue' |
| | | import { inspectPointApi } from '/@/api/intellectInspectSystem/inspectPointManage'; |
| | | import { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download, Upload } from '@element-plus/icons-vue'; |
| | | import { RFIDApi } from '/@/api/intellectInspectSystem/RFID'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | |
| | | |
| | | export default defineComponent({ |
| | | name: 'productionDevice', |
| | | components: { inspectPointDialog, Edit, Delete }, |
| | | components: { inspectPointDialog, Edit, Delete, uploadDialog }, |
| | | setup() { |
| | | const inspectPointDialogRef = ref(); |
| | | const uploadRef = ref() |
| | | const state = reactive<TableDataState>({ |
| | | inspectPointData: { |
| | | data: [], |
| | |
| | | const onOpenDialogRef = (type: string, value: any) => { |
| | | inspectPointDialogRef.value.openInspectPointDialog(type, value, state.regionNameList, state.RFIDList); |
| | | }; |
| | | |
| | | const openUploadDialog = (type: string)=>{ |
| | | uploadRef.value.open(type) |
| | | } |
| | | |
| | | // 删除 |
| | | const onDelProductionDevice = (row: any) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该巡检点:“${row.code}”,是否继续?`, '提示', { |
| | |
| | | return { |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | uploadRef, |
| | | openUploadDialog, |
| | | handleSearch, |
| | | onOpenDialogRef, |
| | | onHandleSizeChange, |
| | |
| | | <!-- </div>--> |
| | | <div class="text item" v-for="i in RFIDList"> |
| | | <div v-if="i.id == item.rfidId"> |
| | | 关联RFID:<span>{{ i.rfidName }}</span> |
| | | 关联RFID:<span>{{ i.rfid }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="text item">--> |
| | |
| | | <el-option v-for="item in inspectPointAllList" :key="item.id" :value="item.id" :label="item.code"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属设备区域" prop="regionId"> |
| | | <el-input v-model="inspectPointForm.regionId" class="input-add" readonly /> |
| | | <el-form-item label="所属设备区域" prop="region"> |
| | | <el-input v-model="inspectPointForm.region" class="input-add" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="关联RFID" prop="rfidId"> |
| | | <el-input v-model="inspectPointForm.rfidId" class="input-add" readonly /> |
| | | <el-form-item label="关联RFID" prop="rfid"> |
| | | <el-input v-model="inspectPointForm.rfid" class="input-add" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="选择巡检指标" prop="quotaId"> |
| | | <el-select v-model="inspectPointForm.quotaId" @change="giveQuotaUnit" placeholder="请选择巡检指标" class="input-add"> |
| | |
| | | code: string; |
| | | regionId: number; |
| | | rfidId: number; |
| | | rfidName: string; |
| | | rfid: string; |
| | | region: string; |
| | | } |
| | | interface classGroup { |
| | |
| | | pointId: number | null; |
| | | pointUuid: string | null; |
| | | regionId: number | null; |
| | | region: string |
| | | regionUuid: string | null; |
| | | rfidId: number | null; |
| | | rfid: string |
| | | quotaId: number | null; |
| | | quotaUnit: string | null; |
| | | execSequence: number | null; |
| | |
| | | pointId: null, |
| | | pointUuid: null, |
| | | regionId: null, |
| | | region: '', |
| | | regionUuid: null, |
| | | rfidId: null, |
| | | rfid: '', |
| | | quotaId: null, |
| | | quotaUnit: null, |
| | | execSequence: null, |
| | |
| | | pointId: null, |
| | | pointUuid: null, |
| | | regionId: null, |
| | | region: '', |
| | | regionUuid: null, |
| | | rfidId: null, |
| | | rfid: '', |
| | | quotaId: null, |
| | | quotaUnit: null, |
| | | execSequence: null, |
| | |
| | | |
| | | const giveRegionAndRFID = () => { |
| | | data.inspectPointForm.regionId = data.inspectPointAllList.find((item) => item.id === data.inspectPointForm.pointId)?.regionId as number; |
| | | data.inspectPointForm.region = data.inspectPointAllList.find((item) => item.id === data.inspectPointForm.pointId)?.region as string; |
| | | data.inspectPointForm.rfidId = data.inspectPointAllList.find((item) => item.id === data.inspectPointForm.pointId)?.rfidId as number; |
| | | data.inspectPointForm.rfid = data.inspectPointAllList.find((item) => item.id === data.inspectPointForm.pointId)?.rfid as string; |
| | | }; |
| | | |
| | | const giveClassGroup = () => { |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="模板"> |
| | | <el-button type="primary" @click="downloadFile">点击下载模板</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="文件上传"> |
| | | <el-upload accept=".xlsx,.xls" :auto-upload="false" method="post" :on-exceed="showTip" :limit='1' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">尺寸小于2M,最多可上传1份</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确认导入</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import axios from "axios"; |
| | | import Cookies from "js-cookie"; |
| | | import * as XLSX from "xlsx"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import { lineApi } from "/@/api/intelligentLine/index"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string; |
| | | isShowDialog: boolean; |
| | | form: { |
| | | files: any |
| | | } |
| | | rules:{}, |
| | | fileList: [], |
| | | uploadUrl: string, |
| | | header: {} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | files: '' |
| | | }, |
| | | rules:{ |
| | | }, |
| | | fileList: [], |
| | | uploadUrl: '', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string) => { |
| | | state.isShowDialog = true; |
| | | if (type === '任务') { |
| | | state.title = '巡检单元导入'; |
| | | } |
| | | if(type == 'id'){ |
| | | state.title = '巡检RFID导入'; |
| | | } |
| | | if(type == '区域'){ |
| | | state.title = '巡检区域导入'; |
| | | } |
| | | if(type == '点'){ |
| | | state.title = '巡检点导入'; |
| | | } |
| | | state.form = { |
| | | files: '' |
| | | } |
| | | state.fileList = [] |
| | | }; |
| | | |
| | | |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.fileList = [] |
| | | } |
| | | |
| | | const downloadFile=()=>{ |
| | | let filePath = '' |
| | | let name = '' |
| | | if(state.title == '巡检单元导入'){ |
| | | filePath = 'excelFiles/missionUpload.xlsx' |
| | | name = '巡检单元导入模板.xlsx' |
| | | } |
| | | if(state.title == '巡检RFID导入'){ |
| | | filePath = 'excelFiles/RFIDUpload.xlsx' |
| | | name = '巡检RFID导入模板.xlsx' |
| | | } |
| | | if(state.title == '巡检区域导入'){ |
| | | filePath = 'excelFiles/regionUpload.xlsx' |
| | | name = '巡检区域导入模板.xlsx' |
| | | } |
| | | if(state.title == '巡检点导入'){ |
| | | filePath = 'excelFiles/pointUpload.xlsx' |
| | | name = '巡检点导入模板.xlsx' |
| | | } |
| | | const link = document.createElement('a') |
| | | link.href = filePath |
| | | link.target = '_blank' |
| | | link.download = name |
| | | link.click() |
| | | } |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | if(state.fileList.length == 0){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请先选择导入文件' |
| | | }) |
| | | return |
| | | }else{ |
| | | let res = {} |
| | | if(state.title == '巡检单元导入'){ |
| | | res = await lineApi().uploadMission({file: state.fileList[0].raw}) |
| | | } |
| | | if(state.title == '巡检RFID导入'){ |
| | | res = await lineApi().uploadRfid({file: state.fileList[0].raw}) |
| | | } |
| | | if(state.title == '巡检区域导入'){ |
| | | res = await lineApi().uploadRegion({file: state.fileList[0].raw}) |
| | | } |
| | | if(state.title == '巡检点导入'){ |
| | | res = await lineApi().uploadPoint({file: state.fileList[0].raw}) |
| | | } |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: res.data.msg, |
| | | duration: 4000 |
| | | }) |
| | | state.fileList = [] |
| | | state.isShowDialog = false |
| | | context.emit('refresh') |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg, |
| | | duration: 4000 |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | downloadFile, |
| | | showTip, |
| | | picSize, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" :icon="Plus" size="default" @click="openInspectTaskDialog('新增', {})">新增</el-button> |
| | | <el-button type="primary" :icon="Upload" size="default" @click="openUploadDialog('任务')">导入</el-button> |
| | | <!-- <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>--> |
| | | </el-col> |
| | | <el-button type="primary" :icon="Refresh" size="default" /> |
| | | </el-row> |
| | | <el-table ref="multipleTableRef" :data="tableData.inspectTaskData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <!-- <el-table-column type="selection" width="55" />--> |
| | | <el-table-column property="unitName" label="任务名称" /> |
| | | <el-table-column property="workType" label="任务类型"> |
| | | <template #default="scope"> |
| | |
| | | </div> |
| | | </div> |
| | | <inspect-task-dialog ref="inspectTaskDialogRef" @refreshInspectTask="getInspectionTask"></inspect-task-dialog> |
| | | <upload-dialog ref="uploadRef" @refresh="getInspectionTask"></upload-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, ref, onMounted } from 'vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download, Upload } from '@element-plus/icons-vue'; |
| | | import { ElTable, ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { inspectTaskApi } from '/@/api/intellectInspectSystem/inspectTask'; |
| | | import inspectTaskDialog from './components/inspectTaskDialog.vue'; |
| | | import inspectTaskDialog from './components/inspectTaskDialog.vue' |
| | | import uploadDialog from './components/upload.vue' |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import { teamManageApi } from '/@/api/systemManage/personShiftManage/teamManage'; |
| | | import { inspectPointApi } from '/@/api/intellectInspectSystem/inspectPointManage'; |
| | |
| | | } |
| | | export default { |
| | | name: 'index', |
| | | components: { inspectTaskDialog }, |
| | | components: { inspectTaskDialog, uploadDialog }, |
| | | setup() { |
| | | const inspectTaskDialogRef = ref(); |
| | | const uploadRef = ref() |
| | | const state = reactive<stateType>({ |
| | | tableData: { |
| | | inspectTaskData: [], |
| | |
| | | } |
| | | }; |
| | | |
| | | const openUploadDialog = (type: string)=>{ |
| | | uploadRef.value.open(type) |
| | | } |
| | | |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.tableData.params.pageSize = val; |
| | |
| | | Delete, |
| | | Refresh, |
| | | Plus, |
| | | Upload, |
| | | reset, |
| | | openUploadDialog, |
| | | changeStatus, |
| | | changeGroup, |
| | | parseNumber, |
| | |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | inspectTaskDialogRef, |
| | | uploadRef, |
| | | openInspectTaskDialog, |
| | | ...toRefs(state) |
| | | }; |
| | |
| | | initialY:number|null |
| | | xOffset:number|null |
| | | yOffset:number|null |
| | | timer: null | any |
| | | } |
| | | export default { |
| | | name: 'intelligentLine', |
| | |
| | | initialX: 0, |
| | | initialY: 0, |
| | | xOffset: 0, |
| | | yOffset: 0 |
| | | yOffset: 0, |
| | | timer: null |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | setInterval(() => { |
| | | state.timer = setInterval(() => { |
| | | state.present = new Date().toLocaleString(); |
| | | }, 1000); |
| | | let curId = route.query.id |
| | |
| | | console.log('socket已经关闭'); |
| | | }; |
| | | }) |
| | | clearInterval(state.timer) |
| | | draggableElement.value.removeEventListener('mousedown', handleMouseDown); |
| | | draggableElement.value.removeEventListener('mousemove', handleMouseMove); |
| | | draggableElement.value.removeEventListener('mouseup', handleMouseUp); |
| | |
| | | onSignIn, |
| | | identify, |
| | | confirmIdentity, |
| | | validatePass, |
| | | validatePass2, |
| | | ...toRefs(state) |
| | | }; |
| | |
| | | <el-col :md="12"> |
| | | <div class="loginContL"> |
| | | <div class="apTitleT">新疆国泰新华</div> |
| | | <div class="apTitleB">安全风险预警监测系统(试运行)</div> |
| | | <div class="apTitleB">安全风险预警监测系统</div> |
| | | <span></span> |
| | | </div> |
| | | </el-col> |
| | |
| | | <div class="leftCont"></div> |
| | | <div class="topCont"> |
| | | <div class="topInfo"> |
| | | <div class="topTit">新疆国泰新华<br />安全风险预警监测系统(试运行)</div> |
| | | <div class="topTit">新疆国泰新华<br />安全风险预警监测系统</div> |
| | | <div class="topTime"> |
| | | <div class="time"> |
| | | {{ time }} |
| | |
| | | </div> |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-12.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="render('12')"> |
| | | <div class="toplayer"> |
| | | <img class="iconImg" src="../../assets/newMenu/icon14.png" /> |
| | | <div> |
| | | <div class="itemTit">监管数据融合互通系统</div> |
| | | <div class="enTit">Regulatory Data Integration and Interoperability System</div> |
| | | </div> |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-14.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="render('7')"> |
| | | <div class="toplayer"> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, computed, defineComponent, onMounted } from 'vue'; |
| | | import {toRefs, reactive, computed, defineComponent, onMounted, onUnmounted} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { useThemeConfig } from '/@/stores/themeConfig'; |
| | | import logoMini from '/@/assets/logo-mini.svg'; |
| | |
| | | date: string; |
| | | weekDay: string; |
| | | dayTime: string; |
| | | timer: null | any |
| | | } |
| | | |
| | | export default defineComponent({ |
| | |
| | | date: '', |
| | | weekDay: '', |
| | | dayTime: '', |
| | | isScreenfull: false |
| | | isScreenfull: false, |
| | | timer: null |
| | | }); |
| | | |
| | | const userName = computed(() =>{ |
| | |
| | | window.open('http://10.211.134.139:5522/#/login'); |
| | | } |
| | | const toManLocation = () =>{ |
| | | window.open('http://10.211.134.138:8081/GUOTAI'); |
| | | window.open('http://124.88.37.66:8081/location_system_5.4.9/login/login.html?company=GUOTAI&version=5.4.9'); |
| | | } |
| | | const throttle = (renderMenu: any, delay: number) => { |
| | | let flag = true; |
| | |
| | | state.once += 1; |
| | | NextLoading.done(); |
| | | getDateTime(); |
| | | setInterval(() => { |
| | | state.timer = setInterval(() => { |
| | | getDateTime(); |
| | | }, 1000); |
| | | }, 30000); |
| | | // loginBg(); |
| | | // loginApp() |
| | | }) |
| | | |
| | | onUnmounted(() => { |
| | | clearInterval(state.timer) |
| | | }); |
| | | |
| | | return { |
| | | render, |
| | | userName, |
| | |
| | | <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> |
| | | </el-row> |
| | | <el-table ref="multipleTableRef" :data="applyData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column property="workPermitNo" label="作业编号" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.workPermitNo?scope.row.workPermitNo:'—'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="seDepName" label="事业部" align="center"/> |
| | | <el-table-column property="applyDepName" label="作业所在车间" align="center"/> |
| | | <el-table-column property="workContent" label="作业内容" align="center"/> |
| | |
| | | {{scope.row.guardianList.length}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="风险研判" align="center"> |
| | | <el-table-column label="作业状态" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag>{{ statusList.find(i=>i.value === scope.row.status)?.label }}</el-tag> |
| | | </template> |
| | |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <!-- <el-button link type="success" size="small" :icon="Finished">修改</el-button>--> |
| | | <!-- <el-button link type="success" size="small" :icon="Download">正式办票</el-button>--> |
| | | <!-- <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button>--> |
| | | <el-button link type="primary" size="small" :icon="Download" @click="downLoadRecord(scope.row)">作业票预览</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="downLoadDialog" title="提示" width="30%" center> |
| | | <span>您确定要导出该条记录吗?</span> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="downLoadDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDownLoad" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- <el-dialog v-model="downLoadDialog" title="提示" width="30%" center>--> |
| | | <!-- <span>您确定要导出该条记录吗?</span>--> |
| | | <!-- <template #footer>--> |
| | | <!-- <span class="dialog-footer">--> |
| | | <!-- <el-button @click="downLoadDialog = false" size="default">取消</el-button>--> |
| | | <!-- <el-button type="primary" @click="conFirmDownLoad" size="default">确认</el-button>--> |
| | | <!-- </span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-dialog>--> |
| | | <!-- </el-tab-pane>--> |
| | | <!-- <el-tab-pane label="已通过" name="2">--> |
| | | <!-- <div style="height: 100%">--> |
| | |
| | | dialogDetails: boolean; |
| | | dialogStatus: boolean; |
| | | deleteDialog: boolean; |
| | | downLoadDialog: boolean; |
| | | pageIndex1: number; |
| | | pageSize1: number; |
| | | chosenIndex: null | number; |
| | | deleteId: null | number; |
| | | downLoadId: null | number; |
| | | downLoadName: string; |
| | | totalSize1: number; |
| | | activeName: string; |
| | | addRecord: {}; |
| | |
| | | dialogDetails: false, |
| | | dialogStatus: false, |
| | | deleteDialog: false, |
| | | downLoadDialog: false, |
| | | addRecord: {}, |
| | | details: {}, |
| | | statusInfo: {}, |
| | | deleteId: null, |
| | | downLoadId: null, |
| | | downLoadName: '', |
| | | deleteArr: [], |
| | | dep4List: [ |
| | | {id:49,name:'电石事业部'}, |
| | |
| | | state.deleteDialog = false; |
| | | }; |
| | | |
| | | // 导出图表 |
| | | const downLoadBtn = (row:any) =>{ |
| | | state.downLoadId = row.workApplyId; |
| | | state.downLoadName = row.workTypeDesc + row.workPermitNo |
| | | state.downLoadDialog = true; |
| | | } |
| | | |
| | | // 导出方法 |
| | | const downLoadRecord = async (data: any) => { |
| | | const downLoadRecord = (row: any) => { |
| | | // let res = await workApplyApi().postPrinting(data); |
| | | axios.post(import.meta.env.VITE_API_URL + `/work/apply/printingPdf`,data,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | console.log(row,555) |
| | | axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/down/load/pdf`,{ id: row.id},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", state.downLoadName + "作业证.pdf"); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | link.setAttribute("download", row.workTypeDesc + row.workPermitNo + "作业证.pdf"); |
| | | document.body.appendChild(link) |
| | | window.open(link.href) |
| | | document.body.removeChild(link) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }) |
| | | |
| | | }; |
| | | |
| | | const conFirmDownLoad = () => { |
| | | downLoadRecord({ applyWorkId: state.downLoadId }); |
| | | state.downLoadDialog = false; |
| | | }; |
| | | |
| | | const handleSizeChange1 = (val: number) => { |
| | |
| | | viewRecord, |
| | | viewStatus, |
| | | deleteRecordBtn, |
| | | downLoadBtn, |
| | | downLoadRecord, |
| | | conFirmDelete, |
| | | conFirmDownLoad, |
| | | getListByPage, |
| | | handleSizeChange1, |
| | | handleCurrentChange1, |
| | |
| | | export default defineComponent({ |
| | | name: 'myApproval', |
| | | components: { |
| | | fire: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/fireLog.vue')), |
| | | space: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/spaceLog.vue')), |
| | | hoist: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/hoistLog.vue')), |
| | | ground: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/groundLog.vue')), |
| | | broken: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/brokenLog.vue')), |
| | | height: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/heightLog.vue')), |
| | | power: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/powerLog.vue')), |
| | | plate: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsp/components/plateLog.vue')) |
| | | fire: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/fireLog.vue')), |
| | | space: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/spaceLog.vue')), |
| | | hoist: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/hoistLog.vue')), |
| | | ground: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/groundLog.vue')), |
| | | broken: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/brokenLog.vue')), |
| | | height: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/heightLog.vue')), |
| | | power: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/powerLog.vue')), |
| | | plate: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsp/components/plateLog.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | |
| | | <el-row class="homeCard"> |
| | | <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> |
| | | <span>时间筛选:</span> |
| | | <el-date-picker v-model="timeRange" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" @change="giveTime()" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" /> |
| | | <el-date-picker v-model="timeRange" value-format="YYYY-MM-DD" type="daterange" @change="giveTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" /> |
| | | </div> |
| | | <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> |
| | | <span>负责人:</span> |
| | |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" :icon="Plus" size="default" @click="toApply()">申请</el-button> |
| | | <el-button type="primary" :icon="Download" size="default" @click="exportSheet()">导出当日记录</el-button> |
| | | <el-button type="primary" :icon="Download" size="default" @click="exportSheet()">导出记录</el-button> |
| | | </el-col> |
| | | <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> |
| | | </el-row> |
| | |
| | | <el-button v-else link type="primary" size="small" @click="openReport('查看', scope.row)">查看研判报告</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="300"> |
| | | <el-table-column fixed="right" label="操作" align="center" width="150"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.status == -1">已废止</span> |
| | | <el-button v-if="scope.row.status == 0 || scope.row.status == 1" link type="danger" size="small" :icon="Delete" @click="abortRecordBtn(scope.row)">作废</el-button> |
| | |
| | | const giveTime = () => { |
| | | if (state.timeRange && state.timeRange !== null) { |
| | | state.searPara.startTime = state.timeRange[0]; |
| | | state.searPara.endTime = state.timeRange[1]; |
| | | state.searPara.endTime = state.timeRange[1] |
| | | } else { |
| | | state.searPara.startTime = ''; |
| | | state.searPara.endTime = ''; |
| | |
| | | |
| | | // 关键词查询记录 |
| | | const searchRecord = async () => { |
| | | state.pageIndex1 = 1 |
| | | getListByPage(); |
| | | }; |
| | | // 重置搜索 |
| | |
| | | // 导出方法 |
| | | const exportSheet = async () => { |
| | | // let res = await workApplyApi().postPrinting(data); |
| | | axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/export/excel`,{},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/export/excel`,{startTime: state.searPara.startTime,endTime: state.searPara.endTime,secondDepId: state.searPara.secondDepId},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/excel'}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", "作业申报记录.xlsx"); |
| | | if(state.searPara.startTime !== '' && state.searPara.endTime !==''){ |
| | | link.setAttribute("download", state.searPara.startTime + '—' + state.searPara.endTime +"作业申报记录.xlsx") |
| | | }else{ |
| | | link.setAttribute("download", "作业申报记录.xlsx") |
| | | } |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | |
| | | depProps: object; |
| | | departList: Array<any>; |
| | | lastTrain: number | null; |
| | | timer: any|null |
| | | } |
| | | export default defineComponent({ |
| | | name: 'warningScreen', |
| | |
| | | emitPath: false |
| | | }, |
| | | departList: [], |
| | | timer: null |
| | | }); |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | state.depValue = screenTheme.value.depId |
| | | getTime(); |
| | | getAllDepartment(); |
| | | setInterval(()=>{ |
| | | state.timer = setInterval(()=>{ |
| | | getTime() |
| | | },1000) |
| | | getTheme() |
| | |
| | | }; |
| | | |
| | | onBeforeUnmount(() =>{ |
| | | clearInterval() |
| | | clearInterval(state.timer) |
| | | }) |
| | | // 隐患状态列表 |
| | | // const getDeviceRecord = async () => { |
| | |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogDetails" title="作业申请详情" center> |
| | | <fire v-if="dialogType == 1" :details = details></fire> |
| | | <space v-else-if="dialogType == 2" :details = details></space> |
| | | <hoist v-else-if="dialogType == 3" :details = details></hoist> |
| | | <ground v-else-if="dialogType == 4" :details = details></ground> |
| | | <broken v-else-if="dialogType == 5" :details = details></broken> |
| | | <height v-else-if="dialogType == 6" :details = details></height> |
| | | <power v-else-if="dialogType == 7" :details = details></power> |
| | | <plate v-else :details = details></plate> |
| | | <!-- <fire v-if="dialogType == 1" :details = details></fire>--> |
| | | <!-- <space v-else-if="dialogType == 2" :details = details></space>--> |
| | | <!-- <hoist v-else-if="dialogType == 3" :details = details></hoist>--> |
| | | <!-- <ground v-else-if="dialogType == 4" :details = details></ground>--> |
| | | <!-- <broken v-else-if="dialogType == 5" :details = details></broken>--> |
| | | <!-- <height v-else-if="dialogType == 6" :details = details></height>--> |
| | | <!-- <power v-else-if="dialogType == 7" :details = details></power>--> |
| | | <!-- <plate v-else :details = details></plate>--> |
| | | <!-- <detail-log :type=dialogType :statusList=statusList :details = details></detail-log>--> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogDetails = false" |
| | |
| | | components: { |
| | | VideoDetail, |
| | | WorkRecord, |
| | | fire: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/fireLog.vue')), |
| | | space: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/spaceLog.vue')), |
| | | hoist: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/hoistLog.vue')), |
| | | ground: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/groundLog.vue')), |
| | | broken: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/brokenLog.vue')), |
| | | height: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/heightLog.vue')), |
| | | power: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/powerLog.vue')), |
| | | plate: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/plateLog.vue')) |
| | | // fire: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireLog.vue')), |
| | | // space: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceLog.vue')), |
| | | // hoist: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistLog.vue')), |
| | | // ground: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundLog.vue')), |
| | | // broken: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenLog.vue')), |
| | | // height: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightLog.vue')), |
| | | // power: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerLog.vue')), |
| | | // plate: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateLog.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const router = useRouter(); |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo) |
| | | const router = useRouter() |
| | | const reviewFormRef = ref<FormInstance>() |
| | | const zyfb = ref("eChartZyfb" + Date.now() + Math.random()) |
| | | const slfx = ref("eChartSlfx" + Date.now() + Math.random()) |
| | | const zyqs = ref("eChartZyqs" + Date.now() + Math.random()) |
| | | const videoRef = ref(); |
| | | const videoRef = ref() |
| | | const recordRef = ref() |
| | | const state = reactive<stateType>({ |
| | | pageIndex: 1, |
| | |
| | | }; |
| | | |
| | | // 查看记录 |
| | | const viewDetail = (row: any) => { |
| | | state.dialogType = row.workType |
| | | state.details = JSON.parse(JSON.stringify(row)); |
| | | if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){ |
| | | state.details.workDetail.otherSpecialWork=[] |
| | | } |
| | | else { |
| | | const a = state.details.workDetail.otherSpecialWork |
| | | state.details.workDetail.otherSpecialWork = a.split(',').map((item) => { |
| | | return state.workTypeList.find((i: { id: number }) => i.id === Number(item))?.name; |
| | | }); |
| | | } |
| | | if(state.details.workDetail.involvedDepIds == '' || !state.details.workDetail.involvedDepIds){ |
| | | state.details.workDetail.involvedDepIds=[] |
| | | } |
| | | else { |
| | | const a = state.details.workDetail.involvedDepIds |
| | | state.details.workDetail.involvedDepIds = a.split(',').map((item) => { |
| | | return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName; |
| | | }); |
| | | } |
| | | if(state.details.workDetail.csDepId){ |
| | | state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName; |
| | | } |
| | | if(state.details.workDetail.operationDepId){ |
| | | state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName; |
| | | } |
| | | if(state.details.workDetail.gbPath){ |
| | | state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',') |
| | | } |
| | | if(state.details.workDetail.bcPath){ |
| | | state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',') |
| | | } |
| | | if(state.details.workDetail.bpLocationMapPath){ |
| | | state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',') |
| | | } |
| | | state.dialogDetails = true; |
| | | }; |
| | | // const viewDetail = (row: any) => { |
| | | // state.dialogType = row.workType |
| | | // state.details = JSON.parse(JSON.stringify(row)); |
| | | // if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){ |
| | | // state.details.workDetail.otherSpecialWork=[] |
| | | // } |
| | | // else { |
| | | // const a = state.details.workDetail.otherSpecialWork |
| | | // state.details.workDetail.otherSpecialWork = a.split(',').map((item) => { |
| | | // return state.workTypeList.find((i: { id: number }) => i.id === Number(item))?.name; |
| | | // }); |
| | | // } |
| | | // if(state.details.workDetail.involvedDepIds == '' || !state.details.workDetail.involvedDepIds){ |
| | | // state.details.workDetail.involvedDepIds=[] |
| | | // } |
| | | // else { |
| | | // const a = state.details.workDetail.involvedDepIds |
| | | // state.details.workDetail.involvedDepIds = a.split(',').map((item) => { |
| | | // return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName; |
| | | // }); |
| | | // } |
| | | // if(state.details.workDetail.csDepId){ |
| | | // state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName; |
| | | // } |
| | | // if(state.details.workDetail.operationDepId){ |
| | | // state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName; |
| | | // } |
| | | // if(state.details.workDetail.gbPath){ |
| | | // state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',') |
| | | // } |
| | | // if(state.details.workDetail.bcPath){ |
| | | // state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',') |
| | | // } |
| | | // if(state.details.workDetail.bpLocationMapPath){ |
| | | // state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',') |
| | | // } |
| | | // state.dialogDetails = true; |
| | | // }; |
| | | |
| | | // const handleReview = (row: object)=>{ |
| | | // state.dialogReview = true |
| | |
| | | toApply, |
| | | searchRecord, |
| | | clearSearch, |
| | | viewDetail, |
| | | // viewDetail, |
| | | viewRecord, |
| | | viewTicket, |
| | | downLoadTicket, |
| | |
| | | { id: '4', name: '智能安全巡检系统', key: 3 }, |
| | | { id: '5', name: '智能安全风险综合预警预报平台', key: 4 }, |
| | | { id: '6', name: '应急管理系统', key: 5 }, |
| | | { id: '12', name: '监管数据融合互通系统', key: 11 }, |
| | | { id: '7', name: '安全目标责任管理系统', key: 6 }, |
| | | { id: '8', name: '安全事故管理系统', key: 7 }, |
| | | { id: '9', name: '设备综合管控系统', key: 8 }, |
| | |
| | | departmentList: [], |
| | | workerList: [], |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName' |
| | |
| | | buttonName: string; |
| | | isShowRoleDialog: boolean; |
| | | roleForm: { |
| | | defaultFlag: number | null |
| | | roleName: string; |
| | | roleCode: string; |
| | | roleInfo: string; |
| | | specialWorkFlag: number | null |
| | | }; |
| | | menuData: Array<MenuDataTree>; |
| | | menuProps: { |
| | |
| | | title: '', |
| | | buttonName: '', |
| | | roleForm: { |
| | | defaultFlag: 0, |
| | | roleName: '', // 角色名称 |
| | | roleCode: '', // 角色标识 |
| | | roleInfo: '' // 排序 |
| | | roleInfo: '', // 排序 |
| | | specialWorkFlag: 0 |
| | | }, |
| | | menuData: [], |
| | | menuProps: { |
| | |
| | | state.title = '新增角色'; |
| | | state.buttonName = '新增'; |
| | | state.roleForm = { |
| | | defaultFlag: 0, |
| | | roleName: '', |
| | | roleCode: '', |
| | | roleInfo: '' |
| | | roleInfo: '', |
| | | specialWorkFlag: 0 |
| | | }; |
| | | } else { |
| | | state.title = '修改角色'; |
| | | state.buttonName = '修改'; |
| | | state.roleForm = JSON.parse(JSON.stringify(value)); |
| | | if(!state.roleForm.defaultFlag){ |
| | | state.roleForm.defaultFlag = 0 |
| | | } |
| | | if(!state.roleForm.specialWorkFlag){ |
| | | state.roleForm.specialWorkFlag = 0 |
| | | } |
| | | } |
| | | }; |
| | | // 新增 |
| | |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import { userApi } from '/@/api/systemManage/user'; |
| | | import {verifyPwd} from "/@/utils/toolsValidate"; |
| | | import {verifyPhone, verifyPwd} from "/@/utils/toolsValidate"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData {} |
| | |
| | | name: 'user', |
| | | setup(props, context) { |
| | | const userRef = ref() |
| | | const checkPhone = (rule: any, value: any, callback: any) => { |
| | | if (value == '') { |
| | | return callback(new Error('该内容不能为空')) |
| | | } |
| | | setTimeout(() => { |
| | | if (!verifyPhone(value)) { |
| | | callback(new Error('手机号格式不正确')) |
| | | }else callback(); |
| | | }, 400) |
| | | } |
| | | let validatePwd = (rule: any, value: any, callback: any)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入密码')) |
| | |
| | | roleIds: [{ required: true, message: '请选择用户角色', trigger: 'change' }], |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | positionIds: [{ required: true, message: '请选择职务', trigger: 'change' }], |
| | | phone: [{ required: true, message: '请填写手机号', trigger: 'blur' }], |
| | | phone: [{ required: true, validator: checkPhone, trigger: 'blur' }], |
| | | type: [{ required: true, message: '请填写用户类型', trigger: 'blur' }], |
| | | gender: [{ required: true, message: '请选择性别', trigger: 'change' }], |
| | | password: [{ required: true, validator: validatePwd, trigger: 'blur' }], |
| | |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenUserDialog('查看', scope.row)">查看</el-button> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenUserDialog('修改', scope.row)">修改</el-button> |
| | | <el-button size="small" text type="primary" @click="onPwdDialog(scope.row.uid)">修改密码</el-button> |
| | | <el-button size="small" text type="primary" @click="onCertificate(scope.row)">证书管理</el-button> |
| | | <el-button style="color: red" :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | |
| | | </el-card> |
| | | <userDialog ref="userRef" @getUserList="initUserTableData" /> |
| | | <dialog-certificate ref="ctfRef" @getUserList="initUserTableData"></dialog-certificate> |
| | | <el-dialog title="修改密码" v-model="showPwdDialog" width="500px"> |
| | | <el-form :model="pwdForm" size="default" ref="pwdRef" :rules="pwdFormRules" label-width="110px"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="新密码" prop="newPassword"> |
| | | <el-input v-model.trim="pwdForm.newPassword" placeholder="请输入" type="password" show-password> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="确认新密码" prop="rePassword"> |
| | | <el-input v-model.trim="pwdForm.rePassword" placeholder="请输入" type="password" show-password> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="showPwdDialog = !showPwdDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onPwdSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { dutyApi } from '/@/api/systemManage/duty'; |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import { useRoleApi } from '/@/api/systemManage/role'; |
| | | import {verifyPwd} from "/@/utils/toolsValidate"; |
| | | import {useLoginApi} from "/@/api/login"; |
| | | import {Session} from "/@/utils/storage"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | |
| | | dutyList: []; |
| | | userTypeList: Array<{id:number,name:string}>; |
| | | props:{} |
| | | showPwdDialog: boolean |
| | | pwdForm: { |
| | | uid: number|string| null |
| | | newPassword: string |
| | | rePassword: string |
| | | } |
| | | pwdFormRules: {} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | |
| | | components: { userDialog,dialogCertificate }, |
| | | setup() { |
| | | const userRef = ref(); |
| | | const pwdRef = ref(); |
| | | const ctfRef = ref() |
| | | let validatePwd = (rule: any, value: any, callback: any)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入密码')) |
| | | }else{ |
| | | if(!verifyPwd(value)){ |
| | | callback(new Error('密码须包含字母、数字、特殊字符,长度在6-16之间')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | const equalToPassword = (rule: any, value: any, callback: any) => { |
| | | if(value == ''){ |
| | | callback(new Error("请再次确认密码")) |
| | | }else if (state.pwdForm.newPassword !== value) { |
| | | callback(new Error("两次输入的密码不一致")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const state = reactive<TableDataState>({ |
| | | userTableData: { |
| | | data: [], |
| | |
| | | { id: 1, name: '超级管理员' }, |
| | | { id: 2, name: '管理员' }, |
| | | { id: 3, name: '普通员工' } |
| | | ] |
| | | ], |
| | | showPwdDialog: false, |
| | | pwdForm: { |
| | | uid: null, |
| | | newPassword: '', |
| | | rePassword: '' |
| | | }, |
| | | pwdFormRules: { |
| | | newPassword: [{ required: true, validator: validatePwd, trigger: 'blur' }], |
| | | rePassword: [{ required: true, validator: equalToPassword, trigger: "blur" }] |
| | | } |
| | | }); |
| | | // 初始化表格数据 |
| | | const initUserTableData = async () => { |
| | |
| | | userRef.value.openDialog(type, value, state.departmentList, state.roleList, state.dutyList); |
| | | }; |
| | | |
| | | const onPwdDialog = (uid: string)=>{ |
| | | state.pwdForm = { |
| | | uid: uid, |
| | | newPassword: '', |
| | | rePassword: '' |
| | | } |
| | | state.showPwdDialog = true |
| | | } |
| | | |
| | | const onPwdSubmit = async () => { |
| | | pwdRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const {rePassword,...data} = state.pwdForm |
| | | let res = await userApi().pwdMod(data); |
| | | if (res.data.code === '200') { |
| | | state.showPwdDialog = false; |
| | | if(state.pwdForm.uid == Cookies.get('uid')){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '密码修改成功,请重新登录', |
| | | duration: 2000 |
| | | }) |
| | | setTimeout(()=>{ |
| | | useLoginApi() |
| | | .signOut() |
| | | .then(() => { |
| | | Session.clear() |
| | | window.location.href = '/' |
| | | }) |
| | | },2000) |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '修改密码成功', |
| | | duration: 2000 |
| | | }) |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | const onCertificate = (value: any)=>{ |
| | | ctfRef.value.openDialog(value); |
| | | } |
| | |
| | | return { |
| | | userRef, |
| | | ctfRef, |
| | | pwdRef, |
| | | onPwdDialog, |
| | | onPwdSubmit, |
| | | onOpenUserDialog, |
| | | onCertificate, |
| | | onRowDel, |