Commit 9627116c authored by 石盼盼's avatar 石盼盼

Merge branch 'spp' into 'master'

Spp

See merge request !29
parents 04cc1ade 7b5152b9
......@@ -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' // 正式接口
......
......@@ -34,7 +34,7 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
const { data, config } = response
console.log('添加响应拦截器', response)
// console.log('添加响应拦截器', response)
if (data.meta.code === 400) {
console.log('===== token过期 =====')
const promisefresh = new Promise(function (resolve, reject) {
......
......@@ -155,6 +155,9 @@
// height: 0.3rem;
margin-bottom: 0.2rem;
}
.wo{
width: 80%;
}
.item-title {
// min-width: 1.5rem;
......@@ -347,4 +350,53 @@
text-align: center;
line-height: 0.78rem;
margin: 1.2rem auto;
}
// 选择工人弹窗样式
.tc-box{
width: 6.9rem;
background: #fff;
padding-top: 0.3rem;
padding-left: 0.3rem;
padding-right: 0.3rem;
padding-bottom: 0.3rem;
}
.tc-box .tc-title{
color: #000000;
font-size: 0.26rem;
margin-bottom: 0.3rem;
font-weight: bold;
text-align: center;
}
.tc-box .workers .worker-item{
width: 2rem;
height: 0.6rem;
background: #f2f2f2;
text-align: center;
line-height: 0.6rem;
border-radius: 0.35rem;
}
.tc-box .workers .activeItem {
width: 2rem;
height: 0.6rem;
background: #0054FF;
color: #fff;
text-align: center;
line-height: 0.6rem;
border-radius: 0.35rem;
}
.btn-box{
margin-top: 0.6rem;
}
.btn-box .btn{
width: 1.80rem;
height: 0.70rem;
background: #FFFFFF;
border: 0.01rem solid #C8C8C8;
border-radius: 0.35rem;
text-align: center;
line-height: 0.7rem;
color: #000000;
font-size: 0.24rem;
margin-right: 0.2rem;
}
\ No newline at end of file
......@@ -34,7 +34,8 @@
v-if="list.length"
>
<div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title">{{item.order_status_display }}</div>
<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
......
......@@ -43,17 +43,32 @@
@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
<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)"
/>
</van-popup>
/>-->
<div class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers flex-h flex-hw flex-hb">
<div
:class="item.worker_id && item.worker_id.includes(child_item.id) ? 'activeItem' : 'worker-item'"
@click="selectWorker(child_index,child_item,index)"
v-for="(child_item,child_index) in columns"
:key="child_index"
>{{child_item.name}}</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>
......@@ -101,7 +116,7 @@
<div class="item-title">退回备注:</div>
<div class="item-desc">{{item.orderlog_cancel.remark}}</div>
</div>
<div v-if="item.worker">
<!-- <div v-if="item.worker">
<div class="line"></div>
<div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div>
......@@ -111,6 +126,13 @@
<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 v-if="item.is_can_assign_worker==1">
......@@ -120,10 +142,10 @@
class="item flex-h flex-vc flex-hb"
@click="workers(index)"
>
<div class="flex-h flex-vc">
<div class="wo flex-h flex-vc">
<div class="item-title" v-if="item.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</div>
<div class="item-desc">{{item.workerName}}</div>
<div class="item-desc worker-name">{{item.workerName.length ? item.workerName.join(',') : ''}}</div>
</div>
<div class="flex-h flex-vc">
<div class="select flex-h flex-vc">
......@@ -192,7 +214,7 @@
<script>
import myTabbar from '@components/common/tabbar.vue'
import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview } from 'vant';
import { ImagePreview, CellGroup } from 'vant';
export default {
name: 'home',
components: {
......@@ -257,6 +279,7 @@ export default {
// 转单
curItem: '', // 当前选中要操作的数据
reason: '', // 原因
currentId: '',
}
},
created () {
......@@ -264,6 +287,33 @@ export default {
this.getWorkers()
},
methods: {
// 选择完工人点击确定按钮
keyConfirm(i){
if(!this.list[i].worker_id.length){
this.$toast('请选择工人!')
return
}
let temp_name = []
this.columns.map(item=>{
if(this.list[i].worker_id.includes(item.id)){
temp_name.push(item.name)
}
})
this.list[i].workerName = temp_name
this.list[i].showWorker = false
},
// 选择工人
selectWorker(child_index,item,index){
if(this.list[index].worker_id.includes(item.id)){ // 删除
let name_i = this.list[index].worker_id.indexOf(item.id)
this.list[index].worker_id.splice(name_i,1)
// this.list[index].workerName.splice(name_i,1)
}else{ // 加入
this.list[index].worker_id.push(item.id)
// this.list[index].workerName.push(item.name)
}
},
onmore(){
this.getList()
},
......@@ -289,13 +339,13 @@ export default {
// console.log('1111',item);
this.curItem = item
this.repair_order_id = item.id
if(!item.worker_id) {
if(!item.worker_id.length) {
this.$toast('请选择工人')
return
}
const curParams = {
repair_order_id: this.repair_order_id,
worker_id: item.worker_id
worker_id: item.worker_id.join(',')
}
this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams)
......@@ -310,7 +360,6 @@ export default {
changeList(data,index){
if(this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3){
this.$set(this.list, index, data)
this.count = this.count-1
}else{
this.list.splice(index,1)
this.count = this.count-1
......@@ -326,12 +375,14 @@ export default {
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
},
// 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){
console.log('111');
this.list[i].showWorker = false
},
endShow(){
......@@ -398,7 +449,18 @@ export default {
this.$http
.get(this.$myApi.GET_WORKER, curParams)
.then((data) => {
this.columns = data
// this.columns = data
var arr = []
for (let i in data) {
let options = {
name: data[i].name,
id: data[i].id,
isCheck: false
}
arr.push(options); //属性
}
this.columns = arr
console.log('工人啊',this.columns);
})
.catch(() => {
......@@ -444,6 +506,8 @@ export default {
this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.list = this.list.map(item=>{
item.showWorker = false
item.workerName = []
item.worker_id = []
return item
})
this.page = data.page
......
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