Commit 18d1f6aa authored by 石盼盼's avatar 石盼盼

Merge branch 'spp' into 'master'

Spp

See merge request !23
parents ab40bdbf 9a62c9ff
......@@ -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' // 正式接口
......
......@@ -461,6 +461,7 @@ export default {
this.isloading = false
this.loading = false
this.finished = false
this.getUserInfo()
},
getStatus () {
this.$http
......
......@@ -35,9 +35,25 @@
<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-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 position="bottom">
<van-picker
show-toolbar
:columns="columns"
value-key="name"
@cancel="Cancel(index)"
@confirm="(value)=>onConfirm(value,index)"
/>
</van-popup>
<div class="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div>
......@@ -69,25 +85,21 @@
<div class="item flex-h flex-start">
<div class="item-title">图片详情:</div>
<div
@click="preview(item.image,index)"
@click="preview(item.image,child_i)"
class="img flex-h"
v-for="(child, index) in item.image"
:key="index"
v-for="(child, child_i) in item.image"
:key="child_i"
>
<img :src="child.url" alt />
</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 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 class="item-desc">{{item.orderlog_cancel.remark}}</div>
</div>
<div v-if="item.worker">
<div class="line"></div>
......@@ -106,11 +118,11 @@
<div
v-if="item.is_can_assign_worker==1"
class="item flex-h flex-vc flex-hb"
@click="workers"
@click="workers(index)"
>
<div class="flex-h flex-vc">
<div class="item-title">派工对象:</div>
<div class="item-desc">{{workerName}}</div>
<div class="item-desc">{{item.workerName}}</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
......@@ -131,8 +143,8 @@
</div>
</div>
</van-list>
<!-- 空数据 -->
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
<!-- 空数据 -->
<van-empty class="custom-image" description="暂无工单哦~" v-if="!list.length && !more" />
</van-pull-refresh>
<div class="blank"></div>
<!-- 取消工单原因弹窗 -->
......@@ -147,16 +159,6 @@
</div>
</van-popup>
<!-- 选择工人弹窗 -->
<van-popup v-model="showWorker" round position="bottom">
<van-picker
show-toolbar
:columns="columns"
value-key="name"
@cancel="Cancel"
@confirm="onConfirm"
/>
</van-popup>
<!-- 选择开始日期弹窗 -->
<van-popup v-model="showStart" round position="bottom">
<van-datetime-picker
......@@ -286,13 +288,13 @@ export default {
// console.log('1111',item);
this.curItem = item
this.repair_order_id = item.id
if(this.worker_id == '') {
if(!item.worker_id) {
this.$toast('请选择工人')
return
}
const curParams = {
repair_order_id: this.repair_order_id,
worker_id: this.worker_id
worker_id: item.worker_id
}
this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams)
......@@ -307,8 +309,10 @@ export default {
changeList(data,index){
if(this.curSelectStatus.statustype == 0){
this.$set(this.list, index, data)
this.count = this.count-1
}else{
this.list.splice(index,1)
this.count = this.count-1
}
},
// 取消工单
......@@ -318,17 +322,16 @@ export default {
this.qxShow = true;
this.reason = ''
},
workers(){
this.showWorker = true
workers(index){
this.$set(this.list, index,{...this.list[index], ...{showWorker:true}})
},
onConfirm(value) {
console.log('1111',value);
this.workerName = value.name;
this.worker_id = value.id
this.showWorker = false;
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(){
this.showWorker = false;
Cancel(i){
this.list[i].showWorker = false
},
endShow(){
this.showEnd = true
......@@ -437,6 +440,10 @@ 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
return item
})
this.page = data.page
this.more = data.more
this.locked = false
......
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