特殊人群
This commit is contained in:
@@ -25,7 +25,8 @@ export default {
|
|||||||
ops: {default: () => ({})},
|
ops: {default: () => ({})},
|
||||||
valueObj: Boolean,
|
valueObj: Boolean,
|
||||||
params: {default: () => ({})},
|
params: {default: () => ({})},
|
||||||
multiple: Boolean
|
multiple: Boolean,
|
||||||
|
single: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -35,6 +36,7 @@ export default {
|
|||||||
gird: {url: "/components/pages/selectGird", label: "girdName"},
|
gird: {url: "/components/pages/selectGird", label: "girdName"},
|
||||||
party: {url: "/components/pages/selectParty", label: "name"},
|
party: {url: "/components/pages/selectParty", label: "name"},
|
||||||
dept: {url: "/components/pages/selectDept", label: "name"},
|
dept: {url: "/components/pages/selectDept", label: "name"},
|
||||||
|
deptUser: {url: "/components/pages/selectDeptUser", label: "name"},
|
||||||
custom: {...this.ops}
|
custom: {...this.ops}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -50,7 +52,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleJump() {
|
handleJump() {
|
||||||
let {config, nodeKey, valueObj, multiple} = this,
|
let {config, nodeKey, valueObj, multiple, single} = this,
|
||||||
selected = (valueObj ? this.value[nodeKey] : this.value) || this.selected?.map(e => e[nodeKey])
|
selected = (valueObj ? this.value[nodeKey] : this.value) || this.selected?.map(e => e[nodeKey])
|
||||||
uni.$once('pagePicker:' + this.type, data => {
|
uni.$once('pagePicker:' + this.type, data => {
|
||||||
console.log('发送', data)
|
console.log('发送', data)
|
||||||
@@ -61,7 +63,7 @@ export default {
|
|||||||
})
|
})
|
||||||
let url = `${config.url}`,
|
let url = `${config.url}`,
|
||||||
qsstr = qs.stringify({
|
qsstr = qs.stringify({
|
||||||
selected, nodeKey, multiple, ...this.params
|
selected, nodeKey, multiple, single, ...this.params
|
||||||
})
|
})
|
||||||
if (!!qsstr) {
|
if (!!qsstr) {
|
||||||
url += `?${qsstr}`
|
url += `?${qsstr}`
|
||||||
|
|||||||
59
src/components/AiTreePath/AiTreePath.vue
Normal file
59
src/components/AiTreePath/AiTreePath.vue
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<section class="AiTreePath">
|
||||||
|
<b v-text="`全部`" @click="$emit('click','all')"/>
|
||||||
|
<div flex v-for="p in parents" :key="p.id">
|
||||||
|
<u-icon name="arrow-right" size="32" color="#ccc"/>
|
||||||
|
<div class="mar-l8" v-text="p[options.label]" @click="$emit('click',p)"/>
|
||||||
|
</div>
|
||||||
|
<u-icon v-if="label" name="arrow-right" size="32" color="#ccc"/>
|
||||||
|
<div class="active" v-text="label" @click="$emit('click',node)"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "AiTreePath",
|
||||||
|
props: {
|
||||||
|
prop: {default: () => ({})},
|
||||||
|
paths: {default: () => ({})},
|
||||||
|
node: {default: null}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
options: v => ({
|
||||||
|
id: 'id',
|
||||||
|
label: 'name',
|
||||||
|
parent: 'parentId',
|
||||||
|
...v.prop
|
||||||
|
}),
|
||||||
|
label: v => v.node?.[v.options.label] || "",
|
||||||
|
parent: v => v.paths?.[v.node?.[v.options.parent]],
|
||||||
|
parents() {
|
||||||
|
const arr = []
|
||||||
|
const {id: KEY, parent: PARENT} = this.options
|
||||||
|
const find = n => {
|
||||||
|
if (!!n?.[KEY]) {
|
||||||
|
arr.unshift(n)
|
||||||
|
find(this.paths[n?.[PARENT]])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
find(this.parent)
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AiTreePath {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: 40px;
|
||||||
|
font-family: PingFang-SC;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.active {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #26f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
src/components/pages/img/right-icon.png
Normal file
BIN
src/components/pages/img/right-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 373 B |
BIN
src/components/pages/img/tx@2x.png
Normal file
BIN
src/components/pages/img/tx@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
182
src/components/pages/selectDept.vue
Normal file
182
src/components/pages/selectDept.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<div class="selectDept">
|
||||||
|
<AiTopFixed>
|
||||||
|
<AiTreePath :node="cursor" :paths="depts.map" :prop="{parent:'parentid'}" @click="changeList"/>
|
||||||
|
</AiTopFixed>
|
||||||
|
<div class="user-list">
|
||||||
|
<template v-if="list.length>0">
|
||||||
|
<div class="item" v-for="(item, index) in list" :key="index" flex>
|
||||||
|
<div class="select-img" @click="checkClick(item)">
|
||||||
|
<img :src="item.isCheck ? checkIcon : cirIcon" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="user-info fill" flex @click="getCursor(item)">
|
||||||
|
<div class="fill" v-text="item.name"/>
|
||||||
|
<u-icon v-if="Array.isArray(item.children)" class="mar-r16" name="arrow-right" size="40" color="#999"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<AiEmpty/>
|
||||||
|
<div class="pad-b118"/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="pad-b118"/>
|
||||||
|
<div class="footer">
|
||||||
|
<div class="btn" @click="confirm">确定选择</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {mapState} from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "selectDept",
|
||||||
|
appName: "选择部门",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
current: 1,
|
||||||
|
total: 0,
|
||||||
|
name: '',
|
||||||
|
list: [],
|
||||||
|
depts: [],
|
||||||
|
cirIcon: require('./img/xz.png'),
|
||||||
|
checkIcon: require('./img/xzh.png'),
|
||||||
|
selected: [],
|
||||||
|
cursor: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
isSingle: v => !!v.$route.query.single,
|
||||||
|
nodeKey: v => v.$route.query.nodeKey || "idNumber",
|
||||||
|
isRequire: v => v.$route.query.isRequire || 1,
|
||||||
|
isAuth: v => !!v.$route.query.isAuth, //是否只能选择自己当前部门及以下
|
||||||
|
},
|
||||||
|
onLoad(query) {
|
||||||
|
console.log(query)
|
||||||
|
if (query.selected) {
|
||||||
|
this.selected = query.selected?.split(",").map(e => Number(e)) || []
|
||||||
|
}
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
var url = this.isAuth ? `/app/wxcp/wxdepartment/listByUser?name=${this.name}` : `/app/wxcp/wxdepartment/listAll?name=${this.name}`
|
||||||
|
this.$http.post(url).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
res.data.forEach(e => e.isCheck = this.selected.includes(e[this.nodeKey]))
|
||||||
|
this.depts = new this.$tree(res.data, {parent: 'parentid'})
|
||||||
|
this.list = this.depts.tree
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkClick(item) {
|
||||||
|
if (this.isSingle && this.isRequire == 1) {
|
||||||
|
this.depts.every(e => {
|
||||||
|
e.isCheck = item.id == e.id
|
||||||
|
})
|
||||||
|
} else item.isCheck = !item.isCheck
|
||||||
|
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
let checkList = []
|
||||||
|
this.depts.every((item) => {
|
||||||
|
if (item.isCheck) {
|
||||||
|
checkList.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!checkList.length && this.isRequire == 1) {
|
||||||
|
return this.$u.toast('请先选择部门')
|
||||||
|
} else {
|
||||||
|
uni.navigateBack({
|
||||||
|
success: () => {
|
||||||
|
uni.$emit("pagePicker:dept", checkList)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeList(item) {
|
||||||
|
if (item == "all") {
|
||||||
|
this.cursor = {}
|
||||||
|
this.list = this.depts.tree
|
||||||
|
} else {
|
||||||
|
this.cursor = item
|
||||||
|
this.list = item.children
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCursor(item) {
|
||||||
|
if (item.children?.length > 0) {
|
||||||
|
this.cursor = item
|
||||||
|
this.list = item.children
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.selectDept {
|
||||||
|
::v-deep .AiTopFixed .u-search {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pad-b118 {
|
||||||
|
padding-bottom: 118px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-list {
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 100vw;
|
||||||
|
|
||||||
|
.select-img {
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
margin: 12px 36px 12px 30px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info {
|
||||||
|
padding: 20px 0 20px 0;
|
||||||
|
height: 100%;
|
||||||
|
border-bottom: 1px solid #E4E5E6;
|
||||||
|
font-size: 36px;
|
||||||
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
line-height: 74px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
width: 100%;
|
||||||
|
height: 118px;
|
||||||
|
background: #F4F8FB;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: inline-block;
|
||||||
|
width: 192px;
|
||||||
|
height: 80px;
|
||||||
|
line-height: 80px;
|
||||||
|
background: #1365DD;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32px;
|
||||||
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
|
color: #FFF;
|
||||||
|
margin: 20px 34px 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
303
src/components/pages/selectDeptUser.vue
Normal file
303
src/components/pages/selectDeptUser.vue
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
<template>
|
||||||
|
<section class="selectDeptUser">
|
||||||
|
<div class="header-middle">
|
||||||
|
<div class="hint">
|
||||||
|
<span v-for="(item, index) in selectDeptPath" :key="index">
|
||||||
|
<span v-if="index>0" class="mar-h4">/</span>
|
||||||
|
<span class="color-3F8DF5" @click="deptNameClick(item, index)">{{ item.name }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="cards" v-for="item in treeList" :key="item.id" @click="itemClick(item)">
|
||||||
|
<div class="imges">
|
||||||
|
<div class="imgselect" v-if="type == 1" :class="{checked:item.isChecked}" />
|
||||||
|
<img src="./img/gird--select-icon.png" alt="" class="avatras"/>
|
||||||
|
</div>
|
||||||
|
<div class="rightes">
|
||||||
|
<div class="applicationNames">{{ item.name }}</div>
|
||||||
|
<img src="./img/right-icon.png" alt="" class="imgs"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="type == 0">
|
||||||
|
<div class="userCards" v-for="(e, userIndex) in userList" :key="e.id">
|
||||||
|
<div class="imges">
|
||||||
|
<div class="imgselect" :class="{checked:e.isChecked}" @click.stop="itemCheck(e, 'user', userIndex)"/>
|
||||||
|
<img src="./img/tx@2x.png" alt="" class="avatras"/>
|
||||||
|
</div>
|
||||||
|
<div class="rights fill">
|
||||||
|
<div class="applicationNames" v-text="e.name"></div>
|
||||||
|
<div class="idNumbers">{{ e.phone }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<AiEmpty description="暂无数据" v-if="!hasData"/>
|
||||||
|
</div>
|
||||||
|
<div class="subBtn" @click="submit">
|
||||||
|
<div>确定选择</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
export default {
|
||||||
|
name: "selectDeptUser",
|
||||||
|
appName: "选择人员",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected: [],
|
||||||
|
allData: null,
|
||||||
|
treeList: [],
|
||||||
|
selectDeptPath: [],
|
||||||
|
userList: [],
|
||||||
|
type: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isSingle: v => !!v.$route.query.single,
|
||||||
|
nodeKey: v => v.$route.query.nodeKey || "id",
|
||||||
|
isRequire: v => v.$route.query.isRequire || 1,
|
||||||
|
hasData() {
|
||||||
|
return this.treeList?.length > 0 || this.userList?.length > 0
|
||||||
|
},
|
||||||
|
...mapState(['user'])
|
||||||
|
},
|
||||||
|
onLoad(query) {
|
||||||
|
if (query.selected) {
|
||||||
|
this.selected = query.selected?.split(",") || []
|
||||||
|
}
|
||||||
|
this.getListAll()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isSelected(id) {
|
||||||
|
return !!this.selected.find(e => e == id)
|
||||||
|
},
|
||||||
|
getListAll() {
|
||||||
|
this.$instance.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
let parents = res.data.map(e => e.parentid)
|
||||||
|
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id)}))
|
||||||
|
this.deptInit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deptInit() {
|
||||||
|
this.treeList = this.allData.filter(e => !e.parentid)
|
||||||
|
this.selectDeptPath = [{name: "可选范围", id: ''}]
|
||||||
|
},
|
||||||
|
itemClick({id, name, corpId}) {
|
||||||
|
let index = this.selectDeptPath.findIndex(e => e.id == id && e.corpId == corpId)
|
||||||
|
if (index == -1) {
|
||||||
|
this.selectDeptPath.push({name, id, corpId})
|
||||||
|
this.getDeptsAndUsersByParent(id, corpId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDeptsAndUsersByParent(departmentId, corpId) {
|
||||||
|
this.treeList = this.allData.filter(e => e.parentid == departmentId && e.corpId == corpId)
|
||||||
|
this.userList = []
|
||||||
|
this.$instance.post(`/app/wxcp/wxuser/listByDeptId`, null, {
|
||||||
|
params: {departmentId, status: 1, cid: corpId}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.userList = res.data.map(e => ({...e, isChecked: this.isSelected(e.id, e.corpId)}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deptNameClick(row, index) {
|
||||||
|
this.userList = []
|
||||||
|
if (!index) { //第一级别
|
||||||
|
this.deptInit()
|
||||||
|
} else {
|
||||||
|
let length = this.selectDeptPath.length - index
|
||||||
|
this.selectDeptPath.splice(index + 1, length)
|
||||||
|
this.getDeptsAndUsersByParent(row.id, row.corpId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemCheck(row, kind, index) {
|
||||||
|
if(this.isSingle) {
|
||||||
|
this.selected = []
|
||||||
|
this.userList.map((item) => {
|
||||||
|
item.isChecked = false
|
||||||
|
})
|
||||||
|
this.userList[index].isChecked = true
|
||||||
|
this.selected.push({...row, kind})
|
||||||
|
} else {
|
||||||
|
row.isChecked = !row.isChecked
|
||||||
|
if (row.isChecked) {
|
||||||
|
this.selected.push({...row, kind})
|
||||||
|
} else {
|
||||||
|
let index = this.selected.findIndex(e => e.id == row.id)
|
||||||
|
this.selected.splice(index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if(![this.selected].flat().length) {
|
||||||
|
return this.$u.toast('请选择人员')
|
||||||
|
}
|
||||||
|
uni.navigateBack({
|
||||||
|
success: () => {
|
||||||
|
uni.$emit("pagePicker:deptUser", this.selected)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.selectDeptUser {
|
||||||
|
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: 0 1px 0 0 #e4e5e6;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-div {
|
||||||
|
height: 16px;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imges {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.imgselect {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-image: url("./img/xz.png");
|
||||||
|
background-position: center;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
&.checked {
|
||||||
|
background-image: url("./img/xzh.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatras {
|
||||||
|
width: 74px;
|
||||||
|
height: 74px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-left: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cards {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 120px;
|
||||||
|
line-height: 120px;
|
||||||
|
padding: 0 0 0 32px;
|
||||||
|
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 74px;
|
||||||
|
height: 74px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rightes {
|
||||||
|
width: calc(100% - 160px);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 32px;
|
||||||
|
border-bottom: 1px solid #e4e5e6;
|
||||||
|
|
||||||
|
.applicationNames {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgs {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.userCards {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 120px;
|
||||||
|
line-height: 120px;
|
||||||
|
padding: 0 0 0 32px;
|
||||||
|
|
||||||
|
.rights {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 32px;
|
||||||
|
border-bottom: 1px solid #e4e5e6;
|
||||||
|
padding-right: 40px;
|
||||||
|
height: inherit;
|
||||||
|
|
||||||
|
.applicationNames {
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-3F8DF5 {
|
||||||
|
color: #3F8DF5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mar-h4 {
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="selectResident">
|
<div class="selectResident">
|
||||||
<AiTopFixed>
|
<!-- <AiTopFixed> -->
|
||||||
<u-search placeholder="搜索" v-model="name" :show-action="false" @change="getList"></u-search>
|
<div class="search-top">
|
||||||
</AiTopFixed>
|
<u-search placeholder="搜索" v-model="name" :show-action="false" bg-color="#fff" search-icon-color="#E2E8F1"
|
||||||
|
color="#666" height="72" @search="getSearchList" @clear="handerClear" @change="getList"></u-search>
|
||||||
|
</div>
|
||||||
|
<!-- </AiTopFixed> -->
|
||||||
<div class="user-list">
|
<div class="user-list">
|
||||||
<template v-if="list.length>0">
|
<template v-if="list.length>0">
|
||||||
<div class="item" v-for="(item, index) in list" :key="index">
|
<div class="item" v-for="(item, index) in list" :key="index">
|
||||||
@@ -37,19 +40,23 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
cirIcon: require('./img/xz.png'),
|
cirIcon: require('./img/xz.png'),
|
||||||
checkIcon: require('./img/xzh.png'),
|
checkIcon: require('./img/xzh.png'),
|
||||||
selected: []
|
selected: [],
|
||||||
|
isSingle: false, //是否单选
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {...mapState(['user'])},
|
computed: {
|
||||||
|
...mapState(['user']),
|
||||||
|
},
|
||||||
onLoad(query) {
|
onLoad(query) {
|
||||||
if (query.selected) {
|
if (query.selected) {
|
||||||
this.selected = query.selected?.split(",") || []
|
this.selected = query.selected?.split(",") || []
|
||||||
}
|
}
|
||||||
|
this.isSingle = query.single || false
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.$http.post(`/app/appresident/list`, null, {
|
this.$instance.post(`/app/appresident/list`, null, {
|
||||||
params: {
|
params: {
|
||||||
current: this.current,
|
current: this.current,
|
||||||
size: 20,
|
size: 20,
|
||||||
@@ -69,7 +76,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkClick(index) {
|
checkClick(index) {
|
||||||
this.list[index].isCheck = !this.list[index].isCheck
|
if(this.isSingle) {
|
||||||
|
this.list.map((item) => {
|
||||||
|
item.isCheck = false
|
||||||
|
})
|
||||||
|
this.list[index].isCheck = true
|
||||||
|
}else {
|
||||||
|
this.list[index].isCheck = !this.list[index].isCheck
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
let checkList = []
|
let checkList = []
|
||||||
@@ -83,10 +98,15 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.$emit("pagePicker", checkList)
|
uni.$emit("pagePicker:resident", checkList)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handerClear() {
|
||||||
|
this.current = 1
|
||||||
|
this.name = ''
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -106,9 +126,20 @@ export default {
|
|||||||
padding-bottom: 118px;
|
padding-bottom: 118px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-top {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
padding: 16px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #E4E5E6;
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
.user-list {
|
.user-list {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
padding-top: 100px;
|
||||||
.item {
|
.item {
|
||||||
.select-img {
|
.select-img {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ export default {
|
|||||||
|
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return {
|
return {
|
||||||
title: '欢迎使用数智巫溪~',
|
title: '欢迎使用数智未央~',
|
||||||
path: `/pages/AppHome/AppHome`
|
path: `/pages/AppHome/AppHome`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ export default {
|
|||||||
}, 600);
|
}, 600);
|
||||||
}
|
}
|
||||||
}).catch(err=> {
|
}).catch(err=> {
|
||||||
|
this.flag = false
|
||||||
this.$u.toast(err.msg)
|
this.$u.toast(err.msg)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -99,17 +99,16 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
hasGridPermit() {
|
hasGridPermit() {
|
||||||
return this.user.girdCheckType != 0
|
return this.user.girdInfos2G && this.user.girdInfos2G.length
|
||||||
},
|
},
|
||||||
isAdmin() {
|
isAdmin() {
|
||||||
return this.user.girdCheckType == 2
|
return this.user.girdInfos2G && this.user.girdInfos2G.length
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$dict.load('appSpecialTypeFive')
|
this.$dict.load('appSpecialTypeFive')
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
document.title = '特殊人群管理'
|
|
||||||
if (this.hasGridPermit) {
|
if (this.hasGridPermit) {
|
||||||
if (!this.search.girdId) {
|
if (!this.search.girdId) {
|
||||||
this.search.girdId = this.user.girdId
|
this.search.girdId = this.user.girdId
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="value" v-else v-text="toString(formData[item.fieldDbName])"/>
|
<div class="value" v-if="!item.dict && item.type!='area' && item.type!='upload'" v-text="toString(formData[item.fieldDbName])"/>
|
||||||
</div>
|
</div>
|
||||||
<!-- input输入框 -->
|
<!-- input输入框 -->
|
||||||
<div class="item" v-if="item.type == 'input' || item.type == 'name' || item.type == 'phone'">
|
<div class="item" v-else-if="item.type == 'input' || item.type == 'name' || item.type == 'phone'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;"
|
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;"
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- number 输入框 -->
|
<!-- number 输入框 -->
|
||||||
<div class="item" v-if="item.type == 'number'">
|
<div class="item" v-else-if="item.type == 'number'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-input type="number" placeholder="请输入" input-align="right"
|
<u-input type="number" placeholder="请输入" input-align="right"
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 身份证输入框 -->
|
<!-- 身份证输入框 -->
|
||||||
<div class="item" v-if="item.type == 'idNumber'">
|
<div class="item" v-else-if="item.type == 'idNumber'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-input type="idcard" placeholder="请输入" input-align="right"
|
<u-input type="idcard" placeholder="请输入" input-align="right"
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- textarea输入框 富文本-->
|
<!-- textarea输入框 富文本-->
|
||||||
<div class="textarea" v-if="item.type == 'textarea' || item.type == 'text' || item.type == 'rtf'">
|
<div class="textarea" v-else-if="item.type == 'textarea' || item.type == 'text' || item.type == 'rtf'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-input type="textarea" placeholder="请输入请输入" placeholder-style="color:#999;font-size:16px;" height="200"
|
<u-input type="textarea" placeholder="请输入请输入" placeholder-style="color:#999;font-size:16px;" height="200"
|
||||||
@@ -60,32 +60,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 字典下拉选择 -->
|
<!-- 字典下拉选择 -->
|
||||||
<div class="item" v-if="item.type == 'dict'">
|
<div class="item" v-else-if="item.type == 'dict'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" @click="selectClick(item.fieldDbName, item.dict)">
|
<div class="value" @click="selectClick(item.fieldDbName, item.dict)">
|
||||||
<AiMore :value="$dict.getLabel(item.dict, formData[item.fieldDbName])"/>
|
<AiMore :value="$dict.getLabel(item.dict, formData[item.fieldDbName])"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 单选radio -->
|
<!-- 单选radio -->
|
||||||
<div class="item" v-if="item.type == 'radio'">
|
<div class="item" v-else-if="item.type == 'radio'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-radio-group v-model="formData[item.fieldDbName]">
|
<u-radio-group v-model="formData[item.fieldDbName]">
|
||||||
<!-- <u-radio :name="item.dictValue" v-for="(item, index) in $dict.getDict(item.dict)" :key="index">
|
<u-radio :name="itemr.dictValue" v-for="(itemr, indexr) in $dict.getDict(item.dict)" :key="indexr">
|
||||||
{{ item.dictName }}
|
{{ itemr.dictName }}
|
||||||
</u-radio> -->
|
</u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 开关onOff -->
|
<!-- 开关onOff -->
|
||||||
<div class="item" v-if="item.type == 'onOff'">
|
<div class="item" v-else-if="item.type == 'onOff'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-switch v-model="formData[item.fieldDbName]" :active-value="1" :inactive-value="0"></u-switch>
|
<u-switch v-model="formData[item.fieldDbName]" :active-value="1" :inactive-value="0"></u-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 多选checkbox -->
|
<!-- 多选checkbox -->
|
||||||
<div class="textarea" v-if="item.type == 'checkbox'">
|
<div class="textarea" v-else-if="item.type == 'checkbox'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<u-checkbox-group>
|
<u-checkbox-group>
|
||||||
@@ -100,26 +100,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 附件 -->
|
<!-- 附件 -->
|
||||||
<div class="textarea" v-if="item.type == 'upload'">
|
<div class="textarea" v-else-if="item.type == 'upload'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<!-- <AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片"
|
<!-- <AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片"
|
||||||
:def.sync="formData[item.fieldDbName]"
|
:def.sync="formData[item.fieldDbName]"
|
||||||
action="/admin/file/add2"/> -->
|
action="/admin/file/add2"/> -->
|
||||||
|
<AiUploader v-model="formData[item.fieldDbName]" :limit="9" action="/admin/file/add2"></AiUploader>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 地区选择 -->
|
<!-- 地区选择 -->
|
||||||
<div class="item" v-if="item.type == 'area'">
|
<div class="item" v-else-if="item.type == 'area'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" flex>
|
<div class="value" flex>
|
||||||
<!-- <AiAreaPicker @select="v=>formData[item.fieldDbName]=v" :name.sync="formData[item.fieldDbName+'_name']"
|
<!-- <AiAreaPicker @select="v=>formData[item.fieldDbName]=v" :name.sync="formData[item.fieldDbName+'_name']"
|
||||||
all :value="formData[item.fieldDbName]" :valueLevel="item.areaPattern" isForm/> -->
|
all :value="formData[item.fieldDbName]" :valueLevel="item.areaPattern" isForm/> -->
|
||||||
|
<AiAreaPicker class="ai-area" v-model="formData[item.fieldDbName]" :fullName="formData[item.fieldDbName+'_name']"
|
||||||
|
:valueLevel="item.areaPattern" :areaId="$areaId" >
|
||||||
|
<div class="ai-area__wrapper">
|
||||||
|
<span :style="formData[item.fieldDbName+'_name']? '' : 'color: #999'">{{ formData[item.fieldDbName+'_name'] || '请选择'}}</span>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||||
|
</div>
|
||||||
|
</AiAreaPicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 人员选择 -->
|
<!-- 人员选择 -->
|
||||||
<div class="item" v-if="item.type == 'user'">
|
<div class="item" v-else-if="item.type == 'user'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" @click="handleSelectUser(item.fieldDbName)">
|
<!-- <div class="value" @click="handleSelectUser(item.fieldDbName)">
|
||||||
<template v-if="!formData[item.fieldDbName].length">
|
<template v-if="!formData[item.fieldDbName].length">
|
||||||
<span>请选择</span>
|
<span>请选择</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -129,26 +137,29 @@
|
|||||||
}}</em>人
|
}}</em>人
|
||||||
</template>
|
</template>
|
||||||
<u-icon name="arrow-right" color="#ddd"></u-icon>
|
<u-icon name="arrow-right" color="#ddd"></u-icon>
|
||||||
</div>
|
</div> -->
|
||||||
|
<AiPagePicker @select="v=>handleSelectDeptUser(v, item)" type="deptUser">
|
||||||
|
<AiMore v-model="formData[item.fieldDbName + '_name']" :placeholder="item.fieldTips"/>
|
||||||
|
</AiPagePicker>
|
||||||
</div>
|
</div>
|
||||||
<!-- 日期选择 / 日期带时分秒选择 / 时间-时分秒选择 -->
|
<!-- 日期选择 / 日期带时分秒选择 / 时间-时分秒选择 -->
|
||||||
<div class="item" v-if="item.type == 'date' || item.type == 'datetime' || item.type == 'time'">
|
<div class="item" v-else-if="item.type == 'date' || item.type == 'datetime' || item.type == 'time'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" @click="dateClick(indexs, index)" flex>
|
<div class="value" @click="dateClick(indexs, index)" flex>
|
||||||
<AiMore v-model="formData[item.fieldDbName]"/>
|
<AiMore v-model="formData[item.fieldDbName]"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 居民档案选择 -->
|
<!-- 居民档案选择 -->
|
||||||
<div class="item" v-if="item.type == 'resident'">
|
<div class="item" v-else-if="item.type == 'resident'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" flex>
|
<div class="value" flex>
|
||||||
<AiPagePicker @select="v=>handleSelectResident(v,item)" single>
|
<AiPagePicker @select="v=>handleSelectResident(v, item.fieldDbName)" single>
|
||||||
<AiMore v-model="formData[item.fieldDbName + '_name']" :placeholder="item.fieldTips"/>
|
<AiMore v-model="formData[item.fieldDbName]" :placeholder="item.fieldTips"/>
|
||||||
</AiPagePicker>
|
</AiPagePicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 网格选择 -->
|
<!-- 网格选择 -->
|
||||||
<div class="item" v-if="item.type == 'gird'">
|
<div class="item" v-else-if="item.type == 'gird'">
|
||||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||||
<div class="value" flex>
|
<div class="value" flex>
|
||||||
<AiPagePicker type="gird" @select="v=>handleSelectGird(v,item)">
|
<AiPagePicker type="gird" @select="v=>handleSelectGird(v,item)">
|
||||||
@@ -190,31 +201,36 @@ export default {
|
|||||||
selectName: '',
|
selectName: '',
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
|
id: '',
|
||||||
|
appId: '',
|
||||||
|
query: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
isEdit() {
|
isEdit() {
|
||||||
return !!this.$route.query.id
|
return !!this.id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getType()
|
this.getType()
|
||||||
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.id = e.id || ''
|
||||||
|
this.appId = e.appId || ''
|
||||||
|
this.query = {...e}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
// document.title = "编辑人员"
|
uni.setNavigationBarTitle({
|
||||||
// if (!this.appId) {
|
title: '编辑人员',
|
||||||
// let {appId: value} = this.$route.query
|
})
|
||||||
// this.typeConfirm([{value}]).then(() => this.getDetail())
|
} else {
|
||||||
// }
|
uni.setNavigationBarTitle({
|
||||||
// } else {
|
title: '新增人员',
|
||||||
// document.title = '新增人员'
|
})
|
||||||
// if (this.$route.query.appId && !this.appId) {
|
}
|
||||||
// let {appId: value, appName} = this.$route.query
|
|
||||||
// this.typeConfirm([{value, label: decodeURIComponent(appName)}])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// ...mapActions(['selectEnterpriseContact']),
|
// ...mapActions(['selectEnterpriseContact']),
|
||||||
@@ -233,6 +249,13 @@ export default {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.typeList = res.data
|
this.typeList = res.data
|
||||||
|
if(this.appId) {
|
||||||
|
this.typeList.map((item) => {
|
||||||
|
if(this.appId == item.id) {
|
||||||
|
this.typeConfirm([{value: item.id, label: item.applicationName}])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -242,6 +265,7 @@ export default {
|
|||||||
return this.$instance.post(`/app/appapplicationinfo/queryApplicationInfo?appId=${this.appId}`).then((res) => {
|
return this.$instance.post(`/app/appapplicationinfo/queryApplicationInfo?appId=${this.appId}`).then((res) => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.formData = {}
|
this.formData = {}
|
||||||
|
this.formDataList = []
|
||||||
let data = res.data
|
let data = res.data
|
||||||
let dictList = []
|
let dictList = []
|
||||||
let formList = {}
|
let formList = {}
|
||||||
@@ -297,6 +321,7 @@ export default {
|
|||||||
...item,
|
...item,
|
||||||
type: item.type,
|
type: item.type,
|
||||||
fieldValue: "",
|
fieldValue: "",
|
||||||
|
// fieldAreaName: item.fieldDbName+'_name'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (item.type == 'date') {
|
if (item.type == 'date') {
|
||||||
@@ -317,6 +342,7 @@ export default {
|
|||||||
}
|
}
|
||||||
formList[item.groupIndex]?.push(colItem) || (formList[item.groupIndex] = [colItem])
|
formList[item.groupIndex]?.push(colItem) || (formList[item.groupIndex] = [colItem])
|
||||||
this.$set(this.formData, colItem.fieldDbName, colItem.fieldValue || "")
|
this.$set(this.formData, colItem.fieldDbName, colItem.fieldValue || "")
|
||||||
|
// this.$set(this.formData, colItem.fieldAreaName, colItem.fieldAreaName || "")
|
||||||
})
|
})
|
||||||
this.formDataList = Object.values(formList)
|
this.formDataList = Object.values(formList)
|
||||||
|
|
||||||
@@ -336,6 +362,10 @@ export default {
|
|||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
this.pageShow = true
|
this.pageShow = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.id) {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -433,6 +463,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if (!isValid) return
|
if (!isValid) return
|
||||||
|
|
||||||
@@ -451,12 +482,21 @@ export default {
|
|||||||
this.$u.toast(err || "提交失败,请联系管理员")
|
this.$u.toast(err || "提交失败,请联系管理员")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSelectResident(resident, item) {
|
handleSelectResident(resident, fieldDbName) {
|
||||||
|
let info = resident[0]
|
||||||
|
info[fieldDbName + "_name"] = info.name
|
||||||
|
this.formData = {...this.formData, ...info}
|
||||||
|
this.formData[fieldDbName] = info.id
|
||||||
|
this.formData[fieldDbName + "_name"] = info.name
|
||||||
|
this.formData.birthDate = this.$idCardNoUtil.getIdCardInfo(info.idNumber).birthday
|
||||||
|
this.$forceUpdate()
|
||||||
|
},
|
||||||
|
handleSelectDeptUser(resident, item) {
|
||||||
let info = resident?.[0] || {}
|
let info = resident?.[0] || {}
|
||||||
this.formData = {...this.formData, ...info}
|
this.formData = {...this.formData, ...info}
|
||||||
this.formData[item.fieldDbName] = info.id
|
this.formData[item.fieldDbName] = info.id
|
||||||
this.formData[item.fieldDbName + "_name"] = info.name
|
this.formData[item.fieldDbName + "_name"] = info.name
|
||||||
this.$forceUpdate()
|
// this.$forceUpdate()
|
||||||
},
|
},
|
||||||
toString(obj) {
|
toString(obj) {
|
||||||
return obj?.toString() || "-"
|
return obj?.toString() || "-"
|
||||||
@@ -468,7 +508,7 @@ export default {
|
|||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
getDetail() {
|
getDetail() {
|
||||||
let {id, appId} = this.$route.query
|
let {id, appId} = this.query
|
||||||
return id ? this.$instance.post("/app/appapplicationinfo/queryDetailById", null, {
|
return id ? this.$instance.post("/app/appapplicationinfo/queryDetailById", null, {
|
||||||
params: {id, appId}
|
params: {id, appId}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -592,6 +632,7 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
|||||||
Reference in New Issue
Block a user