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

指派工人弹窗样式修改

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