|
@ -137,6 +137,19 @@ |
|
|
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> |
|
|
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="list" v-if="current == 2"> |
|
|
|
|
|
<view class="image" style="margin-top: 20rpx;"> |
|
|
|
|
|
<view class="image-list" v-if='imgList.length>0'> |
|
|
|
|
|
<view class="image-item" v-for="(item,index) in imgList" :key="index"> |
|
|
|
|
|
<image :src="item" mode=""></image> |
|
|
|
|
|
<u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)" v-if='data.status != "COMPLETED" && data.status != "VERIFIED"'/> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="image-item image-item1" @click="chooseImage" v-if='imgList?.length<5 && data.status != "COMPLETED" && data.status != "VERIFIED"'> |
|
|
|
|
|
<image src="../../static/images/photo.png" mode=""></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="footer"> |
|
|
<view class="footer"> |
|
@ -179,11 +192,14 @@ |
|
|
} from 'vue' |
|
|
} from 'vue' |
|
|
import * as moldApi from "@/api/mold" |
|
|
import * as moldApi from "@/api/mold" |
|
|
import * as upkeepOrderApi from "@/api/upkeepOrder" |
|
|
import * as upkeepOrderApi from "@/api/upkeepOrder" |
|
|
|
|
|
import * as uploadApi from "@/api/upload" |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
const list = ref([{ |
|
|
const list = ref([{ |
|
|
name: '设备信息' |
|
|
name: '设备信息' |
|
|
}, { |
|
|
}, { |
|
|
name: '保养内容' |
|
|
name: '保养内容' |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '图片' |
|
|
}]) |
|
|
}]) |
|
|
const current = ref(0) |
|
|
const current = ref(0) |
|
|
const changeItem = ref({ |
|
|
const changeItem = ref({ |
|
@ -196,6 +212,8 @@ |
|
|
const serviceList = ref([]) |
|
|
const serviceList = ref([]) |
|
|
const isTrue = ref(false) |
|
|
const isTrue = ref(false) |
|
|
const isVerifyShowSuccess = ref(false) |
|
|
const isVerifyShowSuccess = ref(false) |
|
|
|
|
|
const imgList = ref([]) |
|
|
|
|
|
const fileInfoList = ref([]) |
|
|
function change(index) { |
|
|
function change(index) { |
|
|
current.value = index |
|
|
current.value = index |
|
|
changeItem.value = list.value[current.value] |
|
|
changeItem.value = list.value[current.value] |
|
@ -256,19 +274,25 @@ |
|
|
} |
|
|
} |
|
|
const paramsData = { |
|
|
const paramsData = { |
|
|
id: data.value.id, |
|
|
id: data.value.id, |
|
|
verifyContent: data.value.applyContent |
|
|
verifyContent: data.value.applyContent, |
|
|
} |
|
|
} |
|
|
proxy.$modal.confirm('是否验证完结?').then(() => { |
|
|
proxy.$modal.confirm('是否关闭?').then(() => { |
|
|
proxy.$modal.loading('加载中') |
|
|
proxy.$modal.loading('加载中') |
|
|
loading.value = true |
|
|
loading.value = true |
|
|
|
|
|
|
|
|
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => { |
|
|
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
proxy.$modal.showToast('操作成功') |
|
|
let params = { |
|
|
setTimeout(() => { |
|
|
fileInfoList: fileInfoList.value, |
|
|
proxy.$tab.navigateBack() |
|
|
funcCode: "maintenance", |
|
|
loading.value = false |
|
|
number: data.value.number |
|
|
}, 1500) |
|
|
} |
|
|
|
|
|
uploadApi.uploadCommit(params).then(response=>{ |
|
|
|
|
|
proxy.$modal.showToast('操作成功') |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
proxy.$tab.navigateBack() |
|
|
|
|
|
loading.value = false |
|
|
|
|
|
}, 1500) |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
proxy.$modal.showToast(res.msg) |
|
|
proxy.$modal.showToast(res.msg) |
|
|
loading.value = false |
|
|
loading.value = false |
|
@ -279,7 +303,7 @@ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
// 完成 |
|
|
// 验证 |
|
|
function orderClickVerify() { |
|
|
function orderClickVerify() { |
|
|
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) { |
|
|
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) { |
|
|
proxy.$modal.showToast('没有保养内容') |
|
|
proxy.$modal.showToast('没有保养内容') |
|
@ -287,18 +311,16 @@ |
|
|
} |
|
|
} |
|
|
const paramsData = { |
|
|
const paramsData = { |
|
|
id: data.value.id, |
|
|
id: data.value.id, |
|
|
verifyContent: data.value.applyContent |
|
|
verifyContent: data.value.applyContent, |
|
|
} |
|
|
} |
|
|
isVerifyShowSuccess.value = false |
|
|
isVerifyShowSuccess.value = false |
|
|
proxy.$modal.confirm('是否完成?').then(() => { |
|
|
proxy.$modal.confirm('是否验证完结?').then(() => { |
|
|
proxy.$modal.loading('加载中') |
|
|
proxy.$modal.loading('加载中') |
|
|
loading.value = true |
|
|
loading.value = true |
|
|
upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => { |
|
|
upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
proxy.$modal.showToast('操作成功') |
|
|
proxy.$modal.showToast('操作成功') |
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
// proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`) |
|
|
|
|
|
proxy.$tab.navigateBack() |
|
|
proxy.$tab.navigateBack() |
|
|
loading.value = false |
|
|
loading.value = false |
|
|
}, 1500) |
|
|
}, 1500) |
|
@ -332,15 +354,53 @@ |
|
|
}).catch(() => { }) |
|
|
}).catch(() => { }) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function chooseImage() { |
|
|
|
|
|
uni.chooseImage({ |
|
|
|
|
|
count: 1, // 默认9 |
|
|
|
|
|
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
let filePath = res.tempFilePaths[0] |
|
|
|
|
|
let tempFile = res.tempFiles[0] |
|
|
|
|
|
proxy.$modal.loading() |
|
|
|
|
|
uploadApi.uploadFile({ |
|
|
|
|
|
filePath: filePath, |
|
|
|
|
|
}).then((ret) => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
imgList.value.push(ret.data) |
|
|
|
|
|
let fileInfo = { |
|
|
|
|
|
url : ret.data, |
|
|
|
|
|
name: tempFile.name |
|
|
|
|
|
} |
|
|
|
|
|
fileInfoList.value.push(fileInfo) |
|
|
|
|
|
}).catch((err) => { |
|
|
|
|
|
proxy.$modal.closeLoading() |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// 删除图片 |
|
|
|
|
|
function delImage(index) { |
|
|
|
|
|
imgList.value.splice(index, 1) |
|
|
|
|
|
fileInfoList.value.splice(index, 1) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onLoad(async (option) => { |
|
|
onLoad(async (option) => { |
|
|
if (option.type) type.value = option.type; |
|
|
if (option.type) type.value = option.type; |
|
|
if (option.data) { |
|
|
if (option.data) { |
|
|
data.value = JSON.parse(decodeURIComponent(option.data)) |
|
|
data.value = JSON.parse(decodeURIComponent(option.data)) |
|
|
|
|
|
if(data.value.status != 'PECEIVED' && data.value.status != 'COMPLETED' && data.value.status != 'VERIFIED'){ |
|
|
|
|
|
list.value = [{ |
|
|
|
|
|
name: '设备信息' |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '保养内容' |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
imgList.value = data.value.filePathList?data.value.filePathList:[] |
|
|
} |
|
|
} |
|
|
changeItem.value = list.value[current.value] |
|
|
changeItem.value = list.value[current.value] |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
onShow(() => { |
|
|
onShow(() => { |
|
|
getUpkeepOrderDetailList() |
|
|
getUpkeepOrderDetailList() |
|
@ -556,5 +616,54 @@ |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: flex-start; |
|
|
justify-content: flex-start; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.image { |
|
|
|
|
|
padding: 0px 30rpx; |
|
|
|
|
|
padding-bottom: 30rpx; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
|
|
.image-list { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.image-item { |
|
|
|
|
|
width: 210rpx; |
|
|
|
|
|
height: 210rpx; |
|
|
|
|
|
margin-right: 20rpx; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
border: 1px solid rgba(230, 230, 230, 0.5); |
|
|
|
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
border-radius: 20rpx; |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.close { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
right: 0px; |
|
|
|
|
|
top: 0px; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.image-item1 { |
|
|
|
|
|
border: none; |
|
|
|
|
|
margin-right: 0px; |
|
|
|
|
|
|
|
|
|
|
|
image { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |