Commit 8b63c1b3 authored by 高智胜's avatar 高智胜

修改本版本升级

parent 6cfab2e0
...@@ -27,6 +27,9 @@ export default { ...@@ -27,6 +27,9 @@ export default {
BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信 BINDLOGIN: baseUrl + '/worker/bind/login', // 手机号验证码登录绑定微信
REFRESHTOKEN: baseUrl + '/worker/change/token', REFRESHTOKEN: baseUrl + '/worker/change/token',
// 上传图片
UPLOADIMG: baseUrl + '/worker/uploadImg',
USERINFO: baseUrl + '/worker/user/info', // 获取用户信息 USERINFO: baseUrl + '/worker/user/info', // 获取用户信息
REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表 REPAIR_LIST: baseUrl + '/worker/repair/list', // 工人/审核员端报修单列表
ORDER_STATUS: baseUrl + '/worker/repair/order/status', // 获取订单状态 ORDER_STATUS: baseUrl + '/worker/repair/order/status', // 获取订单状态
......
...@@ -18,7 +18,9 @@ service.interceptors.request.use( ...@@ -18,7 +18,9 @@ service.interceptors.request.use(
// console.log(config, 'config-----------') // console.log(config, 'config-----------')
if (config.method === 'post' || config.method === 'put') { if (config.method === 'post' || config.method === 'put') {
// post、put 提交时,将对象转换为string, 为处理后台解析问题 // post、put 提交时,将对象转换为string, 为处理后台解析问题
config.data = JSON.stringify(config.data) if (config.headers["Content-Type"] !== "multipart/form-data") {
config.data = JSON.stringify(config.data);
}
} }
// 请求发送前进行处理 // 请求发送前进行处理
// console.log("请求发送前进行处理", config) // console.log("请求发送前进行处理", config)
......
...@@ -345,6 +345,11 @@ ...@@ -345,6 +345,11 @@
background: #0054FF; background: #0054FF;
} }
.complete-align{
margin-left: 0.3rem;
font-weight: 600;
}
/deep/ .van-ellipsis { /deep/ .van-ellipsis {
font-size: 0.4rem !important; font-size: 0.4rem !important;
} }
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title">{{order.order_status_display}}</div> <div class="title">{{order.order_status_display}}</div>
</div> </div>
<div class="item flex-h flex-vc">
<div class="item-title">订单编号:</div>
<div class="item-desc">{{ order.repair_no }}</div>
</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div
...@@ -134,6 +138,24 @@ ...@@ -134,6 +138,24 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="order.complete_worker">
<!-- <div class="line"></div> -->
<div class="item flex-h flex-vc">
<div class="item-title">完工说明:</div>
<div class="item-desc">{{ order.complete_worker.content }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">完工图片:</div>
<div
@click="preview(order.complete_image, index)"
class="img flex-h"
v-for="(child, index) in order.complete_image"
:key="index"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div class="line"></div> <div class="line"></div>
<div class="allBtn flex-h flex-hr"> <div class="allBtn flex-h flex-hr">
<div <div
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
>{{ order.order_status_display }}(负责人)</div> >{{ order.order_status_display }}(负责人)</div>
<div class="title" v-else>{{ order.order_status_display }}</div> <div class="title" v-else>{{ order.order_status_display }}</div>
</div> </div>
<div class="item flex-h flex-vc">
<div class="item-title">订单编号:</div>
<div class="item-desc">{{ order.repair_no }}</div>
</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div
...@@ -123,17 +127,40 @@ ...@@ -123,17 +127,40 @@
<div class="item-title">退回备注:</div> <div class="item-title">退回备注:</div>
<div class="item-desc">{{ order.orderlog_cancel.remark }}</div> <div class="item-desc">{{ order.orderlog_cancel.remark }}</div>
</div> </div>
<div v-if="order.complete_worker">
<!-- <div class="line"></div> -->
<div class="item flex-h flex-vc">
<div class="item-title">完工说明:</div>
<div class="item-desc">{{ order.complete_worker.content }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">完工图片:</div>
<div
@click="preview(order.complete_image, index)"
class="img flex-h"
v-for="(child, index) in order.complete_image"
:key="index"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div class="btn flex-h flex-hr flex-hw" v-if="btnShow"> <div class="btn flex-h flex-hr flex-hw" v-if="btnShow">
<div <div
v-if="order.is_can_remark_material == 1" v-if="order.is_can_remark_material == 1"
class="btn-item bz-btn" class="btn-item bz-btn"
@click="bz_click" @click="bz_click"
>备注耗材</div> >备注耗材</div>
<div <!-- <div
v-if="order.is_can_confirm_complete == 1" v-if="order.is_can_confirm_complete == 1"
class="btn-item qr-btn" class="btn-item qr-btn"
@click="sure_click()" @click="sure_click()"
>确认完成</div> >确认完成</div> -->
<div
v-if="order.is_can_confirm_complete == 1"
class="btn-item qr-btn"
@click="wc_click()"
>确认完成</div>
<div <div
v-if="order.is_can_initiate_charge == 1" v-if="order.is_can_initiate_charge == 1"
class="btn-item sf-btn" class="btn-item sf-btn"
...@@ -209,6 +236,29 @@ ...@@ -209,6 +236,29 @@
</div> </div>
</div> </div>
</van-popup> </van-popup>
<!-- 发起确认完成弹窗 -->
<van-popup v-model="wcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">完成备注</div>
<p class="flex-h complete-align">
<span>拍照上传</span>
</p>
<div class="content-box">
<van-uploader
v-model="img_list"
:max-count="3"
accept="image/*"
:before-read="beforeRead"
:after-read="afterRead"
/>
</div>
<textarea placeholder="请输入完工说明" maxlength="20" v-model="wc_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="wc_cancel">取消</div>
<div class="sure" @click="wc_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 --> <!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close"> <van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont"> <div class="cancel_cont">
...@@ -280,7 +330,11 @@ export default { ...@@ -280,7 +330,11 @@ export default {
zdShow: false, // 发起转单弹窗 zdShow: false, // 发起转单弹窗
backShow: false, // 工人退回弹窗 backShow: false, // 工人退回弹窗
back_reason: '', // 工人退回原因 back_reason: '', // 工人退回原因
expend_detail: {} // 耗材详情 expend_detail: {}, // 耗材详情
wcShow: false, // 工人完成弹窗
img_url: [], // 上传成功的图片list
img_list: [], // 操作的图片list
wc_reason: '' // 工人完工说明
} }
}, },
methods: { methods: {
...@@ -294,7 +348,7 @@ export default { ...@@ -294,7 +348,7 @@ export default {
}) })
}, },
// 确认完成 // 确认完成
sure_click (item, index) { sure_click_bak (item, index) {
// const vm = this // const vm = this
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
...@@ -480,6 +534,92 @@ export default { ...@@ -480,6 +534,92 @@ export default {
}) })
.catch(() => { }) .catch(() => { })
}, },
// 完成弹窗
wc_click () {
this.wc_reason = ''
this.wcShow = true
},
// 完成弹窗关闭
wc_cancel () {
this.wcShow = false
this.img_list = []
},
// 完成提交
wc_submit () {
this.img_url = this.img_status()
if (this.img_url.length == 0) {
this.$toast('请选择上传图片')
return
}
if (this.img_url.length < 2) {
this.$toast('请选择上传两张及以上图片')
return
}
if (this.wc_reason === '') {
this.$toast('完工说明不可为空')
return
}
const curParams = {
repair_order_id: this.order_id,
img_url: this.img_url,
description: this.wc_reason
}
this.$http
.post(this.$myApi.REPAIR_COMPLETE, curParams)
.then((data) => {
this.wcShow = false
this.img_list = []
this.$toast('操作成功')
this.order = data
})
.catch(() => {
this.wcShow = false
this.img_list = []
})
},
/** 上传图片之前 */
beforeRead (file) {
console.log(file.type, 'file.type--------')
if (file.type.indexOf('image/') === -1) {
this.$toast('请上传图片格式')
return false
}
return true
},
/** 上传图片 */
afterRead (file, name) {
var curParams = new FormData()
curParams.append('file', file.file)
file.status = 'uploading'
file.message = '上传中...'
this.$http.post(this.$myApi.UPLOADIMG, curParams, {
'Content-Type': 'multipart/form-data'
}).then(data => {
this.$toast('上传成功')
file.status = 'done'
file.message = '上传成功'
file.cur_url = data.url
console.log(file, '---------------file')
})
.catch((err) => {
console.log(err, 'err------')
this.$toast('上传失败')
file.status = 'failed'
file.message = '上传失败'
})
},
/** 上传成功的图片 */
img_status () {
const imgArr = []
this.img_list.forEach(item => {
if (item.status != 'failed') {
imgArr.push(item.cur_url)
}
})
return imgArr
},
cancel () { cancel () {
this.zdShow = false this.zdShow = false
this.hcShow = false this.hcShow = false
......
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
v-if="item.pid == 0 && item.son_count > 0" v-if="item.pid == 0 && item.son_count > 0"
>{{ item.order_status_display }}(负责人)</div> >{{ item.order_status_display }}(负责人)</div>
<div class="title" v-else>{{ item.order_status_display }}</div> <div class="title" v-else>{{ item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">订单编号:</div>
<div class="item-desc">{{ item.repair_no }}</div>
</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div class="item-desc"> <div class="item-desc">
...@@ -169,16 +173,41 @@ ...@@ -169,16 +173,41 @@
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
</div> </div>
<div v-if="item.complete_worker">
<!-- <div class="line"></div> -->
<div class="item flex-h flex-vc">
<div class="item-title">完工说明:</div>
<div class="item-desc">{{ item.complete_worker.content }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">完工图片:</div>
<div
@click="preview(item.complete_image, index)"
class="img flex-h"
v-for="(child, index) in item.complete_image"
:key="index"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div class="btn flex-h flex-hr flex-hw"> <div class="btn flex-h flex-hr flex-hw">
<div <div
v-if="item.is_can_remark_material == 1" v-if="item.is_can_remark_material == 1"
class="btn-item bz-btn" class="btn-item bz-btn"
@click="bz_click(item)" @click="bz_click(item)"
>备注耗材</div> >备注耗材</div>
<div <!-- <div
v-if="item.is_can_confirm_complete == 1" v-if="item.is_can_confirm_complete == 1"
class="btn-item qr-btn" class="btn-item qr-btn"
@click="sure_click(item, index)" @click="sure_click(item, index)"
>确认完成</div> -->
<div
v-if="item.is_can_confirm_complete == 1"
class="btn-item qr-btn"
@click="wc_click(item)"
>确认完成</div> >确认完成</div>
<div <div
v-if="item.is_can_initiate_charge == 1" v-if="item.is_can_initiate_charge == 1"
...@@ -239,6 +268,29 @@ ...@@ -239,6 +268,29 @@
</div> </div>
</div> </div>
</van-popup> </van-popup>
<!-- 发起确认完成弹窗 -->
<van-popup v-model="wcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">完成备注</div>
<p class="flex-h complete-align">
<span>拍照上传</span>
</p>
<div class="content-box">
<van-uploader
v-model="img_list"
:max-count="3"
accept="image/*"
:before-read="beforeRead"
:after-read="afterRead"
/>
</div>
<textarea placeholder="请输入完工说明" maxlength="20" v-model="wc_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="wc_cancel">取消</div>
<div class="sure" @click="wc_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 备注耗材弹窗 --> <!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close"> <van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont"> <div class="cancel_cont">
...@@ -356,7 +408,8 @@ export default { ...@@ -356,7 +408,8 @@ export default {
curStatus: { type: '3', name: '已派工' }, // 当前选择的工单状态 curStatus: { type: '3', name: '已派工' }, // 当前选择的工单状态
statusList: [ statusList: [
{ type: '3', name: '已派工' }, { type: '3', name: '已派工' },
{ type: '4', name: '维修中' } { type: '4', name: '维修中' },
{ type: '8', name: '已完成' }
], ],
statusTab: false, statusTab: false,
// 工单数据 // 工单数据
...@@ -402,7 +455,11 @@ export default { ...@@ -402,7 +455,11 @@ export default {
showEnd: false, showEnd: false,
endTime: '请选择截止日期', endTime: '请选择截止日期',
backShow: false, // 工人退回弹窗 backShow: false, // 工人退回弹窗
back_reason: '' // 工人退回原因 back_reason: '', // 工人退回原因
wcShow: false, // 工人完成弹窗
img_url: [], // 上传成功的图片list
img_list: [], // 操作的图片list
wc_reason: '' // 工人完工说明
} }
}, },
created () { created () {
...@@ -632,6 +689,7 @@ export default { ...@@ -632,6 +689,7 @@ export default {
// 开始维修 // 开始维修
starRepir (id, index) { starRepir (id, index) {
console.log(index) console.log(index)
let statusItem = { type: '4', name: '维修中' }
const vm = this const vm = this
const curParams = { const curParams = {
repair_order_id: id repair_order_id: id
...@@ -639,9 +697,9 @@ export default { ...@@ -639,9 +697,9 @@ export default {
this.$http this.$http
.post(this.$myApi.REPAIR_BEGIN, curParams) .post(this.$myApi.REPAIR_BEGIN, curParams)
.then((data) => { .then((data) => {
// vm.$set(vm.list, index, data) // this.list.splice(index, 1)
this.list.splice(index, 1) // this.count = this.count - 1
this.count = this.count - 1 this.changeStatus(statusItem)
}) })
.catch(() => { }) .catch(() => { })
}, },
...@@ -676,6 +734,98 @@ export default { ...@@ -676,6 +734,98 @@ export default {
this.zdShow = false this.zdShow = false
}) })
}, },
// 完成弹窗
wc_click (item) {
this.curItem = item
this.wc_reason = ''
this.wcShow = true
},
// 完成弹窗关闭
wc_cancel () {
this.wcShow = false
this.img_list = []
},
// 完成提交
wc_submit () {
this.img_url = this.img_status()
if (this.img_url.length == 0) {
this.$toast('请选择上传图片')
return
}
if (this.img_url.length < 2) {
this.$toast('请选择上传两张及以上图片')
return
}
if (this.wc_reason === '') {
this.$toast('完工说明不可为空')
return
}
const curParams = {
repair_order_id: this.curItem.id,
// img_urls: JSON.stringify(this.img_url),
img_url: this.img_url,
description: this.wc_reason
}
this.$http
.post(this.$myApi.REPAIR_COMPLETE, curParams)
.then((data) => {
this.wcShow = false
this.img_list = []
this.$toast('操作成功')
const idx = this.list.findIndex(item => item.id === this.curItem.id)
if (idx !== -1) {
this.list.splice(idx, 1)
this.count = this.count - 1
}
})
.catch(() => {
this.wcShow = false
this.img_list = []
})
},
/** 上传图片之前 */
beforeRead (file) {
console.log(file.type, 'file.type--------')
if (file.type.indexOf('image/') === -1) {
this.$toast('请上传图片格式')
return false
}
return true
},
/** 上传图片 */
afterRead (file, name) {
var curParams = new FormData()
curParams.append('file', file.file)
file.status = 'uploading'
file.message = '上传中...'
this.$http.post(this.$myApi.UPLOADIMG, curParams, {
'Content-Type': 'multipart/form-data'
}).then(data => {
this.$toast('上传成功')
file.status = 'done'
file.message = '上传成功'
file.cur_url = data.url
console.log(file, '---------------file')
})
.catch((err) => {
console.log(err, 'err------')
this.$toast('上传失败')
file.status = 'failed'
file.message = '上传失败'
})
},
/** 上传成功的图片 */
img_status () {
const imgArr = []
this.img_list.forEach(item => {
if (item.status != 'failed') {
imgArr.push(item.cur_url)
}
})
return imgArr
},
// 备注耗材弹窗 // 备注耗材弹窗
bz_click (item) { bz_click (item) {
...@@ -775,7 +925,7 @@ export default { ...@@ -775,7 +925,7 @@ export default {
// .catch(() => {}) // .catch(() => {})
// }, // },
// 确认完成 // 确认完成--废弃
sure_click (item, index) { sure_click (item, index) {
const vm = this const vm = this
this.$dialog.confirm({ this.$dialog.confirm({
......
...@@ -98,6 +98,10 @@ ...@@ -98,6 +98,10 @@
</div> </div>
</van-popup> </van-popup>
<div class="title">{{item.order_status_display }}</div> <div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">订单编号:</div>
<div class="item-desc">{{ item.repair_no }}</div>
</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div
...@@ -223,6 +227,25 @@ ...@@ -223,6 +227,25 @@
</div> </div>
</div> </div>
<div v-if="item.complete_worker">
<!-- <div class="line"></div> -->
<div class="item flex-h flex-vc">
<div class="item-title">完工说明:</div>
<div class="item-desc">{{ item.complete_worker.content }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">完工图片:</div>
<div
@click="preview(item.complete_image, index)"
class="img flex-h"
v-for="(child, index) in item.complete_image"
:key="index"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div v-if="item.is_can_assign_worker==1"> <div v-if="item.is_can_assign_worker==1">
<div class="line"></div> <div class="line"></div>
<div <div
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment