Compare commits

...

3 Commits

Author SHA1 Message Date
PQZ
328d8e41ce 1 2024-10-18 16:10:56 +08:00
PQZ
4e9e246034 Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-repair-app 2024-10-18 15:30:56 +08:00
PQZ
344c6a421c 1 2024-10-18 15:30:12 +08:00
3 changed files with 2537 additions and 17 deletions

2495
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,22 +2,22 @@
<view class="container">
<VNavigationBar background-color="#fff" title="选择人员" title-color="#333"></VNavigationBar>
<view class="body">
<div class="searchBox">
<div class="inputBox">
<input placeholder="请输入人员姓名" type="text">
</div>
<text>搜索</text>
</div>
<!-- <div class="searchBox">-->
<!-- <div class="inputBox">-->
<!-- <input placeholder="请输入人员姓名" type="text">-->
<!-- </div>-->
<!-- <text>搜索</text>-->
<!-- </div>-->
<div class="userList">
<u-checkbox-group
placement="column"
v-model="checked">
<view v-for="item in list" :key="item.id" class="userItem">
<view v-for="item in list" :key="item.userId" class="userItem">
<view class="info">
<text class="name">{{item.userName}}</text>
<text class="trade">{{item.gz}}{{item.checked}}</text>
<text class="trade">{{item.workTypeText}}</text>
</view>
<u-checkbox v-model="item.checked" :name="item.id" iconSize="24" shape="circle" activeColor="#1890ff"></u-checkbox>
<u-checkbox v-model="item.checked" :name="item.userId" iconSize="24" shape="circle" activeColor="#1890ff"></u-checkbox>
</view>
</u-checkbox-group>
@ -34,7 +34,7 @@
import VNavigationBar from '@/components/VNavigationBar.vue'
import {bus} from "@/utils/eventBus";
import request from '@/utils/request';
import {getDictTextByCodeAndValue} from "@/utils/utils";
export default {
components: {
VNavigationBar,
@ -63,13 +63,38 @@ export default {
params:{ticketId:this.ticketId}
}).then((res)=>{
this.list = res.data
this.list.map((item)=>{
item.workTypeText = getDictTextByCodeAndValue('repair_work_type',item.workType)
})
})
},
submit() {
console.log('this.checked', this.checked)
const selected = this.list.filter(f => this.checked.includes(f.id))
bus.$emit('choosePeople', selected)
uni.navigateBack()
const nowRepairId = this.checked[0]
const nowRepair = this.list.filter(item => nowRepairId===item.userId);
const param = {
id:this.ticketId,
nowRepairId:nowRepairId,
nowRepairName:nowRepair[0].userName,
}
console.log(param)
request({
url: '/admin-api/repair/tickets/notify',
method: 'post',
data:param
}).then((res)=>{
uni.showToast({
title: '指派成功!',
icon: 'none'
})
setTimeout(()=>{
uni.navigateBack()
},700)
})
//
// console.log('this.checked', this.checked)
// const selected = this.list.filter(f => this.checked.includes(f.id))
// bus.$emit('choosePeople', selected)
// uni.navigateBack()
}
}
}

View File

@ -86,11 +86,11 @@ function getDictByCode(dictCode){
function getDictTextByCodeAndValue(dictCode,value){
let dictArray = getStorageWithExpiry(dictCode);
if(null==dictArray){
dictArray = this.getDictByCode(dictCode)
dictArray = getDictByCode(dictCode)
}
let dictObj = dictArray.find(item=>item.dictValue==value)
let dictObj = dictArray.find(item=>item.value==value)
if(dictObj){
return dictObj.dictLabel
return dictObj.label
}else{
return "未知数据"
}