Commit 0e13bace authored by 郭欢's avatar 郭欢

'修改,'

parent dace08b0
File added
...@@ -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' // 正式接口
......
...@@ -53,7 +53,7 @@ service.interceptors.response.use( ...@@ -53,7 +53,7 @@ service.interceptors.response.use(
}, (err) => { }, (err) => {
resolve(err) resolve(err)
window.localStorage.clear() window.localStorage.clear()
Toast('身份失效,请重新登录') Toast('身份失效,请重新登录11111')
window.document.location = selfApi.WINDOWHREF_LOGIN // url- window.document.location = selfApi.WINDOWHREF_LOGIN // url-
console.log('错误--------', err) console.log('错误--------', err)
}) })
......
var wx = require('weixin-js-sdk')
import axios from 'axios' import axios from 'axios'
import apiList from './apiList' import apiList from './apiList'
import myAxios from './index' import myAxios from './index'
import { import {
Toast Toast
} from 'vant' } from 'vant'
var wx = require('weixin-js-sdk')
// 微信分享方法 // 微信分享方法
const share = (param) => { const share = (param) => {
Toast.loading({ Toast.loading({
message: "加载中...", message: '加载中...',
duration: 1000, //持续展示 toast duration: 1000 // 持续展示 toast
}) })
const successCall = (res) => { const successCall = (res) => {
console.log('res', res) console.log('res', res)
Toast.clear() Toast.clear()
let result = res.conf const result = res.conf
// let result = res.data // let result = res.data
// let { // let {
// wxConfig, // wxConfig,
...@@ -68,7 +68,7 @@ const share = (param) => { ...@@ -68,7 +68,7 @@ const share = (param) => {
menuList: hideMenuItems menuList: hideMenuItems
}) })
wx.showMenuItems({ wx.showMenuItems({
menuList: ["menuItem:share:appMessage", "menuItem:share:timeline"] // 要显示的菜单项,所有menu项见附录3 menuList: ['menuItem:share:appMessage', 'menuItem:share:timeline'] // 要显示的菜单项,所有menu项见附录3
}) })
}) })
} }
...@@ -81,7 +81,7 @@ const share = (param) => { ...@@ -81,7 +81,7 @@ const share = (param) => {
successCall(res) successCall(res)
Toast.clear() Toast.clear()
}) })
.catch(() => {}) .catch(() => { })
} }
export { export {
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
} }
.bz-title{ .bz-title{
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
color: #ff0000;
} }
.one { .one {
color: #727272; color: #727272;
......
...@@ -7,11 +7,11 @@ import myApi from './api/apiList' ...@@ -7,11 +7,11 @@ import myApi from './api/apiList'
import myAxios from './api/index' import myAxios from './api/index'
import Vant from 'vant' import Vant from 'vant'
import 'vant/lib/index.css' import 'vant/lib/index.css'
import vConsole from '@/plugins/vconsole.js' // import vConsole from '@/plugins/vconsole.js'
import listTips from '@/components/common/listtips.vue' import listTips from '@/components/common/listtips.vue'
Vue.component('listTips', listTips) Vue.component('listTips', listTips)
Vue.use(vConsole) // Vue.use(vConsole)
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -7,12 +7,22 @@ ...@@ -7,12 +7,22 @@
<div> <div>
<div class="filed-list"> <div class="filed-list">
<img class="icon-img" src="@assets/images/login/shouji.png" /> <img class="icon-img" src="@assets/images/login/shouji.png" />
<van-field v-model.trim="tel" type="tel" placeholder="请输入手机号" maxlength="11" /> <van-field
v-model.trim="tel"
type="tel"
placeholder="请输入手机号"
maxlength="11"
/>
</div> </div>
<div class="filed-list code-cont"> <div class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/yzm.png" /> <img class="icon-img" src="@assets/images/login/yzm.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" /> <van-field
<div class="code-btn" @click="getCode">{{buttonText}}</div> v-model.trim="code"
type="text"
placeholder="请输入验证码"
maxlength="6"
/>
<div class="code-btn" @click="getCode">{{ buttonText }}</div>
</div> </div>
</div> </div>
<div class="login-btn" @click="goLogin">立即登录</div> <div class="login-btn" @click="goLogin">立即登录</div>
...@@ -64,7 +74,7 @@ export default { ...@@ -64,7 +74,7 @@ export default {
this.isSending = true this.isSending = true
this.countDown() this.countDown()
}) })
.catch(() => {}) .catch(() => { })
}, },
countDown () { countDown () {
let seconds = 60 let seconds = 60
...@@ -93,7 +103,7 @@ export default { ...@@ -93,7 +103,7 @@ export default {
let url = `${httpUrl}${wxLogin}?callBack=${t}&scopes=snsapi_userinfo&type=1` let url = `${httpUrl}${wxLogin}?callBack=${t}&scopes=snsapi_userinfo&type=1`
window.document.location = url // url- window.document.location = url // url-
}) })
.catch(() => {}) .catch(() => { })
}, },
fetchData (to, from) { fetchData (to, from) {
this.tel = '' // 手机号 this.tel = '' // 手机号
...@@ -118,5 +128,5 @@ export default { ...@@ -118,5 +128,5 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/login/login.scss"; @import '@assets/styles/login/login.scss';
</style> </style>
...@@ -3,35 +3,39 @@ ...@@ -3,35 +3,39 @@
<van-pull-refresh v-model="isloading" @refresh="onRefresh"> <van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item"> <div class="order-item">
<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-title">问题描述:</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 <div
class="item-desc" class="item-desc que-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div> >{{ 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>
<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">{{order.realname}}</div> <div class="item-desc">{{ order.realname }}</div>
</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 phone" @click="callPhone(order)">{{order.telephone}}</div> <div class="item-desc phone" @click="callPhone(order)">{{ order.telephone }}</div>
</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">2021-06-17 09:28:43</div> <div class="item-desc">2021-06-17 09:28:43</div>
</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
class="img" class="img"
v-for="(child, index) in order.image" v-for="(child, index) in order.image"
:key="index" :key="index"
@click="preview(order.image,index)" @click="preview(order.image, index)"
> >
<img :src="child.url" alt /> <img :src="child.url" alt />
</div> </div>
...@@ -40,7 +44,7 @@ ...@@ -40,7 +44,7 @@
<div class="line"></div> <div class="line"></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">{{order.work_name}}</div> <div class="item-desc">{{ order.work_name }}</div>
</div> </div>
</div> </div>
<div class="material" v-if="order.no_pay_order"> <div class="material" v-if="order.no_pay_order">
...@@ -50,25 +54,29 @@ ...@@ -50,25 +54,29 @@
v-for="(child, index) in order.no_pay_order.goods" v-for="(child, index) in order.no_pay_order.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
</div> </div>
<div class="material" v-if="order.pay_order != ''"> <div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div> <div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index"> <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
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</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 one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
...@@ -77,13 +85,17 @@ ...@@ -77,13 +85,17 @@
<div class="item-title bz-title">备注耗材</div> <div class="item-title bz-title">备注耗材</div>
<div <div
class="ma-item flex-h flex-hb" class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order.goods" v-for="(child, index) in order.free_material_order
.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">免费</div> <div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</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>
<div class="one one3 text-line-one">¥0</div> <div class="one one3 text-line-one">¥0</div>
</div> </div>
...@@ -91,23 +103,29 @@ ...@@ -91,23 +103,29 @@
</div> </div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer"> <div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div> <div class="item-title">转单备注:</div>
<div class="item-desc">{{order.orderlog_transfer.remark}}</div> <div class="item-desc">{{ order.orderlog_transfer.remark }}</div>
</div> </div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel"> <div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<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.is_can_assign_worker==1"> <div v-if="order.is_can_assign_worker == 1">
<div class="line"></div> <div class="line"></div>
<div <div
v-if="order.is_can_assign_worker==1" v-if="order.is_can_assign_worker == 1"
class="item flex-h flex-vc flex-hb" class="item flex-h flex-vc flex-hb"
@click="workers" @click="workers"
> >
<div class="wo flex-h flex-vc"> <div class="wo flex-h flex-vc">
<div class="item-title" v-if="order.order_status_display == '已派工'">重新派工:</div> <div class="item-title" v-if="order.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</div> <div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">{{workerName.length ? workerName.join(',') : ''}}</div> <div class="item-desc worker-name">
{{
workerName.length
? workerName.join(',')
: ''
}}
</div>
</div> </div>
<div class="flex-h flex-vc"> <div class="flex-h flex-vc">
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
...@@ -119,8 +137,12 @@ ...@@ -119,8 +137,12 @@
</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 v-if="order.is_can_assign_worker==1" class="button sureBtn" @click="sureOrder">确定</div> <div
<div v-if="order.is_can_cancel==1" class="button" @click="cancelOrder">取消</div> v-if="order.is_can_assign_worker == 1"
class="button sureBtn"
@click="sureOrder"
>确定</div>
<div v-if="order.is_can_cancel == 1" class="button" @click="cancelOrder">取消</div>
</div> </div>
<!-- 选择工人弹窗 --> <!-- 选择工人弹窗 -->
...@@ -128,26 +150,40 @@ ...@@ -128,26 +150,40 @@
<div class="tc-box"> <div class="tc-box">
<div class="tc-title">选择工人</div> <div class="tc-title">选择工人</div>
<div class="workers"> <div class="workers">
<div class="gr-item" v-for="(child_item,child_index) in columns" :key="child_index"> <div
<div class="bm-item">{{child_item.name}}</div> class="gr-item"
v-for="(child_item, child_index) in columns"
:key="child_index"
>
<div class="bm-item">{{ child_item.name }}</div>
<div v-if="child_item.user.length"> <div v-if="child_item.user.length">
<div <div
class="people-item flex-h flex-vc flex-hb" class="people-item flex-h flex-vc flex-hb"
v-for="(lchild_item,lchild_index) in child_item.user" v-for="(
lchild_item, lchild_index
) in child_item.user"
:key="lchild_index" :key="lchild_index"
@click="chooseWorker(lchild_item,lchild_index)" @click="chooseWorker(lchild_item,lchild_index)"
> >
<div class="flex-h flex-vc"> <div class="flex-h flex-vc">
<img class="gr-img" :src="gr_img" /> <img class="gr-img" :src="grImg" />
<div <div
class="gr-name" class="gr-name"
v-if="lchild_item.repired_count !== 0 || lchild_item.repiring_count !== 0" v-if=" lchild_item.repired_count !== 0 || lchild_item.repiring_count !== 0"
>{{lchild_item.name}} (已派工: {{lchild_item.repired_count}};维修中: {{lchild_item.repiring_count}})</div> >
<div class="gr-name" v-else>{{lchild_item.name}} (休息中)</div> {{ lchild_item.name }} (已派工:
{{
lchild_item.repired_count
}};维修中:
{{
lchild_item.repiring_count
}})
</div>
<div class="gr-name" v-else>{{ lchild_item.name }} (休息中)</div>
</div> </div>
<img <img
class="k-img" class="k-img"
:src="temporaryId && temporaryId.includes(lchild_item.id) ? select_img : unselect_img" :src="temporaryId && temporaryId.includes(lchild_item.id) ? selectImg: unselectImg"
/> />
</div> </div>
</div> </div>
...@@ -180,24 +216,23 @@ ...@@ -180,24 +216,23 @@
</template> </template>
<script> <script>
import { trimStrSpace } from '@assets/js/format.js' // import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview, CellGroup } from 'vant'; import { ImagePreview } from 'vant'
import select_img from '@assets/images/select.png' import selectImg from '@assets/images/select.png'
import unselect_img from '@assets/images/un_select.png' import unselectImg from '@assets/images/un_select.png'
import gr_img from '@assets/images/gr.png' import grImg from '@assets/images/gr.png'
export default { export default {
name: 'admin_detail', name: 'admin_detail',
data () { data () {
return { return {
showWorker: false, showWorker: false,
select_img, selectImg,
unselect_img, unselectImg,
gr_img, grImg,
reson: '',//取消原因 reson: '', // 取消原因
qxShow: false, // 发起转单弹窗 qxShow: false, // 发起转单弹窗
workerName: '', workerName: '',
worker_id: '', worker_id: '',
showWorker: false,
columns: [], columns: [],
locked: false, locked: false,
// 上拉加载 // 上拉加载
...@@ -210,20 +245,19 @@ export default { ...@@ -210,20 +245,19 @@ export default {
order: null, order: null,
order_id: '', order_id: '',
temporaryName: '', temporaryName: '',
temporaryId: '', temporaryId: ''
} }
}, },
created () { // created () {
this.order_id = this.$route.query.id // this.order_id = this.$route.query.id
// this.order_id = 211 // this.getDetail()
this.getDetail() // this.getWorkers()
this.getWorkers() // },
},
methods: { methods: {
goBack(){ goBack () {
this.$router.push({ this.$router.push({
path: '/' path: '/'
}).catch(()=>{}) }).catch(() => { })
}, },
getDetail () { getDetail () {
this.isloading = true this.isloading = true
...@@ -234,8 +268,8 @@ export default { ...@@ -234,8 +268,8 @@ export default {
.then(res => { .then(res => {
this.order = res.order this.order = res.order
this.workerName = [] this.workerName = []
this.temporaryName=[] this.temporaryName = []
this.temporaryId=[] this.temporaryId = []
this.worker_id = [] this.worker_id = []
this.locked = false this.locked = false
this.isloading = false this.isloading = false
...@@ -246,10 +280,10 @@ export default { ...@@ -246,10 +280,10 @@ export default {
}) })
}, },
// 选择完工人点击确定按钮 // 选择完工人点击确定按钮
keyConfirm(){ keyConfirm () {
console.log('this.temporaryId',this.temporaryId); console.log('this.temporaryId', this.temporaryId)
console.log('this.temporaryName',this.temporaryName); console.log('this.temporaryName', this.temporaryName)
if(!this.temporaryId.length){ if (!this.temporaryId.length) {
this.$toast('请选择工人!') this.$toast('请选择工人!')
return return
} }
...@@ -257,34 +291,34 @@ export default { ...@@ -257,34 +291,34 @@ export default {
this.worker_id = [...this.temporaryId] this.worker_id = [...this.temporaryId]
this.showWorker = false this.showWorker = false
}, },
chooseWorker(item,lchild_index){ chooseWorker (item, lchild_index) {
console.log('11111111111',item,item.id,item.name,lchild_index); console.log('11111111111', item, item.id, item.name, lchild_index)
if(this.temporaryId.includes(item.id)){ // 删除 if (this.temporaryId.includes(item.id)) { // 删除
let name_i = this.temporaryId.indexOf(item.id) const name_i = this.temporaryId.indexOf(item.id)
this.temporaryId.splice(name_i,1) this.temporaryId.splice(name_i, 1)
this.temporaryName.splice(name_i,1) this.temporaryName.splice(name_i, 1)
}else{ // 加入 } else { // 加入
this.temporaryId.push(item.id) this.temporaryId.push(item.id)
this.temporaryName.push(item.name) this.temporaryName.push(item.name)
} }
}, },
preview(img, index){ preview (img, index) {
let temp = img.map(item=>{ const temp = img.map(item => {
return item.url return item.url
}) })
ImagePreview({ ImagePreview({
images: temp, images: temp,
startPosition: index, startPosition: index
}); })
}, },
callPhone(item){ callPhone (item) {
let phoneNumber = item.telephone const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber window.location.href = 'tel://' + phoneNumber
}, },
//指派工人 // 指派工人
sureOrder(){ sureOrder () {
const vm = this const vm = this
if(!this.worker_id.length) { if (!this.worker_id.length) {
this.$toast('请选择工人') this.$toast('请选择工人')
return return
} }
...@@ -295,31 +329,31 @@ export default { ...@@ -295,31 +329,31 @@ export default {
this.$http this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams) .post(this.$myApi.REPAIR_ASSIGN, curParams)
.then((data) => { .then((data) => {
console.log('指派工人',data); console.log('指派工人', data)
this.$toast('操作成功') this.$toast('操作成功')
this.workerName = [] this.workerName = []
this.temporaryName=[] this.temporaryName = []
this.temporaryId=[] this.temporaryId = []
this.worker_id = [] this.worker_id = []
this.reason = '' this.reason = ''
this.order = data this.order = data
}) })
.catch(() => {}) .catch(() => { })
}, },
// 取消工单 // 取消工单
cancelOrder(){ cancelOrder () {
this.qxShow = true; this.qxShow = true
this.reason = '' this.reason = ''
}, },
workers(){ workers () {
this.showWorker = true this.showWorker = true
}, },
Cancel(){ Cancel () {
this.showWorker = false this.showWorker = false
}, },
//获取工人列表 // 获取工人列表
getWorkers(){ getWorkers () {
const curParams = {} const curParams = {}
this.$http this.$http
.get(this.$myApi.GET_WORKER, curParams) .get(this.$myApi.GET_WORKER, curParams)
...@@ -371,11 +405,28 @@ export default { ...@@ -371,11 +405,28 @@ export default {
cancel () { cancel () {
this.qxShow = false this.qxShow = false
}, },
fetchData (to, from) {
this.order_id = to.query ? to.query.id : ''
console.log(to, 'to-----------11111111111111111111111111111')
if (this.order_id) {
this.getDetail()
this.getWorkers()
}
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/admin_index.scss"; @import '@assets/styles/tabbar/admin_index.scss';
</style> </style>
...@@ -2,51 +2,68 @@ ...@@ -2,51 +2,68 @@
<div class="cont" v-if="order"> <div class="cont" v-if="order">
<div class="top"> <div class="top">
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title">维修类目:</div> <div class="title">维修类目:</div>
<div class="title">{{order.repair_type.type_name}}</div> <div class="title">{{ order.repair_type.type_name }}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">
{{ order.repair_type.type_name }}-{{ order.description }}
</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 flex-h flex-vc">
<div class="item-title">服务地址:</div> <div class="item-title">服务地址:</div>
<div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div> <div class="item-desc">
{{ order.region.region_name }}-{{ order.room.room_name }}-{{
order.address
}}
</div>
</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">{{order.realname}}</div> <div class="item-desc">{{ order.realname }}</div>
</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 phone" @click="callPhone(order)">{{order.telephone}}</div> <div class="item-desc phone" @click="callPhone(order)">
{{ order.telephone }}
</div>
</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">2021-06-17 09:28:43</div> <div class="item-desc">2021-06-17 09:28:43</div>
</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="img flex-h" v-for="(child, index) in order.image" :key="index" @click="preview(order.image,index)"> <div
class="img flex-h"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image, index)"
>
<img :src="child.url" alt /> <img :src="child.url" alt />
</div> </div>
</div> </div>
</div> </div>
<div class="things"> <div class="things">
<div class="things_title">所需耗材</div> <div class="things_title">所需耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index" > <div
<div class="item flex-h flex-hb" @click="showZl(index)" > class="list-item"
v-for="(item, index) in addList"
:key="index"
>
<div class="item flex-h flex-hb" @click="showZl(index)">
<div class="item_title flex-h flex-vc"> <div class="item_title flex-h flex-vc">
<div class="title_left">耗材种类</div> <div class="title_left">耗材种类</div>
<div class="title_r">{{item.zl}}</div> <div class="title_r">{{ item.zl }}</div>
</div> </div>
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
<div class="select_txt">选择</div> <div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt /> <img src="@assets/images/my/select.png" alt />
</div> </div>
</div> </div>
<div class="item flex-h flex-hb" @click="showHc(index)" > <div class="item flex-h flex-hb" @click="showHc(index)">
<div class="item_title flex-h flex-vc"> <div class="item_title flex-h flex-vc">
<div class="title_left">耗材名称</div> <div class="title_left">耗材名称</div>
<div class="title_r">{{item.mc}}</div> <div class="title_r">{{ item.mc }}</div>
</div> </div>
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
<div class="select_txt">选择</div> <div class="select_txt">选择</div>
...@@ -55,33 +72,52 @@ ...@@ -55,33 +72,52 @@
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title_left">耗材个数</div> <div class="title_left">耗材个数</div>
<input type="tel" :min="1" maxlength="3" placeholder="请输入" v-model="item.number" @input="changeInput($event,index)" /> <input
type="tel"
:min="1"
maxlength="3"
placeholder="请输入"
v-model="item.number"
@input="changeInput($event, index)"
/>
<!-- <van-field class="hc_field" v-model="item.number" type="number" placeholder="请输入" maxlength="3" @input="changeInput(item,index)" /> --> <!-- <van-field class="hc_field" v-model="item.number" type="number" placeholder="请输入" maxlength="3" @input="changeInput(item,index)" /> -->
</div> </div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="title_left">耗材单价</div> <div class="title_left">耗材单价</div>
<div class="title_r">{{item.single_price}}</div> <div class="title_r">{{ item.single_price }}</div>
</div> </div>
<div v-if="addList.length>1" class="delete-btn" @click="delMeth(index)"> <div
<img src="@assets/images/lajitong.png" alt=""> v-if="addList.length > 1"
class="delete-btn"
@click="delMeth(index)"
>
<img src="@assets/images/lajitong.png" alt="" />
</div> </div>
<!-- 种类弹窗 --> <!-- 种类弹窗 -->
<van-popup v-model="item.zlSelect" round position="bottom" > <van-popup v-model="item.zlSelect" round position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
:columns="types" :columns="types"
value-key="goods_name" value-key="goods_name"
@confirm="(value)=>{typeConfirm(value,index)}" @confirm="
(value) => {
typeConfirm(value, index)
}
"
@cancel="typeCancel(index)" @cancel="typeCancel(index)"
/> />
</van-popup> </van-popup>
<van-popup v-model="item.mcSelect" round position="bottom" > <van-popup v-model="item.mcSelect" round position="bottom">
<van-picker <van-picker
show-toolbar show-toolbar
:columns="hcName" :columns="hcName"
value-key="goods_name" value-key="goods_name"
@confirm="(value)=>{hcConfirm(value,index)}" @confirm="
(value) => {
hcConfirm(value, index)
}
"
@cancel="hcCancel(index)" @cancel="hcCancel(index)"
/> />
</van-popup> </van-popup>
...@@ -89,7 +125,7 @@ ...@@ -89,7 +125,7 @@
<div class="line"></div> <div class="line"></div>
<div class="add-btn flex-h flex-vc flex-hb"> <div class="add-btn flex-h flex-vc flex-hb">
<!-- <div v-if="addList.length>1" class="del-btn" @click="delMeth" >-删除耗材</div> --> <!-- <div v-if="addList.length>1" class="del-btn" @click="delMeth" >-删除耗材</div> -->
<div class="add-btn" @click="addMeth" >+新增耗材</div> <div class="add-btn" @click="addMeth">+新增耗材</div>
</div> </div>
</div> </div>
<div class="blank"></div> <div class="blank"></div>
...@@ -97,35 +133,36 @@ ...@@ -97,35 +133,36 @@
<div class="bottom flex-h flex-hb flex-vc"> <div class="bottom flex-h flex-hb flex-vc">
<div class="left"> <div class="left">
<span>{{goods_number}}</span>件,总金额: <span>{{ goods_number }}</span
>件,总金额:
<!-- <span v-if="isNaN(total_price)">¥暂无</span> --> <!-- <span v-if="isNaN(total_price)">¥暂无</span> -->
<span>{{total_price}}</span> <span>{{ total_price }}</span>
</div> </div>
<div class="skBtn" @click="launch(repair_order_id)">发起收款</div> <div class="skBtn" @click="launch(repair_order_id)">发起收款</div>
</div> </div>
<!-- 底部返回按钮 --> <!-- 底部返回按钮 -->
<div class="backBtn" @click="goBack"> <div class="backBtn" @click="goBack">
<img src="@assets/images/back3.png" alt=""> <img src="@assets/images/back3.png" alt="" />
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { ImagePreview } from 'vant'; import { ImagePreview } from 'vant'
export default { export default {
name: 'charge', name: 'charge',
data () { data () {
return { return {
addList:[ addList: [
{ {
zl:'', zl: '',
mc:'', mc: '',
number:'', number: '',
single_price: '暂无', single_price: '暂无',
zlSelect:false, zlSelect: false,
mcSelect: false, mcSelect: false,
parent_id: '', parent_id: '',
goods_id: '', goods_id: ''
} }
], ],
showPicker: false, showPicker: false,
...@@ -140,44 +177,44 @@ export default { ...@@ -140,44 +177,44 @@ export default {
hcList: [], hcList: [],
total_price: 0, total_price: 0,
hc_price: '', hc_price: '',
goods_number: 0, goods_number: 0
} }
}, },
created () { created () {
this.repair_order_id = this.$route.query.id this.repair_order_id = this.$route.query.id
this.getDetail() this.getDetail()
}, },
watch:{ watch: {
addList:{ addList: {
handler(newValue,oldValue){ handler (newValue, oldValue) {
let filterValue = newValue.filter(item=>{ const filterValue = newValue.filter(item => {
return (item.zl && item.mc && item.number) return (item.zl && item.mc && item.number)
}) })
if(filterValue.length){ if (filterValue.length) {
this.getMonery(filterValue) this.getMonery(filterValue)
}else{ } else {
this.total_price = 0 this.total_price = 0
} }
}, },
deep:true deep: true
}, }
}, },
methods: { methods: {
goBack(){ goBack () {
this.$router.go(-1); this.$router.go(-1)
}, },
callPhone(order){ callPhone (order) {
let phoneNumber = order.telephone const phoneNumber = order.telephone
window.location.href = 'tel://' + phoneNumber window.location.href = 'tel://' + phoneNumber
}, },
preview(img, index){ preview (img, index) {
let temp = img.map(item=>{ const temp = img.map(item => {
return item.url return item.url
}) })
ImagePreview({ ImagePreview({
images: temp, images: temp,
startPosition: index, startPosition: index
}); })
}, },
getDetail () { getDetail () {
const curParams = { const curParams = {
...@@ -187,7 +224,7 @@ export default { ...@@ -187,7 +224,7 @@ export default {
.then(res => { .then(res => {
this.order = res.order this.order = res.order
var arr = [] var arr = []
for(let i in res.material){ for (const i in res.material) {
arr.push({ arr.push({
id: res.material[i].id, id: res.material[i].id,
goods_name: res.material[i].goods_name, goods_name: res.material[i].goods_name,
...@@ -196,13 +233,13 @@ export default { ...@@ -196,13 +233,13 @@ export default {
} }
this.types = arr this.types = arr
}) })
.catch(() => {}) .catch(() => { })
}, },
showZl(index){ showZl (index) {
this.addList[index].zlSelect = true this.addList[index].zlSelect = true
}, },
typeConfirm(value, index) { typeConfirm (value, index) {
if(value.id == this.addList[index].parent_id){ if (value.id == this.addList[index].parent_id) {
this.addList[index].zlSelect = false this.addList[index].zlSelect = false
return return
} }
...@@ -216,7 +253,7 @@ export default { ...@@ -216,7 +253,7 @@ export default {
this.addList[index].single_price = '' this.addList[index].single_price = ''
var childArr = [] var childArr = []
for(let i in value.son){ for (const i in value.son) {
childArr.push({ childArr.push({
id: value.son[i].id, id: value.son[i].id,
goods_name: value.son[i].goods_name, goods_name: value.son[i].goods_name,
...@@ -226,45 +263,44 @@ export default { ...@@ -226,45 +263,44 @@ export default {
this.hcName = childArr this.hcName = childArr
// this.getMonery() // this.getMonery()
}, },
typeCancel(index) { typeCancel (index) {
this.addList[index].zlSelect = false this.addList[index].zlSelect = false
}, },
showHc(index){ showHc (index) {
this.addList[index].mcSelect = true this.addList[index].mcSelect = true
}, },
hcConfirm(value, index) { hcConfirm (value, index) {
this.addList[index].mc = value.goods_name this.addList[index].mc = value.goods_name
this.addList[index].single_price = value.single_price this.addList[index].single_price = value.single_price
this.addList[index].mcSelect = false this.addList[index].mcSelect = false
this.addList[index].goods_id = value.id this.addList[index].goods_id = value.id
this.hc_price = this.addList[index].single_price this.hc_price = this.addList[index].single_price
let bool = this.addList.every(item=>{ const bool = this.addList.every(item => {
return item.number && item.mc && item.zl return item.number && item.mc && item.zl
}) })
// this.getMonery() // this.getMonery()
}, },
changeInput(e,index){ changeInput (e, index) {
this.hc_number = e.target.value this.hc_number = e.target.value
this.totalCount() this.totalCount()
}, },
getMonery(filterList){ getMonery (filterList) {
let total_price = 0 let total_price = 0
filterList.map(item=>{ filterList.map(item => {
total_price += Number(item.number) * Number(item.single_price) total_price += Number(item.number) * Number(item.single_price)
}) })
this.total_price = Number(total_price) this.total_price = Number(total_price)
// console.log('总价钱',total_price); // console.log('总价钱',total_price);
}, },
totalCount(){ totalCount () {
let count = 0 let count = 0
for(let i=0; i<this.addList.length;i++){ for (let i = 0; i < this.addList.length; i++) {
count += Number(this.addList[i].number) count += Number(this.addList[i].number)
} }
this.goods_number = count this.goods_number = count
}, },
hcCancel(index) { hcCancel (index) {
this.addList[index].mcSelect = false this.addList[index].mcSelect = false
}, },
addMeth () { addMeth () {
...@@ -277,29 +313,28 @@ export default { ...@@ -277,29 +313,28 @@ export default {
mcSelect: false mcSelect: false
}) })
}, },
delMeth(index){ delMeth (index) {
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
message: '确认删除吗?' message: '确认删除吗?'
}).then(()=>{ }).then(() => {
this.addList.splice(index,1) this.addList.splice(index, 1)
// this.getMonery() // this.getMonery()
this.totalCount() this.totalCount()
}) })
.catch(() => {}) .catch(() => { })
}, },
launch(id){ launch (id) {
let bool = this.addList.every(item=>{ const bool = this.addList.every(item => {
return item.number && item.mc && item.zl return item.number && item.mc && item.zl
}) })
if(!bool){ if (!bool) {
this.$toast.fail('请输入完整') this.$toast.fail('请输入完整')
return return
} }
for(let i = 0; i<this.addList.length;i++){ for (let i = 0; i < this.addList.length; i++) {
if(this.addList[i].number == 0){ if (this.addList[i].number == 0) {
this.$toast('耗材个数不能为0') this.$toast('耗材个数不能为0')
return return
} }
...@@ -311,13 +346,13 @@ export default { ...@@ -311,13 +346,13 @@ export default {
// const _this = this // const _this = this
this.$http.post(this.$myApi.REPAIR_ORDER, curParams) this.$http.post(this.$myApi.REPAIR_ORDER, curParams)
.then(res => { .then(res => {
console.log('执行了吗'); console.log('执行了吗')
this.$toast.success('发起成功') this.$toast.success('发起成功')
this.$router.go(-1) this.$router.go(-1)
}) })
.catch(() => {}) .catch(() => { })
}, }
}, }
} }
</script> </script>
...@@ -327,7 +362,7 @@ export default { ...@@ -327,7 +362,7 @@ export default {
background: #fff; background: #fff;
padding-top: 0.2rem; padding-top: 0.2rem;
} }
.backBtn{ .backBtn {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
background: #fff; background: #fff;
...@@ -339,7 +374,7 @@ export default { ...@@ -339,7 +374,7 @@ export default {
border-radius: 50%; border-radius: 50%;
padding: 0.1rem; padding: 0.1rem;
} }
.backBtn img{ .backBtn img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
...@@ -366,7 +401,7 @@ export default { ...@@ -366,7 +401,7 @@ export default {
font-size: 0.3rem; font-size: 0.3rem;
white-space: nowrap; white-space: nowrap;
} }
.hc_field{ .hc_field {
padding: 0; padding: 0;
} }
.item-desc { .item-desc {
...@@ -432,7 +467,7 @@ export default { ...@@ -432,7 +467,7 @@ export default {
.add-btn { .add-btn {
color: #0054ff; color: #0054ff;
font-size: 0.3rem; font-size: 0.3rem;
margin: 0.2rem auto 0 ; margin: 0.2rem auto 0;
} }
.list-item { .list-item {
margin-bottom: 0.8rem; margin-bottom: 0.8rem;
...@@ -445,7 +480,7 @@ export default { ...@@ -445,7 +480,7 @@ export default {
bottom: 0rem; bottom: 0rem;
right: 0rem; right: 0rem;
} }
.delete-btn img{ .delete-btn img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
......
...@@ -2,24 +2,48 @@ ...@@ -2,24 +2,48 @@
<div class="cont"> <div class="cont">
<div class="evaluate-cont"> <div class="evaluate-cont">
<div class="title">整体评价</div> <div class="title">整体评价</div>
<van-rate readonly void-icon="star" v-model="totalStar" void-color="#eee" color="#FFA300" /> <van-rate
readonly
void-icon="star"
v-model="totalStar"
void-color="#eee"
color="#FFA300"
/>
<div class="eva_detail">详细评价</div> <div class="eva_detail">详细评价</div>
<div class="flex-h star-item"> <div class="flex-h star-item">
<div class="left_title">速度</div> <div class="left_title">速度</div>
<van-rate readonly void-icon="star" v-model="speedStar" void-color="#eee" color="#FFA300" /> <van-rate
readonly
void-icon="star"
v-model="speedStar"
void-color="#eee"
color="#FFA300"
/>
</div> </div>
<div class="flex-h star-item"> <div class="flex-h star-item">
<div class="left_title">质量</div> <div class="left_title">质量</div>
<van-rate readonly void-icon="star" v-model="qualityStar" void-color="#eee" color="#FFA300" /> <van-rate
readonly
void-icon="star"
v-model="qualityStar"
void-color="#eee"
color="#FFA300"
/>
</div> </div>
<div class="flex-h star-item"> <div class="flex-h star-item">
<div class="left_title">态度</div> <div class="left_title">态度</div>
<van-rate readonly void-icon="star" v-model="attitudeStar" void-color="#eee" color="#FFA300" /> <van-rate
readonly
void-icon="star"
v-model="attitudeStar"
void-color="#eee"
color="#FFA300"
/>
</div> </div>
<div class="line"></div> <div class="line"></div>
<div class="comments"> <div class="comments">
<div class="title">评价内容</div> <div class="title">评价内容</div>
<div class="content">{{comment.content}}</div> <div class="content">{{ comment.content }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -27,18 +51,18 @@ ...@@ -27,18 +51,18 @@
<script> <script>
export default { export default {
data(){ data () {
return{ return {
totalStar: 0, totalStar: 0,
speedStar: 0, speedStar: 0,
qualityStar: 0, qualityStar: 0,
attitudeStar:0, attitudeStar: 0,
repair_order_id: '', repair_order_id: '',
comment: '', comment: ''
} }
}, },
created () { created () {
console.log('接收的id啊',this.$route.query.id); console.log('接收的id啊', this.$route.query.id)
this.repair_order_id = this.$route.query.id this.repair_order_id = this.$route.query.id
this.look_comment() this.look_comment()
// this.getStatus() // this.getStatus()
...@@ -58,12 +82,12 @@ export default { ...@@ -58,12 +82,12 @@ export default {
this.attitudeStar = Number(data.attitude_stars) this.attitudeStar = Number(data.attitude_stars)
this.totalStar = Number(data.stars) this.totalStar = Number(data.stars)
}) })
.catch(() => {}) .catch(() => { })
}, }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/my/lookEvaluate.scss"; @import '@assets/styles/my/lookEvaluate.scss';
</style> </style>
...@@ -5,48 +5,52 @@ ...@@ -5,48 +5,52 @@
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div <div
class="title" class="title"
v-if="order.pid==0&&order.son_count>0" v-if="order.pid == 0 && order.son_count > 0"
>{{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-title">问题描述:</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 <div
class="item-desc" class="item-desc que-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div> >{{ 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>
<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">{{order.realname}}</div> <div class="item-desc">{{ order.realname }}</div>
</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 phone" @click="callPhone(order)">{{order.telephone}}</div> <div class="item-desc phone" @click="callPhone(order)">{{ order.telephone }}</div>
</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">2021-06-17 09:28:43</div> <div class="item-desc">2021-06-17 09:28:43</div>
</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
class="img" class="img"
v-for="(child, index) in order.image" v-for="(child, index) in order.image"
:key="index" :key="index"
@click="preview(order.image,index)" @click="preview(order.image, index)"
> >
<img :src="child.url" alt /> <img :src="child.url" alt />
</div> </div>
</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">{{order.work_name}}</div> <div class="item-desc">{{ order.work_name }}</div>
</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">{{order.telephone}}</div> <div class="item-desc">{{ order.telephone }}</div>
</div> </div>
<div class="material" v-if="order.no_pay_order"> <div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div> <div class="item-title bz-title">待支付耗材</div>
...@@ -55,26 +59,30 @@ ...@@ -55,26 +59,30 @@
v-for="(child, index) in order.no_pay_order.goods" v-for="(child, index) in order.no_pay_order.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
</div> </div>
<div class="material" v-if="order.pay_order != ''"> <div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div> <div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index"> <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
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</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">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
...@@ -83,13 +91,17 @@ ...@@ -83,13 +91,17 @@
<div class="item-title bz-title">备注耗材</div> <div class="item-title bz-title">备注耗材</div>
<div <div
class="ma-item flex-h flex-hb" class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order.goods" v-for="(child, index) in order.free_material_order
.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">免费</div> <div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</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>
<div class="one one3 text-line-one">¥0</div> <div class="one one3 text-line-one">¥0</div>
</div> </div>
...@@ -97,39 +109,51 @@ ...@@ -97,39 +109,51 @@
</div> </div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer"> <div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div> <div class="item-title">转单备注:</div>
<div class="item-desc">{{order.orderlog_transfer.remark}}</div> <div class="item-desc">{{ order.orderlog_transfer.remark }}</div>
</div> </div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel"> <div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<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 class="btn flex-h flex-hr" v-if="btnShow"> <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 <div
v-if="order.is_can_confirm_complete==1" 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" class="btn-item qr-btn"
@click="sure_click()" @click="sure_click()"
>确认完成</div> >确认完成</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"
@click="tz_charge(order.id)" @click="tz_charge(order.id)"
>发起收费</div> >发起收费</div>
<div <div
v-if="order.is_can_initiate_transfer_order==1" v-if="order.is_can_initiate_transfer_order == 1"
class="btn-item" class="btn-item"
@click="zd_click" @click="zd_click"
>发起转单</div> >发起转单</div>
<div v-if="order.is_can_back==1" class="btn-item" @click="back_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
<div v-if="order.is_can_see_material==1" class="btn-item sf-btn" @click="look_click">查看耗材</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> </div>
<!-- 弹窗 --> <!-- 弹窗 -->
<!-- 备注耗材弹窗 --> <!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close"> <van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont"> <div class="cancel_cont">
<div class="pop_title">备注耗材</div> <div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index"> <div class="list-item" v-for="(item, index) in addList" :key="index">
<input <input
class="input" class="input"
maxlength="20" maxlength="20"
...@@ -146,7 +170,7 @@ ...@@ -146,7 +170,7 @@
/> />
</div> </div>
<div class="math-btn flex-h flex-vc flex-hb"> <div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div> <div v-if="addList.length > 1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div> <div class="add-btn" @click="addMeth">+新增</div>
</div> </div>
<div class="btnItem flex-h"> <div class="btnItem flex-h">
...@@ -187,18 +211,30 @@ ...@@ -187,18 +211,30 @@
v-for="(item, index) in expend_detail.list" v-for="(item, index) in expend_detail.list"
:key="index" :key="index"
> >
<div <div class="one one1 one_title text-line-one">
class="one one1 one_title text-line-one" {{
>{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div> item.parent_detail
? item.parent_detail.goods_name
: '其它'
}}
</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div <div class="_one text-line-one">
class="_one text-line-one" {{
>{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div> item.is_free == 2
<div class="_two text-line-one">*{{item.number}}</div> ? 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>
<div class="one one3">{{item.price}}</div> <div class="hc_total">
共计{{ expend_detail.number }}件,总价: ¥{{
expend_detail.price
}}
</div> </div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div> <div class="sure-btn" @click="cancel">确定</div>
</div> </div>
</van-popup> </van-popup>
...@@ -209,17 +245,17 @@ ...@@ -209,17 +245,17 @@
</div> </div>
</div> </div>
<div v-else> <div v-else>
<img class="none-img" src="https://img01.yzcdn.cn/vant/empty-image-default.png"> <img class="none-img" src="https://img01.yzcdn.cn/vant/empty-image-default.png" />
<p class="none-p">暂无工单哦!</p> <p class="none-p">暂无工单哦!</p>
</div> </div>
</template> </template>
<script> <script>
import { ImagePreview } from 'vant'; import { ImagePreview } from 'vant'
import { trimStrSpace } from '@assets/js/format.js' import { trimStrSpace } from '@assets/js/format.js'
export default { export default {
name: 'order_detail', name: 'order_detail',
data(){ data () {
return { return {
locked: false, locked: false,
isloading: false, isloading: false,
...@@ -237,30 +273,29 @@ export default { ...@@ -237,30 +273,29 @@ export default {
lookShow: false, // 查看耗材弹窗 lookShow: false, // 查看耗材弹窗
reason: '', // 转单原因 reason: '', // 转单原因
zdShow: false, // 发起转单弹窗 zdShow: false, // 发起转单弹窗
backShow: false,//工人退回弹窗 backShow: false, // 工人退回弹窗
back_reason: '',//工人退回原因 back_reason: '', // 工人退回原因
lookShow: false, // 查看耗材弹窗 expend_detail: {} // 耗材详情
expend_detail: {},// 耗材详情
} }
}, },
created () { // created () {
this.order_id = this.$route.query.id // this.order_id = this.$route.query.id
// this.order_id = 211 // console.log(this.$route.query.id, 'this.$route.query.id----------')
this.getDetail() // this.getDetail()
}, // },
methods: { methods: {
preview(img, index){ preview (img, index) {
let temp = img.map(item=>{ const temp = img.map(item => {
return item.url return item.url
}) })
ImagePreview({ ImagePreview({
images: temp, images: temp,
startPosition: index, startPosition: index
}); })
}, },
// 确认完成 // 确认完成
sure_click (item, index) { sure_click (item, index) {
const vm = this // const vm = this
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
message: '确认完成维修?' message: '确认完成维修?'
...@@ -275,9 +310,9 @@ export default { ...@@ -275,9 +310,9 @@ export default {
this.$toast('操作成功') this.$toast('操作成功')
this.order = data this.order = data
}) })
.catch(() => {}) .catch(() => { })
}) })
.catch(() => {}) .catch(() => { })
}, },
onRefresh () { onRefresh () {
if (!this.locked) { if (!this.locked) {
...@@ -389,9 +424,9 @@ export default { ...@@ -389,9 +424,9 @@ export default {
}) })
}, },
// 开始维修 // 开始维修
starRepir (id,) { starRepir (id) {
// console.log(index) // console.log(index)
const vm = this // const vm = this
const curParams = { const curParams = {
repair_order_id: this.order_id repair_order_id: this.order_id
} }
...@@ -400,17 +435,17 @@ export default { ...@@ -400,17 +435,17 @@ export default {
.then((data) => { .then((data) => {
this.order = data this.order = data
}) })
.catch(() => {}) .catch(() => { })
}, },
back_click(){ back_click () {
this.back_reason = '' this.back_reason = ''
this.backShow = true this.backShow = true
}, },
back_cancel(){ back_cancel () {
this.backShow = false this.backShow = false
}, },
//发起退回 // 发起退回
back_submit(){ back_submit () {
if (this.back_reason === '') { if (this.back_reason === '') {
this.$toast('退回原因不可为空') this.$toast('退回原因不可为空')
return return
...@@ -442,25 +477,39 @@ export default { ...@@ -442,25 +477,39 @@ export default {
this.expend_detail = data this.expend_detail = data
this.lookShow = true this.lookShow = true
}) })
.catch(() => {}) .catch(() => { })
}, },
cancel () { cancel () {
this.zdShow = false this.zdShow = false
this.hcShow = false this.hcShow = false
this.lookShow = false this.lookShow = false
}, },
goBack(){ goBack () {
this.$router.push({ this.$router.push({
path: '/' path: '/'
}) })
}, },
fetchData (to, from) {
this.order_id = to.query ? to.query.id : ''
if (this.order_id) {
this.getDetail()
}
}
}, },
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/index.scss"; @import '@assets/styles/tabbar/index.scss';
.backBtn { .backBtn {
width: 0.8rem; width: 0.8rem;
height: 0.8rem; height: 0.8rem;
...@@ -478,11 +527,11 @@ export default { ...@@ -478,11 +527,11 @@ export default {
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
.none-img{ .none-img {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
.none-p{ .none-p {
text-align: center; text-align: center;
} }
</style> </style>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<div class="cont"> <div class="cont">
<div class="top flex-h flex-vc"> <div class="top flex-h flex-vc">
<div class="point"></div> <div class="point"></div>
<div class="status">{{user.online_status_display}}</div> <div class="status">{{ user.online_status_display }}</div>
</div> </div>
<div class="menu flex-h flex-hb"> <div class="menu flex-h flex-hb">
<div class="hc_total">{{count}}个工单</div> <div class="hc_total">{{ count }}个工单</div>
<div class="options"> <div class="options">
<div @click="chooseTab">{{curSelect.name}}</div> <div @click="chooseTab">{{ curSelect.name }}</div>
<div class="option-box" v-show="tabShow"> <div class="option-box" v-show="tabShow">
<div <div
class="option-item" class="option-item"
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
:key="item.type" :key="item.type"
:value="item.name" :value="item.name"
@click="changeItem(item)" @click="changeItem(item)"
>{{item.name}}</div> >{{ item.name }}</div>
</div> </div>
</div> </div>
</div> </div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type==4"> <div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type == 4">
<div class="start" @click="stShow">{{startTime}}</div> <div class="start" @click="stShow">{{ startTime }}</div>
<div class="blue"></div> <div class="blue"></div>
<div class="end" @click="endShow">{{endTime}}</div> <div class="end" @click="endShow">{{ endTime }}</div>
</div> </div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh"> <van-pull-refresh v-model="isloading" @refresh="onRefresh">
...@@ -34,38 +34,48 @@ ...@@ -34,38 +34,48 @@
v-if="list.length" v-if="list.length"
> >
<div class="order-item" v-for="(item, index) in list" :key="item.id"> <div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title" v-if="item.pid==0&&item.son_count>0">{{item.order_status_display}}(负责人)</div> <div
<div class="title" v-else>{{item.order_status_display }}</div> class="title"
v-if="item.pid == 0 && item.son_count > 0"
>{{ 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 flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div class="item-desc">
class="item-desc" {{ item.appointment_date }}
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div> {{ item.appointment_time.start_time }}-{{
item.appointment_time.end_time
}}
</div>
</div> </div>
<div class="item-title">问题描述:</div> <div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{item.repair_type.type_name}}-{{item.description}}</div> <div
class="item-desc que-desc"
>{{ item.repair_type.type_name }}-{{ item.description }}</div>
<div class="item flex-h flex-start"> <div class="item flex-h flex-start">
<div class="item-title">服务地址:</div> <div class="item-title">服务地址:</div>
<div <div class="item-desc">
class="item-desc" {{ item.region.region_name }}-{{
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div> item.room.room_name
}}-{{ item.address }}
</div>
</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">{{item.realname}}</div> <div class="item-desc">{{ item.realname }}</div>
</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 phone" @click="callPhone(item)">{{item.telephone}}</div> <div class="item-desc phone" @click="callPhone(item)">{{ item.telephone }}</div>
</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">{{item.created_at}}</div> <div class="item-desc">{{ item.created_at }}</div>
</div> </div>
<div class="item flex-h flex-start"> <div class="item flex-h flex-start">
<div class="item-title">图片详情:</div> <div class="item-title">图片详情:</div>
<div <div
@click="preview(item.image,index)" @click="preview(item.image, index)"
class="img flex-h" class="img flex-h"
v-for="(child, index) in item.image" v-for="(child, index) in item.image"
:key="index" :key="index"
...@@ -76,11 +86,11 @@ ...@@ -76,11 +86,11 @@
<div class="line"></div> <div class="line"></div>
<div class="item flex-h flex-vc" v-if="item.worker"> <div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">派工对象:</div> <div class="item-title">派工对象:</div>
<div class="item-desc">{{item.worker.name}}</div> <div class="item-desc">{{ item.worker.name }}</div>
</div> </div>
<div class="item flex-h flex-vc" v-if="item.worker"> <div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">联系电话:</div> <div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div> <div class="item-desc">{{ item.worker.phone }}</div>
</div> </div>
<div class="material" v-if="item.no_pay_order"> <div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div> <div class="item-title bz-title">待支付耗材</div>
...@@ -89,12 +99,12 @@ ...@@ -89,12 +99,12 @@
v-for="(child, index) in item.no_pay_order.goods" v-for="(child, index) in item.no_pay_order.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
</div> </div>
...@@ -106,13 +116,17 @@ ...@@ -106,13 +116,17 @@
v-for="(child, index) in parent.goods" v-for="(child, index) in parent.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <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">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</div> class="_one text-line-one"
>{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
...@@ -122,13 +136,17 @@ ...@@ -122,13 +136,17 @@
<div class="item-title bz-title">备注耗材</div> <div class="item-title bz-title">备注耗材</div>
<div <div
class="ma-item flex-h flex-hb" class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order.goods" v-for="(child, index) in item.free_material_order
.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">免费</div> <div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</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>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> --> <!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div> <div class="one one3 text-line-one">¥0</div>
...@@ -137,30 +155,34 @@ ...@@ -137,30 +155,34 @@
</div> </div>
<div class="btn flex-h flex-hr"> <div class="btn flex-h flex-hr">
<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>
<div <div
v-if="item.is_can_initiate_charge==1" v-if="item.is_can_initiate_charge == 1"
class="btn-item sf-btn" class="btn-item sf-btn"
@click="tz_charge(item.id)" @click="tz_charge(item.id)"
>发起收费</div> >发起收费</div>
<div <div
v-if="item.is_can_initiate_transfer_order==1" v-if="item.is_can_initiate_transfer_order == 1"
class="btn-item" class="btn-item"
@click="zd_click(item)" @click="zd_click(item)"
>发起转单</div> >发起转单</div>
<div v-if="item.is_can_back==1" class="btn-item" @click="back_click(item)">发起退回</div>
<div <div
v-if="item.is_can_begin_repair==1" v-if="item.is_can_back == 1"
class="btn-item"
@click="back_click(item)"
>发起退回</div>
<div
v-if="item.is_can_begin_repair == 1"
class="btn-item" class="btn-item"
@click="starRepir(item.id,index)" @click="starRepir(item.id, index)"
>开始维修</div> >开始维修</div>
<!-- <div <!-- <div
v-if="item.is_can_see_appraisal==1" v-if="item.is_can_see_appraisal==1"
...@@ -168,7 +190,7 @@ ...@@ -168,7 +190,7 @@
@click="look_comment(item)" @click="look_comment(item)"
>查看评价</div>--> >查看评价</div>-->
<div <div
v-if="item.is_can_see_material==1" v-if="item.is_can_see_material == 1"
class="btn-item sf-btn" class="btn-item sf-btn"
@click="look_click(item)" @click="look_click(item)"
>查看耗材</div> >查看耗材</div>
...@@ -205,7 +227,7 @@ ...@@ -205,7 +227,7 @@
<van-popup v-model="hcShow" close-icon="close"> <van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont"> <div class="cancel_cont">
<div class="pop_title">备注耗材</div> <div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index"> <div class="list-item" v-for="(item, index) in addList" :key="index">
<input <input
class="input" class="input"
maxlength="20" maxlength="20"
...@@ -223,7 +245,7 @@ ...@@ -223,7 +245,7 @@
/> />
</div> </div>
<div class="math-btn flex-h flex-vc flex-hb"> <div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div> <div v-if="addList.length > 1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div> <div class="add-btn" @click="addMeth">+新增</div>
</div> </div>
<div class="btnItem flex-h"> <div class="btnItem flex-h">
...@@ -242,18 +264,30 @@ ...@@ -242,18 +264,30 @@
v-for="(item, index) in expend_detail.list" v-for="(item, index) in expend_detail.list"
:key="index" :key="index"
> >
<div <div class="one one1 one_title text-line-one">
class="one one1 one_title text-line-one" {{
>{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div> item.parent_detail
? item.parent_detail.goods_name
: '其它'
}}
</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div <div class="_one text-line-one">
class="_one text-line-one" {{
>{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div> item.is_free == 2
<div class="_two text-line-one">*{{item.number}}</div> ? item.good_detail.goods_name
: item.goods_name
}}
</div>
<div class="_two text-line-one">*{{ item.number }}</div>
</div> </div>
<div class="one one3">{{item.price}}</div> <div class="one one3">{{ item.price }}</div>
</div>
<div class="hc_total">
共计{{ expend_detail.number }}件,总价: ¥{{
expend_detail.price
}}
</div> </div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div> <div class="sure-btn" @click="cancel">确定</div>
</div> </div>
</van-popup> </van-popup>
...@@ -291,7 +325,7 @@ ...@@ -291,7 +325,7 @@
<script> <script>
import myTabbar from '@components/common/tabbar.vue' import myTabbar from '@components/common/tabbar.vue'
import { trimStrSpace } from '@assets/js/format.js' import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview, Toast } from 'vant'; import { ImagePreview } from 'vant'
import { share } from '@/api/wxShare.js' import { share } from '@/api/wxShare.js'
export default { export default {
name: 'home', name: 'home',
...@@ -336,41 +370,41 @@ export default { ...@@ -336,41 +370,41 @@ export default {
], // 添加的备注耗材数据 ], // 添加的备注耗材数据
hcShow: false, // 耗材弹窗 hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗 lookShow: false, // 查看耗材弹窗
expend_detail: {},// 耗材详情 expend_detail: {}, // 耗材详情
user: '', user: '',
startTime: '请选择开始日期', startTime: '请选择开始日期',
showStart: false, showStart: false,
startObj:{ startObj: {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
}, },
endObj:{ endObj: {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
}, },
currentDate: new Date(), currentDate: new Date(),
showEnd: false, showEnd: false,
endTime: "请选择截止日期", endTime: '请选择截止日期',
backShow: false,//工人退回弹窗 backShow: false, // 工人退回弹窗
back_reason: '',//工人退回原因 back_reason: '' // 工人退回原因
} }
}, },
created () { created () {
share() share()
this.getList() // this.getList()
this.getUserInfo() // this.getUserInfo()
}, },
methods: { methods: {
back_click(item){ back_click (item) {
this.curItem = item this.curItem = item
this.back_reason = '' this.back_reason = ''
this.backShow = true this.backShow = true
}, },
back_cancel(){ back_cancel () {
this.backShow = false this.backShow = false
}, },
//发起退回 // 发起退回
back_submit(){ back_submit () {
if (this.back_reason === '') { if (this.back_reason === '') {
this.$toast('退回原因不可为空') this.$toast('退回原因不可为空')
return return
...@@ -387,90 +421,89 @@ export default { ...@@ -387,90 +421,89 @@ export default {
const idx = this.list.findIndex(item => item.id === this.curItem.id) const idx = this.list.findIndex(item => item.id === this.curItem.id)
if (idx !== -1) { if (idx !== -1) {
this.list.splice(idx, 1) this.list.splice(idx, 1)
this.count = this.count-1 this.count = this.count - 1
} }
}) })
.catch(() => { .catch(() => {
this.backShow = false this.backShow = false
}) })
}, },
showAll(item,e){ showAll (item, e) {
this.$toast(e.target.innerHTML,{ this.$toast(e.target.innerHTML, {
duration: 0 duration: 0
}) })
}, },
callPhone(item){ callPhone (item) {
console.log('电话',item) console.log('电话', item)
let phoneNumber = item.telephone const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber window.location.href = 'tel://' + phoneNumber
}, },
onmore(){ onmore () {
this.getList() this.getList()
}, },
preview(img, index){ preview (img, index) {
let temp = img.map(item=>{ const temp = img.map(item => {
return item.url return item.url
}) })
ImagePreview({ ImagePreview({
images: temp, images: temp,
startPosition: index, startPosition: index
}); })
}, },
endShow(){ endShow () {
this.showEnd = true this.showEnd = true
}, },
stShow(){ stShow () {
this.showStart = true this.showStart = true
}, },
formatter(type, val) { formatter (type, val) {
if (type === 'year') {
if (type === "year") { return `${val}年`
return `${val}年`; } else if (type === 'month') {
} else if (type === "month") { return `${val}月`
return `${val}月`; } else if (type === 'day') {
} else if (type === "day") { return `${val}日`
return `${val}日`;
} }
return val; return val
}, },
birConfirm(value) { birConfirm (value) {
this.showStart = false this.showStart = false
if(this.startTime == this.conversionTime(value)){ if (this.startTime == this.conversionTime(value)) {
return return
} }
console.log('啊啊啊',value); console.log('啊啊啊', value)
this.startTime = this.conversionTime(value) this.startTime = this.conversionTime(value)
this.$set(this.endObj,'minDate',value) this.$set(this.endObj, 'minDate', value)
this.anginList() this.anginList()
console.log('开始时间',this.startTime); console.log('开始时间', this.startTime)
}, },
conversionTime(temp){ conversionTime (temp) {
let mounth = (temp.getMonth() + 1) <10 ? '0'+(temp.getMonth() + 1) : (temp.getMonth() + 1) const mounth = (temp.getMonth() + 1) < 10 ? '0' + (temp.getMonth() + 1) : (temp.getMonth() + 1)
let date = temp.getDate() <10 ? '0' + temp.getDate() : temp.getDate() const date = temp.getDate() < 10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() + return temp.getFullYear() +
"-" + '-' +
mounth + mounth +
"-" + '-' +
date date
}, },
birCancel() { birCancel () {
this.showStart = false; this.showStart = false
}, },
endTimeConfirm(value){ endTimeConfirm (value) {
this.showEnd = false this.showEnd = false
if(this.endTime == this.conversionTime(value)){ if (this.endTime == this.conversionTime(value)) {
return return
} }
this.endTime = this.conversionTime(value) this.endTime = this.conversionTime(value)
this.$set(this.startObj,'maxDate',value) this.$set(this.startObj, 'maxDate', value)
this.anginList() this.anginList()
console.log('结束时间',this.endTime); console.log('结束时间', this.endTime)
}, },
endTimeCancel() { endTimeCancel () {
this.showEnd = false; this.showEnd = false
}, },
anginList(){ anginList () {
if(this.startTime !='请选择开始日期' && this.endTime!='请选择截止日期'){ if (this.startTime != '请选择开始日期' && this.endTime != '请选择截止日期') {
this.initData() this.initData()
this.getList() this.getList()
} }
...@@ -493,7 +526,7 @@ export default { ...@@ -493,7 +526,7 @@ export default {
console.log(res) console.log(res)
this.status = res this.status = res
}) })
.catch(() => {}) .catch(() => { })
}, },
getUserInfo () { getUserInfo () {
this.$http this.$http
...@@ -501,26 +534,26 @@ export default { ...@@ -501,26 +534,26 @@ export default {
.then((res) => { .then((res) => {
this.user = res this.user = res
}) })
.catch(() => {}) .catch(() => { })
}, },
// 获取工单列表 // 获取工单列表
getList () { getList () {
if (this.more && !this.isloading) { if (this.more && !this.isloading) {
this.isloading = true this.isloading = true
let curParams = {} let curParams = {}
if(this.curSelect.type==4){ if (this.curSelect.type == 4) {
curParams = { curParams = {
time_type: this.curSelect.type, time_type: this.curSelect.type,
page: this.page, page: this.page,
limit: this.limit, limit: this.limit,
start: this.startTime, start: this.startTime,
end: this.endTime, end: this.endTime
} }
}else{ } else {
curParams = { curParams = {
time_type: this.curSelect.type, time_type: this.curSelect.type,
page: this.page, page: this.page,
limit: this.limit, limit: this.limit
} }
} }
this.$http this.$http
...@@ -533,7 +566,7 @@ export default { ...@@ -533,7 +566,7 @@ export default {
this.isloading = false this.isloading = false
this.count = data.count this.count = data.count
this.loading = false this.loading = false
this.finished = !data.more; this.finished = !data.more
}) })
.catch(() => { .catch(() => {
this.locked = false this.locked = false
...@@ -558,16 +591,16 @@ export default { ...@@ -558,16 +591,16 @@ export default {
this.curSelect = item this.curSelect = item
this.tabShow = false this.tabShow = false
if(this.curSelect.type == 4){ if (this.curSelect.type == 4) {
this.startTime ='请选择开始日期' this.startTime = '请选择开始日期'
this.endTime='请选择截止日期' this.endTime = '请选择截止日期'
this.startObj={ this.startObj = {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
} }
this.endObj={ this.endObj = {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
} }
return return
} }
...@@ -587,7 +620,7 @@ export default { ...@@ -587,7 +620,7 @@ export default {
.then((data) => { .then((data) => {
vm.$set(vm.list, index, data) vm.$set(vm.list, index, data)
}) })
.catch(() => {}) .catch(() => { })
}, },
// 转单弹窗 // 转单弹窗
zd_click (item) { zd_click (item) {
...@@ -613,7 +646,7 @@ export default { ...@@ -613,7 +646,7 @@ export default {
const idx = this.list.findIndex(item => item.id === this.curItem.id) const idx = this.list.findIndex(item => item.id === this.curItem.id)
if (idx !== -1) { if (idx !== -1) {
this.list.splice(idx, 1) this.list.splice(idx, 1)
this.count = this.count-1 this.count = this.count - 1
} }
}) })
.catch(() => { .catch(() => {
...@@ -696,7 +729,7 @@ export default { ...@@ -696,7 +729,7 @@ export default {
this.expend_detail = data this.expend_detail = data
this.lookShow = true this.lookShow = true
}) })
.catch(() => {}) .catch(() => { })
}, },
// 查看评论 // 查看评论
look_comment (item) { look_comment (item) {
...@@ -736,9 +769,9 @@ export default { ...@@ -736,9 +769,9 @@ export default {
vm.$set(vm.list, index, data) vm.$set(vm.list, index, data)
this.$toast('操作成功') this.$toast('操作成功')
}) })
.catch(() => {}) .catch(() => { })
}) })
.catch(() => {}) .catch(() => { })
}, },
// 取消按钮 // 取消按钮
...@@ -754,11 +787,23 @@ export default { ...@@ -754,11 +787,23 @@ export default {
path: '/charge', path: '/charge',
query: { id } query: { id }
}) })
},
fetchData (to, from) {
this.getList()
this.getUserInfo()
} }
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/index.scss"; @import '@assets/styles/tabbar/index.scss';
</style> </style>
<template> <template>
<div class="cont"> <div class="cont">
<div class="menu flex-h flex-hb flex-vc"> <div class="menu flex-h flex-hb flex-vc">
<div class="hc_total">{{count}}个工单</div> <div class="hc_total">{{ count }}个工单</div>
<div class="flex-h flex-hb"> <div class="flex-h flex-hb">
<div class="options"> <div class="options">
<div @click="chooseStatus">{{curSelectStatus.name}}</div> <div @click="chooseStatus">{{ curSelectStatus.name }}</div>
<div class="option-box" v-show="statusShow"> <div class="option-box" v-show="statusShow">
<div <div
class="option-item" class="option-item"
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
:key="item.statustype" :key="item.statustype"
:value="item.name" :value="item.name"
@click="changeStatus(item)" @click="changeStatus(item)"
>{{item.name}}</div> >{{ item.name }}</div>
</div> </div>
</div> </div>
<div class="options"> <div class="options">
<div @click="chooseTab">{{curSelect.name}}</div> <div @click="chooseTab">{{ curSelect.name }}</div>
<div class="option-box" v-show="tabShow"> <div class="option-box" v-show="tabShow">
<div <div
class="option-item" class="option-item"
...@@ -24,15 +24,15 @@ ...@@ -24,15 +24,15 @@
:key="item.type" :key="item.type"
:value="item.name" :value="item.name"
@click="changeItem(item)" @click="changeItem(item)"
>{{item.name}}</div> >{{ item.name }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type==4"> <div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type == 4">
<div class="start" @click="stShow">{{startTime}}</div> <div class="start" @click="stShow">{{ startTime }}</div>
<div class="blue"></div> <div class="blue"></div>
<div class="end" @click="endShow">{{endTime}}</div> <div class="end" @click="endShow">{{ endTime }}</div>
</div> </div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh"> <van-pull-refresh v-model="isloading" @refresh="onRefresh">
...@@ -56,26 +56,62 @@ ...@@ -56,26 +56,62 @@
<div class="tc-box"> <div class="tc-box">
<div class="tc-title">选择工人</div> <div class="tc-title">选择工人</div>
<div class="workers"> <div class="workers">
<div class="gr-item" v-for="(child_item,child_index) in columns" :key="child_index"> <div
<div class="bm-item">{{child_item.name}}</div> class="gr-item"
v-for="(child_item, child_index) in columns"
:key="child_index"
>
<div class="bm-item">{{ child_item.name }}</div>
<div v-if="child_item.user.length"> <div v-if="child_item.user.length">
<div <div
class="people-item flex-h flex-vc flex-hb" class="people-item flex-h flex-vc flex-hb"
v-for="(lchild_item,lchild_index) in child_item.user" v-for="(
lchild_item, lchild_index
) in child_item.user"
:key="lchild_index" :key="lchild_index"
@click="chooseWorker(lchild_item,lchild_index,index)" @click="
chooseWorker(
lchild_item,
lchild_index,
index
)
"
> >
<div class="flex-h flex-vc"> <div class="flex-h flex-vc">
<img class="gr-img" :src=gr_img /> <img class="gr-img" :src="grImg" />
<div <div
class="gr-name" class="gr-name"
v-if="lchild_item.repired_count !== 0 || lchild_item.repiring_count !== 0" v-if="
>{{lchild_item.name}} (已派工: {{lchild_item.repired_count}};维修中: {{lchild_item.repiring_count}})</div> lchild_item.repired_count !==
<div class="gr-name" v-else>{{lchild_item.name}} (休息中)</div> 0 ||
lchild_item.repiring_count !==
0
"
>
{{ lchild_item.name }}
(已派工:
{{
lchild_item.repired_count
}};维修中:
{{
lchild_item.repiring_count
}})
</div>
<div class="gr-name" v-else>
{{ lchild_item.name }}
(休息中)
</div>
</div> </div>
<img <img
class="k-img" class="k-img"
:src="item.temporaryId && item.temporaryId.includes(lchild_item.id) ? select_img : unselect_img" :src="
item.temporaryId &&
item.temporaryId.includes(
lchild_item.id
)
? selectImg
: unselectImg
"
/> />
</div> </div>
</div> </div>
...@@ -88,38 +124,45 @@ ...@@ -88,38 +124,45 @@
</div> </div>
</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 flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div class="item-desc">
class="item-desc" {{ item.appointment_date }}
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div> {{ item.appointment_time.start_time }}-{{
item.appointment_time.end_time
}}
</div>
</div> </div>
<div class="item-title">问题描述:</div> <div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{item.repair_type.type_name}}-{{item.description}}</div> <div
class="item-desc que-desc"
>{{ item.repair_type.type_name }}-{{ item.description }}</div>
<div class="item flex-h flex-start"> <div class="item flex-h flex-start">
<div class="item-title">服务地址:</div> <div class="item-title">服务地址:</div>
<div <div class="item-desc">
class="item-desc" {{ item.region.region_name }}-{{
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div> item.room.room_name
}}-{{ item.address }}
</div>
</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">{{item.realname}}</div> <div class="item-desc">{{ item.realname }}</div>
</div> </div>
<!--<a :href="'tel' + item.telephone">{{item.telephone}}</a> --> <!--<a :href="'tel' + item.telephone">{{item.telephone}}</a> -->
<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 phone" @click="callPhone(item)">{{item.telephone}}</div> <div class="item-desc phone" @click="callPhone(item)">{{ item.telephone }}</div>
</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">{{item.created_at}}</div> <div class="item-desc">{{ item.created_at }}</div>
</div> </div>
<div class="item flex-h flex-start"> <div class="item flex-h flex-start">
<div class="item-title">图片详情:</div> <div class="item-title">图片详情:</div>
<div <div
@click="preview(item.image,child_i)" @click="preview(item.image, child_i)"
class="img flex-h" class="img flex-h"
v-for="(child, child_i) in item.image" v-for="(child, child_i) in item.image"
:key="child_i" :key="child_i"
...@@ -134,12 +177,12 @@ ...@@ -134,12 +177,12 @@
v-for="(child, index) in item.no_pay_order.goods" v-for="(child, index) in item.no_pay_order.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{child.number}}</div> <div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
</div> </div>
...@@ -151,13 +194,17 @@ ...@@ -151,13 +194,17 @@
v-for="(child, index) in parent.goods" v-for="(child, index) in parent.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div> <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">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</div> class="_one text-line-one"
>{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div> </div>
<div class="one one3">{{child.price}}</div> <div class="one one3">{{ child.price }}</div>
</div> </div>
</div> </div>
<div class="item_line"></div> <div class="item_line"></div>
...@@ -167,13 +214,17 @@ ...@@ -167,13 +214,17 @@
<div class="item-title bz-title">备注耗材</div> <div class="item-title bz-title">备注耗材</div>
<div <div
class="ma-item flex-h flex-hb" class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order.goods" v-for="(child, index) in item.free_material_order
.goods"
:key="index" :key="index"
> >
<div class="one one1 text-line-one">免费</div> <div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h"> <div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div> <div
<div class="_two text-line-one">*{{child.number}}</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>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> --> <!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div> <div class="one one3 text-line-one">¥0</div>
...@@ -182,11 +233,11 @@ ...@@ -182,11 +233,11 @@
</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>
</div> </div>
<div class="item flex-h flex-start" v-if="item.orderlog_cancel"> <div class="item flex-h flex-start" v-if="item.orderlog_cancel">
<div class="item-title">退回备注:</div> <div class="item-title">退回备注:</div>
<div class="item-desc">{{item.orderlog_cancel.remark}}</div> <div class="item-desc">{{ item.orderlog_cancel.remark }}</div>
</div> </div>
<!-- <div v-if="item.worker"> <!-- <div v-if="item.worker">
<div class="line"></div> <div class="line"></div>
...@@ -203,21 +254,24 @@ ...@@ -203,21 +254,24 @@
<div class="line"></div> <div class="line"></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">{{item.work_name}}</div> <div class="item-desc">{{ item.work_name }}</div>
</div> </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
v-if="item.is_can_assign_worker==1" v-if="item.is_can_assign_worker == 1"
class="item flex-h flex-vc flex-hb" class="item flex-h flex-vc flex-hb"
@click="workers(index)" @click="workers(index)"
> >
<div class="wo flex-h flex-vc"> <div class="wo flex-h flex-vc">
<div class="item-title" v-if="item.order_status_display == '已派工'">重新派工:</div> <div
class="item-title"
v-if="item.order_status_display == '已派工'"
>重新派工:</div>
<div class="item-title" v-else>派工对象:</div> <div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">{{item.realName}}</div> <div class="item-desc worker-name">{{ item.realName }}</div>
</div> </div>
<div class="flex-h flex-vc"> <div class="flex-h flex-vc">
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
...@@ -229,11 +283,15 @@ ...@@ -229,11 +283,15 @@
<div class="line"></div> <div class="line"></div>
<div class="allBtn flex-h flex-hr"> <div class="allBtn flex-h flex-hr">
<div <div
v-if="item.is_can_assign_worker==1" v-if="item.is_can_assign_worker == 1"
class="button sureBtn" class="button sureBtn"
@click="sureOrder(item,index)" @click="sureOrder(item, index)"
>确定</div> >确定</div>
<div v-if="item.is_can_cancel==1" class="button" @click="cancelOrder(item)">取消</div> <div
v-if="item.is_can_cancel == 1"
class="button"
@click="cancelOrder(item)"
>取消</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -284,23 +342,19 @@ ...@@ -284,23 +342,19 @@
</template> </template>
<script> <script>
import myTabbar from '@components/common/tabbar.vue' // import { trimStrSpace } from '@assets/js/format.js'
import { trimStrSpace } from '@assets/js/format.js' import { ImagePreview } from 'vant'
import { ImagePreview, CellGroup } from 'vant'; import selectImg from '@assets/images/select.png'
import select_img from '@assets/images/select.png' import unselectImg from '@assets/images/un_select.png'
import unselect_img from '@assets/images/un_select.png' import grImg from '@assets/images/gr.png'
import gr_img from '@assets/images/gr.png'
export default { export default {
name: 'home', name: 'home',
components: {
myTabbar
},
data () { data () {
return { return {
select_img, selectImg,
unselect_img, unselectImg,
gr_img, grImg,
reson: '',//取消原因 reson: '', // 取消原因
qxShow: false, // 发起转单弹窗 qxShow: false, // 发起转单弹窗
workerName: '', workerName: '',
worker_id: '', worker_id: '',
...@@ -308,17 +362,17 @@ export default { ...@@ -308,17 +362,17 @@ export default {
columns: [], columns: [],
startTime: '请选择开始日期', startTime: '请选择开始日期',
showStart: false, showStart: false,
startObj:{ startObj: {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
}, },
endObj:{ endObj: {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
}, },
currentDate: new Date(), currentDate: new Date(),
showEnd: false, showEnd: false,
endTime: "请选择截止日期", endTime: '请选择截止日期',
// 头部日期范围筛选 // 头部日期范围筛选
tabShow: false, // tab范围选择框是否显示 tabShow: false, // tab范围选择框是否显示
curSelect: { type: '1', name: '今日' }, // 当前选择的日期范围 curSelect: { type: '1', name: '今日' }, // 当前选择的日期范围
...@@ -357,17 +411,17 @@ export default { ...@@ -357,17 +411,17 @@ export default {
// 转单 // 转单
curItem: '', // 当前选中要操作的数据 curItem: '', // 当前选中要操作的数据
reason: '', // 原因 reason: '', // 原因
currentId: '', currentId: ''
} }
}, },
created () { // created () {
this.getList() // this.getList()
this.getWorkers() // this.getWorkers()
}, // },
methods: { methods: {
// 选择完工人点击确定按钮 // 选择完工人点击确定按钮
keyConfirm(i){ keyConfirm (i) {
if(!this.list[i].temporaryId.length){ if (!this.list[i].temporaryId.length) {
this.$toast('请选择工人!') this.$toast('请选择工人!')
return return
} }
...@@ -376,43 +430,43 @@ export default { ...@@ -376,43 +430,43 @@ export default {
this.list[i].worker_id = [...this.list[i].temporaryId] this.list[i].worker_id = [...this.list[i].temporaryId]
this.list[i].showWorker = false this.list[i].showWorker = false
}, },
chooseWorker(item,lchild_index,index){ chooseWorker (item, lchild_index, index) {
if(this.list[index].temporaryId.includes(item.id)){ // 删除 if (this.list[index].temporaryId.includes(item.id)) { // 删除
let name_i = this.list[index].temporaryId.indexOf(item.id) const name_i = this.list[index].temporaryId.indexOf(item.id)
this.list[index].temporaryId.splice(name_i,1) this.list[index].temporaryId.splice(name_i, 1)
this.list[index].temporaryName.splice(name_i,1) this.list[index].temporaryName.splice(name_i, 1)
}else{ // 加入 } else { // 加入
this.list[index].temporaryId.push(item.id) this.list[index].temporaryId.push(item.id)
this.list[index].temporaryName.push(item.name) this.list[index].temporaryName.push(item.name)
} }
}, },
onmore(){ onmore () {
this.getList() this.getList()
}, },
preview(img, index){ preview (img, index) {
let temp = img.map(item=>{ const temp = img.map(item => {
return item.url return item.url
}) })
ImagePreview({ ImagePreview({
images: temp, images: temp,
startPosition: index, startPosition: index
}); })
}, },
callPhone(item){ callPhone (item) {
console.log('电话',item) console.log('电话', item)
let phoneNumber = item.telephone const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber window.location.href = 'tel://' + phoneNumber
}, },
//指派工人 // 指派工人
sureOrder(item,index){ sureOrder (item, index) {
const vm = this const vm = this
// const index = this.list.findIndex(item => item.id === this.curItem.id) // const index = this.list.findIndex(item => item.id === this.curItem.id)
// console.log('index',index); // console.log('index',index);
// console.log('1111',item); // console.log('1111',item);
this.curItem = item this.curItem = item
this.repair_order_id = item.id this.repair_order_id = item.id
console.log('工人id',item.worker_id); console.log('工人id', item.worker_id)
if(!item.worker_id.length) { if (!item.worker_id.length) {
this.$toast('请选择工人') this.$toast('请选择工人')
return return
} }
...@@ -425,32 +479,32 @@ export default { ...@@ -425,32 +479,32 @@ export default {
.then((data) => { .then((data) => {
data.workerName = [] data.workerName = []
data.realName = '' data.realName = ''
data.temporaryName=[] data.temporaryName = []
data.temporaryId=[] data.temporaryId = []
data.worker_id = [] data.worker_id = []
this.$toast('操作成功') this.$toast('操作成功')
this.reason = '' this.reason = ''
this.changeList(data,index) this.changeList(data, index)
}) })
.catch(() => {}) .catch(() => { })
}, },
changeList(data,index){ changeList (data, index) {
if(this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3){ if (this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3) {
this.$set(this.list, index, data) this.$set(this.list, index, data)
}else{ } else {
this.list.splice(index,1) this.list.splice(index, 1)
this.count = this.count-1 this.count = this.count - 1
} }
}, },
// 取消工单 // 取消工单
cancelOrder(item){ cancelOrder (item) {
console.log('aaa',item); console.log('aaa', item)
this.curItem = item this.curItem = item
this.qxShow = true; this.qxShow = true
this.reason = '' this.reason = ''
}, },
workers(index){ workers (index) {
this.$set(this.list, index,{...this.list[index], ...{showWorker:true}}) this.$set(this.list, index, { ...this.list[index], ...{ showWorker: true } })
}, },
// onConfirm(value,i) { // onConfirm(value,i) {
// console.log('id啊',value.id); // console.log('id啊',value.id);
...@@ -458,69 +512,69 @@ export default { ...@@ -458,69 +512,69 @@ export default {
// this.list[i].showWorker = false // this.list[i].showWorker = false
// }, // },
Cancel(i){ Cancel (i) {
this.list[i].showWorker = false this.list[i].showWorker = false
}, },
endShow(){ endShow () {
this.showEnd = true this.showEnd = true
}, },
stShow(){ stShow () {
this.showStart = true this.showStart = true
}, },
formatter(type, val) { formatter (type, val) {
if (type === "year") { if (type === 'year') {
return `${val}年`; return `${val}年`
} else if (type === "month") { } else if (type === 'month') {
return `${val}月`; return `${val}月`
} else if (type === "day") { } else if (type === 'day') {
return `${val}日`; return `${val}日`
} }
return val; return val
}, },
birConfirm(value) { birConfirm (value) {
this.showStart = false this.showStart = false
console.log('啊啊啊',value); console.log('啊啊啊', value)
if(this.startTime == this.conversionTime(value)){ if (this.startTime == this.conversionTime(value)) {
return return
} }
this.startTime = this.conversionTime(value) this.startTime = this.conversionTime(value)
this.$set(this.endObj,'minDate',value) this.$set(this.endObj, 'minDate', value)
this.anginList() this.anginList()
console.log('开始时间',this.startTime); console.log('开始时间', this.startTime)
}, },
conversionTime(temp){ conversionTime (temp) {
let mounth = (temp.getMonth() + 1) <10 ? '0'+(temp.getMonth() + 1) : (temp.getMonth() + 1) const mounth = (temp.getMonth() + 1) < 10 ? '0' + (temp.getMonth() + 1) : (temp.getMonth() + 1)
let date = temp.getDate() <10 ? '0' + temp.getDate() : temp.getDate() const date = temp.getDate() < 10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() + return temp.getFullYear() +
"-" + '-' +
mounth + mounth +
"-" + '-' +
date date
}, },
birCancel() { birCancel () {
this.showStart = false; this.showStart = false
}, },
endTimeConfirm(value){ endTimeConfirm (value) {
this.showEnd = false this.showEnd = false
if(this.endTime == this.conversionTime(value)){ if (this.endTime == this.conversionTime(value)) {
return return
} }
this.endTime = this.conversionTime(value) this.endTime = this.conversionTime(value)
this.$set(this.startObj,'maxDate',value) this.$set(this.startObj, 'maxDate', value)
this.anginList() this.anginList()
console.log('结束时间',this.endTime); console.log('结束时间', this.endTime)
}, },
anginList(){ anginList () {
if(this.startTime !='请选择开始日期' && this.endTime!='请选择截止日期'){ if (this.startTime != '请选择开始日期' && this.endTime != '请选择截止日期') {
this.initData() this.initData()
this.getList() this.getList()
} }
}, },
endTimeCancel() { endTimeCancel () {
this.showEnd = false; this.showEnd = false
}, },
//获取工人列表 // 获取工人列表
getWorkers(){ getWorkers () {
const curParams = {} const curParams = {}
this.$http this.$http
.get(this.$myApi.GET_WORKER, curParams) .get(this.$myApi.GET_WORKER, curParams)
...@@ -559,7 +613,7 @@ export default { ...@@ -559,7 +613,7 @@ export default {
if (this.more && !this.isloading) { if (this.more && !this.isloading) {
this.isloading = true this.isloading = true
let curParams = {} let curParams = {}
if(this.curSelect.type==4){ if (this.curSelect.type == 4) {
curParams = { curParams = {
time_type: this.curSelect.type, time_type: this.curSelect.type,
page: this.page, page: this.page,
...@@ -568,7 +622,7 @@ export default { ...@@ -568,7 +622,7 @@ export default {
end: this.endTime, end: this.endTime,
status: this.curSelectStatus.statustype status: this.curSelectStatus.statustype
} }
}else{ } else {
curParams = { curParams = {
time_type: this.curSelect.type, time_type: this.curSelect.type,
page: this.page, page: this.page,
...@@ -580,12 +634,12 @@ export default { ...@@ -580,12 +634,12 @@ export default {
.get(this.$myApi.REPAIR_LIST, curParams) .get(this.$myApi.REPAIR_LIST, curParams)
.then((data) => { .then((data) => {
this.list = this.page === 1 ? data.list : this.list.concat(data.list) this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.list = this.list.map(item=>{ this.list = this.list.map(item => {
item.showWorker = false item.showWorker = false
item.workerName = [] item.workerName = []
item.realName = '' item.realName = ''
item.temporaryName=[] item.temporaryName = []
item.temporaryId=[] item.temporaryId = []
item.worker_id = [] item.worker_id = []
return item return item
}) })
...@@ -595,8 +649,8 @@ export default { ...@@ -595,8 +649,8 @@ export default {
this.isloading = false this.isloading = false
this.count = data.count this.count = data.count
this.loading = false this.loading = false
this.finished = !data.more; this.finished = !data.more
if(data.worker){ if (data.worker) {
this.worker_id = data.worker.id this.worker_id = data.worker.id
this.workerName = data.worker.name this.workerName = data.worker.name
} }
...@@ -619,7 +673,7 @@ export default { ...@@ -619,7 +673,7 @@ export default {
chooseTab (e) { chooseTab (e) {
this.tabShow = !this.tabShow this.tabShow = !this.tabShow
}, },
//点击选择工单状态 // 点击选择工单状态
chooseStatus (e) { chooseStatus (e) {
this.statusShow = !this.statusShow this.statusShow = !this.statusShow
}, },
...@@ -628,16 +682,16 @@ export default { ...@@ -628,16 +682,16 @@ export default {
if (item.type !== this.curSelect.type) { if (item.type !== this.curSelect.type) {
this.curSelect = item this.curSelect = item
this.tabShow = false this.tabShow = false
if(this.curSelect.type == 4){ if (this.curSelect.type == 4) {
this.startTime ='请选择开始日期' this.startTime = '请选择开始日期'
this.endTime='请选择截止日期' this.endTime = '请选择截止日期'
this.startObj={ this.startObj = {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
} }
this.endObj={ this.endObj = {
minDate: new Date(2021, 0, 1), minDate: new Date(2021, 0, 1),
maxDate: new Date(), maxDate: new Date()
} }
return return
} }
...@@ -647,7 +701,7 @@ export default { ...@@ -647,7 +701,7 @@ export default {
}, 0) }, 0)
} }
}, },
//订单状态变化 // 订单状态变化
changeStatus (item) { changeStatus (item) {
if (item.statustype !== this.curSelectStatus.statustype) { if (item.statustype !== this.curSelectStatus.statustype) {
this.curSelectStatus = item this.curSelectStatus = item
...@@ -676,7 +730,7 @@ export default { ...@@ -676,7 +730,7 @@ export default {
.then((data) => { .then((data) => {
this.qxShow = false this.qxShow = false
this.$toast('操作成功') this.$toast('操作成功')
this.changeList(data,index) this.changeList(data, index)
}) })
.catch(() => { .catch(() => {
this.qxShow = false this.qxShow = false
...@@ -686,10 +740,22 @@ export default { ...@@ -686,10 +740,22 @@ export default {
cancel () { cancel () {
this.qxShow = false this.qxShow = false
}, },
fetchData (to, from) {
this.getList()
this.getUserInfo()
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/admin_index.scss"; @import '@assets/styles/tabbar/admin_index.scss';
</style> </style>
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<div class="photo"> <div class="photo">
<img src="@assets/images/my/touxiang.png" alt /> <img src="@assets/images/my/touxiang.png" alt />
</div> </div>
<div class="btn">{{user.online_status_display}}</div> <div class="btn">{{ user.online_status_display }}</div>
<div class="name">{{user.name}}</div> <div class="name">{{ user.name }}</div>
<div class="group">{{user.department.name}}</div> <div class="group">{{ user.department.name }}</div>
<div class="tel flex-h" @click="goPhone"> <div class="tel flex-h" @click="goPhone">
<div class="telNumber">{{telToHide(user.phone)}}</div> <div class="telNumber">{{ telToHide(user.phone) }}</div>
<img src="@assets/images/my/bianji.png" alt /> <img src="@assets/images/my/bianji.png" alt />
</div> </div>
</div> </div>
...@@ -30,14 +30,14 @@ export default { ...@@ -30,14 +30,14 @@ export default {
user: '' user: ''
} }
}, },
created () { // created () {
this.getUserInfo() // this.getUserInfo()
}, // },
methods: { methods: {
goPhone(){ goPhone () {
this.$router.push({ this.$router.push({
path: '/modifyPhone', path: '/modifyPhone',
query:{phone:this.user.phone} query: { phone: this.user.phone }
}) })
}, },
getUserInfo () { getUserInfo () {
...@@ -46,12 +46,23 @@ export default { ...@@ -46,12 +46,23 @@ export default {
.then((res) => { .then((res) => {
this.user = res this.user = res
}) })
.catch(() => {}) .catch(() => { })
}, },
telToHide (tel) { telToHide (tel) {
var phone = tel.substr(0, 3) + '****' + tel.substring(7, 11); var phone = tel.substr(0, 3) + '****' + tel.substring(7, 11)
return phone; return phone
},
fetchData (to, from) {
this.getUserInfo()
} }
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
} }
} }
</script> </script>
......
<template> <template>
<div class="cont"> <div class="cont">
<div class="tel"> <div class="tel">
<input v-model.trim="old_tel" maxlength="11" type="tel" placeholder="请输入原手机号" /> <input
v-model.trim="old_tel"
maxlength="11"
type="tel"
placeholder="请输入原手机号"
/>
</div> </div>
<div class="tel"> <div class="tel">
<input v-model.trim="tel" maxlength="11" type="tel" placeholder="请输入新的手机号" /> <input
v-model.trim="tel"
maxlength="11"
type="tel"
placeholder="请输入新的手机号"
/>
</div> </div>
<div class="code flex-h"> <div class="code flex-h">
<van-field class="code_field" v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" /> <van-field
<div class="getCode" @click="getCode">{{buttonText}}</div> class="code_field"
v-model.trim="code"
type="text"
placeholder="请输入验证码"
maxlength="6"
/>
<div class="getCode" @click="getCode">{{ buttonText }}</div>
</div> </div>
<div class="submit-btn" @click="submit">提交</div> <div class="submit-btn" @click="submit">提交</div>
</div> </div>
...@@ -18,7 +34,7 @@ ...@@ -18,7 +34,7 @@
export default { export default {
data () { data () {
return { return {
old_tel: '',//旧手机号 old_tel: '', // 旧手机号
tel: '', // 手机号 tel: '', // 手机号
code: '', // 验证码 code: '', // 验证码
buttonText: '获取验证码', buttonText: '获取验证码',
...@@ -29,7 +45,7 @@ export default { ...@@ -29,7 +45,7 @@ export default {
}, },
methods: { methods: {
checkData () { checkData () {
if(!this.checkCon()){ if (!this.checkCon()) {
return return
} }
if (this.code.length !== 6) { if (this.code.length !== 6) {
...@@ -38,7 +54,7 @@ export default { ...@@ -38,7 +54,7 @@ export default {
} }
return true return true
}, },
checkCon(){ checkCon () {
if (this.old_tel != this.$route.query.phone) { if (this.old_tel != this.$route.query.phone) {
this.$toast('请正确输入原手机号码') this.$toast('请正确输入原手机号码')
return false return false
...@@ -55,7 +71,7 @@ export default { ...@@ -55,7 +71,7 @@ export default {
}, },
getCode () { getCode () {
if (this.isSending) return if (this.isSending) return
if(!this.checkCon()){ if (!this.checkCon()) {
return return
} }
const curParams = { const curParams = {
...@@ -68,7 +84,7 @@ export default { ...@@ -68,7 +84,7 @@ export default {
this.isSending = true this.isSending = true
this.countDown() this.countDown()
}) })
.catch(() => {}) .catch(() => { })
}, },
countDown () { countDown () {
let seconds = 60 let seconds = 60
...@@ -93,7 +109,7 @@ export default { ...@@ -93,7 +109,7 @@ export default {
this.$toast('修改成功') this.$toast('修改成功')
this.$router.go(-1) this.$router.go(-1)
}) })
.catch(() => {}) .catch(() => { })
}, },
fetchData (to, from) { fetchData (to, from) {
this.tel = '' // 手机号 this.tel = '' // 手机号
...@@ -119,5 +135,5 @@ export default { ...@@ -119,5 +135,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@assets/styles/tabbar/modifyPhone.scss"; @import '@assets/styles/tabbar/modifyPhone.scss';
</style> </style>
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