Commit 20645d11 authored by 石盼盼's avatar 石盼盼

指派工人弹窗样式修改

parent 45fa1a50
......@@ -355,9 +355,10 @@
// 选择工人弹窗样式
.tc-box{
width: 6.9rem;
height: 7rem;
height: 90%;
background: #fff;
padding: 0.3rem;
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}
.tc-box .tc-title{
color: #000000;
......@@ -369,6 +370,21 @@
.tc-box .workers .gr-item{
margin-bottom: 0.4rem;
}
.tc-box .workers .gr-item .bm-item{
width: 6.9rem;
height: 0.56rem;
background: #f2f2f2;
line-height: 0.56rem;
color: #000000;
font-size: 0.28rem;
padding-left: 0.3rem;
margin-bottom: 0.3rem;
}
.people-item{
padding-left: 0.3rem;
padding-right: 0.3rem;
margin-bottom: 0.3rem;
}
.tc-box .workers .gr-item .gr-img {
width: 0.56rem;
height: 0.56rem;
......
......@@ -56,21 +56,31 @@
<div class="tc-box">
<div class="tc-title">选择工人</div>
<div class="workers">
<!-- :class="item.worker_id && item.worker_id.includes(child_item.id) ? 'activeItem' : 'worker-item'" -->
<div class="gr-item flex-h flex-vc flex-hb" @click="selectWorker(child_index,child_item,index)"
<div
class="gr-item"
v-for="(child_item,child_index) in columns"
:key="child_index"
>
<div class="flex-h flex-vc">
<img class="gr-img" src="@assets/images/gr.png" />
<div class="gr-name" v-if="child_item.repired_count !== 0 || child_item.repiring_count !== 0">
{{child_item.name}} (已派工: {{child_item.repired_count}};维修中: {{child_item.repiring_count}})
<div class="bm-item">{{child_item.name}}</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="@assets/images/gr.png" />
<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.username}} (休息中)</div>
</div>
<img
class="k-img"
:src="item.temporaryId && item.temporaryId.includes(lchild_item.id) ? select_img : unselect_img"
/>
</div>
<div class="gr-name" v-else>
{{child_item.name}} (休息中)
</div>
</div>
<img class="k-img" :src="item.worker_id && item.worker_id.includes(child_item.id) ? select_img : unselect_img" />
</div>
</div>
<div class="allBtn btn-box flex-h flex-hc">
......@@ -155,7 +165,9 @@
<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.workerName.length ? item.workerName.join(',') : ''}}</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">
......@@ -234,8 +246,8 @@ export default {
},
data () {
return {
select_img,
unselect_img,
select_img,
unselect_img,
reson: '',//取消原因
qxShow: false, // 发起转单弹窗
workerName: '',
......@@ -303,29 +315,24 @@ export default {
methods: {
// 选择完工人点击确定按钮
keyConfirm(i){
if(!this.list[i].worker_id.length){
if(!this.list[i].temporaryId.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].workerName = [...this.list[i].temporaryName]
this.list[i].worker_id = [...this.list[i].temporaryId]
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)
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].worker_id.push(item.id)
// this.list[index].workerName.push(item.name)
this.list[index].temporaryId.push(item.id)
this.list[index].temporaryName.push(item.name)
// console.log('选中的',this.list[index].temporaryName);
}
},
onmore(){
......@@ -396,7 +403,6 @@ export default {
// },
Cancel(i){
console.log('111');
this.list[i].showWorker = false
},
endShow(){
......@@ -463,20 +469,19 @@ export default {
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
console.log('工人啊',this.columns);
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(() => {
......@@ -498,7 +503,6 @@ export default {
if (this.more && !this.isloading) {
this.isloading = true
let curParams = {}
console.log('类型',this.curSelect.type);
if(this.curSelect.type==4){
curParams = {
time_type: this.curSelect.type,
......@@ -523,6 +527,8 @@ export default {
this.list = this.list.map(item=>{
item.showWorker = false
item.workerName = []
item.temporaryName=[]
item.temporaryId=[]
item.worker_id = []
return item
})
......@@ -537,8 +543,6 @@ export default {
this.worker_id = data.worker.id
this.workerName = data.worker.name
}
console.log('工人',data.worker.id,data.worker.name);
})
.catch(() => {
this.locked = false
......@@ -580,7 +584,7 @@ export default {
changeStatus (item) {
if (item.statustype !== this.curSelectStatus.statustype) {
this.curSelectStatus = item
console.log('1111',this.curSelectStatus);
// console.log('1111',this.curSelectStatus);
this.statusShow = false
setTimeout(() => {
this.initData()
......
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