Commit b6db5ec3 authored by 石盼盼's avatar 石盼盼

Merge branch 'spp' into 'master'

Spp

See merge request !35
parents 22bc1a7a 341385f9
...@@ -10,8 +10,8 @@ const baseUrl = '/api' ...@@ -10,8 +10,8 @@ const baseUrl = '/api'
// todo: url // todo: url
// const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口 // const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const httpUrl = 'https://repair.zeruiedu.com' // 正式接口 const httpUrl = 'https://repair.zeruiedu.com' // 正式接口
const h5Url = 'http://localhost:8080' // 测试h5线上地址 // const h5Url = 'http://localhost:8080' // 测试h5线上地址
// const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址 const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
window.localStorage.setItem('httpUrl', httpUrl) window.localStorage.setItem('httpUrl', httpUrl)
window.localStorage.setItem('h5Url', h5Url) window.localStorage.setItem('h5Url', h5Url)
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口 // const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
...@@ -47,6 +47,7 @@ export default { ...@@ -47,6 +47,7 @@ export default {
REPAIR_APPRAISAL: baseUrl + '/worker/repair/appraisal', // 查看评论 REPAIR_APPRAISAL: baseUrl + '/worker/repair/appraisal', // 查看评论
USER_EDIT: baseUrl + '/worker/user/edit', // 修改手机号 USER_EDIT: baseUrl + '/worker/user/edit', // 修改手机号
WORKER_BACK: baseUrl + '/worker/repair/worker/back', // 工人端退回报修单 WORKER_BACK: baseUrl + '/worker/repair/worker/back', // 工人端退回报修单
ORDER_INFO: baseUrl + '/worker/repair/order/info', // 工人端工单详情页
// 管理员端 // 管理员端
GET_WORKER: baseUrl + '/worker/get/worker', // 查看评论 GET_WORKER: baseUrl + '/worker/get/worker', // 查看评论
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
.one { .one {
color: #727272; color: #727272;
margin-bottom: 0.3rem; // margin-bottom: 0.3rem;
} }
.one-item { .one-item {
......
...@@ -61,6 +61,24 @@ const routes = [{ ...@@ -61,6 +61,24 @@ const routes = [{
}, },
component: () => import('@/views/my/charge.vue') component: () => import('@/views/my/charge.vue')
}, },
{
path: '/order_detail',
name: 'order_detail',
meta: {
title: '工单详情',
hideBack: true
},
component: () => import('@/views/my/order_detail.vue')
},
{
path: '/admin_detail',
name: 'admin_detail',
meta: {
title: '审核员工单详情',
hideBack: true
},
component: () => import('@/views/my/admin_detail.vue')
},
{ {
path: '/lookEvaluate', path: '/lookEvaluate',
name: 'lookEvaluate', name: 'lookEvaluate',
...@@ -97,15 +115,15 @@ router.beforeEach((to, from, next) => { ...@@ -97,15 +115,15 @@ router.beforeEach((to, from, next) => {
return true return true
} }
if (to.query.token && to.query.status) { if (to.query.token && to.query.status) {
console.log('ok-------0', status) // console.log('ok-------0', status)
token = to.query.token token = to.query.token
status = to.query.status status = to.query.status
console.log('1111', to.query) console.log('1111', to)
if (to.query.role != 0) { if (to.query.role != 0) {
role = to.query.role role = to.query.role
window.localStorage.setItem('role', role) window.localStorage.setItem('role', role)
} }
console.log('router里的', window.localStorage.getItem('role')); // console.log('router里的', window.localStorage.getItem('role'));
// console.log(token) // console.log(token)
// console.log(status) // console.log(status)
...@@ -113,13 +131,15 @@ router.beforeEach((to, from, next) => { ...@@ -113,13 +131,15 @@ router.beforeEach((to, from, next) => {
window.localStorage.setItem('status', status) window.localStorage.setItem('status', status)
} }
if (token && status === '200') { if (token && status === '200') {
// const is_detail = to.query.is_info ? 1 : 0
// console.log('is_detail', is_detail)
console.log('ok-------1', 200) console.log('ok-------1', 200)
if (role == 2 || role == 4) { // 2审核员身份 4超管身份 if ((role == 2 || role == 4) && to.path =='/') { // 2审核员身份 4超管身份
setTimeout(() => { // setTimeout(() => {
next({ next({
path: '/admin_home' path: '/admin_home'
}) })
}, 50) // }, 50)
} }
next() next()
} else if (token && status === '100') { } else if (token && status === '100') {
......
<template>
<div>审核员详情页</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -164,9 +164,7 @@ export default { ...@@ -164,9 +164,7 @@ export default {
}, },
methods: { methods: {
goBack(){ goBack(){
this.$router.push({ this.$router.go(-1);
path: '/'
})
}, },
callPhone(order){ callPhone(order){
let phoneNumber = order.telephone let phoneNumber = order.telephone
......
<template>
<div class="cont" v-if="order">
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item">
<div class="item flex-h flex-vc">
<div
class="title"
v-if="order.pid==0&&order.son_count>0"
>{{order.order_status_display}}(负责人)</div>
<div class="title" v-else>{{order.order_status_display}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{order.repair_type.type_name}}-{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{order.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{order.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image,index)"
>
<img :src="child.url" alt />
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{order.work_name}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{order.telephone}}</div>
</div>
<div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in order.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index">
<div class="ma-item flex-h flex-hb" v-for="(child, index) in parent.goods" :key="index">
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="btn flex-h flex-hr" v-if="btnShow">
<div v-if="order.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click">备注耗材</div>
<div
v-if="order.is_can_confirm_complete==1"
class="btn-item qr-btn"
@click="sure_click()"
>确认完成</div>
<div
v-if="order.is_can_initiate_charge==1"
class="btn-item sf-btn"
@click="tz_charge(order.id)"
>发起收费</div>
<div
v-if="order.is_can_initiate_transfer_order==1"
class="btn-item"
@click="zd_click"
>发起转单</div>
<div v-if="order.is_can_back==1" class="btn-item" @click="back_click">发起退回</div>
<div v-if="order.is_can_begin_repair==1" class="btn-item" @click="starRepir">开始维修</div>
<div v-if="order.is_can_see_material==1" class="btn-item sf-btn" @click="look_click">查看耗材</div>
</div>
<!-- 弹窗 -->
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index">
<input
class="input"
maxlength="20"
v-model="item.goods_name"
type="text"
placeholder="请输入耗材名称"
/>
<van-field
class="hc_field"
v-model.number="item.number"
type="number"
placeholder="请输入耗材个数"
maxlength="3"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由" maxlength="20" v-model="reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="zd_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起退回弹窗 -->
<van-popup v-model="backShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注退回原因</div>
<textarea placeholder="请输入退回理由" maxlength="100" v-model="back_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="back_cancel">取消</div>
<div class="sure" @click="back_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">查看耗材</div>
<div class="tc_line"></div>
<div
class="ma-item one-item flex-h flex-vc"
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div
class="one one1 one_title text-line-one"
>{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
>{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div>
<div class="_two text-line-one">*{{item.number}}</div>
</div>
<div class="one one3">{{item.price}}</div>
</div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div>
</div>
</van-popup>
</div>
</van-pull-refresh>
<div class="backBtn" @click="goBack">
<img src="@assets/images/tabbar/icon_01_sel.png" alt />
</div>
</div>
</template>
<script>
import { ImagePreview } from 'vant';
import { trimStrSpace } from '@assets/js/format.js'
export default {
name: 'order_detail',
data(){
return {
locked: false,
isloading: false,
btnShow: true,
order: null,
order_id: '',
// 备注耗材
addList: [
{
goods_name: '',
number: ''
}
], // 添加的备注耗材数据
hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗
reason: '', // 转单原因
zdShow: false, // 发起转单弹窗
backShow: false,//工人退回弹窗
back_reason: '',//工人退回原因
lookShow: false, // 查看耗材弹窗
expend_detail: {},// 耗材详情
}
},
created () {
this.order_id = this.$route.query.id
// this.order_id = 143
this.getDetail()
},
methods: {
// 确认完成
sure_click (item, index) {
const vm = this
this.$dialog.confirm({
title: '提示',
message: '确认完成维修?'
})
.then(() => {
const curParams = {
repair_order_id: this.order_id
}
this.$http
.post(this.$myApi.REPAIR_COMPLETE, curParams)
.then((data) => {
this.$toast('操作成功')
this.order = data
})
.catch(() => {})
})
.catch(() => {})
},
onRefresh () {
if (!this.locked) {
this.locked = true
this.getDetail()
}
},
getDetail () {
this.isloading = true
const curParams = {
repair_order_id: this.order_id
}
this.$http.get(this.$myApi.ORDER_INFO, curParams)
.then(res => {
this.order = res.order
this.locked = false
this.isloading = false
})
.catch(() => {
this.locked = false
this.isloading = false
})
},
bz_click () {
this.hcShow = true
// 默认为一个空数据
this.addList = [{
goods_name: '',
number: ''
}]
},
// 添加耗材
addMeth () {
this.addList.push({
goods_name: '',
number: ''
})
},
// 删除耗材
delMeth (index) {
this.addList.splice(index, 1)
},
// 备注提交
bz_submit () {
const vm = this
// const index = this.list.findIndex(item => item.id === this.curItem.id)
let noall = false
this.addList.some(item => {
if (trimStrSpace(item.goods_name) === '' || item.number === '') {
item.goods_name = trimStrSpace(item.goods_name)
vm.$toast('耗材信息请填写完整')
noall = true
return true
}
if (item.number < 1) {
vm.$toast('请正确填写耗材数量')
noall = true
return true
}
})
if (noall) { return }
const curParams = {
repair_order_id: this.order_id,
goods: this.addList
}
this.$http
.post(this.$myApi.MATERIAL_REMARK, curParams)
.then((data) => {
this.hcShow = false
this.$toast('操作成功')
this.order = data
})
.catch(() => {
this.hcShow = false
})
},
// 发起收费
tz_charge (id) {
this.$router.push({
path: '/charge',
query: { id }
})
},
// 转单弹窗
zd_click () {
this.reason = ''
this.zdShow = true
},
// 转单提交
zd_submit () {
if (this.reason === '') {
this.$toast('转单原因不可为空')
return
}
const curParams = {
repair_order_id: this.order_id,
content: this.reason
}
this.$http
.post(this.$myApi.REPAIR_TRANSFER, curParams)
.then((data) => {
this.zdShow = false
this.$toast('操作成功')
this.btnShow = false
})
.catch(() => {
this.zdShow = false
})
},
// 开始维修
starRepir (id,) {
// console.log(index)
const vm = this
const curParams = {
repair_order_id: this.order_id
}
this.$http
.post(this.$myApi.REPAIR_BEGIN, curParams)
.then((data) => {
this.order = data
})
.catch(() => {})
},
back_click(){
this.back_reason = ''
this.backShow = true
},
back_cancel(){
this.backShow = false
},
//发起退回
back_submit(){
if (this.back_reason === '') {
this.$toast('退回原因不可为空')
return
}
const curParams = {
repair_order_id: this.order_id,
content: this.back_reason
}
this.$http
.get(this.$myApi.WORKER_BACK, curParams)
.then((data) => {
this.backShow = false
this.$toast('操作成功')
this.btnShow = false
})
.catch(() => {
this.backShow = false
})
},
// 查看耗材弹窗
look_click () {
const curParams = {
repair_order_id: this.order_id
}
this.$http
.get(this.$myApi.REPAIR_MATERIAL_SHOW, curParams)
.then((data) => {
console.log(data, 'data-------------')
this.expend_detail = data
this.lookShow = true
})
.catch(() => {})
},
cancel () {
this.zdShow = false
this.hcShow = false
this.lookShow = false
},
goBack(){
this.$router.push({
path: '/'
})
},
},
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/index.scss";
.backBtn {
width: 1rem;
height: 1rem;
background: #fff;
box-shadow: 0 0 0.1rem #0054ff;
position: fixed;
right: 0.3rem;
bottom: 1.3rem;
z-index: 1;
border-radius: 50%;
padding: 0.1rem;
}
.backBtn img {
width: 100%;
height: 100%;
border-radius: 50%;
}
</style>
\ No newline at end of file
...@@ -128,6 +128,55 @@ ...@@ -128,6 +128,55 @@
<img :src="child.url" alt /> <img :src="child.url" alt />
</div> </div>
</div> </div>
<div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div class="no-pay ma-item flex-h flex-hb" v-for="(child, index) in item.no_pay_order.goods" :key="index">
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="item.pay_order != ''">
<div class="item-title bz-title">已支付耗材</div>
<div v-for="(parent, index) in item.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<!-- <div class="line"></div> -->
<div class="material" v-if="item.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="item.orderlog_transfer"> <div class="item flex-h flex-start" v-if="item.orderlog_transfer">
<div class="item-title">转单备注:</div> <div class="item-title">转单备注:</div>
<div class="item-desc">{{item.orderlog_transfer.remark}}</div> <div class="item-desc">{{item.orderlog_transfer.remark}}</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