|
@@ -3,46 +3,109 @@
|
|
|
<van-row ustify="center">
|
|
|
<van-col span="12">
|
|
|
<van-cell-group>
|
|
|
- <van-field v-model="personType" clearable center readonly placeholder="请选择人员类型" input-align="right"
|
|
|
- right-icon="arrow-down" @click="showPerson = true" />
|
|
|
+ <van-field
|
|
|
+ v-model="personType"
|
|
|
+ clearable
|
|
|
+ center
|
|
|
+ readonly
|
|
|
+ placeholder="请选择人员类型"
|
|
|
+ input-align="right"
|
|
|
+ right-icon="arrow-down"
|
|
|
+ @click="showPerson = true"
|
|
|
+ />
|
|
|
<van-popup v-model:show="showPerson" round position="bottom">
|
|
|
- <van-picker title="人员类型" :columns="$dictUtils.getDictList('hs_people_type')" :columns-field-names="{
|
|
|
- text: 'label',
|
|
|
- value: 'value'
|
|
|
- }" @cancel="showPerson = false" @confirm="getPersonType" />
|
|
|
+ <van-picker
|
|
|
+ title="人员类型"
|
|
|
+ :columns="$dictUtils.getDictList('hs_people_type')"
|
|
|
+ :columns-field-names="{
|
|
|
+ text: 'label',
|
|
|
+ value: 'value',
|
|
|
+ }"
|
|
|
+ @cancel="showPerson = false"
|
|
|
+ @confirm="getPersonType"
|
|
|
+ />
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
</van-col>
|
|
|
<van-col span="12">
|
|
|
<van-cell-group>
|
|
|
- <van-field v-model="religiousType" clearable center readonly placeholder="请选择宗教类型" input-align="right"
|
|
|
- right-icon="arrow-down" @click="showPlace = true" />
|
|
|
+ <van-field
|
|
|
+ v-model="religiousType"
|
|
|
+ clearable
|
|
|
+ center
|
|
|
+ readonly
|
|
|
+ placeholder="请选择宗教类型"
|
|
|
+ input-align="right"
|
|
|
+ right-icon="arrow-down"
|
|
|
+ @click="showPlace = true"
|
|
|
+ />
|
|
|
<van-popup v-model:show="showPlace" round position="bottom">
|
|
|
- <van-picker title="宗教类型" :columns="$dictUtils.getDictList('hs_religion_type')" :columns-field-names="{
|
|
|
- text: 'label',
|
|
|
- value: 'value'
|
|
|
- }" @cancel="showPlace = false" @confirm="getType" />
|
|
|
+ <van-picker
|
|
|
+ title="宗教类型"
|
|
|
+ :columns="$dictUtils.getDictList('hs_religion_type')"
|
|
|
+ :columns-field-names="{
|
|
|
+ text: 'label',
|
|
|
+ value: 'value',
|
|
|
+ }"
|
|
|
+ @cancel="showPlace = false"
|
|
|
+ @confirm="getType"
|
|
|
+ />
|
|
|
</van-popup>
|
|
|
</van-cell-group>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
- <van-search v-model="searchForm.name" clearable show-action shape="round" placeholder="请输入搜索关键词" input-align="center"
|
|
|
- @search="onLoad" @cancel="onCancel" />
|
|
|
- <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
- <van-checkbox-group v-if="type == 1" v-model="checked" ref="checkboxGroup">
|
|
|
- <van-button type="primary" size="mini" @click="checkAll">全选</van-button>
|
|
|
- <van-button type="primary" size="mini" @click="nocheckAll">取消全选</van-button>
|
|
|
+ <van-search
|
|
|
+ v-model="searchForm.name"
|
|
|
+ clearable
|
|
|
+ show-action
|
|
|
+ shape="round"
|
|
|
+ placeholder="请输入搜索关键词"
|
|
|
+ input-align="center"
|
|
|
+ @search="onLoad"
|
|
|
+ @cancel="onCancel"
|
|
|
+ />
|
|
|
+ <van-list
|
|
|
+ v-model:loading="loading"
|
|
|
+ :finished="finished"
|
|
|
+ finished-text="没有更多了"
|
|
|
+ @load="onLoad"
|
|
|
+ >
|
|
|
+ <van-checkbox-group
|
|
|
+ v-if="type == 1"
|
|
|
+ v-model="checked"
|
|
|
+ ref="checkboxGroup"
|
|
|
+ >
|
|
|
+ <van-button type="primary" size="mini" @click="checkAll"
|
|
|
+ >全选</van-button
|
|
|
+ >
|
|
|
+ <van-button type="primary" size="mini" @click="nocheckAll"
|
|
|
+ >取消全选</van-button
|
|
|
+ >
|
|
|
<van-cell-group inset>
|
|
|
- <van-cell v-for="(item, index) in list" clickable :key="item" :title="item.name">
|
|
|
+ <van-cell
|
|
|
+ v-for="(item, index) in list"
|
|
|
+ clickable
|
|
|
+ :key="item"
|
|
|
+ :title="item.name"
|
|
|
+ >
|
|
|
<template #right-icon>
|
|
|
- <van-checkbox :name="item" :ref="el => (checkboxRefs[index] = el)" @click="toggle(index)" />
|
|
|
+ <van-checkbox
|
|
|
+ :name="item"
|
|
|
+ :ref="(el) => (checkboxRefs[index] = el)"
|
|
|
+ @click="toggle(index)"
|
|
|
+ />
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
</van-cell-group>
|
|
|
</van-checkbox-group>
|
|
|
<van-radio-group v-if="type == 0" v-model="checked">
|
|
|
<van-cell-group inset>
|
|
|
- <van-cell v-for="item in list" clickable :key="item" :title="item.name">
|
|
|
+ <van-cell
|
|
|
+ v-for="item in list"
|
|
|
+ clickable
|
|
|
+ :key="item"
|
|
|
+ :title="item.name"
|
|
|
+ >
|
|
|
<template #right-icon>
|
|
|
<van-radio :name="item" @click="selectes(item)" />
|
|
|
</template>
|
|
@@ -75,21 +138,25 @@ export default {
|
|
|
religion: "",
|
|
|
createEnd: "",
|
|
|
createBegin: "",
|
|
|
- nativePlace: '',
|
|
|
- currentResidence: '',
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ nativePlace: "",
|
|
|
+ currentResidence: "",
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ props.value.siteId != "" &&
|
|
|
+ searchForm.value.location.id != props.value.siteId
|
|
|
+ ) {
|
|
|
+ searchForm.value.location.id = props.siteId;
|
|
|
+ }
|
|
|
// 搜索
|
|
|
const onCancel = () => {
|
|
|
list.value = [];
|
|
|
index = 0;
|
|
|
finished.value = false;
|
|
|
- searchForm.value.name = ""
|
|
|
- searchForm.value.religion = ""
|
|
|
- searchForm.value.personnelType = ""
|
|
|
- personType.value = ""
|
|
|
- religiousType.value = ""
|
|
|
+ searchForm.value.name = "";
|
|
|
+ searchForm.value.religion = "";
|
|
|
+ searchForm.value.personnelType = "";
|
|
|
+ personType.value = "";
|
|
|
+ religiousType.value = "";
|
|
|
};
|
|
|
// 选择人员
|
|
|
const checked = ref([]);
|
|
@@ -101,7 +168,6 @@ export default {
|
|
|
};
|
|
|
// 全选
|
|
|
const checkAll = () => {
|
|
|
-
|
|
|
checkboxGroup.value.toggleAll(true);
|
|
|
console.log("checked", checked);
|
|
|
emit("selected", checked.value, 1);
|
|
@@ -124,27 +190,26 @@ export default {
|
|
|
return { ...searchForm.value };
|
|
|
},
|
|
|
(newValue, oldValue) => {
|
|
|
-
|
|
|
if (oldValue != newValue) {
|
|
|
index = 0;
|
|
|
- onLoad()
|
|
|
+ onLoad();
|
|
|
}
|
|
|
},
|
|
|
{ deep: true }
|
|
|
);
|
|
|
let showPlace = ref(false);
|
|
|
let showPerson = ref(false);
|
|
|
- let religiousType = ref('');
|
|
|
- let personType = ref('');
|
|
|
+ let religiousType = ref("");
|
|
|
+ let personType = ref("");
|
|
|
const getType = ({ selectedOptions }) => {
|
|
|
showPlace.value = false;
|
|
|
searchForm.value.religion = selectedOptions[0].value;
|
|
|
- religiousType.value = selectedOptions[0].label
|
|
|
+ religiousType.value = selectedOptions[0].label;
|
|
|
};
|
|
|
const getPersonType = ({ selectedOptions }) => {
|
|
|
showPerson.value = false;
|
|
|
searchForm.value.personnelType = selectedOptions[0].value;
|
|
|
- personType.value = selectedOptions[0].label
|
|
|
+ personType.value = selectedOptions[0].label;
|
|
|
};
|
|
|
const onLoad = () => {
|
|
|
if (index == 0) {
|
|
@@ -156,26 +221,28 @@ export default {
|
|
|
.list({
|
|
|
current: index + 1,
|
|
|
size: 15,
|
|
|
- ...searchForm.value
|
|
|
+ ...searchForm.value,
|
|
|
})
|
|
|
.then(({ records }) => {
|
|
|
- list.value.push(...records)
|
|
|
+ list.value.push(...records);
|
|
|
// 加载状态结束
|
|
|
loading.value = false;
|
|
|
// 数据全部加载完成
|
|
|
if (records.length < 15) {
|
|
|
finished.value = true;
|
|
|
- if (finished.value && !loading.value && searchForm.value.location.id != "") {
|
|
|
- checked.value.push(...list.value)
|
|
|
+ if (
|
|
|
+ finished.value &&
|
|
|
+ !loading.value &&
|
|
|
+ searchForm.value.location.id != ""
|
|
|
+ ) {
|
|
|
+ checked.value.push(...list.value);
|
|
|
}
|
|
|
} else {
|
|
|
index++;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
- if (props.siteId != "" && searchForm.value.location.id != props.siteId) {
|
|
|
- searchForm.value.location.id = props.siteId;
|
|
|
- }
|
|
|
+
|
|
|
return {
|
|
|
// 人员
|
|
|
list,
|
|
@@ -200,7 +267,7 @@ export default {
|
|
|
showPerson,
|
|
|
getPersonType,
|
|
|
religiousType,
|
|
|
- personType
|
|
|
+ personType,
|
|
|
};
|
|
|
},
|
|
|
};
|