From 01f62968de39cacddaed903bb936cc5163573fc4 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 23 十二月 2022 14:51:37 +0800
Subject: [PATCH] 更改列表显示
---
src/views/specialWorkManage/workTicket/myJobApply/index.vue | 74 +++++++++++++++++++++++++++----------
1 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/src/views/specialWorkManage/workTicket/myJobApply/index.vue b/src/views/specialWorkManage/workTicket/myJobApply/index.vue
index 38e6013..244da37 100644
--- a/src/views/specialWorkManage/workTicket/myJobApply/index.vue
+++ b/src/views/specialWorkManage/workTicket/myJobApply/index.vue
@@ -32,8 +32,8 @@
<el-table ref="multipleTableRef" :data="applyData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }">
<el-table-column property="workPermitNo" label="作业申请单号" width="180" />
<el-table-column property="applyUname" label="申请人" />
- <el-table-column property="depName" label="部门名称" />
- <el-table-column property="operators" label="作业人" />
+ <el-table-column property="operatorCompanys" label="施工单位" />
+ <el-table-column property="operatorUnames" label="作业人" />
<el-table-column property="workTypeDesc" label="作业类型" />
<el-table-column property="workLevelDesc" label="作业等级" />
<el-table-column property="applyTime" label="申请时间" width="180" />
@@ -47,6 +47,7 @@
<el-button link type="text" @click="viewRecord(scope.row)">查看</el-button>
<el-button link type="text" @click="viewStatus(scope.row)">进度</el-button>
<el-button link type="text" @click="deleteRecordBtn(scope.row)">取消</el-button>
+ <el-button :disabled="scope.row.status == 7 ? false : true" link type="text" @click="downLoadRecord(scope.row)">导出作业票</el-button>
</template>
</el-table-column>
</el-table>
@@ -74,9 +75,12 @@
</template>
</el-dialog>
<el-dialog :visible.sync="dialogStatus" title="作业申请进度" width="60%">
- <el-form v-if="approveInfo.operators.length > 0" style="margin-bottom: 40px">
- <el-form-item label="申请作业人">
- <el-input v-model="approveInfo.operators" readonly type="textarea" />
+ <el-form style="margin-bottom: 40px">
+ <el-form-item label="作业人" v-if="approveInfo.operatorUnames">
+ <el-input v-model="approveInfo.operatorUnames" readonly type="textarea" />
+ </el-form-item>
+ <el-form-item label="作业人" v-else>
+ <el-input placeholder="无" readonly type="textarea" />
</el-form-item>
</el-form>
<div style="display: flex; flex-direction: column-reverse">
@@ -103,7 +107,7 @@
><span>{{ i.resultDesc }}</span>
</div>
</div>
- <div class="approveItem">
+ <div class="approveItem" v-if="item.stepItems && item.stepItems.length>0">
<div class="item-tit">
<span>审批项目</span>
<!-- <span>类型</span>-->
@@ -112,7 +116,7 @@
<div class="item-cont" v-for="i in item.stepItems">
<span>{{ i.itemName }}</span>
<!-- <span>{{ i.typeDesc }}</span>-->
- <div v-if="i.measure !== null">
+ <div v-if="i.measure">
<div>
<span>作业类型:</span><span>{{ i.measure.workTypeDesc }}</span>
</div>
@@ -120,7 +124,7 @@
<span>措施内容:</span><span>{{ i.measure.context }}</span>
</div>
</div>
- <div v-if="i.stand !== null">
+ <div v-if="i.stand">
<div>
<span>标题名称:</span><span>{{ i.stand.title }}</span>
</div>
@@ -198,6 +202,8 @@
import power from './components/powerLog'
import plate from './components/plateLog'
import {workApplyApi} from "../../../../api/workApply";
+import Cookies from 'js-cookie';
+import axios from 'axios';
export default{
name: 'myApply',
components: {
@@ -294,6 +300,34 @@
this.getListByPage();
},
+ // 导出方法
+ downLoadRecord(row) {
+ if(row.status == 7){
+ axios.post(process.env.BASE_API + `/work/apply/printing`,{applyWorkId: row.workApplyId},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`},responseType: 'blob'}).then(res=>{
+ if (res) {
+ const link = document.createElement('a')
+ let blob = new Blob([res.data],{type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'})
+ link.style.display = "none";
+ link.href = URL.createObjectURL(blob); // 创建URL
+ link.setAttribute("download", row.workTypeDesc + row.workPermitNo + "作业证.docx");
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ } else {
+ this.$message({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ })
+ }else{
+ this.$message({
+ type: 'warning',
+ message: '该作业申请未完成审批流程,不可导出'
+ });
+ }
+ },
+
// 填写表单
toApply() {
this.$router.push({
@@ -341,9 +375,9 @@
let res = await workApplyApi().getStatus(data);
if (res.data.code === '200') {
this.approveInfo = JSON.parse(JSON.stringify(res.data.data));
- this.approveInfo.operators = this.approveInfo.operators.map(item => {
- return item.operatorUname
- }).join('、')
+ // this.approveInfo.operators = this.approveInfo.operators.map(item => {
+ // return item.operatorUname
+ // }).join('、')
} else {
this.$message({
type: 'warning',
@@ -382,15 +416,15 @@
this.dialogType = row.workType
this.details = JSON.parse(JSON.stringify(row));
this.details.operators = this.details.operators.join('、')
- if(this.details.workDetail.otherSpecialWork == '' || !this.details.workDetail.otherSpecialWork){
- this.details.workDetail.otherSpecialWork = ''
- }
- else {
- const a = this.details.workDetail.otherSpecialWork
- this.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
- return this.workType.find((i) => i.id === Number(item)).name;
- }).join('、');
- }
+ // if(!this.details.workDetail.otherSpecialWork || this.details.workDetail.otherSpecialWork == ''){
+ // this.details.workDetail.otherSpecialWork = ''
+ // }
+ // else {
+ // const a = this.details.workDetail.otherSpecialWork
+ // this.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
+ // return this.workType.find((i) => i.id === Number(item)).name;
+ // }).join('、');
+ // }
if(this.details.workDetail.involvedDepIds == '' || !this.details.workDetail.involvedDepIds){
this.details.workDetail.involvedDepIds = ''
}
--
Gitblit v1.9.2