湖南公安

This commit is contained in:
liuye
2022-06-15 15:46:31 +08:00
parent 2b543c6d98
commit 2fc027c8c9
5 changed files with 71 additions and 88 deletions

View File

@@ -20,6 +20,7 @@ export default {
value: {default: ""},
type: {default: "resident"},
nodeKey: {default: "idNumber"},
isRequire: {default: 1},
selected: {default: () => []},
placeholder: {default: "选择人员"},
ops: {default: () => ({})},
@@ -48,7 +49,7 @@ export default {
},
methods: {
handleJump() {
let {config, nodeKey, valueObj} = this,
let {config, nodeKey, valueObj, isRequire} = this,
selected = (valueObj ? this.value[nodeKey] : this.value) || this.selected?.map(e => e[nodeKey])
uni.$once('pagePicker:' + this.type, data => {
console.log('发送', data)
@@ -58,7 +59,7 @@ export default {
})
let url = `${config.url}`,
qsstr = qs.stringify({
selected, nodeKey, ...this.$attrs
selected, nodeKey, isRequire, ...this.$attrs
})
if (!!qsstr) {
url += `?${qsstr}`

View File

@@ -48,6 +48,9 @@ export default {
},
nodeKey() {
return this.$route.query.nodeKey || "idNumber"
},
isRequire() {
return this.$route.query.isRequire || 1
}
},
onLoad(query) {
@@ -86,12 +89,15 @@ export default {
checkList.push(item)
}
})
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:dept", checkList)
}
})
if (!checkList.length && this.isRequire == 1) {
return this.$u.toast('请先选择部门')
} else {
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:dept", checkList)
}
})
}
}
},
}

View File

@@ -51,7 +51,10 @@ export default {
},
nodeKey() {
return this.$route.query.nodeKey || "idNumber"
}
},
isRequire() {
return this.$route.query.isRequire || 1
},
},
onLoad(query) {
if (query.selected) {
@@ -92,7 +95,7 @@ export default {
checkList.push(item)
}
})
if (!checkList.length) {
if (!checkList.length && this.isRequire == 1) {
return this.$u.toast('请先选择人员')
} else {
uni.navigateBack({