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

'修改,'

parent dace08b0
File added
......@@ -10,8 +10,8 @@ const baseUrl = '/api'
// todo: url
// const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const httpUrl = 'https://repair.zeruiedu.com' // 正式接口
const h5Url = 'http://localhost:8080' // 测试h5线上地址
// const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
// const h5Url = 'http://localhost:8080' // 测试h5线上地址
const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
window.localStorage.setItem('httpUrl', httpUrl)
window.localStorage.setItem('h5Url', h5Url)
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
......
......@@ -53,7 +53,7 @@ service.interceptors.response.use(
}, (err) => {
resolve(err)
window.localStorage.clear()
Toast('身份失效,请重新登录')
Toast('身份失效,请重新登录11111')
window.document.location = selfApi.WINDOWHREF_LOGIN // url-
console.log('错误--------', err)
})
......
var wx = require('weixin-js-sdk')
import axios from 'axios'
import apiList from './apiList'
import myAxios from './index'
import {
Toast
} from 'vant'
var wx = require('weixin-js-sdk')
// 微信分享方法
const share = (param) => {
Toast.loading({
message: "加载中...",
duration: 1000, //持续展示 toast
message: '加载中...',
duration: 1000 // 持续展示 toast
})
const successCall = (res) => {
console.log('res', res)
Toast.clear()
let result = res.conf
const result = res.conf
// let result = res.data
// let {
// wxConfig,
......@@ -68,7 +68,7 @@ const share = (param) => {
menuList: hideMenuItems
})
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) => {
successCall(res)
Toast.clear()
})
.catch(() => {})
.catch(() => { })
}
export {
......
......@@ -121,6 +121,7 @@
}
.bz-title{
margin-bottom: 0.2rem;
color: #ff0000;
}
.one {
color: #727272;
......
......@@ -7,11 +7,11 @@ import myApi from './api/apiList'
import myAxios from './api/index'
import Vant from 'vant'
import 'vant/lib/index.css'
import vConsole from '@/plugins/vconsole.js'
// import vConsole from '@/plugins/vconsole.js'
import listTips from '@/components/common/listtips.vue'
Vue.component('listTips', listTips)
Vue.use(vConsole)
// Vue.use(vConsole)
Vue.config.productionTip = false
......
......@@ -7,12 +7,22 @@
<div>
<div class="filed-list">
<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 class="filed-list code-cont">
<img class="icon-img" src="@assets/images/login/yzm.png" />
<van-field v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="code-btn" @click="getCode">{{buttonText}}</div>
<van-field
v-model.trim="code"
type="text"
placeholder="请输入验证码"
maxlength="6"
/>
<div class="code-btn" @click="getCode">{{ buttonText }}</div>
</div>
</div>
<div class="login-btn" @click="goLogin">立即登录</div>
......@@ -64,7 +74,7 @@ export default {
this.isSending = true
this.countDown()
})
.catch(() => {})
.catch(() => { })
},
countDown () {
let seconds = 60
......@@ -81,19 +91,19 @@ export default {
goLogin () {
if (this.checkData()) return true
const curParams = {
tel: this.tel,
tel: this.tel,
code: this.code
}
this.$http.post(this.$myApi.BINDLOGIN, curParams)
.then(res => {
const httpUrl = window.localStorage.getItem('httpUrl')
const httpUrl = window.localStorage.getItem('httpUrl')
const h5Url = window.localStorage.getItem('h5Url')
const wxLogin = window.localStorage.getItem('wxLogin')
const t = res.role == 3 ? h5Url : `${h5Url}/admin_home` // 测试h5线上地址
let url = `${httpUrl}${wxLogin}?callBack=${t}&scopes=snsapi_userinfo&type=1`
window.document.location = url // url-
})
.catch(() => {})
.catch(() => { })
},
fetchData (to, from) {
this.tel = '' // 手机号
......@@ -118,5 +128,5 @@ export default {
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/login/login.scss";
@import '@assets/styles/login/login.scss';
</style>
<template>
<div class="cont" v-if="order">
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item">
<div class="item flex-h flex-vc">
<div class="title">{{order.order_status_display}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{order.repair_type.type_name}}-{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{order.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{order.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image,index)"
>
<img :src="child.url" alt />
</div>
</div>
<div v-if="order.work_name">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{order.work_name}}</div>
</div>
</div>
<div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in order.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index">
<div class="ma-item flex-h flex-hb" v-for="(child, index) in parent.goods" :key="index">
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{order.orderlog_transfer.remark}}</div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{order.orderlog_cancel.remark}}</div>
</div>
<div v-if="order.is_can_assign_worker==1">
<div class="line"></div>
<div
v-if="order.is_can_assign_worker==1"
class="item flex-h flex-vc flex-hb"
@click="workers"
>
<div class="wo flex-h flex-vc">
<div class="item-title" v-if="order.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">{{workerName.length ? workerName.join(',') : ''}}</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
</div>
</div>
</div>
</div>
<div class="line"></div>
<div class="allBtn flex-h flex-hr">
<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>
<!-- 选择工人弹窗 -->
<van-popup v-model="showWorker" round>
<div class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers">
<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
class="people-item flex-h flex-vc flex-hb"
v-for="(lchild_item,lchild_index) in child_item.user"
:key="lchild_index"
@click="chooseWorker(lchild_item,lchild_index)"
>
<div class="flex-h flex-vc">
<img class="gr-img" :src="gr_img" />
<div
class="gr-name"
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>
<div class="cont" v-if="order">
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item">
<div class="item flex-h flex-vc">
<div class="title">{{ order.order_status_display }}</div>
</div>
<div class="item-title">问题描述:</div>
<div
class="item-desc que-desc"
>{{ order.repair_type.type_name }}-{{ order.description }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">
{{ order.region.region_name }}-{{
order.room.room_name
}}-{{ order.address }}
</div>
<img
class="k-img"
:src="temporaryId && temporaryId.includes(lchild_item.id) ? select_img : unselect_img"
/>
</div>
</div>
<div v-else class="none">暂无员工</div>
</div>
</div>
<div class="allBtn btn-box flex-h flex-hc">
<div class="button" @click="Cancel">取消</div>
<div class="button sureBtn" @click="keyConfirm">确定</div>
</div>
</div>
</van-popup>
<!-- 取消工单原因弹窗 -->
<van-popup v-model="qxShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注取消原因</div>
<textarea placeholder="请输入转单理由" v-model="reason" maxlength="100"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="qx_submit">提交</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{ order.realname }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{ order.telephone }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image, index)"
>
<img :src="child.url" alt />
</div>
</div>
<div v-if="order.work_name">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{ order.work_name }}</div>
</div>
</div>
<div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in order.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order
.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
@click="showAll(item, $event)"
>{{ child.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{ order.orderlog_transfer.remark }}</div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{ order.orderlog_cancel.remark }}</div>
</div>
<div v-if="order.is_can_assign_worker == 1">
<div class="line"></div>
<div
v-if="order.is_can_assign_worker == 1"
class="item flex-h flex-vc flex-hb"
@click="workers"
>
<div class="wo flex-h flex-vc">
<div class="item-title" v-if="order.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">
{{
workerName.length
? workerName.join(',')
: ''
}}
</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
</div>
</div>
</div>
</div>
<div class="line"></div>
<div class="allBtn flex-h flex-hr">
<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>
<!-- 选择工人弹窗 -->
<van-popup v-model="showWorker" round>
<div class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers">
<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
class="people-item flex-h flex-vc flex-hb"
v-for="(
lchild_item, lchild_index
) in child_item.user"
:key="lchild_index"
@click="chooseWorker(lchild_item,lchild_index)"
>
<div class="flex-h flex-vc">
<img class="gr-img" :src="grImg" />
<div
class="gr-name"
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>
</div>
<img
class="k-img"
:src="temporaryId && temporaryId.includes(lchild_item.id) ? selectImg: unselectImg"
/>
</div>
</div>
<div v-else class="none">暂无员工</div>
</div>
</div>
<div class="allBtn btn-box flex-h flex-hc">
<div class="button" @click="Cancel">取消</div>
<div class="button sureBtn" @click="keyConfirm">确定</div>
</div>
</div>
</van-popup>
<!-- 取消工单原因弹窗 -->
<van-popup v-model="qxShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注取消原因</div>
<textarea placeholder="请输入转单理由" v-model="reason" maxlength="100"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="qx_submit">提交</div>
</div>
</div>
</van-popup>
</div>
</div>
</van-popup>
</div>
</van-pull-refresh>
<div class="backBtn" @click="goBack">
<img src="@assets/images/tabbar/icon_01_sel.png" alt />
</van-pull-refresh>
<div class="backBtn" @click="goBack">
<img src="@assets/images/tabbar/icon_01_sel.png" alt />
</div>
</div>
</div>
</template>
<script>
import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview, CellGroup } from 'vant';
import select_img from '@assets/images/select.png'
import unselect_img from '@assets/images/un_select.png'
import gr_img from '@assets/images/gr.png'
// import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview } from 'vant'
import selectImg from '@assets/images/select.png'
import unselectImg from '@assets/images/un_select.png'
import grImg from '@assets/images/gr.png'
export default {
name: 'admin_detail',
data () {
name: 'admin_detail',
data () {
return {
showWorker: false,
select_img,
unselect_img,
gr_img,
reson: '',//取消原因
showWorker: false,
selectImg,
unselectImg,
grImg,
reson: '', // 取消原因
qxShow: false, // 发起转单弹窗
workerName: '',
worker_id: '',
showWorker: false,
columns: [],
locked: false,
// 上拉加载
......@@ -206,85 +241,84 @@ export default {
imgList: [],
// 转单
reason: '', // 原因
currentId: '',
order: null,
order_id: '',
temporaryName: '',
temporaryId: '',
currentId: '',
order: null,
order_id: '',
temporaryName: '',
temporaryId: ''
}
},
created () {
this.order_id = this.$route.query.id
// this.order_id = 211
this.getDetail()
this.getWorkers()
},
methods: {
goBack(){
},
// created () {
// this.order_id = this.$route.query.id
// this.getDetail()
// this.getWorkers()
// },
methods: {
goBack () {
this.$router.push({
path: '/'
}).catch(()=>{})
}).catch(() => { })
},
getDetail () {
this.isloading = true
getDetail () {
this.isloading = true
const curParams = {
repair_order_id: this.order_id
repair_order_id: this.order_id
}
this.$http.get(this.$myApi.ORDER_INFO, curParams)
.then(res => {
this.order = res.order
this.workerName = []
this.temporaryName=[]
this.temporaryId=[]
this.worker_id = []
this.locked = false
this.isloading = false
this.order = res.order
this.workerName = []
this.temporaryName = []
this.temporaryId = []
this.worker_id = []
this.locked = false
this.isloading = false
})
.catch(() => {
this.locked = false
this.isloading = false
})
},
// 选择完工人点击确定按钮
keyConfirm(){
console.log('this.temporaryId',this.temporaryId);
console.log('this.temporaryName',this.temporaryName);
if(!this.temporaryId.length){
this.$toast('请选择工人!')
return
}
this.workerName = [...this.temporaryName]
this.worker_id = [...this.temporaryId]
this.showWorker = false
},
chooseWorker(item,lchild_index){
console.log('11111111111',item,item.id,item.name,lchild_index);
if(this.temporaryId.includes(item.id)){ // 删除
let name_i = this.temporaryId.indexOf(item.id)
this.temporaryId.splice(name_i,1)
this.temporaryName.splice(name_i,1)
}else{ // 加入
this.temporaryId.push(item.id)
this.temporaryName.push(item.name)
}
},
preview(img, index){
let temp = img.map(item=>{
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
},
callPhone(item){
let phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
//指派工人
sureOrder(){
this.locked = false
this.isloading = false
})
},
// 选择完工人点击确定按钮
keyConfirm () {
console.log('this.temporaryId', this.temporaryId)
console.log('this.temporaryName', this.temporaryName)
if (!this.temporaryId.length) {
this.$toast('请选择工人!')
return
}
this.workerName = [...this.temporaryName]
this.worker_id = [...this.temporaryId]
this.showWorker = false
},
chooseWorker (item, lchild_index) {
console.log('11111111111', item, item.id, item.name, lchild_index)
if (this.temporaryId.includes(item.id)) { // 删除
const name_i = this.temporaryId.indexOf(item.id)
this.temporaryId.splice(name_i, 1)
this.temporaryName.splice(name_i, 1)
} else { // 加入
this.temporaryId.push(item.id)
this.temporaryName.push(item.name)
}
},
preview (img, index) {
const temp = img.map(item => {
return item.url
})
ImagePreview({
images: temp,
startPosition: index
})
},
callPhone (item) {
const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
// 指派工人
sureOrder () {
const vm = this
if(!this.worker_id.length) {
if (!this.worker_id.length) {
this.$toast('请选择工人')
return
}
......@@ -295,40 +329,40 @@ export default {
this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams)
.then((data) => {
console.log('指派工人',data);
this.$toast('操作成功')
this.workerName = []
this.temporaryName=[]
this.temporaryId=[]
this.worker_id = []
console.log('指派工人', data)
this.$toast('操作成功')
this.workerName = []
this.temporaryName = []
this.temporaryId = []
this.worker_id = []
this.reason = ''
this.order = data
this.order = data
})
.catch(() => {})
.catch(() => { })
},
// 取消工单
cancelOrder(){
this.qxShow = true;
cancelOrder () {
this.qxShow = true
this.reason = ''
},
workers(){
this.showWorker = true
workers () {
this.showWorker = true
},
Cancel(){
this.showWorker = false
Cancel () {
this.showWorker = false
},
//获取工人列表
getWorkers(){
// 获取工人列表
getWorkers () {
const curParams = {}
this.$http
.get(this.$myApi.GET_WORKER, curParams)
.then((data) => {
this.columns = data
})
.catch(() => {
})
this.$http
.get(this.$myApi.GET_WORKER, curParams)
.then((data) => {
this.columns = data
})
.catch(() => {
})
},
// 初始化
initData () {
......@@ -360,8 +394,8 @@ export default {
.post(this.$myApi.REPAIR_CANCEL, curParams)
.then((data) => {
this.qxShow = false
this.$toast('操作成功')
this.order = data
this.$toast('操作成功')
this.order = data
})
.catch(() => {
this.qxShow = false
......@@ -371,11 +405,28 @@ export default {
cancel () {
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>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/admin_index.scss";
</style>
\ No newline at end of file
@import '@assets/styles/tabbar/admin_index.scss';
</style>
......@@ -2,51 +2,68 @@
<div class="cont" v-if="order">
<div class="top">
<div class="item flex-h flex-vc">
<div class="title">维修类目:</div>
<div class="title">{{order.repair_type.type_name}}</div>
<div class="title">维修类目:</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 class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{order.repair_type.type_name}}-{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
<div class="item-title">服务地址:</div>
<div class="item-desc">
{{ order.region.region_name }}-{{ order.room.room_name }}-{{
order.address
}}
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{order.realname}}</div>
<div class="item-title">客户姓名</div>
<div class="item-desc">{{ order.realname }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{order.telephone}}</div>
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">
{{ order.telephone }}
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-title">提交时间</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div class="img flex-h" v-for="(child, index) in order.image" :key="index" @click="preview(order.image,index)">
<div class="item-title">图片详情:</div>
<div
class="img flex-h"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image, index)"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div class="things">
<div class="things_title">所需耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index" >
<div class="item flex-h flex-hb" @click="showZl(index)" >
<div
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="title_left">耗材种类</div>
<div class="title_r">{{item.zl}}</div>
<div class="title_r">{{ item.zl }}</div>
</div>
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
</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="title_left">耗材名称</div>
<div class="title_r">{{item.mc}}</div>
<div class="title_r">{{ item.mc }}</div>
</div>
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
......@@ -55,33 +72,52 @@
</div>
<div class="item flex-h flex-vc">
<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)" /> -->
</div>
<div class="item flex-h flex-vc">
<div class="title_left">耗材单价</div>
<div class="title_r">{{item.single_price}}</div>
<div class="title_r">{{ item.single_price }}</div>
</div>
<div v-if="addList.length>1" class="delete-btn" @click="delMeth(index)">
<img src="@assets/images/lajitong.png" alt="">
<div
v-if="addList.length > 1"
class="delete-btn"
@click="delMeth(index)"
>
<img src="@assets/images/lajitong.png" alt="" />
</div>
<!-- 种类弹窗 -->
<van-popup v-model="item.zlSelect" round position="bottom" >
<van-popup v-model="item.zlSelect" round position="bottom">
<van-picker
show-toolbar
:columns="types"
value-key="goods_name"
@confirm="(value)=>{typeConfirm(value,index)}"
@confirm="
(value) => {
typeConfirm(value, index)
}
"
@cancel="typeCancel(index)"
/>
</van-popup>
<van-popup v-model="item.mcSelect" round position="bottom" >
<van-popup v-model="item.mcSelect" round position="bottom">
<van-picker
show-toolbar
:columns="hcName"
value-key="goods_name"
@confirm="(value)=>{hcConfirm(value,index)}"
@confirm="
(value) => {
hcConfirm(value, index)
}
"
@cancel="hcCancel(index)"
/>
</van-popup>
......@@ -89,95 +125,96 @@
<div class="line"></div>
<div class="add-btn flex-h flex-vc flex-hb">
<!-- <div v-if="addList.length>1" class="del-btn" @click="delMeth" >-删除耗材</div> -->
<div class="add-btn" @click="addMeth" >+新增耗材</div>
<div class="add-btn" @click="addMeth">+新增耗材</div>
</div>
</div>
<div class="blank"></div>
<!-- 底部 -->
<div class="bottom flex-h flex-hb flex-vc">
<div class="left">
<span>{{goods_number}}</span>件,总金额:
<!-- <span v-if="isNaN(total_price)">¥暂无</span> -->
<span>{{total_price}}</span>
</div>
<div class="skBtn" @click="launch(repair_order_id)">发起收款</div>
</div>
<div class="blank"></div>
<!-- 底部 -->
<div class="bottom flex-h flex-hb flex-vc">
<div class="left">
<span>{{ goods_number }}</span
>件,总金额:
<!-- <span v-if="isNaN(total_price)">¥暂无</span> -->
<span>{{ total_price }}</span>
</div>
<div class="skBtn" @click="launch(repair_order_id)">发起收款</div>
</div>
<!-- 底部返回按钮 -->
<div class="backBtn" @click="goBack">
<img src="@assets/images/back3.png" alt="">
<img src="@assets/images/back3.png" alt="" />
</div>
</div>
</div>
</template>
<script>
import { ImagePreview } from 'vant';
import { ImagePreview } from 'vant'
export default {
name: 'charge',
data () {
return {
addList:[
{
zl:'',
mc:'',
number:'',
single_price: '暂无',
zlSelect:false,
mcSelect: false,
parent_id: '',
goods_id: '',
}
],
showPicker: false,
types: [],
type_name: '请选择',
hcName: [],
hc_name: '请选择',
hcPicker: false,
hcNum: '',
repair_order_id: '',
order: '',
hcList: [],
addList: [
{
zl: '',
mc: '',
number: '',
single_price: '暂无',
zlSelect: false,
mcSelect: false,
parent_id: '',
goods_id: ''
}
],
showPicker: false,
types: [],
type_name: '请选择',
hcName: [],
hc_name: '请选择',
hcPicker: false,
hcNum: '',
repair_order_id: '',
order: '',
hcList: [],
total_price: 0,
hc_price: '',
goods_number: 0,
goods_number: 0
}
},
created () {
this.repair_order_id = this.$route.query.id
this.getDetail()
},
watch:{
addList:{
handler(newValue,oldValue){
let filterValue = newValue.filter(item=>{
watch: {
addList: {
handler (newValue, oldValue) {
const filterValue = newValue.filter(item => {
return (item.zl && item.mc && item.number)
})
if(filterValue.length){
if (filterValue.length) {
this.getMonery(filterValue)
}else{
this.total_price = 0
} else {
this.total_price = 0
}
},
deep:true
},
deep: true
}
},
methods: {
goBack(){
this.$router.go(-1);
goBack () {
this.$router.go(-1)
},
callPhone(order){
let phoneNumber = order.telephone
callPhone (order) {
const phoneNumber = order.telephone
window.location.href = 'tel://' + phoneNumber
},
preview(img, index){
let temp = img.map(item=>{
preview (img, index) {
const temp = img.map(item => {
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
startPosition: index
})
},
getDetail () {
const curParams = {
......@@ -185,29 +222,29 @@ export default {
}
this.$http.get(this.$myApi.REPAIR_ORDER_DETAIL, curParams)
.then(res => {
this.order = res.order
var arr = []
for(let i in res.material){
arr.push({
id: res.material[i].id,
goods_name: res.material[i].goods_name,
son: res.material[i].son
})
}
this.types = arr
this.order = res.order
var arr = []
for (const i in res.material) {
arr.push({
id: res.material[i].id,
goods_name: res.material[i].goods_name,
son: res.material[i].son
})
}
this.types = arr
})
.catch(() => {})
.catch(() => { })
},
showZl(index){
this.addList[index].zlSelect = true
},
typeConfirm(value, index) {
if(value.id == this.addList[index].parent_id){
showZl (index) {
this.addList[index].zlSelect = true
},
typeConfirm (value, index) {
if (value.id == this.addList[index].parent_id) {
this.addList[index].zlSelect = false
return
}
this.hcList = value
this.addList[index].zl = value.goods_name
this.hcList = value
this.addList[index].zl = value.goods_name
this.addList[index].zlSelect = false
this.addList[index].parent_id = value.id
// 当重新选择耗材种类时要清空之前选择的耗材
......@@ -215,58 +252,57 @@ export default {
this.addList[index].mc = ''
this.addList[index].single_price = ''
var childArr = []
for(let i in value.son){
childArr.push({
id: value.son[i].id,
goods_name: value.son[i].goods_name,
single_price: value.son[i].price
})
}
var childArr = []
for (const i in value.son) {
childArr.push({
id: value.son[i].id,
goods_name: value.son[i].goods_name,
single_price: value.son[i].price
})
}
this.hcName = childArr
// this.getMonery()
},
typeCancel(index) {
this.addList[index].zlSelect = false
},
showHc(index){
this.addList[index].mcSelect = true
},
hcConfirm(value, index) {
this.addList[index].mc = value.goods_name
this.addList[index].single_price = value.single_price
},
typeCancel (index) {
this.addList[index].zlSelect = false
},
showHc (index) {
this.addList[index].mcSelect = true
},
hcConfirm (value, index) {
this.addList[index].mc = value.goods_name
this.addList[index].single_price = value.single_price
this.addList[index].mcSelect = false
this.addList[index].goods_id = value.id
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
})
// this.getMonery()
// this.getMonery()
},
changeInput(e,index){
changeInput (e, index) {
this.hc_number = e.target.value
this.totalCount()
},
getMonery(filterList){
getMonery (filterList) {
let total_price = 0
filterList.map(item=>{
filterList.map(item => {
total_price += Number(item.number) * Number(item.single_price)
})
this.total_price = Number(total_price)
// console.log('总价钱',total_price);
},
totalCount(){
totalCount () {
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)
}
this.goods_number = count
},
hcCancel(index) {
this.addList[index].mcSelect = false
},
hcCancel (index) {
this.addList[index].mcSelect = false
},
addMeth () {
this.addList.push({
zl: '',
......@@ -277,47 +313,46 @@ export default {
mcSelect: false
})
},
delMeth(index){
delMeth (index) {
this.$dialog.confirm({
title: '提示',
message: '确认删除吗?'
}).then(()=>{
this.addList.splice(index,1)
}).then(() => {
this.addList.splice(index, 1)
// this.getMonery()
this.totalCount()
})
.catch(() => {})
},
launch(id){
let bool = this.addList.every(item=>{
.catch(() => { })
},
launch (id) {
const bool = this.addList.every(item => {
return item.number && item.mc && item.zl
})
if(!bool){
if (!bool) {
this.$toast.fail('请输入完整')
return
}
for(let i = 0; i<this.addList.length;i++){
if(this.addList[i].number == 0){
for (let i = 0; i < this.addList.length; i++) {
if (this.addList[i].number == 0) {
this.$toast('耗材个数不能为0')
return
}
}
const curParams = {
repair_order_id: this.repair_order_id,
const curParams = {
repair_order_id: this.repair_order_id,
goods: this.addList
}
// const _this = this
this.$http.post(this.$myApi.REPAIR_ORDER, curParams)
.then(res => {
console.log('执行了吗');
console.log('执行了吗')
this.$toast.success('发起成功')
this.$router.go(-1)
})
.catch(() => {})
},
},
.catch(() => { })
}
}
}
</script>
......@@ -327,7 +362,7 @@ export default {
background: #fff;
padding-top: 0.2rem;
}
.backBtn{
.backBtn {
width: 1rem;
height: 1rem;
background: #fff;
......@@ -339,7 +374,7 @@ export default {
border-radius: 50%;
padding: 0.1rem;
}
.backBtn img{
.backBtn img {
width: 100%;
height: 100%;
border-radius: 50%;
......@@ -366,7 +401,7 @@ export default {
font-size: 0.3rem;
white-space: nowrap;
}
.hc_field{
.hc_field {
padding: 0;
}
.item-desc {
......@@ -386,7 +421,7 @@ export default {
border-radius: 0.08rem;
margin-top: 0.8rem;
margin-right: 0.16rem;
border-radius: 0.08rem;
border-radius: 0.08rem;
}
.img img {
width: 100%;
......@@ -432,7 +467,7 @@ export default {
.add-btn {
color: #0054ff;
font-size: 0.3rem;
margin: 0.2rem auto 0 ;
margin: 0.2rem auto 0;
}
.list-item {
margin-bottom: 0.8rem;
......@@ -445,7 +480,7 @@ export default {
bottom: 0rem;
right: 0rem;
}
.delete-btn img{
.delete-btn img {
width: 100%;
height: 100%;
}
......@@ -490,4 +525,4 @@ export default {
color: #ffffff;
font-size: 0.26rem;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="cont">
<div class="evaluate-cont">
<div class="title">整体评价</div>
<van-rate readonly void-icon="star" v-model="totalStar" void-color="#eee" color="#FFA300" />
<div class="eva_detail">详细评价</div>
<div class="flex-h star-item">
<div class="left_title">速度</div>
<van-rate readonly void-icon="star" v-model="speedStar" void-color="#eee" color="#FFA300" />
</div>
<div class="flex-h star-item">
<div class="left_title">质量</div>
<van-rate readonly void-icon="star" v-model="qualityStar" void-color="#eee" color="#FFA300" />
</div>
<div class="flex-h star-item">
<div class="left_title">态度</div>
<van-rate readonly void-icon="star" v-model="attitudeStar" void-color="#eee" color="#FFA300" />
</div>
<div class="line"></div>
<div class="comments">
<div class="title">评价内容</div>
<div class="content">{{comment.content}}</div>
</div>
<div class="cont">
<div class="evaluate-cont">
<div class="title">整体评价</div>
<van-rate
readonly
void-icon="star"
v-model="totalStar"
void-color="#eee"
color="#FFA300"
/>
<div class="eva_detail">详细评价</div>
<div class="flex-h star-item">
<div class="left_title">速度</div>
<van-rate
readonly
void-icon="star"
v-model="speedStar"
void-color="#eee"
color="#FFA300"
/>
</div>
<div class="flex-h star-item">
<div class="left_title">质量</div>
<van-rate
readonly
void-icon="star"
v-model="qualityStar"
void-color="#eee"
color="#FFA300"
/>
</div>
<div class="flex-h star-item">
<div class="left_title">态度</div>
<van-rate
readonly
void-icon="star"
v-model="attitudeStar"
void-color="#eee"
color="#FFA300"
/>
</div>
<div class="line"></div>
<div class="comments">
<div class="title">评价内容</div>
<div class="content">{{ comment.content }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return{
data () {
return {
totalStar: 0,
speedStar: 0,
qualityStar: 0,
attitudeStar:0,
attitudeStar: 0,
repair_order_id: '',
comment: '',
comment: ''
}
},
created () {
console.log('接收的id啊',this.$route.query.id);
console.log('接收的id啊', this.$route.query.id)
this.repair_order_id = this.$route.query.id
this.look_comment()
// this.getStatus()
......@@ -58,12 +82,12 @@ export default {
this.attitudeStar = Number(data.attitude_stars)
this.totalStar = Number(data.stars)
})
.catch(() => {})
},
.catch(() => { })
}
}
}
</script>
<style lang="scss" scoped>
@import "@assets/styles/my/lookEvaluate.scss";
</style>
\ No newline at end of file
@import '@assets/styles/my/lookEvaluate.scss';
</style>
<template>
<div class="cont" v-if="order">
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item">
<div class="item flex-h flex-vc">
<div
class="title"
v-if="order.pid==0&&order.son_count>0"
>{{order.order_status_display}}(负责人)</div>
<div class="title" v-else>{{order.order_status_display}}</div>
</div>
<div class="item-title">问题描述:</div>
<div class="item-desc que-desc">{{order.repair_type.type_name}}-{{order.description}}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div
class="item-desc"
>{{order.region.region_name}}-{{order.room.room_name}}-{{order.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{order.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{order.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image,index)"
>
<img :src="child.url" alt />
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{order.work_name}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{order.telephone}}</div>
</div>
<div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in order.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index">
<div class="ma-item flex-h flex-hb" v-for="(child, index) in parent.goods" :key="index">
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{order.orderlog_transfer.remark}}</div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{order.orderlog_cancel.remark}}</div>
</div>
<div class="btn flex-h flex-hr" v-if="btnShow">
<div v-if="order.is_can_remark_material==1" class="btn-item bz-btn" @click="bz_click">备注耗材</div>
<div
v-if="order.is_can_confirm_complete==1"
class="btn-item qr-btn"
@click="sure_click()"
>确认完成</div>
<div
v-if="order.is_can_initiate_charge==1"
class="btn-item sf-btn"
@click="tz_charge(order.id)"
>发起收费</div>
<div
v-if="order.is_can_initiate_transfer_order==1"
class="btn-item"
@click="zd_click"
>发起转单</div>
<div v-if="order.is_can_back==1" class="btn-item" @click="back_click">发起退回</div>
<div v-if="order.is_can_begin_repair==1" class="btn-item" @click="starRepir">开始维修</div>
<div v-if="order.is_can_see_material==1" class="btn-item sf-btn" @click="look_click">查看耗材</div>
</div>
<!-- 弹窗 -->
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index">
<input
class="input"
maxlength="20"
v-model="item.goods_name"
type="text"
placeholder="请输入耗材名称"
/>
<van-field
class="hc_field"
v-model.number="item.number"
type="number"
placeholder="请输入耗材个数"
maxlength="3"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由" maxlength="20" v-model="reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="zd_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起退回弹窗 -->
<van-popup v-model="backShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注退回原因</div>
<textarea placeholder="请输入退回理由" maxlength="100" v-model="back_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="back_cancel">取消</div>
<div class="sure" @click="back_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">查看耗材</div>
<div class="tc_line"></div>
<div
class="ma-item one-item flex-h flex-vc"
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div
class="one one1 one_title text-line-one"
>{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div>
<div class="one one2 flex-h">
<div class="cont" v-if="order">
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<div class="order-item">
<div class="item flex-h flex-vc">
<div
class="title"
v-if="order.pid == 0 && order.son_count > 0"
>{{ order.order_status_display }}(负责人)</div>
<div class="title" v-else>{{ order.order_status_display }}</div>
</div>
<div class="item-title">问题描述:</div>
<div
class="_one text-line-one"
>{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div>
<div class="_two text-line-one">*{{item.number}}</div>
</div>
<div class="one one3">{{item.price}}</div>
class="item-desc que-desc"
>{{ order.repair_type.type_name }}-{{ order.description }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">服务地址:</div>
<div class="item-desc">
{{ order.region.region_name }}-{{
order.room.room_name
}}-{{ order.address }}
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{ order.realname }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(order)">{{ order.telephone }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">2021-06-17 09:28:43</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">图片详情:</div>
<div
class="img"
v-for="(child, index) in order.image"
:key="index"
@click="preview(order.image, index)"
>
<img :src="child.url" alt />
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{ order.work_name }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{ order.telephone }}</div>
</div>
<div class="material" v-if="order.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in order.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in order.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="order.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in order.free_material_order
.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
@click="showAll(item, $event)"
>{{ child.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{ order.orderlog_transfer.remark }}</div>
</div>
<div class="item flex-h flex-start" v-if="order.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{ order.orderlog_cancel.remark }}</div>
</div>
<div class="btn flex-h flex-hr" v-if="btnShow">
<div
v-if="order.is_can_remark_material == 1"
class="btn-item bz-btn"
@click="bz_click"
>备注耗材</div>
<div
v-if="order.is_can_confirm_complete == 1"
class="btn-item qr-btn"
@click="sure_click()"
>确认完成</div>
<div
v-if="order.is_can_initiate_charge == 1"
class="btn-item sf-btn"
@click="tz_charge(order.id)"
>发起收费</div>
<div
v-if="order.is_can_initiate_transfer_order == 1"
class="btn-item"
@click="zd_click"
>发起转单</div>
<div v-if="order.is_can_back == 1" class="btn-item" @click="back_click">发起退回</div>
<div
v-if="order.is_can_begin_repair == 1"
class="btn-item"
@click="starRepir"
>开始维修</div>
<div
v-if="order.is_can_see_material == 1"
class="btn-item sf-btn"
@click="look_click"
>查看耗材</div>
</div>
<!-- 弹窗 -->
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item, index) in addList" :key="index">
<input
class="input"
maxlength="20"
v-model="item.goods_name"
type="text"
placeholder="请输入耗材名称"
/>
<van-field
class="hc_field"
v-model.number="item.number"
type="number"
placeholder="请输入耗材个数"
maxlength="3"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length > 1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由" maxlength="20" v-model="reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="zd_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起退回弹窗 -->
<van-popup v-model="backShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注退回原因</div>
<textarea placeholder="请输入退回理由" maxlength="100" v-model="back_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="back_cancel">取消</div>
<div class="sure" @click="back_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">查看耗材</div>
<div class="tc_line"></div>
<div
class="ma-item one-item flex-h flex-vc"
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div class="one one1 one_title text-line-one">
{{
item.parent_detail
? item.parent_detail.goods_name
: '其它'
}}
</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">
{{
item.is_free == 2
? item.good_detail.goods_name
: item.goods_name
}}
</div>
<div class="_two text-line-one">*{{ item.number }}</div>
</div>
<div class="one one3">{{ item.price }}</div>
</div>
<div class="hc_total">
共计{{ expend_detail.number }}件,总价: ¥{{
expend_detail.price
}}
</div>
<div class="sure-btn" @click="cancel">确定</div>
</div>
</van-popup>
</div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div>
</div>
</van-popup>
</div>
</van-pull-refresh>
<div class="backBtn" @click="goBack">
<img src="@assets/images/tabbar/icon_01_sel.png" alt />
</van-pull-refresh>
<div class="backBtn" @click="goBack">
<img src="@assets/images/tabbar/icon_01_sel.png" alt />
</div>
</div>
<div v-else>
<img class="none-img" src="https://img01.yzcdn.cn/vant/empty-image-default.png" />
<p class="none-p">暂无工单哦!</p>
</div>
</div>
<div v-else>
<img class="none-img" src="https://img01.yzcdn.cn/vant/empty-image-default.png">
<p class="none-p">暂无工单哦!</p>
</div>
</template>
<script>
import { ImagePreview } from 'vant';
import { ImagePreview } from 'vant'
import { trimStrSpace } from '@assets/js/format.js'
export default {
name: 'order_detail',
data(){
data () {
return {
locked: false,
isloading: false,
btnShow: true,
order: null,
order_id: '',
// 备注耗材
locked: false,
isloading: false,
btnShow: true,
order: null,
order_id: '',
// 备注耗材
addList: [
{
goods_name: '',
......@@ -234,33 +270,32 @@ export default {
}
], // 添加的备注耗材数据
hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗
reason: '', // 转单原因
zdShow: false, // 发起转单弹窗
backShow: false,//工人退回弹窗
back_reason: '',//工人退回原因
lookShow: false, // 查看耗材弹窗
expend_detail: {},// 耗材详情
lookShow: false, // 查看耗材弹窗
reason: '', // 转单原因
zdShow: false, // 发起转单弹窗
backShow: false, // 工人退回弹窗
back_reason: '', // 工人退回原因
expend_detail: {} // 耗材详情
}
},
created () {
this.order_id = this.$route.query.id
// this.order_id = 211
this.getDetail()
},
// created () {
// this.order_id = this.$route.query.id
// console.log(this.$route.query.id, 'this.$route.query.id----------')
// this.getDetail()
// },
methods: {
preview(img, index){
let temp = img.map(item=>{
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
},
// 确认完成
preview (img, index) {
const temp = img.map(item => {
return item.url
})
ImagePreview({
images: temp,
startPosition: index
})
},
// 确认完成
sure_click (item, index) {
const vm = this
// const vm = this
this.$dialog.confirm({
title: '提示',
message: '确认完成维修?'
......@@ -272,36 +307,36 @@ export default {
this.$http
.post(this.$myApi.REPAIR_COMPLETE, curParams)
.then((data) => {
this.$toast('操作成功')
this.order = data
this.$toast('操作成功')
this.order = data
})
.catch(() => {})
.catch(() => { })
})
.catch(() => {})
.catch(() => { })
},
onRefresh () {
onRefresh () {
if (!this.locked) {
this.locked = true
this.getDetail()
}
},
getDetail () {
this.isloading = true
this.isloading = true
const curParams = {
repair_order_id: this.order_id
repair_order_id: this.order_id
}
this.$http.get(this.$myApi.ORDER_INFO, curParams)
.then(res => {
this.order = res.order
this.locked = false
this.isloading = false
this.order = res.order
this.locked = false
this.isloading = false
})
.catch(() => {
this.locked = false
this.isloading = false
})
},
bz_click () {
this.locked = false
this.isloading = false
})
},
bz_click () {
this.hcShow = true
// 默认为一个空数据
this.addList = [{
......@@ -354,15 +389,15 @@ export default {
.catch(() => {
this.hcShow = false
})
},
// 发起收费
},
// 发起收费
tz_charge (id) {
this.$router.push({
path: '/charge',
query: { id }
})
},
// 转单弹窗
},
// 转单弹窗
zd_click () {
this.reason = ''
this.zdShow = true
......@@ -381,17 +416,17 @@ export default {
.post(this.$myApi.REPAIR_TRANSFER, curParams)
.then((data) => {
this.zdShow = false
this.$toast('操作成功')
this.btnShow = false
this.$toast('操作成功')
this.btnShow = false
})
.catch(() => {
this.zdShow = false
})
},
// 开始维修
starRepir (id,) {
},
// 开始维修
starRepir (id) {
// console.log(index)
const vm = this
// const vm = this
const curParams = {
repair_order_id: this.order_id
}
......@@ -400,38 +435,38 @@ export default {
.then((data) => {
this.order = data
})
.catch(() => {})
},
back_click(){
this.back_reason = ''
this.backShow = true
},
back_cancel(){
this.backShow = false
},
//发起退回
back_submit(){
if (this.back_reason === '') {
this.$toast('退回原因不可为空')
return
}
const curParams = {
repair_order_id: this.order_id,
content: this.back_reason
}
this.$http
.get(this.$myApi.WORKER_BACK, curParams)
.then((data) => {
this.backShow = false
this.$toast('操作成功')
this.btnShow = false
})
.catch(() => {
this.backShow = false
})
},
// 查看耗材弹窗
look_click () {
.catch(() => { })
},
back_click () {
this.back_reason = ''
this.backShow = true
},
back_cancel () {
this.backShow = false
},
// 发起退回
back_submit () {
if (this.back_reason === '') {
this.$toast('退回原因不可为空')
return
}
const curParams = {
repair_order_id: this.order_id,
content: this.back_reason
}
this.$http
.get(this.$myApi.WORKER_BACK, curParams)
.then((data) => {
this.backShow = false
this.$toast('操作成功')
this.btnShow = false
})
.catch(() => {
this.backShow = false
})
},
// 查看耗材弹窗
look_click () {
const curParams = {
repair_order_id: this.order_id
}
......@@ -442,47 +477,61 @@ export default {
this.expend_detail = data
this.lookShow = true
})
.catch(() => {})
.catch(() => { })
},
cancel () {
cancel () {
this.zdShow = false
this.hcShow = false
this.lookShow = false
},
goBack(){
},
goBack () {
this.$router.push({
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>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/index.scss";
@import '@assets/styles/tabbar/index.scss';
.backBtn {
width: 0.8rem;
height: 0.8rem;
background: #fff;
box-shadow: 0 0 0.1rem #0054ff;
position: fixed;
right: 0.6rem;
top: 1rem;
z-index: 1;
border-radius: 50%;
padding: 0.1rem;
width: 0.8rem;
height: 0.8rem;
background: #fff;
box-shadow: 0 0 0.1rem #0054ff;
position: fixed;
right: 0.6rem;
top: 1rem;
z-index: 1;
border-radius: 50%;
padding: 0.1rem;
}
.backBtn img {
width: 100%;
height: 100%;
border-radius: 50%;
width: 100%;
height: 100%;
border-radius: 50%;
}
.none-img{
display: block;
margin: 0 auto;
.none-img {
display: block;
margin: 0 auto;
}
.none-p{
text-align: center;
.none-p {
text-align: center;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="cont">
<div class="top flex-h flex-vc">
<div class="point"></div>
<div class="status">{{user.online_status_display}}</div>
</div>
<div class="menu flex-h flex-hb">
<div class="hc_total">{{count}}个工单</div>
<div class="options">
<div @click="chooseTab">{{curSelect.name}}</div>
<div class="option-box" v-show="tabShow">
<div
class="option-item"
v-for="item in optionList"
:key="item.type"
:value="item.name"
@click="changeItem(item)"
>{{item.name}}</div>
<div class="cont">
<div class="top flex-h flex-vc">
<div class="point"></div>
<div class="status">{{ user.online_status_display }}</div>
</div>
<div class="menu flex-h flex-hb">
<div class="hc_total">{{ count }}个工单</div>
<div class="options">
<div @click="chooseTab">{{ curSelect.name }}</div>
<div class="option-box" v-show="tabShow">
<div
class="option-item"
v-for="item in optionList"
:key="item.type"
:value="item.name"
@click="changeItem(item)"
>{{ item.name }}</div>
</div>
</div>
</div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type == 4">
<div class="start" @click="stShow">{{ startTime }}</div>
<div class="blue"></div>
<div class="end" @click="endShow">{{ endTime }}</div>
</div>
</div>
</div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type==4">
<div class="start" @click="stShow">{{startTime}}</div>
<div class="blue"></div>
<div class="end" @click="endShow">{{endTime}}</div>
</div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了~"
@load="onmore"
v-if="list.length"
>
<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 class="title" v-else>{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div
class="item-desc"
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div>
<div class="item-title">问题描述:</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-title">服务地址:</div>
<div
class="item-desc"
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{item.realname}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(item)">{{item.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">{{item.created_at}}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">图片详情:</div>
<div
@click="preview(item.image,index)"
class="img flex-h"
v-for="(child, index) in item.image"
:key="index"
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了~"
@load="onmore"
v-if="list.length"
>
<img :src="child.url" alt />
<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 class="title" v-else>{{ item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div class="item-desc">
{{ item.appointment_date }}
{{ item.appointment_time.start_time }}-{{
item.appointment_time.end_time
}}
</div>
</div>
<div class="item-title">问题描述:</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-title">服务地址:</div>
<div class="item-desc">
{{ item.region.region_name }}-{{
item.room.room_name
}}-{{ item.address }}
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{ item.realname }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(item)">{{ item.telephone }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">{{ item.created_at }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">图片详情:</div>
<div
@click="preview(item.image, index)"
class="img flex-h"
v-for="(child, index) in item.image"
:key="index"
>
<img :src="child.url" alt />
</div>
</div>
<div class="line"></div>
<div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{ item.worker.name }}</div>
</div>
<div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{ item.worker.phone }}</div>
</div>
<div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in item.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="item.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in item.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div
class="one one1 text-line-one"
>{{ child.parent_detail.goods_name }}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div
class="_one text-line-one"
>{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<!-- <div class="line"></div> -->
<div class="material" v-if="item.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order
.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
@click="showAll(item, $event)"
>{{ child.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="btn flex-h flex-hr">
<div
v-if="item.is_can_remark_material == 1"
class="btn-item bz-btn"
@click="bz_click(item)"
>备注耗材</div>
<div
v-if="item.is_can_confirm_complete == 1"
class="btn-item qr-btn"
@click="sure_click(item, index)"
>确认完成</div>
<div
v-if="item.is_can_initiate_charge == 1"
class="btn-item sf-btn"
@click="tz_charge(item.id)"
>发起收费</div>
<div
v-if="item.is_can_initiate_transfer_order == 1"
class="btn-item"
@click="zd_click(item)"
>发起转单</div>
<div
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"
@click="starRepir(item.id, index)"
>开始维修</div>
<!-- <div
v-if="item.is_can_see_appraisal==1"
class="btn-item"
@click="look_comment(item)"
>查看评价</div>-->
<div
v-if="item.is_can_see_material == 1"
class="btn-item sf-btn"
@click="look_click(item)"
>查看耗材</div>
</div>
</div>
<!-- 空数据 -->
</van-list>
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
</van-pull-refresh>
<div class="blank"></div>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由" maxlength="20" v-model="reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="zd_submit">提交</div>
</div>
</div>
</div>
<div class="line"></div>
<div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{item.worker.name}}</div>
</div>
<div class="item flex-h flex-vc" v-if="item.worker">
<div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div>
</div>
<div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in item.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</van-popup>
<!-- 发起退回弹窗 -->
<van-popup v-model="backShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注退回原因</div>
<textarea placeholder="请输入退回理由" maxlength="100" v-model="back_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="back_cancel">取消</div>
<div class="sure" @click="back_submit">提交</div>
</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="item.pay_order != ''">
<div class="item-title">已支付耗材</div>
<div v-for="(parent, index) in item.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</van-popup>
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item, index) in addList" :key="index">
<input
class="input"
maxlength="20"
v-model="item.goods_name"
type="text"
placeholder="请输入耗材名称"
/>
<!-- <input class="input" maxlength="3" v-model.number="item.number" type="number" placeholder="请输入耗材个数" /> -->
<van-field
class="hc_field"
v-model.number="item.number"
type="number"
placeholder="请输入耗材个数"
maxlength="3"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length > 1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<!-- <div class="line"></div> -->
<div class="material" v-if="item.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">查看耗材</div>
<div class="tc_line"></div>
<div
class="ma-item one-item flex-h flex-vc"
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div class="one one1 one_title text-line-one">
{{
item.parent_detail
? item.parent_detail.goods_name
: '其它'
}}
</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">
{{
item.is_free == 2
? item.good_detail.goods_name
: item.goods_name
}}
</div>
<div class="_two text-line-one">*{{ item.number }}</div>
</div>
<div class="one one3">{{ item.price }}</div>
</div>
<div class="hc_total">
共计{{ expend_detail.number }}件,总价: ¥{{
expend_detail.price
}}
</div>
<div class="sure-btn" @click="cancel">确定</div>
</div>
<div class="item_line"></div>
</div>
<div class="btn flex-h flex-hr">
<div
v-if="item.is_can_remark_material==1"
class="btn-item bz-btn"
@click="bz_click(item)"
>备注耗材</div>
<div
v-if="item.is_can_confirm_complete==1"
class="btn-item qr-btn"
@click="sure_click(item, index)"
>确认完成</div>
<div
v-if="item.is_can_initiate_charge==1"
class="btn-item sf-btn"
@click="tz_charge(item.id)"
>发起收费</div>
<div
v-if="item.is_can_initiate_transfer_order==1"
class="btn-item"
@click="zd_click(item)"
>发起转单</div>
<div 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"
@click="starRepir(item.id,index)"
>开始维修</div>
<!-- <div
v-if="item.is_can_see_appraisal==1"
class="btn-item"
@click="look_comment(item)"
>查看评价</div>-->
<div
v-if="item.is_can_see_material==1"
class="btn-item sf-btn"
@click="look_click(item)"
>查看耗材</div>
</div>
</div>
<!-- 空数据 -->
</van-list>
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
</van-pull-refresh>
<div class="blank"></div>
<!-- 发起转单弹窗 -->
<van-popup v-model="zdShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注转单原因</div>
<textarea placeholder="请输入转单理由" maxlength="20" v-model="reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="zd_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 发起退回弹窗 -->
<van-popup v-model="backShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注退回原因</div>
<textarea placeholder="请输入退回理由" maxlength="100" v-model="back_reason"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="back_cancel">取消</div>
<div class="sure" @click="back_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 备注耗材弹窗 -->
<van-popup v-model="hcShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注耗材</div>
<div class="list-item" v-for="(item,index) in addList" :key="index">
<input
class="input"
maxlength="20"
v-model="item.goods_name"
type="text"
placeholder="请输入耗材名称"
/>
<!-- <input class="input" maxlength="3" v-model.number="item.number" type="number" placeholder="请输入耗材个数" /> -->
<van-field
class="hc_field"
v-model.number="item.number"
type="number"
placeholder="请输入耗材个数"
maxlength="3"
/>
</div>
<div class="math-btn flex-h flex-vc flex-hb">
<div v-if="addList.length>1" class="del-btn" @click="delMeth">-删除</div>
<div class="add-btn" @click="addMeth">+新增</div>
</div>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="bz_submit">提交</div>
</div>
</div>
</van-popup>
<!-- 查看耗材弹窗 -->
<van-popup v-model="lookShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">查看耗材</div>
<div class="tc_line"></div>
<div
class="ma-item one-item flex-h flex-vc"
v-for="(item, index) in expend_detail.list"
:key="index"
>
<div
class="one one1 one_title text-line-one"
>{{item.parent_detail ? item.parent_detail.goods_name : '其它'}}</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
>{{item.is_free == 2 ? item.good_detail.goods_name : item.goods_name}}</div>
<div class="_two text-line-one">*{{item.number}}</div>
</div>
<div class="one one3">{{item.price}}</div>
</div>
<div class="hc_total">共计{{expend_detail.number}}件,总价: ¥{{expend_detail.price}}</div>
<div class="sure-btn" @click="cancel">确定</div>
</div>
</van-popup>
<!-- 选择开始日期弹窗 -->
<van-popup v-model="showStart" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="startObj.minDate"
:max-date="startObj.maxDate"
@confirm="birConfirm"
@cancel="birCancel"
:formatter="formatter"
/>
</van-popup>
<!-- 选择截止日期弹窗 -->
<van-popup v-model="showEnd" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="endObj.minDate"
:max-date="endObj.maxDate"
@confirm="endTimeConfirm"
@cancel="endTimeCancel"
:formatter="formatter"
/>
</van-popup>
<!-- tabbar -->
<my-tabbar curname="home"></my-tabbar>
</div>
</van-popup>
<!-- 选择开始日期弹窗 -->
<van-popup v-model="showStart" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="startObj.minDate"
:max-date="startObj.maxDate"
@confirm="birConfirm"
@cancel="birCancel"
:formatter="formatter"
/>
</van-popup>
<!-- 选择截止日期弹窗 -->
<van-popup v-model="showEnd" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="endObj.minDate"
:max-date="endObj.maxDate"
@confirm="endTimeConfirm"
@cancel="endTimeCancel"
:formatter="formatter"
/>
</van-popup>
<!-- tabbar -->
<my-tabbar curname="home"></my-tabbar>
</div>
</template>
<script>
import myTabbar from '@components/common/tabbar.vue'
import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview, Toast } from 'vant';
import { ImagePreview } from 'vant'
import { share } from '@/api/wxShare.js'
export default {
name: 'home',
......@@ -336,42 +370,42 @@ export default {
], // 添加的备注耗材数据
hcShow: false, // 耗材弹窗
lookShow: false, // 查看耗材弹窗
expend_detail: {},// 耗材详情
expend_detail: {}, // 耗材详情
user: '',
startTime: '请选择开始日期',
showStart: false,
startObj:{
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
startObj: {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
},
endObj:{
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
endObj: {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
},
currentDate: new Date(),
showEnd: false,
endTime: "请选择截止日期",
backShow: false,//工人退回弹窗
back_reason: '',//工人退回原因
endTime: '请选择截止日期',
backShow: false, // 工人退回弹窗
back_reason: '' // 工人退回原因
}
},
created () {
share()
this.getList()
this.getUserInfo()
// this.getList()
// this.getUserInfo()
},
methods: {
back_click(item){
this.curItem = item
this.back_reason = ''
this.backShow = true
},
back_cancel(){
this.backShow = false
},
//发起退回
back_submit(){
if (this.back_reason === '') {
back_click (item) {
this.curItem = item
this.back_reason = ''
this.backShow = true
},
back_cancel () {
this.backShow = false
},
// 发起退回
back_submit () {
if (this.back_reason === '') {
this.$toast('退回原因不可为空')
return
}
......@@ -387,93 +421,92 @@ export default {
const idx = this.list.findIndex(item => item.id === this.curItem.id)
if (idx !== -1) {
this.list.splice(idx, 1)
this.count = this.count-1
this.count = this.count - 1
}
})
.catch(() => {
this.backShow = false
})
},
showAll(item,e){
this.$toast(e.target.innerHTML,{
duration: 0
})
},
callPhone(item){
console.log('电话',item)
let phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
onmore(){
this.getList()
},
preview(img, index){
let temp = img.map(item=>{
},
showAll (item, e) {
this.$toast(e.target.innerHTML, {
duration: 0
})
},
callPhone (item) {
console.log('电话', item)
const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
onmore () {
this.getList()
},
preview (img, index) {
const temp = img.map(item => {
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
startPosition: index
})
},
endShow(){
endShow () {
this.showEnd = true
},
stShow(){
stShow () {
this.showStart = true
},
formatter(type, val) {
if (type === "year") {
return `${val}年`;
} else if (type === "month") {
return `${val}月`;
} else if (type === "day") {
return `${val}日`;
formatter (type, val) {
if (type === 'year') {
return `${val}年`
} else if (type === 'month') {
return `${val}月`
} else if (type === 'day') {
return `${val}日`
}
return val;
return val
},
birConfirm(value) {
birConfirm (value) {
this.showStart = false
if(this.startTime == this.conversionTime(value)){
return
if (this.startTime == this.conversionTime(value)) {
return
}
console.log('啊啊啊',value);
console.log('啊啊啊', value)
this.startTime = this.conversionTime(value)
this.$set(this.endObj,'minDate',value)
this.$set(this.endObj, 'minDate', value)
this.anginList()
console.log('开始时间',this.startTime);
},
conversionTime(temp){
let mounth = (temp.getMonth() + 1) <10 ? '0'+(temp.getMonth() + 1) : (temp.getMonth() + 1)
let date = temp.getDate() <10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() +
"-" +
mounth +
"-" +
console.log('开始时间', this.startTime)
},
conversionTime (temp) {
const mounth = (temp.getMonth() + 1) < 10 ? '0' + (temp.getMonth() + 1) : (temp.getMonth() + 1)
const date = temp.getDate() < 10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() +
'-' +
mounth +
'-' +
date
},
birCancel() {
this.showStart = false;
birCancel () {
this.showStart = false
},
endTimeConfirm(value){
endTimeConfirm (value) {
this.showEnd = false
if(this.endTime == this.conversionTime(value)){
return
if (this.endTime == this.conversionTime(value)) {
return
}
this.endTime = this.conversionTime(value)
this.$set(this.startObj,'maxDate',value)
this.$set(this.startObj, 'maxDate', value)
this.anginList()
console.log('结束时间',this.endTime);
console.log('结束时间', this.endTime)
},
endTimeCancel() {
this.showEnd = false;
endTimeCancel () {
this.showEnd = false
},
anginList(){
if(this.startTime !='请选择开始日期' && this.endTime!='请选择截止日期'){
this.initData()
this.getList()
}
anginList () {
if (this.startTime != '请选择开始日期' && this.endTime != '请选择截止日期') {
this.initData()
this.getList()
}
},
// 初始化
initData () {
......@@ -493,7 +526,7 @@ export default {
console.log(res)
this.status = res
})
.catch(() => {})
.catch(() => { })
},
getUserInfo () {
this.$http
......@@ -501,26 +534,26 @@ export default {
.then((res) => {
this.user = res
})
.catch(() => {})
.catch(() => { })
},
// 获取工单列表
getList () {
if (this.more && !this.isloading) {
this.isloading = true
let curParams = {}
if(this.curSelect.type==4){
curParams = {
if (this.curSelect.type == 4) {
curParams = {
time_type: this.curSelect.type,
page: this.page,
limit: this.limit,
start: this.startTime,
end: this.endTime,
end: this.endTime
}
}else{
curParams = {
} else {
curParams = {
time_type: this.curSelect.type,
page: this.page,
limit: this.limit,
limit: this.limit
}
}
this.$http
......@@ -533,7 +566,7 @@ export default {
this.isloading = false
this.count = data.count
this.loading = false
this.finished = !data.more;
this.finished = !data.more
})
.catch(() => {
this.locked = false
......@@ -558,18 +591,18 @@ export default {
this.curSelect = item
this.tabShow = false
if(this.curSelect.type == 4){
this.startTime ='请选择开始日期'
this.endTime='请选择截止日期'
this.startObj={
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
}
this.endObj={
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
}
return
if (this.curSelect.type == 4) {
this.startTime = '请选择开始日期'
this.endTime = '请选择截止日期'
this.startObj = {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
}
this.endObj = {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
}
return
}
this.initData()
this.getList()
......@@ -587,7 +620,7 @@ export default {
.then((data) => {
vm.$set(vm.list, index, data)
})
.catch(() => {})
.catch(() => { })
},
// 转单弹窗
zd_click (item) {
......@@ -613,7 +646,7 @@ export default {
const idx = this.list.findIndex(item => item.id === this.curItem.id)
if (idx !== -1) {
this.list.splice(idx, 1)
this.count = this.count-1
this.count = this.count - 1
}
})
.catch(() => {
......@@ -626,7 +659,7 @@ export default {
this.curItem = item
// 默认为一个空数据
this.addList = [{
goods_name: '',
goods_name: '',
number: ''
}]
this.hcShow = true
......@@ -669,15 +702,15 @@ export default {
this.$http
.post(this.$myApi.MATERIAL_REMARK, curParams)
.then((data) => {
this.hcShow = false
// setTimeout(()=>{
this.hcShow = false
// setTimeout(()=>{
this.$toast('操作成功')
this.addList = [{
goods_name: '',
number: ''
}]
vm.$set(vm.list, index, data)
// },800)
}]
vm.$set(vm.list, index, data)
// },800)
})
.catch(() => {
this.hcShow = false
......@@ -696,7 +729,7 @@ export default {
this.expend_detail = data
this.lookShow = true
})
.catch(() => {})
.catch(() => { })
},
// 查看评论
look_comment (item) {
......@@ -736,9 +769,9 @@ export default {
vm.$set(vm.list, index, data)
this.$toast('操作成功')
})
.catch(() => {})
.catch(() => { })
})
.catch(() => {})
.catch(() => { })
},
// 取消按钮
......@@ -754,11 +787,23 @@ export default {
path: '/charge',
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>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/index.scss";
@import '@assets/styles/tabbar/index.scss';
</style>
<template>
<div class="cont">
<div class="menu flex-h flex-hb flex-vc">
<div class="hc_total">{{count}}个工单</div>
<div class="flex-h flex-hb">
<div class="options">
<div @click="chooseStatus">{{curSelectStatus.name}}</div>
<div class="option-box" v-show="statusShow">
<div
class="option-item"
v-for="item in statusList"
:key="item.statustype"
:value="item.name"
@click="changeStatus(item)"
>{{item.name}}</div>
</div>
<div class="cont">
<div class="menu flex-h flex-hb flex-vc">
<div class="hc_total">{{ count }}个工单</div>
<div class="flex-h flex-hb">
<div class="options">
<div @click="chooseStatus">{{ curSelectStatus.name }}</div>
<div class="option-box" v-show="statusShow">
<div
class="option-item"
v-for="item in statusList"
:key="item.statustype"
:value="item.name"
@click="changeStatus(item)"
>{{ item.name }}</div>
</div>
</div>
<div class="options">
<div @click="chooseTab">{{ curSelect.name }}</div>
<div class="option-box" v-show="tabShow">
<div
class="option-item"
v-for="item in optionList"
:key="item.type"
:value="item.name"
@click="changeItem(item)"
>{{ item.name }}</div>
</div>
</div>
</div>
</div>
<div class="options">
<div @click="chooseTab">{{curSelect.name}}</div>
<div class="option-box" v-show="tabShow">
<div
class="option-item"
v-for="item in optionList"
:key="item.type"
:value="item.name"
@click="changeItem(item)"
>{{item.name}}</div>
</div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type == 4">
<div class="start" @click="stShow">{{ startTime }}</div>
<div class="blue"></div>
<div class="end" @click="endShow">{{ endTime }}</div>
</div>
</div>
</div>
<div class="date flex-h flex-hb flex-vc" v-if="this.curSelect.type==4">
<div class="start" @click="stShow">{{startTime}}</div>
<div class="blue"></div>
<div class="end" @click="endShow">{{endTime}}</div>
</div>
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了~"
@load="onmore"
v-if="list.length"
>
<div class="order-item" v-for="(item, index) in list" :key="index">
<!-- 选择工人弹窗 -->
<van-popup v-model="item.showWorker" round>
<!-- <van-picker
<van-pull-refresh v-model="isloading" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了~"
@load="onmore"
v-if="list.length"
>
<div class="order-item" v-for="(item, index) in list" :key="index">
<!-- 选择工人弹窗 -->
<van-popup v-model="item.showWorker" round>
<!-- <van-picker
show-toolbar
:columns="columns"
value-key="name"
@cancel="Cancel(index)"
@confirm="(value)=>onConfirm(value,index)"
/>-->
<div class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers">
<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 class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers">
<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
class="people-item flex-h flex-vc flex-hb"
v-for="(
lchild_item, lchild_index
) in child_item.user"
:key="lchild_index"
@click="
chooseWorker(
lchild_item,
lchild_index,
index
)
"
>
<div class="flex-h flex-vc">
<img class="gr-img" :src="grImg" />
<div
class="gr-name"
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>
</div>
<img
class="k-img"
:src="
item.temporaryId &&
item.temporaryId.includes(
lchild_item.id
)
? selectImg
: unselectImg
"
/>
</div>
</div>
<div v-else class="none">暂无员工</div>
</div>
</div>
<div class="allBtn btn-box flex-h flex-hc">
<div class="button" @click="Cancel(index)">取消</div>
<div class="button sureBtn" @click="keyConfirm(index)">确定</div>
</div>
</div>
</van-popup>
<div class="title">{{ item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div class="item-desc">
{{ item.appointment_date }}
{{ item.appointment_time.start_time }}-{{
item.appointment_time.end_time
}}
</div>
</div>
<div class="item-title">问题描述:</div>
<div
class="people-item flex-h flex-vc flex-hb"
v-for="(lchild_item,lchild_index) in child_item.user"
:key="lchild_index"
@click="chooseWorker(lchild_item,lchild_index,index)"
>
<div class="flex-h flex-vc">
<img class="gr-img" :src=gr_img />
class="item-desc que-desc"
>{{ item.repair_type.type_name }}-{{ item.description }}</div>
<div class="item flex-h flex-start">
<div class="item-title">服务地址:</div>
<div class="item-desc">
{{ item.region.region_name }}-{{
item.room.room_name
}}-{{ item.address }}
</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{ item.realname }}</div>
</div>
<!--<a :href="'tel' + item.telephone">{{item.telephone}}</a> -->
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(item)">{{ item.telephone }}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">{{ item.created_at }}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">图片详情:</div>
<div
class="gr-name"
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>
</div>
<img
class="k-img"
:src="item.temporaryId && item.temporaryId.includes(lchild_item.id) ? select_img : unselect_img"
/>
@click="preview(item.image, child_i)"
class="img flex-h"
v-for="(child, child_i) in item.image"
:key="child_i"
>
<img :src="child.url" alt />
</div>
</div>
</div>
<div v-else class="none">暂无员工</div>
</div>
</div>
<div class="allBtn btn-box flex-h flex-hc">
<div class="button" @click="Cancel(index)">取消</div>
<div class="button sureBtn" @click="keyConfirm(index)">确定</div>
</div>
</div>
</van-popup>
<div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
<div
class="item-desc"
>{{item.appointment_date}} {{item.appointment_time.start_time}}-{{item.appointment_time.end_time}}</div>
</div>
<div class="item-title">问题描述:</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-title">服务地址:</div>
<div
class="item-desc"
>{{item.region.region_name}}-{{item.room.room_name}}-{{item.address}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">客户姓名:</div>
<div class="item-desc">{{item.realname}}</div>
</div>
<!--<a :href="'tel' + item.telephone">{{item.telephone}}</a> -->
<div class="item flex-h flex-vc">
<div class="item-title">联系电话:</div>
<div class="item-desc phone" @click="callPhone(item)">{{item.telephone}}</div>
</div>
<div class="item flex-h flex-vc">
<div class="item-title">提交时间:</div>
<div class="item-desc">{{item.created_at}}</div>
</div>
<div class="item flex-h flex-start">
<div class="item-title">图片详情:</div>
<div
@click="preview(item.image,child_i)"
class="img flex-h"
v-for="(child, child_i) in item.image"
:key="child_i"
>
<img :src="child.url" alt />
</div>
</div>
<div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in item.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="item.pay_order != ''">
<div class="item-title bz-title">已支付耗材</div>
<div v-for="(parent, index) in item.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div class="one one1 text-line-one">{{child.parent_detail.goods_name}}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div class="_one text-line-one">{{child.good_detail.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<div class="one one3">{{child.price}}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<!-- <div class="line"></div> -->
<div class="material" v-if="item.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div class="_one text-line-one" @click="showAll(item,$event)">{{child.goods_name}}</div>
<div class="_two text-line-one">*{{child.number}}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="item.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{item.orderlog_transfer.remark}}</div>
</div>
<div class="item flex-h flex-start" v-if="item.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{item.orderlog_cancel.remark}}</div>
</div>
<!-- <div v-if="item.worker">
<div class="material" v-if="item.no_pay_order">
<div class="item-title bz-title">待支付耗材</div>
<div
class="no-pay ma-item flex-h flex-hb"
v-for="(child, index) in item.no_pay_order.goods"
:key="index"
>
<div class="one one1 text-line-one">{{ child.parent_detail.goods_name }}</div>
<div class="one one2 flex-h">
<div class="_one text-line-one">{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
<div class="item_line"></div>
</div>
<div class="material" v-if="item.pay_order != ''">
<div class="item-title bz-title">已支付耗材</div>
<div v-for="(parent, index) in item.pay_order" :key="index">
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in parent.goods"
:key="index"
>
<div
class="one one1 text-line-one"
>{{ child.parent_detail.goods_name }}</div>
<!-- <div class="one">{{child.good_detail.goods_name}}*{{child.number}}</div> -->
<div class="one one2 flex-h">
<div
class="_one text-line-one"
>{{ child.good_detail.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<div class="one one3">{{ child.price }}</div>
</div>
</div>
<div class="item_line"></div>
</div>
<!-- <div class="line"></div> -->
<div class="material" v-if="item.free_material_order">
<div class="item-title bz-title">备注耗材</div>
<div
class="ma-item flex-h flex-hb"
v-for="(child, index) in item.free_material_order
.goods"
:key="index"
>
<div class="one one1 text-line-one">免费</div>
<div class="one one2 flex-h">
<div
class="_one text-line-one"
@click="showAll(item, $event)"
>{{ child.goods_name }}</div>
<div class="_two text-line-one">*{{ child.number }}</div>
</div>
<!-- <div class="one one2 text-line-one">{{child.goods_name}}*{{child.number}}</div> -->
<div class="one one3 text-line-one">¥0</div>
</div>
<div class="item_line"></div>
</div>
<div class="item flex-h flex-start" v-if="item.orderlog_transfer">
<div class="item-title">转单备注:</div>
<div class="item-desc">{{ item.orderlog_transfer.remark }}</div>
</div>
<div class="item flex-h flex-start" v-if="item.orderlog_cancel">
<div class="item-title">退回备注:</div>
<div class="item-desc">{{ item.orderlog_cancel.remark }}</div>
</div>
<!-- <div v-if="item.worker">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
......@@ -198,109 +249,112 @@
<div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div>
</div>
</div>-->
<div v-if="item.work_name">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{item.work_name}}</div>
</div>
</div>
</div>-->
<div v-if="item.work_name">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{ item.work_name }}</div>
</div>
</div>
<div v-if="item.is_can_assign_worker==1">
<div class="line"></div>
<div
v-if="item.is_can_assign_worker==1"
class="item flex-h flex-vc flex-hb"
@click="workers(index)"
>
<div class="wo flex-h flex-vc">
<div class="item-title" v-if="item.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">{{item.realName}}</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
<div v-if="item.is_can_assign_worker == 1">
<div class="line"></div>
<div
v-if="item.is_can_assign_worker == 1"
class="item flex-h flex-vc flex-hb"
@click="workers(index)"
>
<div class="wo flex-h flex-vc">
<div
class="item-title"
v-if="item.order_status_display == '已派工'"
>重新派工:</div>
<div class="item-title" v-else>派工对象:</div>
<div class="item-desc worker-name">{{ item.realName }}</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
<div class="select_txt">选择</div>
<img src="@assets/images/my/select.png" alt />
</div>
</div>
</div>
<div class="line"></div>
<div class="allBtn flex-h flex-hr">
<div
v-if="item.is_can_assign_worker == 1"
class="button sureBtn"
@click="sureOrder(item, index)"
>确定</div>
<div
v-if="item.is_can_cancel == 1"
class="button"
@click="cancelOrder(item)"
>取消</div>
</div>
</div>
</div>
</van-list>
<!-- 空数据 -->
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
</van-pull-refresh>
<div class="blank"></div>
<!-- 取消工单原因弹窗 -->
<van-popup v-model="qxShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注取消原因</div>
<textarea placeholder="请输入转单理由" v-model="reason" maxlength="100"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="qx_submit">提交</div>
</div>
</div>
</div>
<div class="line"></div>
<div class="allBtn flex-h flex-hr">
<div
v-if="item.is_can_assign_worker==1"
class="button sureBtn"
@click="sureOrder(item,index)"
>确定</div>
<div v-if="item.is_can_cancel==1" class="button" @click="cancelOrder(item)">取消</div>
</div>
</div>
</div>
</van-list>
<!-- 空数据 -->
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
</van-pull-refresh>
<div class="blank"></div>
<!-- 取消工单原因弹窗 -->
<van-popup v-model="qxShow" close-icon="close">
<div class="cancel_cont">
<div class="pop_title">备注取消原因</div>
<textarea placeholder="请输入转单理由" v-model="reason" maxlength="100"></textarea>
<div class="btnItem flex-h">
<div class="cancel" @click="cancel">取消</div>
<div class="sure" @click="qx_submit">提交</div>
</div>
</div>
</van-popup>
</van-popup>
<!-- 选择开始日期弹窗 -->
<van-popup v-model="showStart" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="startObj.minDate"
:max-date="startObj.maxDate"
@confirm="birConfirm"
@cancel="birCancel"
:formatter="formatter"
/>
</van-popup>
<!-- 选择截止日期弹窗 -->
<van-popup v-model="showEnd" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="endObj.minDate"
:max-date="endObj.maxDate"
@confirm="endTimeConfirm"
@cancel="endTimeCancel"
:formatter="formatter"
/>
</van-popup>
</div>
<!-- 选择开始日期弹窗 -->
<van-popup v-model="showStart" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="startObj.minDate"
:max-date="startObj.maxDate"
@confirm="birConfirm"
@cancel="birCancel"
:formatter="formatter"
/>
</van-popup>
<!-- 选择截止日期弹窗 -->
<van-popup v-model="showEnd" round position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
:min-date="endObj.minDate"
:max-date="endObj.maxDate"
@confirm="endTimeConfirm"
@cancel="endTimeCancel"
:formatter="formatter"
/>
</van-popup>
</div>
</template>
<script>
import myTabbar from '@components/common/tabbar.vue'
import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview, CellGroup } from 'vant';
import select_img from '@assets/images/select.png'
import unselect_img from '@assets/images/un_select.png'
import gr_img from '@assets/images/gr.png'
// import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview } from 'vant'
import selectImg from '@assets/images/select.png'
import unselectImg from '@assets/images/un_select.png'
import grImg from '@assets/images/gr.png'
export default {
name: 'home',
components: {
myTabbar
},
data () {
return {
select_img,
unselect_img,
gr_img,
reson: '',//取消原因
selectImg,
unselectImg,
grImg,
reson: '', // 取消原因
qxShow: false, // 发起转单弹窗
workerName: '',
worker_id: '',
......@@ -308,17 +362,17 @@ export default {
columns: [],
startTime: '请选择开始日期',
showStart: false,
startObj:{
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
startObj: {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
},
endObj:{
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
endObj: {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
},
currentDate: new Date(),
showEnd: false,
endTime: "请选择截止日期",
endTime: '请选择截止日期',
// 头部日期范围筛选
tabShow: false, // tab范围选择框是否显示
curSelect: { type: '1', name: '今日' }, // 当前选择的日期范围
......@@ -357,62 +411,62 @@ export default {
// 转单
curItem: '', // 当前选中要操作的数据
reason: '', // 原因
currentId: '',
currentId: ''
}
},
created () {
this.getList()
this.getWorkers()
},
// created () {
// this.getList()
// this.getWorkers()
// },
methods: {
// 选择完工人点击确定按钮
keyConfirm(i){
if(!this.list[i].temporaryId.length){
this.$toast('请选择工人!')
return
}
this.list[i].workerName = [...this.list[i].temporaryName]
this.list[i].realName = this.list[i].workerName.length ? this.list[i].workerName.join(',') : ''
this.list[i].worker_id = [...this.list[i].temporaryId]
this.list[i].showWorker = false
},
chooseWorker(item,lchild_index,index){
if(this.list[index].temporaryId.includes(item.id)){ // 删除
let name_i = this.list[index].temporaryId.indexOf(item.id)
this.list[index].temporaryId.splice(name_i,1)
this.list[index].temporaryName.splice(name_i,1)
}else{ // 加入
this.list[index].temporaryId.push(item.id)
this.list[index].temporaryName.push(item.name)
}
},
onmore(){
this.getList()
},
preview(img, index){
let temp = img.map(item=>{
// 选择完工人点击确定按钮
keyConfirm (i) {
if (!this.list[i].temporaryId.length) {
this.$toast('请选择工人!')
return
}
this.list[i].workerName = [...this.list[i].temporaryName]
this.list[i].realName = this.list[i].workerName.length ? this.list[i].workerName.join(',') : ''
this.list[i].worker_id = [...this.list[i].temporaryId]
this.list[i].showWorker = false
},
chooseWorker (item, lchild_index, index) {
if (this.list[index].temporaryId.includes(item.id)) { // 删除
const name_i = this.list[index].temporaryId.indexOf(item.id)
this.list[index].temporaryId.splice(name_i, 1)
this.list[index].temporaryName.splice(name_i, 1)
} else { // 加入
this.list[index].temporaryId.push(item.id)
this.list[index].temporaryName.push(item.name)
}
},
onmore () {
this.getList()
},
preview (img, index) {
const temp = img.map(item => {
return item.url
})
ImagePreview({
images: temp,
startPosition: index,
});
startPosition: index
})
},
callPhone (item) {
console.log('电话', item)
const phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
callPhone(item){
console.log('电话',item)
let phoneNumber = item.telephone
window.location.href = 'tel://' + phoneNumber
},
//指派工人
sureOrder(item,index){
// 指派工人
sureOrder (item, index) {
const vm = this
// const index = this.list.findIndex(item => item.id === this.curItem.id)
// console.log('index',index);
// console.log('1111',item);
this.curItem = item
this.repair_order_id = item.id
console.log('工人id',item.worker_id);
if(!item.worker_id.length) {
console.log('工人id', item.worker_id)
if (!item.worker_id.length) {
this.$toast('请选择工人')
return
}
......@@ -423,125 +477,125 @@ export default {
this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams)
.then((data) => {
data.workerName = []
data.realName = ''
data.temporaryName=[]
data.temporaryId=[]
data.worker_id = []
data.workerName = []
data.realName = ''
data.temporaryName = []
data.temporaryId = []
data.worker_id = []
this.$toast('操作成功')
this.reason = ''
this.changeList(data,index)
this.changeList(data, index)
})
.catch(() => {})
.catch(() => { })
},
changeList(data,index){
if(this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3){
this.$set(this.list, index, data)
}else{
this.list.splice(index,1)
this.count = this.count-1
changeList (data, index) {
if (this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3) {
this.$set(this.list, index, data)
} else {
this.list.splice(index, 1)
this.count = this.count - 1
}
},
// 取消工单
cancelOrder(item){
console.log('aaa',item);
cancelOrder (item) {
console.log('aaa', item)
this.curItem = item
this.qxShow = true;
this.qxShow = true
this.reason = ''
},
workers(index){
this.$set(this.list, index,{...this.list[index], ...{showWorker:true}})
workers (index) {
this.$set(this.list, index, { ...this.list[index], ...{ showWorker: true } })
},
// onConfirm(value,i) {
// console.log('id啊',value.id);
// this.$set(this.list,i,{...this.list[i],...{worker_id: value.id, workerName: value.name}})
// this.list[i].showWorker = false
// },
Cancel(i){
this.list[i].showWorker = false
Cancel (i) {
this.list[i].showWorker = false
},
endShow(){
endShow () {
this.showEnd = true
},
stShow(){
stShow () {
this.showStart = true
},
formatter(type, val) {
if (type === "year") {
return `${val}年`;
} else if (type === "month") {
return `${val}月`;
} else if (type === "day") {
return `${val}日`;
formatter (type, val) {
if (type === 'year') {
return `${val}年`
} else if (type === 'month') {
return `${val}月`
} else if (type === 'day') {
return `${val}日`
}
return val;
return val
},
birConfirm(value) {
this.showStart = false
console.log('啊啊啊',value);
if(this.startTime == this.conversionTime(value)){
return
birConfirm (value) {
this.showStart = false
console.log('啊啊啊', value)
if (this.startTime == this.conversionTime(value)) {
return
}
this.startTime = this.conversionTime(value)
this.$set(this.endObj,'minDate',value)
this.$set(this.endObj, 'minDate', value)
this.anginList()
console.log('开始时间',this.startTime);
console.log('开始时间', this.startTime)
},
conversionTime(temp){
let mounth = (temp.getMonth() + 1) <10 ? '0'+(temp.getMonth() + 1) : (temp.getMonth() + 1)
let date = temp.getDate() <10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() +
"-" +
mounth +
"-" +
conversionTime (temp) {
const mounth = (temp.getMonth() + 1) < 10 ? '0' + (temp.getMonth() + 1) : (temp.getMonth() + 1)
const date = temp.getDate() < 10 ? '0' + temp.getDate() : temp.getDate()
return temp.getFullYear() +
'-' +
mounth +
'-' +
date
},
birCancel() {
this.showStart = false;
birCancel () {
this.showStart = false
},
endTimeConfirm(value){
this.showEnd = false
if(this.endTime == this.conversionTime(value)){
return
endTimeConfirm (value) {
this.showEnd = false
if (this.endTime == this.conversionTime(value)) {
return
}
this.endTime = this.conversionTime(value)
this.$set(this.startObj,'maxDate',value)
this.$set(this.startObj, 'maxDate', value)
this.anginList()
console.log('结束时间',this.endTime);
console.log('结束时间', this.endTime)
},
anginList(){
if(this.startTime !='请选择开始日期' && this.endTime!='请选择截止日期'){
this.initData()
this.getList()
}
anginList () {
if (this.startTime != '请选择开始日期' && this.endTime != '请选择截止日期') {
this.initData()
this.getList()
}
},
endTimeCancel() {
this.showEnd = false;
endTimeCancel () {
this.showEnd = false
},
//获取工人列表
getWorkers(){
// 获取工人列表
getWorkers () {
const curParams = {}
this.$http
.get(this.$myApi.GET_WORKER, curParams)
.then((data) => {
this.columns = data
// var arr = []
// for (let i in data) {
// let options = {
// name: data[i].name,
// id: data[i].id,
// isCheck: false,
// repired_count: data[i].repired_count,
// repiring_count: data[i].repiring_count,
// }
// arr.push(options); //属性
// }
// this.columns = arr
})
.catch(() => {
})
this.$http
.get(this.$myApi.GET_WORKER, curParams)
.then((data) => {
this.columns = data
// var arr = []
// for (let i in data) {
// let options = {
// name: data[i].name,
// id: data[i].id,
// isCheck: false,
// repired_count: data[i].repired_count,
// repiring_count: data[i].repiring_count,
// }
// arr.push(options); //属性
// }
// this.columns = arr
})
.catch(() => {
})
},
// 初始化
initData () {
......@@ -559,8 +613,8 @@ export default {
if (this.more && !this.isloading) {
this.isloading = true
let curParams = {}
if(this.curSelect.type==4){
curParams = {
if (this.curSelect.type == 4) {
curParams = {
time_type: this.curSelect.type,
page: this.page,
limit: this.limit,
......@@ -568,8 +622,8 @@ export default {
end: this.endTime,
status: this.curSelectStatus.statustype
}
}else{
curParams = {
} else {
curParams = {
time_type: this.curSelect.type,
page: this.page,
limit: this.limit,
......@@ -580,14 +634,14 @@ export default {
.get(this.$myApi.REPAIR_LIST, curParams)
.then((data) => {
this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.list = this.list.map(item=>{
item.showWorker = false
item.workerName = []
item.realName = ''
item.temporaryName=[]
item.temporaryId=[]
item.worker_id = []
return item
this.list = this.list.map(item => {
item.showWorker = false
item.workerName = []
item.realName = ''
item.temporaryName = []
item.temporaryId = []
item.worker_id = []
return item
})
this.page = data.page
this.more = data.more
......@@ -595,10 +649,10 @@ export default {
this.isloading = false
this.count = data.count
this.loading = false
this.finished = !data.more;
if(data.worker){
this.worker_id = data.worker.id
this.workerName = data.worker.name
this.finished = !data.more
if (data.worker) {
this.worker_id = data.worker.id
this.workerName = data.worker.name
}
})
.catch(() => {
......@@ -619,7 +673,7 @@ export default {
chooseTab (e) {
this.tabShow = !this.tabShow
},
//点击选择工单状态
// 点击选择工单状态
chooseStatus (e) {
this.statusShow = !this.statusShow
},
......@@ -628,18 +682,18 @@ export default {
if (item.type !== this.curSelect.type) {
this.curSelect = item
this.tabShow = false
if(this.curSelect.type == 4){
this.startTime ='请选择开始日期'
this.endTime='请选择截止日期'
this.startObj={
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
}
this.endObj={
minDate: new Date(2021, 0, 1),
maxDate: new Date(),
}
return
if (this.curSelect.type == 4) {
this.startTime = '请选择开始日期'
this.endTime = '请选择截止日期'
this.startObj = {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
}
this.endObj = {
minDate: new Date(2021, 0, 1),
maxDate: new Date()
}
return
}
setTimeout(() => {
this.initData()
......@@ -647,7 +701,7 @@ export default {
}, 0)
}
},
//订单状态变化
// 订单状态变化
changeStatus (item) {
if (item.statustype !== this.curSelectStatus.statustype) {
this.curSelectStatus = item
......@@ -676,7 +730,7 @@ export default {
.then((data) => {
this.qxShow = false
this.$toast('操作成功')
this.changeList(data,index)
this.changeList(data, index)
})
.catch(() => {
this.qxShow = false
......@@ -686,10 +740,22 @@ export default {
cancel () {
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>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/admin_index.scss";
@import '@assets/styles/tabbar/admin_index.scss';
</style>
<template>
<div class="cont" v-if="user">
<div class="top"></div>
<div class="info-item">
<div class="photo">
<img src="@assets/images/my/touxiang.png" alt />
</div>
<div class="btn">{{user.online_status_display}}</div>
<div class="name">{{user.name}}</div>
<div class="group">{{user.department.name}}</div>
<div class="tel flex-h" @click="goPhone">
<div class="telNumber">{{telToHide(user.phone)}}</div>
<img src="@assets/images/my/bianji.png" alt />
</div>
<div class="cont" v-if="user">
<div class="top"></div>
<div class="info-item">
<div class="photo">
<img src="@assets/images/my/touxiang.png" alt />
</div>
<div class="btn">{{ user.online_status_display }}</div>
<div class="name">{{ user.name }}</div>
<div class="group">{{ user.department.name }}</div>
<div class="tel flex-h" @click="goPhone">
<div class="telNumber">{{ telToHide(user.phone) }}</div>
<img src="@assets/images/my/bianji.png" alt />
</div>
</div>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div>
<!-- tabbar -->
<my-tabbar curname="my"></my-tabbar>
</div>
</template>
<script>
......@@ -30,14 +30,14 @@ export default {
user: ''
}
},
created () {
this.getUserInfo()
},
// created () {
// this.getUserInfo()
// },
methods: {
goPhone(){
goPhone () {
this.$router.push({
path: '/modifyPhone',
query:{phone:this.user.phone}
query: { phone: this.user.phone }
})
},
getUserInfo () {
......@@ -46,79 +46,90 @@ export default {
.then((res) => {
this.user = res
})
.catch(() => {})
.catch(() => { })
},
telToHide (tel) {
var phone = tel.substr(0, 3) + '****' + tel.substring(7, 11);
return phone;
var phone = tel.substr(0, 3) + '****' + tel.substring(7, 11)
return phone
},
fetchData (to, from) {
this.getUserInfo()
}
},
beforeRouteEnter (to, from, next) {
next(vm => {
vm.fetchData(to, from, next)
})
},
beforeRouteLeave (to, from, next) {
next()
}
}
</script>
<style lang="scss" scoped>
.cont {
min-height: 100vh;
background: #f7f7f7;
min-height: 100vh;
background: #f7f7f7;
}
.top {
width: 100%;
height: 2.82rem;
background: #0054ff;
position: relative;
width: 100%;
height: 2.82rem;
background: #0054ff;
position: relative;
}
.info-item {
width: 7.5rem;
height: 8.05rem;
background: #ffffff;
border-radius: 0.28rem 0.28rem 0rem 0rem;
position: absolute;
top: 2.5rem;
left: 0;
text-align: center;
width: 7.5rem;
height: 8.05rem;
background: #ffffff;
border-radius: 0.28rem 0.28rem 0rem 0rem;
position: absolute;
top: 2.5rem;
left: 0;
text-align: center;
}
.photo {
width: 1.7rem;
height: 1.7rem;
border-radius: 50%;
background: #f1f1f1;
position: absolute;
top: -1rem;
left: 2.9rem;
width: 1.7rem;
height: 1.7rem;
border-radius: 50%;
background: #f1f1f1;
position: absolute;
top: -1rem;
left: 2.9rem;
}
.btn {
width: 1.38rem;
height: 0.48rem;
background: #0054ff;
border-radius: 0.24rem;
color: #fff;
text-align: center;
line-height: 0.48rem;
margin: 1.13rem auto 0.59rem;
width: 1.38rem;
height: 0.48rem;
background: #0054ff;
border-radius: 0.24rem;
color: #fff;
text-align: center;
line-height: 0.48rem;
margin: 1.13rem auto 0.59rem;
}
.name {
color: #000000;
font-size: 0.38rem;
margin-bottom: 0.27rem;
font-weight: bold;
color: #000000;
font-size: 0.38rem;
margin-bottom: 0.27rem;
font-weight: bold;
}
.group {
color: #000000;
font-size: 0.3rem;
margin-bottom: 0.48rem;
color: #000000;
font-size: 0.3rem;
margin-bottom: 0.48rem;
}
.tel {
width: 2rem;
height: 0.28rem;
margin: 0 auto;
width: 2rem;
height: 0.28rem;
margin: 0 auto;
}
.tel .telNumber {
color: #000000;
font-size: 0.3rem;
margin-right: 0.2rem;
color: #000000;
font-size: 0.3rem;
margin-right: 0.2rem;
}
.tel img {
width: 0.28rem;
height: 0.28rem;
width: 0.28rem;
height: 0.28rem;
}
</style>
<template>
<div class="cont">
<div class="tel">
<input v-model.trim="old_tel" maxlength="11" type="tel" placeholder="请输入原手机号" />
<div class="cont">
<div class="tel">
<input
v-model.trim="old_tel"
maxlength="11"
type="tel"
placeholder="请输入原手机号"
/>
</div>
<div class="tel">
<input
v-model.trim="tel"
maxlength="11"
type="tel"
placeholder="请输入新的手机号"
/>
</div>
<div class="code flex-h">
<van-field
class="code_field"
v-model.trim="code"
type="text"
placeholder="请输入验证码"
maxlength="6"
/>
<div class="getCode" @click="getCode">{{ buttonText }}</div>
</div>
<div class="submit-btn" @click="submit">提交</div>
</div>
<div class="tel">
<input v-model.trim="tel" maxlength="11" type="tel" placeholder="请输入新的手机号" />
</div>
<div class="code flex-h">
<van-field class="code_field" v-model.trim="code" type="text" placeholder="请输入验证码" maxlength="6" />
<div class="getCode" @click="getCode">{{buttonText}}</div>
</div>
<div class="submit-btn" @click="submit">提交</div>
</div>
</template>
<script>
export default {
data () {
return {
old_tel: '',//旧手机号
old_tel: '', // 旧手机号
tel: '', // 手机号
code: '', // 验证码
buttonText: '获取验证码',
......@@ -29,7 +45,7 @@ export default {
},
methods: {
checkData () {
if(!this.checkCon()){
if (!this.checkCon()) {
return
}
if (this.code.length !== 6) {
......@@ -38,7 +54,7 @@ export default {
}
return true
},
checkCon(){
checkCon () {
if (this.old_tel != this.$route.query.phone) {
this.$toast('请正确输入原手机号码')
return false
......@@ -51,14 +67,14 @@ export default {
this.$toast('请正确输入新手机号码')
return false
}
return true
return true
},
getCode () {
if (this.isSending) return
if(!this.checkCon()){
if (!this.checkCon()) {
return
}
const curParams = {
const curParams = {
tel: this.tel,
old_tel: this.old_tel,
is_edit: 1
......@@ -68,7 +84,7 @@ export default {
this.isSending = true
this.countDown()
})
.catch(() => {})
.catch(() => { })
},
countDown () {
let seconds = 60
......@@ -83,9 +99,9 @@ export default {
}, 1000)
},
submit () {
if (!this.checkData()) return
if (!this.checkData()) return
const curParams = {
tel: this.tel,
tel: this.tel,
code: this.code
}
this.$http.post(this.$myApi.USER_EDIT, curParams)
......@@ -93,7 +109,7 @@ export default {
this.$toast('修改成功')
this.$router.go(-1)
})
.catch(() => {})
.catch(() => { })
},
fetchData (to, from) {
this.tel = '' // 手机号
......@@ -119,5 +135,5 @@ export default {
</script>
<style lang="scss" scoped>
@import "@assets/styles/tabbar/modifyPhone.scss";
@import '@assets/styles/tabbar/modifyPhone.scss';
</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