工单 告警 报事 修改
This commit is contained in:
@@ -28,10 +28,10 @@
|
||||
<view class="detail-value"><text class="detail-key">发起单位/人:</text>{{ detail.initiatorPeople }}</view>
|
||||
<view class="detail-value remark"><text>备注:</text>{{ detail.remark }}</view>
|
||||
<view class="detail-value"><text class="detail-key">工单图片:</text></view>
|
||||
<view class="image-list" v-if="detail.orderImgUrl">
|
||||
<u-image v-for="(imgUrl, index) in detail.orderImgUrl.split(',')" :key="index" :src="imgUrl"
|
||||
<view class="image-list" v-if="orderImgUrls.length > 0">
|
||||
<u-image v-for="(imgUrl, index) in orderImgUrls" :key="index" :src="imgUrl"
|
||||
width="200rpx" height="200rpx" border-radius="10rpx"
|
||||
@click="previewImage(detail.orderImgUrl.split(','), index)"
|
||||
@click="previewImage(orderImgUrls, index)"
|
||||
style="margin-right: 20rpx; margin-bottom: 20rpx;"></u-image>
|
||||
</view>
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
detail: {},
|
||||
isManager: false,
|
||||
showSelect: false,
|
||||
users: []
|
||||
users: [],
|
||||
orderImgUrls: [] // 添加用于存储处理后的图片URL数组
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -76,6 +77,9 @@
|
||||
// 现在可以使用item对象了
|
||||
// 进度映射
|
||||
this.getStepInfo()
|
||||
// 处理图片URL
|
||||
|
||||
this.getImageUrl()
|
||||
}
|
||||
if ((this.isManager && this.detailStep == 0) || (!this.isManager && this.detailStep == 1)) {
|
||||
this.getHandler()
|
||||
@@ -85,26 +89,37 @@
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
async getImageUrl() {
|
||||
if (!this.detail.orderImgUrl) return;
|
||||
|
||||
const imgIds = this.detail.orderImgUrl.split(',');
|
||||
const res = await this.$u.api.getImageUrl({}, imgIds);
|
||||
if (res.code == 200 && res.data) {
|
||||
// 提取res.data数组中每个对象的url字段
|
||||
this.orderImgUrls = res.data.map(item => item.url);
|
||||
}
|
||||
},
|
||||
|
||||
async getHandler() {
|
||||
let handlers = await this.$u.api.getHandler3({}, this.detail.type);
|
||||
if (handlers.code === 200) {
|
||||
this.users = [...this.users, ...handlers.data];
|
||||
}
|
||||
},
|
||||
getStepInfo(){
|
||||
if (this.detail.status == 0) {
|
||||
this.detailStep = 0;
|
||||
this.detailStatus = '创建工单';
|
||||
} else if (this.detail.status == 4) {
|
||||
this.detailStep = 3;
|
||||
this.detailStatus = '已结束';
|
||||
} else if (this.detail.status == 3) {
|
||||
this.detailStep = 2;
|
||||
this.detailStatus = '处理中';
|
||||
} else {
|
||||
this.detailStep = 1;
|
||||
this.detailStatus = '已接单';
|
||||
}
|
||||
},
|
||||
getStepInfo(){
|
||||
if (this.detail.status == 0) {
|
||||
this.detailStep = 0;
|
||||
this.detailStatus = '创建工单';
|
||||
} else if (this.detail.status == 4) {
|
||||
this.detailStep = 3;
|
||||
this.detailStatus = '已结束';
|
||||
} else if (this.detail.status == 3) {
|
||||
this.detailStep = 2;
|
||||
this.detailStatus = '处理中';
|
||||
} else {
|
||||
this.detailStep = 1;
|
||||
this.detailStatus = '已接单';
|
||||
}
|
||||
},
|
||||
previewImage(urls, index) {
|
||||
// 使用uView的图片预览组件
|
||||
@@ -122,23 +137,22 @@
|
||||
// 关闭页面前发送事件通知前页面刷新
|
||||
uni.$emit('refreshData', '');
|
||||
this.detail.handler = selected.value
|
||||
this.detail.status = 1
|
||||
this.detail.status = 1
|
||||
this.getStepInfo()
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
let params = this.detail
|
||||
if(this.detail.status == 1||this.detail.status == 2){
|
||||
params.status = 3
|
||||
}else {
|
||||
params.status = 4
|
||||
if(this.detail.status == 1||this.detail.status == 2){
|
||||
params.status = 3
|
||||
}else {
|
||||
params.status = 4
|
||||
}
|
||||
let res = await this.$u.api.updateOrder2(params);
|
||||
if (res.code == '200') {
|
||||
// 关闭页面前发送事件通知前页面刷新
|
||||
uni.$emit('refreshData', '');
|
||||
this.detail.status = params.status
|
||||
console.log("t1", params.status)
|
||||
this.detail.status = params.status
|
||||
this.getStepInfo()
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user