This commit is contained in:
shijing 2023-03-21 11:26:45 +08:00
parent 9b6f1d0995
commit dcb843a554
8 changed files with 169 additions and 120 deletions

View File

@ -1,10 +1,11 @@
<template>
<!--基本信息!-->
<el-main v-loading="mainLoading">
<el-main v-loading="mainLoading" style="margin-top: -60px;">
<div id="exportDiv" class="exportDiv">
<p style="font-weight: 600px;font-size: 18px;text-align: center;margin-top: 40px;">{{form.cate_name}}作业许可证<span>{{ form.number }}</span></p>
<p class="tables-title">作业信息</p>
<el-card shadow="hover">
<el-descriptions column=2>
<el-descriptions column=2 id="opl__opre">
<el-descriptions-item label="作业名称:">
{{ operationObj.name }}
</el-descriptions-item>
@ -49,7 +50,7 @@
</el-card>
<p class="tables-title">许可证信息</p>
<el-card shadow="hover">
<el-descriptions column=2>
<el-descriptions column=2 id="opl__opre">
<el-descriptions-item label="编号:">
{{ form.number }}
</el-descriptions-item>
@ -64,7 +65,7 @@
</el-descriptions-item>
<el-descriptions-item label="状态:">
<span v-if="form.ticket_&&form.ticket_.state_" style="margin-right: 5px;">{{form.ticket_.state_.name }}</span>
<span :class="[form.ticket_.act_state===0?'nomalState':form.ticket_.act_state===1?'nomalState':form.ticket_.act_state===2?'dangerState':form.ticket_.act_state===3?'dangerState':form.ticket_.act_state===5?'dangerState':form.ticket_.act_state===4?'successState':'nomalState']"
<span :class="['btnState' ,form.ticket_.act_state===0?'nomalState':form.ticket_.act_state===1?'nomalState':form.ticket_.act_state===2?'dangerState':form.ticket_.act_state===3?'dangerState':form.ticket_.act_state===5?'dangerState':form.ticket_.act_state===4?'successState':'nomalState']"
v-if="form.ticket_&&form.ticket_.act_state">{{act_states[form.ticket_.act_state]}}</span>
</el-descriptions-item>
<el-descriptions-item label="作业部门:">
@ -103,7 +104,7 @@
</el-card> -->
<p class="tables-title">作业人员</p>
<table class="tables" cellspacing="0">
<tr class="tableTh">
<tr class="tableTh tableThS">
<td class="tableTd">序号</td>
<td class="tableTd">姓名</td>
<td class="tableTd">工作职责</td>
@ -111,19 +112,19 @@
<td class="tableTd">创建时间</td>
</tr>
<tr v-if="workerData.length==0" class="noDataTr"> 无数据</tr>
<tr class="tableTr" v-for="(item,index) in workerData" :key="item.id">
<tr class="tableTr tableTrS" v-for="(item,index) in workerData" :key="item.id">
<td class="tableTd">{{ index+1 }}</td>
<td class="tableTd">{{ item.worker_.name }}</td>
<td class="tableTd">{{ item.duty }}</td>
<td class="tableTd">
<span v-for="cer in item.certificates_" :key="cer.number">{{cer.name}}</span>
<span v-for="cer in item.certificates_" :key="cer.number">{{cer.name}}-{{cer.number }}</span>
</td>
<td class="tableTd">{{ item.create_time }}</td>
</tr>
</table>
<p class="tables-title">气体检测记录</p>
<table class="tables" cellspacing="0">
<tr class="tableTh">
<tr class="tableTh tableThS">
<td class="tableTd">序号</td>
<td class="tableTd">检测部位</td>
<td class="tableTd">O₂%</td>
@ -135,7 +136,7 @@
<td class="tableTd">创建时间</td>
</tr>
<tr v-if="gasData.length==0" class="noDataTr"> 无数据</tr>
<tr class="tableTr" v-for="(item,index) in gasData" :key="item.id">
<tr class="tableTr tableTrS" v-for="(item,index) in gasData" :key="item.id">
<td class="tableTd">{{ index+1 }}</td>
<td class="tableTd">{{ item.check_place }}</td>
<td class="tableTd">{{ item.o2 }}</td>
@ -151,8 +152,8 @@
<table class="tables" cellspacing="0">
<tr class="tableTh">
<td class="tableTd">进行状态</td>
<td class="tableTd">操作类型</td>
<td class="tableTd">操作属性</td>
<td class="tableTd attributeTd">操作类型</td>
<td class="tableTd attributeTd">操作属性</td>
<td class="tableTd">操作意见</td>
<td class="tableTd">操作人</td>
<!-- <td class="tableTd">电子签名</td> -->
@ -161,10 +162,10 @@
<tr v-if="logsData.length==0" class="noDataTr"> 无处理日志</tr>
<tr class="tableTr" v-for="item in logsData" :key="item.id">
<td class="tableTd">{{ item.state_.name }}</td>
<td class="tableTd">{{ typeOptions[item.intervene_type] }}</td>
<td class="tableTd">
<span v-if="item.transition_attribute == 1" class="successState">同意</span>
<span v-else class="dangerState">拒绝</span>
<td class="tableTd attributeTd">{{ typeOptions[item.intervene_type] }}</td>
<td class="tableTd attributeTd">
<span v-if="item.transition_attribute == 1" class="successText">同意</span>
<span v-else class="dangerText">拒绝</span>
</td>
<td class="tableTd">{{ item.suggestion }}</td>
<td class="tableTd">
@ -291,10 +292,6 @@
that.oplcateCode = res.cate_code;
that.ticketId = res.ticket;
that.$nextTick(()=>{
// that.$API.wf.ticket.ticketItem.req(that.ticketId).then((ress) => {
// that.ticketDetail = ress;
// that.ticketDetailState = true;
// }).catch(e=>{});
this.$API.wf.ticket.ticketFlowlogs.req(that.ticketId).then((res) => {
if (res.err_msg) {
} else {
@ -336,18 +333,33 @@
.el-drawer__header {
margin-bottom: 0px;
}
.nomalState{
.btnState{
font-size: 12px;
padding: 0 9px;
color: #536dfe;
height: 24px;
line-height: 23px;
border-radius: 5px;
vertical-align: top;
display: inline-block;
background-color: #edf0fe;
}
.nomalState{
color: #536dfe;
border: 1px solid #dcdfe6;
}
.dangerState{
color: #FF0000;
border: 1px solid #fbe0e0;
}
.successState{
color: #14c532;
border: 1px solid #e6f3e6;
}
.successText{
color: #14c532;
}
.dangerText{
color: #FF0000;
}
.tables{
width: 100%;
color: #606266;
@ -358,33 +370,42 @@
.tables-title{
color: #303331;
font-size: 16px;
font-weight: 700;
margin: 20px 0 10px 0;
/* font-weight: 700; */
margin: 10px 0;
}
.tableTh,.tableTr{
display: flex;
}
.tableTh>td{
font-weight: 700;
color: #909399;
/* color: #909399; */
height: 35px;
line-height: 35px;
padding: 0 5px;
/* background: #fafafa; */
}
.tableTh>td:first-child{
.tableThS>td:first-child{
flex-shrink:0;
width: 70px;
}
.tableTr>td{
min-height: 30px;
line-height: 30px;
padding: 0 5px;
}
.tableTr>td:first-child{
.tableTrS>td:first-child{
flex-shrink:0;
width: 70px;
}
.tableTh>td.attributeTd{
flex-shrink:0;
width: 90px;
}
.tableTr>td.attributeTd{
flex-shrink:0;
width: 90px;
}
td{
width: 25%;
border-right: 1px solid #e4e7ed;

View File

@ -1,6 +1,7 @@
<template>
<div class="sc-upload-multiple">
<el-upload ref="uploader" list-type="picture-card"
<el-upload ref="uploader"
list-type="picture-card"
:auto-upload="autoUpload"
:disabled="disabled"
:action="action"
@ -10,7 +11,7 @@
:file-list="defaultFileList"
:show-file-list="showFileList"
:accept="accept"
:multiple="multiple"
multiple=true
:limit="limit"
:before-upload="before"
:on-success="success"
@ -51,26 +52,25 @@
export default {
props: {
modelValue: { type: String, default: "" },
modelValue: { },
tip: { type: String, default: "" },
action: { type: String, default: "" },
apiObj: { type: Object, default: () => {} },
name: { type: String, default: config.filename },
data: { type: Object, default: () => {} },
accept: { type: String, default: "image/gif, image/jpeg, image/png" },
maxSize: { type: Number, default: config.maxSizeFile },
limit: { type: Number, default: 0 },
name: { type: String, default: config.filename },
limit: { type: Number, default: 9 },
autoUpload: { type: Boolean, default: true },
showFileList: { type: Boolean, default: true },
multiple: { type: Boolean, default: true },
disabled: { type: Boolean, default: false },
draggable: { type: Boolean, default: false },
onSuccess: { type: Function, default: () => { return true } }
onSuccess: { type: Function, default: () => { return true } },
maxSize: { type: Number, default: config.maxSizeFile },
accept: { type: String, default: "image/gif, image/jpeg, image/png" },
},
data(){
return {
value: "",
defaultFileList: []
defaultFileList: []//[{name:'',url:''}]
}
},
watch:{
@ -94,11 +94,17 @@
}
},
mounted() {
this.value = this.modelValue
this.defaultFileList = this.toArr(this.modelValue)
if(!this.disabled && this.draggable){
this.rowDrop()
this.defaultFileList = this.modelValue//ids
console.log(this.modelValue);
if(this.modelValue.length>0){
this.modelValue.forEach(item=>{
})
// this.value.push()
}
},
methods: {
//
@ -147,14 +153,19 @@
return false;
}
},
success(res, file){
success(res, file , fileList){
debugger;
var os = this.onSuccess(res, file)
console.log(os)
if(os!=undefined && os==false){
return false
}
var response = config.parseData(res)
file.name = response.fileName
file.url = response.src
file.url = response.src;
file.name = response.fileName;
this.$emit('uploadSuccess',fileList);
this.value = this.value+','+res.id;
},
error(err){
this.$notify.error({
@ -198,12 +209,12 @@
}
}).then(res => {
config.parseData(res);
param.onSuccess(res)
// if(response.code == config.successCode){
// param.onSuccess(res)
// }else{
// param.onError(response.msg || "")
// return {
// fileName: res.name,//
// src: res.path,//
// }
param.onSuccess(res)
debugger;
}).catch(err => {
param.onError(err)
})

View File

@ -103,4 +103,7 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
#eventImgWrap .el-image__preview,#eventImgWrap .el-image__inne{
width: auto;
}
#opl__opre>.el-descriptions__body>.el-descriptions__table:not(.is-bordered) .el-descriptions__cell{
padding-bottom: 5px;
}

View File

@ -21,23 +21,17 @@ class PdfLoader {
async getPDF(resolve) {
const ele = this.ele;
let eleme = this.ele;
eleme.style.width="750px";
eleme.style.width="800px";
const pdfFileName = this.pdfFileName
const eleW = ele.offsetWidth// 获得该容器的宽
const eleH = ele.scrollHeight// 获得该容器的高
const eleH = ele.scrollHeight;// 获得该容器的高
const eleOffsetTop = ele.offsetTop// 获得该容器到文档顶部的距离
const eleOffsetLeft = ele.offsetLeft// 获得该容器到文档最左的距离
const canvas = document.createElement('canvas')
// let abs = 0
// const win_in = document.documentElement.clientWidth || document.body.clientWidth// 获得当前可视窗口的宽度(不包含滚动条)
// const win_out = window.innerWidth// 获得当前窗口的宽度(包含滚动条)
// if (win_out > win_in) {
// abs = (win_out - win_in) / 2// 获得滚动条宽度的一半
// }
canvas.width = eleW * 2// 将画布宽&&高放大两倍
canvas.height = eleH * 2
canvas.width = eleW * 3// 将画布宽&&高放大两倍
canvas.height = eleH * 3
const context = canvas.getContext('2d')
context.scale(2,2) // 增强图片清晰度
context.scale(3,3) // 增强图片清晰度
context.translate(-eleOffsetLeft , -eleOffsetTop)
html2canvas(eleme, {
useCORS: true// 允许canvas画布内可以跨域请求外部链接图片, 允许跨域请求。
@ -49,7 +43,7 @@ class PdfLoader {
// 未生成pdf的html页面高度
let leftHeight = contentHeight
// 页面偏移
let position = 0
let position = 20
// a4纸的尺寸[595,842],单位像素html页面生成的canvas在pdf中图片的宽高
const imgWidth = this.A4_WIDTH - 40 // -10为了页面有右边距
const imgHeight = (this.A4_WIDTH / contentWidth) * contentHeight
@ -63,7 +57,7 @@ class PdfLoader {
} else {
// 分页
while (leftHeight > 0) {
pdf.addImage(pageData, 'JPEG', 5, position, imgWidth, imgHeight)
pdf.addImage(pageData, 'JPEG', 20, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= this.A4_HEIGHT
// 避免添加空白页

View File

@ -114,7 +114,7 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="签名">
<sc-upload v-model="form.signature" title="签名"></sc-upload>
<el-image :src="form.signature" style="width: 148px;min-height: 80px;"></el-image>
</el-form-item>
</el-col>
</el-row>

View File

@ -72,12 +72,12 @@
v-model="form.dept_do"
:options="deptoptions"
:props="{
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
expandTrigger: 'hover', //
label: 'label', //
value: 'value', //
emitPath: false, // false
checkStrictly: true
}"
clearable
/>
</el-form-item>
@ -89,14 +89,6 @@
style="width:200px"
disabled
></el-input>
<!-- <el-select v-model="form.charger_name" placeholder="选择作业负责人">
<el-option
v-for="item in useroptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select> -->
<ehsUserSelect :multiple="false" @submit="getCharger"/>
</el-form-item>
</el-col>
@ -145,18 +137,22 @@
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="作业前照片" prop="measures_checked">
<sc-Upload-Multiple @uploadSuccess="uploadSuccess" v-model="create_imgs" :modelValue="imgList" title="证件照"></sc-Upload-Multiple>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="margin-bottom: 20px; text-align:center">
<el-button
:disabled="issave"
:loading="issave"
:disabled="issave"
:loading="issave"
type="primary" plain
@click="handleNextStep"
>下一步</el-button>
</div>
</el-main>
<!--作业人员!-->
<el-main class="nopadding" v-show="active === 1">
<div class="left-panel" style="margin: 10px">
@ -328,10 +324,10 @@
opl: "",
};
const defaultformgas = {
id: "",
check_time: null,
opl:""
};
id: "",
check_time: null,
opl:""
};
export default {
name: "fire",
components: {},
@ -353,16 +349,19 @@
operation: "",
cate: "",
risks_checked: [],
create_imgs:[],
},
create_imgs:[],
imgList:[],
initForm: {},
operationId: "",
oplcateId: "",
oplcateCode: "",
oplId: "",
leveloptions: [
{ id: "主干道", name: "主干道" },
{ id: "次干渠", name: "次干渠" }
],
{ id: "主干道", name: "主干道" },
{ id: "次干渠", name: "次干渠" }
],
deptoptions: [],
useroptions: [],
risklist: [],
@ -422,6 +421,21 @@
// this.getUser();
},
methods: {
uploadSuccess(data){
debugger;
console.log(data);
debugger;
let imgArr = [];
if(data.constructor===Array ){
data.forEach(item=>{
imgArr.push(item.response.id)
})
}else{
imgArr.push(data.id)
}
this.form.create_imgs = imgArr;
},
getCharger(data) {
this.form.charger=data.id;
this.form.charger_name=data.name
@ -503,45 +517,48 @@
},
//
handleNextStep() {
// debugger;
console.log(this.form.create_imgs);
// return;
if (this.active == 0) {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.issave = false; //
if (this.oplId == "") {
//
debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.issave = true;
//
if (this.oplId == "") {
//
// debugger;
this.form.cate = this.oplcateId;
this.form.operation = this.operationId;
console.log(this.form);
this.$API.opm.opl.create
.req(this.form)
.then((res) => {
this.$emit("success", this.form);
this.$message.success("创建成功");
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
return err;
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
this.active = 1;
this.issave = false;
this.oplId = res.id;
this.getworkerList();
this.getgasList();
return res;
})
.catch((err) => {
return err;
this.getworkerList();
});
} else if (this.oplId != "") {
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
this.$message.success("基本修改成功!");
} else {
this.active = 1;
this.issave = false;
this.getgasList();
this.getworkerList();
});
} else {
this.active = 1;
this.issave = false;
}
}
}
})
}

View File

@ -86,7 +86,7 @@
</el-table-column>
</scTable>
</el-card>
<el-drawer :size="'50%'" v-model="showLimited" :title="oplName + '作业许可证详情'">
<el-drawer :size="'50%'" v-model="showLimited">
<sc-fire :id="oplId" :wfId="operationId"></sc-fire>
</el-drawer>
</el-main>

View File

@ -66,7 +66,8 @@
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="签名">
<el-image :src="form.signature" style="width: 148px; height: 80px"></el-image>
<sc-upload v-model="form.signature" title="证件照" :disabled="true"></sc-upload>
<!-- <el-image :src="form.signature" style="width: 148px; height: 80px"></el-image> -->
</el-form-item>
</el-col>
<el-col>
@ -102,8 +103,10 @@ export default {
},
submitForm() {
let sform = {
"id_number":this.form.id_number,
"photo": this.form.photo,
"phone": this.form.phone,
"email": this.form.email
"email": this.form.email,
}
this.saveLoading = true
this.$API.hrm.employee.improve_info.req(sform).then(res=>{