<template>
|
<a-drawer
|
:title="title"
|
:width="drawerWidth"
|
:visible="visible"
|
@close="handleCancel"
|
:confirmLoading="confirmLoading"
|
:maskClosable="maskClosable"
|
>
|
<a-card :style="getBackground()">
|
<template>
|
<a-card>
|
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
<a-row :style="{textAlign:'left'}">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleSW"
|
:disabled=SWbuttonDistable
|
type="primary"
|
v-has="'daily3MaintenanceOrder:SW'"
|
>开工</a-button>
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleReport"
|
:disabled="buttonDistable"
|
type="primary"
|
v-has="'daily3MaintenanceOrder:report'"
|
>报工</a-button>
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleReset"
|
:disabled="revocationDistable"
|
type="primary"
|
v-has="'daily3MaintenanceOrder:reset'"
|
>撤销</a-button>
|
</a-row>
|
</div>
|
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
<a-row :gutter="24">
|
<a-col :span="6">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="状态"
|
class="hightColor"
|
>
|
<span
|
v-if="this.model != null"
|
class="hightColor"
|
>{{ this.model.statusName }}</span>
|
<span
|
v-else
|
class="frozenRowClass"
|
>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="6">
|
<a-form-item
|
:labelCol="{span:8}"
|
:wrapperCol="{span:16}"
|
label="保养工单号"
|
class="hightColor"
|
>
|
<span
|
v-if="this.model != null"
|
class="hightColor"
|
>{{ this.model.num }}</span>
|
<span
|
v-else
|
class="frozenRowClass"
|
>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="6">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="使用部门"
|
class="hightColor"
|
>
|
<span
|
v-if="this.model != null"
|
class="hightColor"
|
>{{ this.model.departName }}</span>
|
<span
|
v-else
|
class="frozenRowClass"
|
>-</span>
|
</a-form-item>
|
</a-col>
|
<a-col :span="6">
|
<a-form-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
label="责任班组"
|
class="hightColor"
|
>
|
<span
|
v-if="this.model != null"
|
class="hightColor"
|
>{{ this.model.teamName }}</span>
|
<span
|
v-else
|
class="frozenRowClass"
|
>-</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="17">
|
<a-form-item
|
label="问题/处理措施"
|
:labelCol="{span:3}"
|
:wrapperCol="{span:18}"
|
class="hightColor"
|
>
|
<a-textarea
|
allowClear
|
:disabled="this.model.status!='4'"
|
:placeholder="'请维修人员签字填写!'"
|
v-model="model.description"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="7">
|
<a-form-item
|
label="保养人"
|
:labelCol="{span:4}"
|
:wrapperCol="{span:17}"
|
class="hightColor"
|
>
|
<a-input
|
:disabled="this.model.status!='4'"
|
allow-clear
|
placeholder="请输入保养人"
|
v-model="model.maintenanceUserId"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</div>
|
|
<a-tabs
|
type="card"
|
defaultActiveKey="1"
|
>
|
<a-tab-pane
|
tab='保养明细'
|
key="1"
|
class="hightColor"
|
>
|
|
<div>
|
<a-table
|
ref="table"
|
size="middle"
|
bordered
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:loading="loading"
|
@change="handleTableChange"
|
:pagination="ipagination"
|
>
|
<!-- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" -->
|
<!-- :scroll="{x:true}" -->
|
<template
|
v-for="col in columns"
|
:slot="col.dataIndex"
|
slot-scope='text, record, index'
|
>
|
<div :key="col.dataIndex">
|
<!-- <span
|
v-show=" col.dataIndex == 'photo' && !text"
|
style="font-size: 12px;font-style: italic;"
|
>无图片</span>
|
<img
|
v-show="col.dataIndex == 'photo' && text"
|
:src="getImgView(text)"
|
:preview="record.maintenanceStandardDetailId"
|
height="25px"
|
alt=""
|
style="max-width:80px;font-size: 12px;font-style: italic;"
|
/> -->
|
<!-- 示意图 开始 -->
|
<!-- <Tooltip
|
placement="top"
|
title="预览图片"
|
>
|
<img
|
v-if=" col.dataIndex == 'photo' && record.sketchPhoto.path && (record.sketchPhoto.format.toLowerCase()=='jpg'||record.sketchPhoto.format.toLowerCase()=='bmp'||record.sketchPhoto.format.toLowerCase()=='png'||record.sketchPhoto.format.toLowerCase()=='jpeg'||record.sketchPhoto.format.toLowerCase()=='gif')"
|
width="30"
|
height="14"
|
border="1"
|
draggable="false"
|
preview="1"
|
:preview-text="''"
|
:src="record.sketchPhoto.src"
|
/>
|
</Tooltip>
|
|
<a
|
v-if=" col.dataIndex == 'photo' && record.sketchPhoto.path && record.sketchPhoto.format.toLowerCase()=='pdf'"
|
href="javascript:;"
|
@click="viewP(record.sketchPhoto)"
|
>
|
预览
|
</a> -->
|
|
<a-input
|
:value="text"
|
v-show="col.dataIndex == 'maintenanceOrderDetailUda1'"
|
@change="(e)=>handleChange(e, record.key, col, index)"
|
:disabled="true"
|
/>
|
<!-- :disabled="record.disabled" -->
|
</div>
|
</template>
|
</a-table>
|
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
<a-row :style="{textAlign:'right'}">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleCancel"
|
>
|
取消
|
</a-button>
|
<a-button
|
@click="handleOk()"
|
type="primary"
|
:disabled="this.model.status!='4'"
|
:loading="confirmLoading"
|
>保存</a-button>
|
</a-row>
|
<!-- v-has="'dailyMaintenanceOrder:actualWorkHoursSave'" -->
|
<!-- :disabled="false" -->
|
</div>
|
</div>
|
</a-tab-pane>
|
|
<!-- <a-tab-pane
|
tab='计划用料'
|
key="2"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<maintenance-standard-planning-material :maintenanceStandardId='maintenanceStandardId' />
|
</div>
|
</a-tab-pane>
|
<a-tab-pane
|
tab='危险防控'
|
key="3"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<maintenance-standard-safety-requirement :maintenanceStandardId='maintenanceStandardId' />
|
</div>
|
</a-tab-pane>
|
<a-tab-pane
|
tab='作业指导书'
|
key="4"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
|
</div>
|
</a-tab-pane>-->
|
<a-tab-pane
|
tab='实际用料'
|
key="5"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<actual-material-edit-table
|
:dailyMaintenanceOrderId="this.model.id"
|
:dailyMaintenanceOrderStatus="this.model.status"
|
:equipmentId="this.model.equipmentId"
|
></actual-material-edit-table>
|
</div>
|
</a-tab-pane>
|
<a-tab-pane
|
tab='实际工时'
|
key="6"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<actual-work-hours-edit-table
|
:dailyMaintenanceOrderId="this.model.id"
|
:dailyMaintenanceOrderStatus="this.model.status"
|
:equipmentId="this.model.equipmentId"
|
:teamId="this.model.teamId"
|
></actual-work-hours-edit-table>
|
</div>
|
</a-tab-pane>
|
<a-tab-pane
|
tab='炉类报告'
|
key="7"
|
>
|
<div
|
class="table-operator"
|
style="margin:-16px"
|
>
|
<stove-category-report-list :maintenanceStandardId='this.model.id' />
|
</div>
|
</a-tab-pane>
|
</a-tabs>
|
</a-card>
|
</template>
|
</a-card>
|
|
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
|
<a-row :style="{textAlign:'right'}">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleCancel"
|
>
|
取消
|
</a-button>
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleTS"
|
:disabled="buttonDistable"
|
type="primary"
|
v-if="false"
|
>暂存</a-button>
|
<a-button
|
@click="handleOk"
|
:disabled="buttonDistable"
|
type="primary"
|
v-if="false"
|
>保存</a-button>
|
</a-row>
|
</div>
|
</a-drawer>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { requestPut, getAction, downFile, postAction } from '@/api/manage'
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
import { preview } from 'vue-photo-preview'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import Vue from 'vue'
|
import PdfView from '@views/common/PdfView'
|
import { getFileAccessHttpUrl } from '@/api/manage';
|
|
import MaintenanceStandardPlanningMaterial from '../dailyMaintenanceOrder/MaintenanceStandardPlanningMaterial'
|
import MaintenanceStandardSafetyRequirement from '../dailyMaintenanceOrder/MaintenanceStandardSafetyRequirement'
|
import MaintenanceStandardWorkInstruction from '../dailyMaintenanceOrder/MaintenanceStandardWorkInstruction'
|
import ActualMaterialEditTable from '../dailyMaintenanceOrder/ActualMaterialEditTable.vue'
|
import ActualWorkHoursEditTable from '../dailyMaintenanceOrder/ActualWorkHoursEditTable.vue'
|
import StoveCategoryReportList from './StoveCategoryReportList.vue'
|
|
export default {
|
name: 'DailyMaintenanceOrderExeDrawer',
|
mixins: [JeecgListMixin],
|
components: {
|
PdfView,
|
preview,
|
Tooltip,
|
MaintenanceStandardPlanningMaterial,
|
MaintenanceStandardSafetyRequirement,
|
MaintenanceStandardWorkInstruction,
|
ActualMaterialEditTable,
|
ActualWorkHoursEditTable,
|
StoveCategoryReportList
|
},
|
data() {
|
return {
|
title: "三级保养工单执行",
|
visible: false,
|
maskClosable: true,
|
confirmLoading: false,
|
drawerWidth: "100%",
|
buttonDistable: false,
|
SWbuttonDistable: false,
|
revocationDistable: false,
|
currentNodeSelect: '',
|
maintenanceStandardId: '-1',
|
maintenanceOrderId: '-1',
|
loading: false,
|
dataSource: [],
|
model: {},
|
form: this.$form.createForm(this),
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 },
|
},
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 99,
|
pageSizeOptions: ['99'],
|
showTotal: (total, range) => {
|
return range[0] + "-" + range[1] + " 共" + total + "条"
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
validatorRules: {
|
// description: {
|
// rules: [
|
// { required: true, message: '请输入描述!' },
|
// ]
|
// }
|
},
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
width: 60,
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
}
|
|
},
|
{
|
title: '保养部位',
|
align: 'center',
|
dataIndex: 'location',
|
},
|
// class: "notshow"
|
// {
|
// title: '示意图',
|
// align: 'center',
|
// dataIndex: 'photo',
|
// scopedSlots: { customRender: 'photo' },
|
// },
|
// class: "notshow"
|
{
|
title: '保养内容',
|
align: 'center',
|
dataIndex: 'maintenanceProjectNum',
|
},
|
{
|
title: '验收标准',
|
align: 'center',
|
dataIndex: 'standard',
|
},
|
// {
|
// title: '方法',
|
// align: 'center',
|
// dataIndex: 'maintenanceMethodName',
|
// },
|
// {
|
// title: '工具',
|
// align: 'center',
|
// dataIndex: 'maintenanceTool',
|
// },
|
// {
|
// title: '安全要求',
|
// align: 'center',
|
// dataIndex: 'maintenanceRequire',
|
// },
|
// {
|
// title: '工时定额(小时)',
|
// align: 'center',
|
// dataIndex: 'workingHourQuota',
|
// },
|
// {
|
// title: '保养周期',
|
// align: 'center',
|
// dataIndex: 'maintenanceCycleName',
|
// },
|
// {
|
// title: '维保专业',
|
// align: 'center',
|
// dataIndex: 'maintenanceSpecialtyName',
|
// },
|
{
|
title: '保养人',
|
align: 'center',
|
dataIndex: 'maintenanceOrderDetailUda1',
|
width: 200,
|
scopedSlots: { customRender: 'maintenanceOrderDetailUda1' },
|
},
|
],
|
url: {
|
list: "/eam/dailyMaintenanceOrderDetail/get3MaintenanceOrderDetailList",
|
urlDownload: window._CONFIG['staticDomainURL'],
|
download: '/sys/upload/downloadFile',
|
editStatus: "/eam/dailyMaintenanceOrder/editStatus",
|
revocation: "/eam/dailyMaintenanceOrder/revocation3M",
|
report: "/eam/dailyMaintenanceOrder/report3M",
|
edit: "/eam/dailyMaintenanceOrderDetail/edit"
|
},
|
}
|
},
|
mounted() {
|
this.$bus.$on('closeDrawer', (data) => {
|
this.visible = false;
|
})
|
},
|
|
methods: {
|
|
handleShow(record) {
|
this.model = Object.assign({}, record);
|
this.maintenanceStandardId = record.maintenanceStandardId
|
this.maintenanceOrderId = record.id
|
this.dataSource = []
|
this.visible = true;
|
this.queryParam.dailyMaintenanceOrderId = record.id
|
this.loadData1(1)
|
},
|
|
loadData1(arg) {
|
if (!this.url.list) {
|
this.$message.error("请设置url.list属性!")
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1;
|
}
|
var params = this.getQueryParams();//查询条件
|
this.loading = true;
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
// for (let i = 0; i < res.result.records.length; i++) {
|
// let r = res.result.records[i].sketchPhoto;
|
// r.src = this.getSrc(res.result.records[i].sketchPhoto);
|
// }
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
this.dataSource = res.result.records || res.result;
|
// if (res.result.total) {
|
// this.ipagination.total = res.result.total;
|
// } else {
|
// this.ipagination.total = 0;
|
// }
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
} else {
|
this.$message.warning(res.message)
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
|
modalFormOk() {
|
//清空列表选中
|
this.onClearSelected()
|
},
|
loadData() {
|
},
|
getBackground() {
|
return "background-color:rgba(127, 127, 127,0.08)";
|
},
|
handleCancel() {
|
this.maintenanceOrderId = '-1'
|
this.$emit('ok');
|
this.alterFlag = new Date();
|
this.close()
|
},
|
close() {
|
this.visible = false;
|
},
|
//暂存
|
handleTS() {
|
|
},
|
//开工
|
handleSW() {
|
const that = this;
|
that.confirmLoading = true;
|
this.$confirm({
|
title: '保养工单开工',
|
content: '提示:开工后无法撤回,请谨慎操作!',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
requestPut(that.url.editStatus, { id: that.model.id, status: '4' }).then((res) => {
|
if (res.success) {
|
that.loadData1(1)
|
that.model.status = '4'
|
that.$message.success("工单开工成功!")
|
that.buttonDistable = false
|
that.revocationDistable = true
|
that.SWbuttonDistable = true
|
} else {
|
that.$message.warning("工单开工失败!")
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
// that.close();
|
})
|
},
|
})
|
},
|
//报工
|
handleReport() {
|
const that = this;
|
that.confirmLoading = true;
|
// for (let i = 0; i < that.dataSource.length; i++) {
|
// let o = this.dataSource[i]
|
// if (o.maintenanceOrderDetailUda1 == null || o.maintenanceOrderDetailUda1 == '') {
|
// that.$message.warning("请填写第" + (i + 1) + "保养人!");
|
// that.confirmLoading = false;
|
// return
|
// }
|
// }
|
if (that.model.maintenanceUserId == null || that.model.maintenanceUserId == "") {
|
that.$message.warning("请填写保养人!");
|
that.confirmLoading = false;
|
return
|
}
|
this.$confirm({
|
title: '保养工单报工',
|
content: '提示:报工后保养完工,请谨慎操作!',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description, dailyMaintenanceOrderDetails: that.dataSource, maintenanceUserId: that.model.maintenanceUserId }).then((res) => {
|
if (res.success) {
|
that.model.status = '5'
|
that.$message.success(res.message)
|
that.buttonDistable = false
|
that.revocationDistable = true
|
that.SWbuttonDistable = true
|
that.$emit('ok');
|
that.alterFlag = new Date();
|
that.close();
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
//
|
})
|
},
|
})
|
},
|
//撤销
|
handleReset() {
|
const that = this;
|
that.confirmLoading = true;
|
this.$confirm({
|
title: '完工撤销',
|
content: '提示:完工撤销后可继续报工操作!',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
requestPut(that.url.revocation, { id: that.model.id, status: '4' }).then((res) => {
|
if (res.success) {
|
that.model.status = '4'
|
that.$message.success(res.message)
|
that.buttonDistable = false
|
that.revocationDistable = true
|
that.SWbuttonDistable = true
|
that.loadData1(1)
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
// that.close();
|
})
|
},
|
})
|
},
|
//保存
|
handleOk() {
|
const that = this
|
this.loading = true;
|
this.form.validateFields((err, values) => {
|
if (!err) {
|
that.confirmLoading = true
|
let formData = {}
|
formData.dailyMaintenanceOrderDetails = that.dataSource;
|
let obj = obj = postAction(this.url.edit, formData)
|
obj.then((res) => {
|
if (res.success) {
|
that.$message.success(res.message)
|
that.$emit('ok')
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = false
|
that.loadData1();
|
this.loading = false;
|
})
|
}
|
})
|
},
|
|
handleChange(value, key, column, index) {
|
let that = this;
|
const temp = [...that.dataSource];
|
const target = temp[index];
|
if (target) {
|
target[column.dataIndex] = value;
|
if ('maintenanceOrderDetailUda1' == column.dataIndex) {
|
target['maintenanceOrderDetailUda1'] = value.target.value;
|
}
|
that.dataSource = temp;
|
}
|
},
|
|
view(record) {
|
this.$refs.pdfview.showPdf(record.src);
|
},
|
|
handleDownload(record) {
|
downFile(this.url.download, { id: record.upload.id }).then((res) => {
|
if (!res) {
|
this.$message.warning('文件下载失败')
|
return
|
} else {
|
let fileName = record.upload.name;
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
window.navigator.msSaveBlob(new Blob([res]), fileName);
|
} else {
|
let url = window.URL.createObjectURL(new Blob([res]));
|
let link = document.createElement('a');
|
link.style.display = 'none';
|
link.href = url;
|
link.setAttribute('download', fileName);
|
document.body.appendChild(link);
|
link.click()
|
document.body.removeChild(link) //下载完成移除元素
|
window.URL.revokeObjectURL(url) //释放掉blob对象
|
}
|
}
|
})
|
},
|
|
getSrc(record) {
|
if (!record.path) {
|
return '';
|
}
|
//本地:local\Minio:minio\阿里云:alioss
|
if (record.uploadType == 'local') {
|
|
let ssoLoginFlag = Vue.ls.get("ssoLoginFlag");
|
let deployMode = Vue.ls.get("deployMode");
|
|
if (ssoLoginFlag && deployMode == "container") {
|
var baseProject = Vue.ls.get("baseProject");
|
console.log("baseProject==>" + baseProject)
|
|
var hostname = window.location.protocol + "//" + window.location.host;
|
var url = hostname + '/' + baseProject + '/sys/common/static';
|
return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer'])
|
} else {
|
//根据发布状态修改https 或 http
|
return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer'])
|
}
|
|
} else if (record.uploadType == 'alioss') {
|
|
const OSS = require('ali-oss')
|
const client = new OSS({
|
// region以杭州为例(oss-cn-hangzhou),其他region按实际情况填写。
|
region: window._CONFIG['region'],
|
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
|
accessKeyId: window._CONFIG['accessKeyId'],
|
accessKeySecret: window._CONFIG['accessKeySecret'],
|
bucket: window._CONFIG['bucket'],
|
})
|
// object-key表示从OSS下载文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
|
return client.signatureUrl(record.path)
|
}
|
},
|
},
|
|
}
|
</script>
|
|
<style scoped>
|
@import '~@assets/less/common.less';
|
.hightColor {
|
height: 10%;
|
font-weight: bold;
|
font-size: 20px;
|
color: #1b1e1e;
|
}
|
.frozenRowClass {
|
color: #c9c9c9;
|
}
|
.fontweight {
|
font-weight: bold;
|
}
|
.hight {
|
color: #f5222d;
|
}
|
/deep/ .red {
|
color: red;
|
}
|
</style>
|