Commit 52c38694 authored by 石盼盼's avatar 石盼盼

审核员多人派工功能

parent f07ea16a
...@@ -10,8 +10,8 @@ const baseUrl = '/api' ...@@ -10,8 +10,8 @@ const baseUrl = '/api'
// todo: url // todo: url
// const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口 // const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const httpUrl = 'https://repair.zeruiedu.com' // 正式接口 const httpUrl = 'https://repair.zeruiedu.com' // 正式接口
const h5Url = 'http://localhost:8080' // 测试h5线上地址 // const h5Url = 'http://localhost:8080' // 测试h5线上地址
// const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址 const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
window.localStorage.setItem('httpUrl', httpUrl) window.localStorage.setItem('httpUrl', httpUrl)
window.localStorage.setItem('h5Url', h5Url) window.localStorage.setItem('h5Url', h5Url)
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口 // const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
......
...@@ -34,7 +34,7 @@ service.interceptors.request.use( ...@@ -34,7 +34,7 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const { data, config } = response const { data, config } = response
console.log('添加响应拦截器', response) // console.log('添加响应拦截器', response)
if (data.meta.code === 400) { if (data.meta.code === 400) {
console.log('===== token过期 =====') console.log('===== token过期 =====')
const promisefresh = new Promise(function (resolve, reject) { const promisefresh = new Promise(function (resolve, reject) {
......
...@@ -155,6 +155,9 @@ ...@@ -155,6 +155,9 @@
// height: 0.3rem; // height: 0.3rem;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
} }
.wo{
width: 80%;
}
.item-title { .item-title {
// min-width: 1.5rem; // min-width: 1.5rem;
...@@ -347,4 +350,53 @@ ...@@ -347,4 +350,53 @@
text-align: center; text-align: center;
line-height: 0.78rem; line-height: 0.78rem;
margin: 1.2rem auto; 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 @@ ...@@ -34,7 +34,8 @@
v-if="list.length" v-if="list.length"
> >
<div class="order-item" v-for="(item, index) in list" :key="item.id"> <div class="order-item" v-for="(item, index) in list" :key="item.id">
<div class="title">{{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 flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
<div <div
......
...@@ -43,17 +43,32 @@ ...@@ -43,17 +43,32 @@
@load="onmore" @load="onmore"
v-if="list.length" v-if="list.length"
> >
<div class="order-item" v-for="(item, index) in list" :key="index" > <div class="order-item" v-for="(item, index) in list" :key="index">
<!-- 选择工人弹窗 --> <!-- 选择工人弹窗 -->
<van-popup v-model="item.showWorker" round position="bottom"> <van-popup v-model="item.showWorker" round>
<van-picker <!-- <van-picker
show-toolbar show-toolbar
:columns="columns" :columns="columns"
value-key="name" value-key="name"
@cancel="Cancel(index)" @cancel="Cancel(index)"
@confirm="(value)=>onConfirm(value,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="title">{{item.order_status_display }}</div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">预约时间:</div> <div class="item-title">预约时间:</div>
...@@ -101,7 +116,7 @@ ...@@ -101,7 +116,7 @@
<div class="item-title">退回备注:</div> <div class="item-title">退回备注:</div>
<div class="item-desc">{{item.orderlog_cancel.remark}}</div> <div class="item-desc">{{item.orderlog_cancel.remark}}</div>
</div> </div>
<div v-if="item.worker"> <!-- <div v-if="item.worker">
<div class="line"></div> <div class="line"></div>
<div class="item flex-h flex-vc"> <div class="item flex-h flex-vc">
<div class="item-title">派工对象:</div> <div class="item-title">派工对象:</div>
...@@ -111,6 +126,13 @@ ...@@ -111,6 +126,13 @@
<div class="item-title">联系电话:</div> <div class="item-title">联系电话:</div>
<div class="item-desc">{{item.worker.phone}}</div> <div class="item-desc">{{item.worker.phone}}</div>
</div> </div>
</div>-->
<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.is_can_assign_worker==1"> <div v-if="item.is_can_assign_worker==1">
...@@ -120,10 +142,10 @@ ...@@ -120,10 +142,10 @@
class="item flex-h flex-vc flex-hb" class="item flex-h flex-vc flex-hb"
@click="workers(index)" @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-if="item.order_status_display == '已派工'">重新派工:</div>
<div class="item-title" v-else>派工对象:</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>
<div class="flex-h flex-vc"> <div class="flex-h flex-vc">
<div class="select flex-h flex-vc"> <div class="select flex-h flex-vc">
...@@ -192,7 +214,7 @@ ...@@ -192,7 +214,7 @@
<script> <script>
import myTabbar from '@components/common/tabbar.vue' import myTabbar from '@components/common/tabbar.vue'
import { trimStrSpace } from '@assets/js/format.js' import { trimStrSpace } from '@assets/js/format.js'
import { ImagePreview } from 'vant'; import { ImagePreview, CellGroup } from 'vant';
export default { export default {
name: 'home', name: 'home',
components: { components: {
...@@ -257,6 +279,7 @@ export default { ...@@ -257,6 +279,7 @@ export default {
// 转单 // 转单
curItem: '', // 当前选中要操作的数据 curItem: '', // 当前选中要操作的数据
reason: '', // 原因 reason: '', // 原因
currentId: '',
} }
}, },
created () { created () {
...@@ -264,6 +287,33 @@ export default { ...@@ -264,6 +287,33 @@ export default {
this.getWorkers() this.getWorkers()
}, },
methods: { 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(){ onmore(){
this.getList() this.getList()
}, },
...@@ -289,13 +339,13 @@ export default { ...@@ -289,13 +339,13 @@ export default {
// console.log('1111',item); // console.log('1111',item);
this.curItem = item this.curItem = item
this.repair_order_id = item.id this.repair_order_id = item.id
if(!item.worker_id) { if(!item.worker_id.length) {
this.$toast('请选择工人') this.$toast('请选择工人')
return return
} }
const curParams = { const curParams = {
repair_order_id: this.repair_order_id, repair_order_id: this.repair_order_id,
worker_id: item.worker_id worker_id: item.worker_id.join(',')
} }
this.$http this.$http
.post(this.$myApi.REPAIR_ASSIGN, curParams) .post(this.$myApi.REPAIR_ASSIGN, curParams)
...@@ -310,7 +360,6 @@ export default { ...@@ -310,7 +360,6 @@ export default {
changeList(data,index){ changeList(data,index){
if(this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3){ if(this.curSelectStatus.statustype == 0 || this.curSelectStatus.statustype == 3){
this.$set(this.list, index, data) this.$set(this.list, index, data)
this.count = this.count-1
}else{ }else{
this.list.splice(index,1) this.list.splice(index,1)
this.count = this.count-1 this.count = this.count-1
...@@ -326,12 +375,14 @@ export default { ...@@ -326,12 +375,14 @@ export default {
workers(index){ workers(index){
this.$set(this.list, index,{...this.list[index], ...{showWorker:true}}) this.$set(this.list, index,{...this.list[index], ...{showWorker:true}})
}, },
onConfirm(value,i) { // onConfirm(value,i) {
console.log('id啊',value.id); // console.log('id啊',value.id);
this.$set(this.list,i,{...this.list[i],...{worker_id: value.id, workerName: value.name}}) // this.$set(this.list,i,{...this.list[i],...{worker_id: value.id, workerName: value.name}})
this.list[i].showWorker = false // this.list[i].showWorker = false
}, // },
Cancel(i){ Cancel(i){
console.log('111');
this.list[i].showWorker = false this.list[i].showWorker = false
}, },
endShow(){ endShow(){
...@@ -398,7 +449,18 @@ export default { ...@@ -398,7 +449,18 @@ export default {
this.$http this.$http
.get(this.$myApi.GET_WORKER, curParams) .get(this.$myApi.GET_WORKER, curParams)
.then((data) => { .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(() => { .catch(() => {
...@@ -444,6 +506,8 @@ export default { ...@@ -444,6 +506,8 @@ export default {
this.list = this.page === 1 ? data.list : this.list.concat(data.list) this.list = this.page === 1 ? data.list : this.list.concat(data.list)
this.list = this.list.map(item=>{ this.list = this.list.map(item=>{
item.showWorker = false item.showWorker = false
item.workerName = []
item.worker_id = []
return item return item
}) })
this.page = data.page 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