|
|
@@ -42,11 +42,11 @@
|
|
|
<el-date-picker
|
|
|
v-if="row.isshow"
|
|
|
v-model="checkTime"
|
|
|
- type="datetime"
|
|
|
+ type="date"
|
|
|
style="width: 50%"
|
|
|
placeholder="选择日期时间"
|
|
|
size="small"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
<span v-else>{{
|
|
|
@@ -69,7 +69,7 @@
|
|
|
<span>{{ workOrderInfo ? workOrderInfo.rejectReason : '' }}</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-<!-- <el-row class="repair_row">
|
|
|
+ <!-- <el-row class="repair_row">
|
|
|
<el-col :span="24" class="repair_column">
|
|
|
<span>图片:</span>
|
|
|
<div class="upload-img" v-if="row.isshow">
|
|
|
@@ -117,7 +117,8 @@
|
|
|
<el-row class="repair_row">
|
|
|
<el-col :span="12" class="repair_column">
|
|
|
<span>设备分类:</span>
|
|
|
- <span>{{ equipmentInfo.category
|
|
|
+ <span>{{
|
|
|
+ equipmentInfo.category
|
|
|
? equipmentInfo.category.categoryLevelPath
|
|
|
: ''
|
|
|
}}</span>
|
|
|
@@ -136,14 +137,18 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="repair_column">
|
|
|
<span>设备位置:</span>
|
|
|
- <span>{{ equipmentInfo.position}}</span>
|
|
|
+ <span>{{ equipmentInfo.position }}</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row class="repair_row">
|
|
|
<el-col :span="12" class="repair_column">
|
|
|
<span>规格型号:</span>
|
|
|
<span>
|
|
|
- {{equipmentInfo.category&&equipmentInfo.category.specification}}|{{equipmentInfo.category&&equipmentInfo.category.modelType}}
|
|
|
+ {{
|
|
|
+ equipmentInfo.category && equipmentInfo.category.specification
|
|
|
+ }}|{{
|
|
|
+ equipmentInfo.category && equipmentInfo.category.modelType
|
|
|
+ }}
|
|
|
</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -162,7 +167,9 @@
|
|
|
<el-row class="repair_row">
|
|
|
<el-col :span="12" class="repair_column">
|
|
|
<span>来源:</span>
|
|
|
- <span>{{infoData ?getDictValue('报修来源', infoData.sourceType):''}}</span>
|
|
|
+ <span>{{
|
|
|
+ infoData ? getDictValue('报修来源', infoData.sourceType) : ''
|
|
|
+ }}</span>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="repair_column">
|
|
|
<span>来源编码:</span>
|
|
|
@@ -195,7 +202,7 @@
|
|
|
<span>{{ infoData ? infoData.remark : '' }}</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-<!-- <el-row class="repair_row">
|
|
|
+ <!-- <el-row class="repair_row">
|
|
|
<el-col :span="24" class="repair_column">
|
|
|
<span>图片:</span>
|
|
|
<el-image
|
|
|
@@ -241,187 +248,195 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getAssetInfo } from '@/api/ledgerAssets';
|
|
|
-import { getRepairById , getOutsourceInfo , checkOrBack } from '@/api/maintenance/repair_report';
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
-export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- props: {},
|
|
|
- data () {
|
|
|
- return {
|
|
|
- equipmentdialog: false,
|
|
|
- detailsTabsActiveName: 'repairApplication',
|
|
|
- workOrderInfo: {},
|
|
|
- equipmentInfo: {},
|
|
|
- infoData: {},
|
|
|
- statusObj: {
|
|
|
- 0: '委外中',
|
|
|
- 1: '未修复',
|
|
|
- 2: '已完成'
|
|
|
- },
|
|
|
- dialogTitle: '',
|
|
|
- row: {},
|
|
|
- cause: '',
|
|
|
- showtext: false,
|
|
|
- checkTime: '',
|
|
|
- imageUrl: null
|
|
|
- }
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.requestDict('报修来源');
|
|
|
- this.requestDict('报修状态');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handleClose () {
|
|
|
- this.equipmentdialog = false
|
|
|
- this.checkTime = ''
|
|
|
- this.imageUrl = null
|
|
|
- this.detailsTabsActiveName = 'keepInRepair'
|
|
|
+ import { getAssetInfo } from '@/api/ledgerAssets';
|
|
|
+ import {
|
|
|
+ getRepairById,
|
|
|
+ getOutsourceInfo,
|
|
|
+ checkOrBack
|
|
|
+ } from '@/api/maintenance/repair_report';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ equipmentdialog: false,
|
|
|
+ detailsTabsActiveName: 'repairApplication',
|
|
|
+ workOrderInfo: {},
|
|
|
+ equipmentInfo: {},
|
|
|
+ infoData: {},
|
|
|
+ statusObj: {
|
|
|
+ 0: '委外中',
|
|
|
+ 1: '未修复',
|
|
|
+ 2: '已完成'
|
|
|
+ },
|
|
|
+ dialogTitle: '',
|
|
|
+ row: {},
|
|
|
+ cause: '',
|
|
|
+ showtext: false,
|
|
|
+ checkTime: '',
|
|
|
+ imageUrl: null
|
|
|
+ };
|
|
|
},
|
|
|
- async init (row) {
|
|
|
- console.log(row)
|
|
|
- this.row = row
|
|
|
- this.equipmentdialog = true
|
|
|
- this.dialogTitle = row.title
|
|
|
- this.detailsTabsActiveName = 'keepInRepair'
|
|
|
- const res = await getOutsourceInfo(row.id)
|
|
|
- this.workOrderInfo = res
|
|
|
- this.getSbinfo(row.equiId)
|
|
|
- this.getBxinfo(row.repairRequestId)
|
|
|
- },
|
|
|
-
|
|
|
- getSbinfo (params) {
|
|
|
- getAssetInfo(params).then(res => {
|
|
|
- if (res) {
|
|
|
- this.equipmentInfo = res
|
|
|
- this.$set(this.equipmentInfo,'position',res.positionList[0].pathName?res.positionList[0].pathName:'')
|
|
|
- }
|
|
|
- })
|
|
|
+ created() {
|
|
|
+ this.requestDict('报修来源');
|
|
|
+ this.requestDict('报修状态');
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ handleClose() {
|
|
|
+ this.equipmentdialog = false;
|
|
|
+ this.checkTime = '';
|
|
|
+ this.imageUrl = null;
|
|
|
+ this.detailsTabsActiveName = 'keepInRepair';
|
|
|
+ },
|
|
|
+ async init(row) {
|
|
|
+ console.log(row);
|
|
|
+ this.row = row;
|
|
|
+ this.equipmentdialog = true;
|
|
|
+ this.dialogTitle = row.title;
|
|
|
+ this.detailsTabsActiveName = 'keepInRepair';
|
|
|
+ const res = await getOutsourceInfo(row.id);
|
|
|
+ this.workOrderInfo = res;
|
|
|
+ this.getSbinfo(row.equiId);
|
|
|
+ this.getBxinfo(row.repairRequestId);
|
|
|
+ },
|
|
|
|
|
|
- getBxinfo (params) {
|
|
|
- getRepairById(params).then(res => {
|
|
|
- if (res) {
|
|
|
- this.infoData = res
|
|
|
- // 处理图片
|
|
|
- // if (this.infoData && this.infoData.repairsImg) {
|
|
|
- // const repairsImg = this.infoData.repairsImg
|
|
|
- // this.infoData.repairsImg = []
|
|
|
- // repairsImg.split(',').map(item => {
|
|
|
- // imageView(item).then(res => {
|
|
|
- // this.infoData.repairsImg.push({
|
|
|
- // name: item.substring('/download/'.length),
|
|
|
- // url: res
|
|
|
- // })
|
|
|
- // })
|
|
|
- // return
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ getSbinfo(params) {
|
|
|
+ getAssetInfo(params).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ this.equipmentInfo = res;
|
|
|
+ this.$set(
|
|
|
+ this.equipmentInfo,
|
|
|
+ 'position',
|
|
|
+ res.positionList[0].pathName ? res.positionList[0].pathName : ''
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- //通过按钮事件
|
|
|
- pass () {
|
|
|
- let params = {
|
|
|
- id: this.row.id,
|
|
|
- checkResult: 1,
|
|
|
- checkTime: this.checkTime,
|
|
|
- picPath: this.imageUrl,
|
|
|
- rejectReason: ''
|
|
|
- }
|
|
|
- checkOrBack(params).then(res => {
|
|
|
- this.$message.success('验收成功!')
|
|
|
- this.$emit('refesh')
|
|
|
- this.handleClose()
|
|
|
- })
|
|
|
- },
|
|
|
- //驳回按钮事件
|
|
|
- reject () {
|
|
|
- this.showtext = true
|
|
|
- let ele = document.getElementsByClassName('el-dialog__wrapper')
|
|
|
- let bodyscrollHeight = document.body.scrollHeight
|
|
|
- this.$nextTick(() => {
|
|
|
- ele.forEach(element => {
|
|
|
- if (element.style.display !== 'none') {
|
|
|
- element.scrollTop = bodyscrollHeight
|
|
|
+ getBxinfo(params) {
|
|
|
+ getRepairById(params).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ this.infoData = res;
|
|
|
+ // 处理图片
|
|
|
+ // if (this.infoData && this.infoData.repairsImg) {
|
|
|
+ // const repairsImg = this.infoData.repairsImg
|
|
|
+ // this.infoData.repairsImg = []
|
|
|
+ // repairsImg.split(',').map(item => {
|
|
|
+ // imageView(item).then(res => {
|
|
|
+ // this.infoData.repairsImg.push({
|
|
|
+ // name: item.substring('/download/'.length),
|
|
|
+ // url: res
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // })
|
|
|
+ // }
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- cancelreject () {
|
|
|
- this.showtext = false
|
|
|
- this.cause = ''
|
|
|
- },
|
|
|
- surereject () {
|
|
|
- if (!this.cause) {
|
|
|
- this.$message.info('请填写驳回原因!')
|
|
|
- } else {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //通过按钮事件
|
|
|
+ pass() {
|
|
|
let params = {
|
|
|
id: this.row.id,
|
|
|
- checkResult: 0,
|
|
|
+ checkResult: 1,
|
|
|
checkTime: this.checkTime,
|
|
|
picPath: this.imageUrl,
|
|
|
- rejectReason: this.cause
|
|
|
+ rejectReason: ''
|
|
|
+ };
|
|
|
+ checkOrBack(params).then((res) => {
|
|
|
+ this.$message.success('验收成功!');
|
|
|
+ this.$emit('refesh');
|
|
|
+ this.handleClose();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //驳回按钮事件
|
|
|
+ reject() {
|
|
|
+ this.showtext = true;
|
|
|
+ let ele = document.getElementsByClassName('el-dialog__wrapper');
|
|
|
+ let bodyscrollHeight = document.body.scrollHeight;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ ele.forEach((element) => {
|
|
|
+ if (element.style.display !== 'none') {
|
|
|
+ element.scrollTop = bodyscrollHeight;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelreject() {
|
|
|
+ this.showtext = false;
|
|
|
+ this.cause = '';
|
|
|
+ },
|
|
|
+ surereject() {
|
|
|
+ if (!this.cause) {
|
|
|
+ this.$message.info('请填写驳回原因!');
|
|
|
+ } else {
|
|
|
+ let params = {
|
|
|
+ id: this.row.id,
|
|
|
+ checkResult: 0,
|
|
|
+ checkTime: this.checkTime,
|
|
|
+ picPath: this.imageUrl,
|
|
|
+ rejectReason: this.cause
|
|
|
+ };
|
|
|
+ checkOrBack(params).then((res) => {
|
|
|
+ this.$message.success('驳回成功!');
|
|
|
+ this.$emit('refesh');
|
|
|
+ this.handleClose();
|
|
|
+ });
|
|
|
}
|
|
|
- checkOrBack(params).then(res => {
|
|
|
- this.$message.success('驳回成功!')
|
|
|
- this.$emit('refesh')
|
|
|
- this.handleClose()
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- // 选择图片回调
|
|
|
- cbUploadImg (data) {
|
|
|
- if (data.length > 0) {
|
|
|
- this.imageUrl = data[0]
|
|
|
- } else {
|
|
|
- this.imageUrl = ''
|
|
|
+ // 选择图片回调
|
|
|
+ cbUploadImg(data) {
|
|
|
+ if (data.length > 0) {
|
|
|
+ this.imageUrl = data[0];
|
|
|
+ } else {
|
|
|
+ this.imageUrl = '';
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- equipmentdialog (nVal, oVal) {
|
|
|
- if (!nVal) {
|
|
|
- this.cause = ''
|
|
|
- this.showtext = false
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ equipmentdialog(nVal, oVal) {
|
|
|
+ if (!nVal) {
|
|
|
+ this.cause = '';
|
|
|
+ this.showtext = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.repair_row {
|
|
|
- margin-bottom: 15px;
|
|
|
- .repair_column {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- > span {
|
|
|
- &:first-child {
|
|
|
- font-weight: 700;
|
|
|
- text-align: right;
|
|
|
- width: 120px;
|
|
|
+ .repair_row {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ .repair_column {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ > span {
|
|
|
+ &:first-child {
|
|
|
+ font-weight: 700;
|
|
|
+ text-align: right;
|
|
|
+ width: 120px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-.btnbox {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-::v-deep .el-button {
|
|
|
- padding: 10px 20px;
|
|
|
- margin-right: 10px;
|
|
|
-}
|
|
|
-.textbox {
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-.textbtnbox {
|
|
|
- margin-top: 10px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
-}
|
|
|
+ .btnbox {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ ::v-deep .el-button {
|
|
|
+ padding: 10px 20px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ .textbox {
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .textbtnbox {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
</style>
|