| | |
| | | notifyUser: '' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | name: '', |
| | | cateName: '', |
| | | orgName: '', |
| | | pusTime: '', |
| | | effectiveTime: '', |
| | | dueTime: '', |
| | | notifyUser: '' |
| | | state.title = '重新上报' |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | // state.form = { |
| | | // uuid: data.uuid, |
| | | // name: '', |
| | | // cateName: '', |
| | | // orgName: '', |
| | | // pusTime: '', |
| | | // effectiveTime: '', |
| | | // dueTime: '', |
| | | // notifyUser: '' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="出厂时间"> |
| | | <el-form-item label="出厂时间" prop="productionTime"> |
| | | <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-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="设备状况"> |
| | | <el-form-item label="设备状况" prop="status"> |
| | | <el-select v-model="form.status" placeholder="请选择设备状况"> |
| | | <el-option :key="1" label="1" :value="1"/> |
| | | <el-option :key="2" label="2" :value="2"/> |
| | |
| | | <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> |
| | | <div class="el-upload__tip">仅支持上传pdf文件,尺寸小于5M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </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> |
| | |
| | | checkStatus: number | null |
| | | nextCheckTime: string |
| | | lastCheckTime: string |
| | | files: string |
| | | files: string, |
| | | deleted: string |
| | | } |
| | | rules:{} |
| | | fileList: [], |
| | |
| | | checkStatus: null, |
| | | nextCheckTime: '', |
| | | lastCheckTime: '', |
| | | files: '' |
| | | files: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | no: [{ required: true, message: '请填写编号', trigger: 'blur' }], |
| | | status: [{ 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' }] |
| | | registerNo: [{ required: true, message: '请填写注册登记编号', trigger: 'blur' }], |
| | | productionTime: [{ required: true, message: '请选择出场时间', trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | |
| | | 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: '' |
| | | } |
| | | files: '', |
| | | deleted: '0' |
| | | } |
| | | state.fileList = [] |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | if(data.files !== ''){ |
| | | state.fileList = state.form.files.split(',').map((i,index) => { |
| | | return { |
| | | url: i, |
| | | name: '文件' + (index+1) |
| | | } |
| | | }) |
| | | }else{ |
| | | state.fileList = [] |
| | | } |
| | | // state.form = { |
| | | // uuid: data.uuid, |
| | | // no: '', |
| | | // name: '', |
| | | // cateName: '', |
| | | // model: '', |
| | | // productionTime: '', |
| | | // isSpecial: null, |
| | | // isRegister: null, |
| | | // registerNo: '', |
| | | // status: null, |
| | | // registerTable: '', |
| | | // checkStatus: null, |
| | | // nextCheckTime: '', |
| | | // lastCheckTime: '', |
| | | // files: '' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | |
| | | }; |
| | | |
| | | 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: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | // 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: '文件读取失败' |
| | | // }); |
| | | // } |
| | | // }) |
| | | window.open(file) |
| | | } |
| | | |
| | | return { |
| | |
| | | <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> |
| | | <div class="el-upload__tip">仅支持上传pdf文件,尺寸小于5M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | |
| | | files: '', |
| | | deleted: '0' |
| | | } |
| | | state.fileList = [] |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | type: 1, |
| | | uuid: data.uuid, |
| | | name: '', |
| | | remarks: '', |
| | | evaluateTime: '', |
| | | files: '', |
| | | deleted: '0' |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | if(data.files !== ''){ |
| | | state.fileList = state.form.files.split(',').map((i,index) => { |
| | | return { |
| | | url: i, |
| | | name: '文件' + (index+1) |
| | | } |
| | | }) |
| | | }else{ |
| | | state.fileList = [] |
| | | } |
| | | // state.form = { |
| | | // type: 1, |
| | | // uuid: data.uuid, |
| | | // name: '', |
| | | // remarks: '', |
| | | // evaluateTime: '', |
| | | // files: '', |
| | | // deleted: '0' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | | // 图片上传 |
| | |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 2){ |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过2M' |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | |
| | | if(res){ |
| | | uploadFile.name = res |
| | | state.form.files = res |
| | | console.log(state.fileList,'list') |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | |
| | | 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: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | // axios.get(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: '文件读取失败' |
| | | // }); |
| | | // } |
| | | // }) |
| | | window.open(file) |
| | | } |
| | | |
| | | // 删除用户 |
| | |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | programmeName: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | programmeType: null, |
| | | responsibleDept: '', |
| | | responsiblePerson: '', |
| | | craftName: '', |
| | | seq: '', |
| | | preparation: '', |
| | | programme: '' |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | // state.form = { |
| | | // uuid: data.uuid, |
| | | // programmeName: '', |
| | | // startTime: '', |
| | | // endTime: '', |
| | | // programmeType: null, |
| | | // responsibleDept: '', |
| | | // responsiblePerson: '', |
| | | // craftName: '', |
| | | // seq: '', |
| | | // preparation: '', |
| | | // programme: '' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | |
| | | reactionType: '', |
| | | keyMonitorUnit: '' |
| | | } |
| | | state.fileList=[] |
| | | }else{ |
| | | state.title = '重新上报' |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | craftName: '', |
| | | craftContent: '', |
| | | mainProdEquip: '', |
| | | keyParts: '', |
| | | hazardCode: '', |
| | | msds: '', |
| | | hazardCharacter: '', |
| | | parameterIndex: '', |
| | | controlMean: '', |
| | | craftDraw: '', |
| | | reactionType: '', |
| | | keyMonitorUnit: '' |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | if(data.craftDraw !== ''){ |
| | | state.fileList = data.craftDraw.split(',').map((i,index) => { |
| | | return { |
| | | url: i, |
| | | name: i |
| | | } |
| | | }) |
| | | }else{ |
| | | state.fileList=[] |
| | | } |
| | | |
| | | // state.form = { |
| | | // uuid: data.uuid, |
| | | // craftName: '', |
| | | // craftContent: '', |
| | | // mainProdEquip: '', |
| | | // keyParts: '', |
| | | // hazardCode: '', |
| | | // msds: '', |
| | | // hazardCharacter: '', |
| | | // parameterIndex: '', |
| | | // controlMean: '', |
| | | // craftDraw: '', |
| | | // reactionType: '', |
| | | // keyMonitorUnit: '' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | |
| | | <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> |
| | | <!-- <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>--> |
| | | <div v-if="scope.row.craftDraw !== ''"> |
| | | <el-image |
| | | v-for="(item,index) in scope.row.craftDraw.split(',')" |
| | | style="width: 50px; height: 50px" |
| | | :src="item" |
| | | fit="cover" |
| | | :preview-teleported= true |
| | | /> |
| | | </div> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="reactionType" label="反应类型" show-overflow-tooltip></el-table-column> |
| | |
| | | }; |
| | | |
| | | const toDoublePrevent = () => { |
| | | window.open('http://121.239.169.27:6801'); |
| | | window.open('http://124.88.37.66:6801'); |
| | | }; |
| | | const toSmartFactory = () =>{ |
| | | window.open('http://10.211.134.139:5522/#/login'); |