工单管理
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
<div class="contents">
|
||||
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
|
||||
<u-form-item label="转交给" prop="status" required :border-bottom="false" right-icon="arrow-right" class="first-form" v-if="status == 1">
|
||||
<u-input v-model="forms.name" placeholder="请选择转交对象" @click="toSelectUser" disabled/>
|
||||
<!-- <u-input v-model="forms.name" placeholder="请选择转交对象" @click="toSelectUser" disabled/> -->
|
||||
<AiPagePicker type="sysUser" single :isShowPhone="true" :selected.sync="forms.user" action="/app/wxcp/wxuser/list?status=1" nodeKey="id" @select="handleSelectUser" class="select-user">
|
||||
<span style="margin-left: 4px" v-if="forms.user && forms.user.length">{{ forms.user[0].name }}</span>
|
||||
<span v-else class="color-999">请选择</span>
|
||||
</AiPagePicker>
|
||||
</u-form-item>
|
||||
<u-form-item label="事件分类" prop="groupName" required :border-bottom="false" right-icon="arrow-right" v-if="status != 1">
|
||||
<!-- <u-input v-model="forms.groupName" placeholder="请选择事件分类" /> -->
|
||||
@@ -52,7 +56,9 @@ export default {
|
||||
groupId: '',
|
||||
content: '',
|
||||
files: [],
|
||||
name: ''
|
||||
name: '',
|
||||
handleUserId: '',
|
||||
handleUserName: ''
|
||||
},
|
||||
flag: false,
|
||||
show: false,
|
||||
@@ -97,8 +103,14 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
handleSelectUser(e) {
|
||||
this.forms.user = e
|
||||
this.forms.handleUserId = e[0].id
|
||||
this.forms.handleUserName = e[0].name
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if (this.status == 1 && !this.forms.name) {
|
||||
if (this.status == 1 && !this.forms.handleUserName) {
|
||||
return this.$u.toast('请选择转交对象')
|
||||
}
|
||||
if (this.status != 1 && !this.forms.groupName) {
|
||||
@@ -156,7 +168,7 @@ export default {
|
||||
this.forms.groupId = e[0].value
|
||||
},
|
||||
toSelectUser() {
|
||||
uni.navigateTo({url: '../AppGridManagement/selectGridMember'})
|
||||
uni.navigateTo({url: './SelectUser'})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
<div class="times">{{ data.createTime }}</div>
|
||||
</div>
|
||||
<span class="edit-btn" @click="toEdit()" v-if="data.eventStatus != 2 || data.eventStatus != 3">编辑</span>
|
||||
</div>
|
||||
|
||||
<div class="header-middle">
|
||||
@@ -104,7 +105,7 @@
|
||||
<div class="doIt" @click="doItShow = true">我来受理</div>
|
||||
</div>
|
||||
|
||||
<div class="endDoIt" v-if="data.eventStatus == 1 && data.rightType == 0" @click="toContent(3)">前往办理</div>
|
||||
<div class="endDoIt" v-if="data.eventStatus == 1" @click="toContent(3)">前往办理</div>
|
||||
</div>
|
||||
<AiEvaluation v-show="false" v-model="evaluation" :bid="data.id"/>
|
||||
<u-modal v-model="doItShow" :mask-close-able="true" z-index="99" content="确定受理该事件?" :show-cancel-button="true" @confirm="doThings"></u-modal>
|
||||
@@ -137,7 +138,7 @@ export default {
|
||||
const getAvatar = str => str?.substring(str?.length, str?.length - 2)
|
||||
const list = this.data.processList.map(e => ({
|
||||
...e,
|
||||
avatar: getAvatar(e.girdMemberName),
|
||||
avatar: getAvatar(e.userName),
|
||||
statusLabel: this.$dict.getLabel('clapDoStatus', e.doStatus)
|
||||
}))
|
||||
if (this.evaluation.id) {
|
||||
@@ -196,6 +197,9 @@ export default {
|
||||
current: img
|
||||
})
|
||||
},
|
||||
toEdit() {
|
||||
uni.navigateTo({url: `./Edit?id=${this.id}`})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -213,6 +217,7 @@ uni-page-body {
|
||||
display: flex;
|
||||
margin: 26px 0 14px 0;
|
||||
padding: 0 32px;
|
||||
position: relative;
|
||||
|
||||
.avatars {
|
||||
width: 80px;
|
||||
@@ -239,6 +244,17 @@ uni-page-body {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
position: absolute;
|
||||
color: #197df0;
|
||||
top: 16px;
|
||||
right: 32px;
|
||||
width: 150px;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
|
||||
253
src/project/xbot/AppWorkOrder/Edit.vue
Normal file
253
src/project/xbot/AppWorkOrder/Edit.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="Edit">
|
||||
<div class="contents">
|
||||
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
|
||||
<u-form-item label="事件描述" prop="content" required :border-bottom="false" label-position="top" class="contents">
|
||||
<u-input v-model="forms.content" placeholder="请输入事件描述..." type="textarea" auto-height height="100" maxlength="500"/>
|
||||
</u-form-item>
|
||||
<u-form-item label="事件类型" prop="flName" required :border-bottom="false" right-icon="arrow-right">
|
||||
<span @click="show = true" class="right-span" :style="forms.flName ? '' : 'color:#999;'">{{ forms.flName || '请选择事件类型' }}</span>
|
||||
<u-select v-model="show" :list="flList" value-name="id" label-name="groupName" @confirm="selectFl"></u-select>
|
||||
</u-form-item>
|
||||
<div class="line"></div>
|
||||
<u-form-item label="所属网格" prop="girdName" required :border-bottom="false">
|
||||
<AiPagePicker type="gird" v-model="forms.girdId" @change="confirmGird" valueObj nodeKey="id" formType="2" class="right-span">
|
||||
<AiMore v-model="forms.girdName" placeholder="请选择所属网格"/>
|
||||
</AiPagePicker>
|
||||
</u-form-item>
|
||||
<u-form-item label="联系方式" prop="phone" required :border-bottom="false" >
|
||||
<u-input v-model="forms.phone" placeholder="请输入联系方式" />
|
||||
</u-form-item>
|
||||
<u-form-item label="上报位置" prop="mapInfo" required :border-bottom="false" right-icon="arrow-right" class="border">
|
||||
<span @click="toMap" class="right-span" :style="forms.mapInfo.address ? '' : 'color:#999;'">{{ forms.mapInfo.address || '请选择上报位置' }}</span>
|
||||
</u-form-item>
|
||||
<div class="line"></div>
|
||||
<u-form-item label="图片上传(最多9张)" prop="files" :border-bottom="false" class="avatars" label-position="top">
|
||||
<AiUploader :def.sync="forms.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
</u-form>
|
||||
</div>
|
||||
|
||||
<div class="btn" @click="confirm">
|
||||
<span>提交</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
export default {
|
||||
name: 'Edit',
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
groupName: '',
|
||||
groupId: '',
|
||||
content: '',
|
||||
mapInfo: {address: ''},
|
||||
girdId: '',
|
||||
girdName: '',
|
||||
files: [],
|
||||
name: '',
|
||||
phone: ''
|
||||
},
|
||||
flag: false,
|
||||
show: false,
|
||||
flList: [],
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.typeList()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '事件编辑'
|
||||
this.forms.name = this.user.name
|
||||
this.forms.phone = this.user.phone
|
||||
this.forms.girdId = this.user.girdId
|
||||
this.forms.girdName = this.user.girdName
|
||||
uni.$on('chooseLat', res => {
|
||||
this.forms.mapInfo = {...res}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appsessionarchivereportinfo/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.forms = res.data
|
||||
this.forms.mapInfo = {
|
||||
lat: res.data.lat,
|
||||
lng: res.data.lng,
|
||||
address: res.data.address,
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
typeList() {
|
||||
this.$http.post(`/app/appresidentreportgroup/list?current=1&size=100000`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.flList = res.data.records.map(v => {
|
||||
return {
|
||||
label: v.id,
|
||||
value: v.groupName
|
||||
}
|
||||
})
|
||||
this.$forceUpdate()
|
||||
this.getDetail()
|
||||
}
|
||||
})
|
||||
},
|
||||
selectFl(e) {
|
||||
this.forms.flName = e[0].label
|
||||
this.forms.flId = e[0].value
|
||||
},
|
||||
confirmGird(v) {
|
||||
this.forms.girdId = v.id
|
||||
this.forms.girdName = v.girdName
|
||||
},
|
||||
toMap() {
|
||||
uni.navigateTo({url: `./Map`})
|
||||
},
|
||||
confirm() {
|
||||
if(this.flag) return
|
||||
|
||||
if (!this.forms.content) {
|
||||
return this.$u.toast('请输入事件描述')
|
||||
}
|
||||
if (!this.forms.flName) {
|
||||
return this.$u.toast('请选择事件类型')
|
||||
}
|
||||
|
||||
// if (!this.forms.mapInfo.address) {
|
||||
// return this.$u.toast('请选择上报位置')
|
||||
// }
|
||||
// if (!this.forms.girdName) {
|
||||
// return this.$u.toast('请选择所属网格')
|
||||
// }
|
||||
// if (!this.forms.name) {
|
||||
// return this.$u.toast('请输入姓名')
|
||||
// }
|
||||
// if (!this.forms.phone) {
|
||||
// return this.$u.toast('请输入手机号')
|
||||
// }
|
||||
this.flag = true
|
||||
this.$http.post(`/app/appsessionarchivereportinfo/update`, {...this.forms, ...this.forms.mapInfo}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('事件编辑成功')
|
||||
uni.$emit('getListInit')
|
||||
uni.$emit('updateDeatil')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.Edit {
|
||||
height: 100%;
|
||||
|
||||
.contents {
|
||||
padding-bottom: 140px;
|
||||
|
||||
::v-deep .u-form {
|
||||
.u-form-item {
|
||||
// padding: 0 45px !important;
|
||||
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
padding-bottom: 0;
|
||||
|
||||
.u-input {
|
||||
text-align: right !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-form-item:first-child {
|
||||
.u-form-item__body {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 24px;
|
||||
background: #f3f6f9;
|
||||
}
|
||||
|
||||
.contents {
|
||||
padding-bottom: 20px !important;
|
||||
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
.u-input {
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.avatars {
|
||||
padding-bottom: 20px !important;
|
||||
|
||||
.u-form-item__body {
|
||||
// .default {
|
||||
// width: 160px;
|
||||
// height: 160px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.border {
|
||||
::v-deep .u-form-item__body {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background: #3975c6;
|
||||
padding: 34px 0;
|
||||
text-align: center;
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.right-span {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
|
||||
::v-deep .u-icon__label {
|
||||
font-size: 28px!important;
|
||||
}
|
||||
|
||||
::v-deep .uicon-arrow-right{
|
||||
color: #c0c4cc!important;
|
||||
}
|
||||
}
|
||||
::v-deep .uni-input-placeholder {
|
||||
color: #999!important;
|
||||
font-size: 28px!important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
333
src/project/xbot/AppWorkOrder/Map.vue
Normal file
333
src/project/xbot/AppWorkOrder/Map.vue
Normal file
@@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="map">
|
||||
<!-- <div class="build-btn locate" @click="getLocale">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/h5/Location2.png" alt=""/>
|
||||
当前<br>位置
|
||||
</div> -->
|
||||
<div class="address-search">
|
||||
<div class="address-search__wrapper">
|
||||
<image src="./components/img/search.png" />
|
||||
<input placeholder-style="color: #98A6B6" placeholder="搜索地点" v-model="address" @input="onChange">
|
||||
</div>
|
||||
</div>
|
||||
<scroll-view scroll-y scroll-into-view="address-item1" v-if="addressList.length">
|
||||
<div class="address-item" :id="'address-item' + index" v-for="(item, index) in addressList" :key="index" @click="chooseAddress(index)">
|
||||
<div class="left">
|
||||
<h2>{{ item.title }}</h2>
|
||||
<p>{{ item.address }}</p>
|
||||
</div>
|
||||
<!-- <div class="right" :class="[currIndex === index ? 'active' : '']"></div> -->
|
||||
</div>
|
||||
</scroll-view>
|
||||
<div class="map-content">
|
||||
<AiTMap :map.sync="map" :lib.sync="lib" :ops="ops" :libraries="['service', 'tools', 'geocoder']"/>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="btn" @click="confirm">确认定位</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapActions} from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ops: {},
|
||||
lib: null,
|
||||
map: null,
|
||||
markerLayer: '',
|
||||
isFlag: false,
|
||||
latLng: {lat: '', lng: ''},
|
||||
address: '',
|
||||
addressList: []
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
mounted() {
|
||||
this.initMap()
|
||||
},
|
||||
onShow() {
|
||||
document.title = "选择上报位置"
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['injectJWeixin']),
|
||||
initMap(retryTimes = 0) { //初始化地图
|
||||
this.$nextTick(() => {
|
||||
let {map} = this
|
||||
if (map) {
|
||||
map.setZoom(15)
|
||||
map.on("click", (evt) => {
|
||||
this.handleMapClick(evt)
|
||||
});
|
||||
} else {
|
||||
if (retryTimes < 10)
|
||||
setTimeout(() => {
|
||||
this.initMap(++retryTimes)
|
||||
}, 500)
|
||||
else console.error("地图渲染失败")
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange () {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout)
|
||||
}
|
||||
this.timeout = setTimeout(() => {
|
||||
this.currIndex = -1
|
||||
new this.lib.service.Suggestion({
|
||||
pageSize: 20
|
||||
}).getSuggestions({
|
||||
keyword: this.address
|
||||
}).then(res => {
|
||||
this.addressList = []
|
||||
if (res.data.length) {
|
||||
this.addressList = res.data
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
},
|
||||
getAddress () {
|
||||
new this.lib.service.Search({
|
||||
pageSize: 20
|
||||
}).explore({
|
||||
center: this.latLng,
|
||||
radius: 2000,
|
||||
orderBy: '_distance'
|
||||
}).then(res => {
|
||||
this.addressList = []
|
||||
if (res.data.length) {
|
||||
this.addressList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseAddress (index) {
|
||||
this.address = this.addressList[index].address
|
||||
this.latLng = {lat: this.addressList[index].location.lat, lng: this.addressList[index].location.lng}
|
||||
this.addMarker(this.addressList[index].location)
|
||||
},
|
||||
addMarker (position) {
|
||||
if (this.marker) {
|
||||
this.marker.setMap(null)
|
||||
this.marker = null
|
||||
}
|
||||
this.marker = new this.lib.MultiMarker({
|
||||
id: 'marker-layer',
|
||||
map: this.map,
|
||||
styles: {
|
||||
marker: new this.lib.MarkerStyle({
|
||||
width: 30,
|
||||
height: 45,
|
||||
anchor: { x: 10, y: 30 }
|
||||
}),
|
||||
},
|
||||
geometries: [{
|
||||
id: 'marker',
|
||||
styleId: 'marker',
|
||||
position: position,
|
||||
properties: {
|
||||
title: 'marker'
|
||||
}
|
||||
}]
|
||||
})
|
||||
this.easeTo(position)
|
||||
},
|
||||
|
||||
easeTo (position) {
|
||||
this.map.easeTo({
|
||||
center: position,
|
||||
zoom: 17
|
||||
},
|
||||
{ duration: 500 })
|
||||
},
|
||||
handleMapClick(evt) {
|
||||
console.log(evt)
|
||||
let {lib: TMap, map} = this
|
||||
if (this.markerLayer) {
|
||||
this.markerLayer.setMap(null);
|
||||
}
|
||||
this.markerLayer = new TMap.MultiMarker({id: 'marker-layer', map});
|
||||
this.markerLayer.add({
|
||||
position: evt.latLng
|
||||
});
|
||||
this.latLng = evt.latLng
|
||||
|
||||
// var geocoder = new TMap.geocoder({
|
||||
// city: "全国",
|
||||
// radius: 1000 //范围,默认:500
|
||||
// });
|
||||
// geocoder.getAddress(this.latLng, function(status, result) {
|
||||
// if (status === 'complete'&&result.regeocode) {
|
||||
// var address = result.regeocode.formattedAddress;
|
||||
// this.address = address
|
||||
// console.log(this.address)
|
||||
// }else{
|
||||
// log.error('根据经纬度查询地址失败')
|
||||
// }
|
||||
// })
|
||||
|
||||
// this.address = evt.poi.name
|
||||
},
|
||||
confirm() {
|
||||
if (!this.latLng.lat) {
|
||||
return this.$u.toast(`未获取到定位信息,无法定位`)
|
||||
}
|
||||
|
||||
uni.$emit('chooseLat', {
|
||||
lat: this.latLng.lat,
|
||||
lng: this.latLng.lng,
|
||||
address: this.address
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.map {
|
||||
height: 100vh;
|
||||
|
||||
.build-btn {
|
||||
width: 80px;
|
||||
height: 160px;
|
||||
background: #FFF;
|
||||
box-shadow: 0 4px 8px 0 rgba(138, 138, 138, 0.5);
|
||||
border-radius: 8px;
|
||||
position: fixed;
|
||||
bottom: 136px;
|
||||
right: 24px;
|
||||
z-index: 99999;
|
||||
padding: 16px 16px 0;
|
||||
box-sizing: border-box;
|
||||
font-size: 24px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
line-height: 30px;
|
||||
|
||||
&.locate {
|
||||
transform: translateY(calc(-100% - 20px));
|
||||
}
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.map-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.footer {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 99999;
|
||||
display: flex;
|
||||
font-size: 32px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
|
||||
.click {
|
||||
flex: 1;
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.btn {
|
||||
flex: 2;
|
||||
background: #1365DD;
|
||||
color: #FFF;
|
||||
}
|
||||
}
|
||||
.address-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
padding: 0 32px;
|
||||
|
||||
.address-search__wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 72px;
|
||||
padding: 0 32px;
|
||||
background: #F6F7F9;
|
||||
border-radius: 36px;
|
||||
|
||||
image {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: 26px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
scroll-view {
|
||||
height: 400px;
|
||||
padding: 0 32px;
|
||||
|
||||
.address-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32px 0;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex-shrink: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
border: 4px solid #CCCCCC;
|
||||
transition: all ease 0.3s;
|
||||
|
||||
&.active {
|
||||
border: 10px solid #1365DD;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 20px;
|
||||
color: #222222;
|
||||
font-weight: 600;
|
||||
font-size: 34px;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.2;
|
||||
color: #999999;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,339 +0,0 @@
|
||||
<template>
|
||||
<div class="SelectUser">
|
||||
<div class="header-middle">
|
||||
<div class="hint">
|
||||
<span v-for="(item, index) in slectList" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span style="color:#3F8DF5" @click="girdNameClick(item, index)">{{item.girdName}}</span></span>
|
||||
</div>
|
||||
|
||||
<div class="showTypes" v-if="!userList.length">
|
||||
<div v-if="treeList.length > 0">
|
||||
<div class="cards" v-for="(item, index) in treeList" :key="index" @click="itemClick(item)">
|
||||
<div class="imges">
|
||||
<span v-if="item.girdLevel == 2">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)" />
|
||||
</span>
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras" />
|
||||
</div>
|
||||
<div class="rightes">
|
||||
<div class="applicationNames">{{ item.girdName }}</div>
|
||||
<img src="./components/img/right-icon.png" alt="" class="imgs" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</div>
|
||||
|
||||
<div class="showUsers" v-else>
|
||||
<div v-if="userList.length > 0">
|
||||
<div class="cards" v-for="(e, index) in userList" :key="index">
|
||||
<div class="imges">
|
||||
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(e, index)" />
|
||||
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)" />
|
||||
|
||||
<img src="./components/img/tx@2x.png" alt="" class="avatras" />
|
||||
</div>
|
||||
|
||||
<div class="rights">
|
||||
<div class="applicationNames">{{ e.name }}</div>
|
||||
<div class="idNumbers">{{ e.phone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="subBtn" @click="submit">
|
||||
<div>确定选择</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SelectUser',
|
||||
data() {
|
||||
return {
|
||||
selectUser: {},
|
||||
allData: null,
|
||||
treeList: [],
|
||||
slectList: [],
|
||||
userList: [],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getTree()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '选择人员'
|
||||
},
|
||||
methods: {
|
||||
getTree() {
|
||||
this.slectList = []
|
||||
this.$http.post('/app/appgirdinfo/listAllByTop').then((res) => {
|
||||
if (res?.data) {
|
||||
this.allData = res.data
|
||||
this.treeInit()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
treeInit() {
|
||||
if(this.allData[0].girdLevel == 2) {
|
||||
if(this.allData[0].girdMemberList && this.allData[0].girdMemberList.length) {
|
||||
this.userList = this.allData[0].girdMemberList
|
||||
this.userList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
}
|
||||
}else {
|
||||
this.treeList = this.allData[0].girdList
|
||||
}
|
||||
var obj = {
|
||||
girdName: this.allData[0].girdName,
|
||||
id: this.allData[0].id,
|
||||
girdLevel: this.allData[0].girdLevel
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
},
|
||||
|
||||
itemClick(row) {
|
||||
console.log(row)
|
||||
var obj = {
|
||||
girdName: row.girdName,
|
||||
id: row.id,
|
||||
girdLevel: row.girdLevel
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
this.searckGird(row)
|
||||
},
|
||||
|
||||
searckGird(row) {
|
||||
this.treeList = []
|
||||
if(row.girdLevel != 2) { //查网格
|
||||
this.$http.post(`/app/appgirdinfo/list?parentGirdId=${row.id}&size=999`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data.records
|
||||
}
|
||||
})
|
||||
}else { //查网格员
|
||||
this.userList = []
|
||||
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${row.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.userList = res.data
|
||||
this.userList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
girdNameClick(row, index) {
|
||||
this.userList = []
|
||||
if(!index) { //第一级别
|
||||
this.slectList = []
|
||||
this.treeInit()
|
||||
}else {
|
||||
var list = []
|
||||
this.slectList.map((item, i) => {
|
||||
if(i <= index) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.slectList = list
|
||||
this.searckGird(row)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
girdClick(row, index) {
|
||||
if (this.treeList[index].isChecked) {//取消
|
||||
this.treeList[index].isChecked = false
|
||||
this.selectUser = {}
|
||||
} else {
|
||||
this.treeList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
this.treeList[index].isChecked = true
|
||||
this.selectUser = row
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
userClick(row, index) {
|
||||
if (this.userList[index].isChecked) {//取消
|
||||
this.userList[index].isChecked = false
|
||||
this.selectUser = {}
|
||||
} else {
|
||||
this.userList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
this.userList[index].isChecked = true
|
||||
this.selectUser = row
|
||||
}
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
submit() {
|
||||
if (this.selectUser.id != null) {
|
||||
uni.$emit('goback', this.selectUser)
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
return this.$u.toast('请选择网格或网格员')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SelectUser {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
}
|
||||
|
||||
.header-middle {
|
||||
padding-bottom: 140px;
|
||||
.hint {
|
||||
padding: 28px 20px 28px 32px;
|
||||
line-height: 56px;
|
||||
box-shadow: 0px 1px 0px 0px #e4e5e6;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.showTypes {
|
||||
.empty-div {
|
||||
height: 16px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// width: 200px;
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.rightes {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.showUsers {
|
||||
.cards {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
line-height: 120px;
|
||||
// background: pink;
|
||||
padding: 0 0 0 32px;
|
||||
|
||||
.imges {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.avatras {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
margin-left: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.rights {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subBtn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
background: #1365dd;
|
||||
border-radius: 4px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
margin: 20px 34px 0 0;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/xbot/AppWorkOrder/components/img/search.png
Normal file
BIN
src/project/xbot/AppWorkOrder/components/img/search.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 854 B |
Reference in New Issue
Block a user