123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <template>
- <div class="main">
- <p class="title">宗教场所录入</p>
- <div class="formArea">
- <p class="miniTitle">基础信息</p>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.religiousType"
- readonly
- label="所属宗教:"
- placeholder="请选择宗教"
- input-align="right"
- right-icon="arrow-down"
- @click="showPicker = true"
- />
- <van-popup v-model:show="showPicker" round position="bottom">
- <van-picker
- title="宗教类型"
- :columns="places"
- @cancel="showPicker = false"
- @confirm="getPlace"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.name"
- center
- label="场所名称:"
- placeholder="请填写场所名称"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.contact"
- center
- label="场所联系人"
- placeholder="请填写场所联系人"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.contactNumber"
- center
- label="联系电话"
- placeholder="请填写联系电话"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.placeSelectName"
- center
- readonly
- label="场所地点"
- placeholder="请填场所地点"
- input-align="right"
- right-icon="arrow-down"
- @click="showPlace1 = true"
- />
- <van-popup v-model:show="showPlace1" round position="bottom">
- <van-picker
- title="活动场所"
- :columns="options"
- :columns-field-names="customFieldName"
- @cancel="showPlace1 = false"
- @confirm="getPlace1"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.place"
- center
- label="详细场所"
- placeholder="请填写详细场所"
- input-align="right"
- right-icon="location"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.siteType"
- readonly
- label="场所类型"
- placeholder="请选择场所类型"
- input-align="right"
- right-icon="arrow-down"
- @click="showPicker1 = true"
- />
- <van-popup v-model:show="showPicker1" round position="bottom">
- <van-picker
- title="场所类型"
- :columns="placeType"
- @cancel="showPicker1 = false"
- @confirm="getplaceType"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.constructionStage"
- readonly
- label="场所建设阶段"
- placeholder="请选择场所建设阶段"
- input-align="right"
- right-icon="arrow-down"
- @click="showPicker2 = true"
- />
- <van-popup v-model:show="showPicker2" round position="bottom">
- <van-picker
- title="场所建设阶段"
- :columns="construction"
- @cancel="showPicker2 = false"
- @confirm="getConstruction"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.nature"
- readonly
- label="场所性质"
- placeholder="请选择场所性质"
- input-align="right"
- right-icon="arrow-down"
- @click="showPicker3 = true"
- />
- <van-popup v-model:show="showPicker3" round position="bottom">
- <van-picker
- title="场所性质选择"
- :columns="property"
- @cancel="showPicker3 = false"
- @confirm="getproperty"
- />
- </van-popup>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.religiousDeptManaUserName.name"
- center
- label="宗教管理人员"
- placeholder="请填写宗教管理人员"
- input-align="right"
- right-icon="arrow-down"
- @click="showPerson = true"
- />
- <van-dialog
- v-model:show="showPerson"
- title="宗教部门管理人员"
- show-cancel-button
- @confirm="reselected"
- >
- <manage-list @selected="selected" :type="1"></manage-list>
- </van-dialog>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.securityDeptManaUserName.name"
- center
- label="公安管理人员"
- placeholder="请填写公安管理人员"
- input-align="right"
- right-icon="arrow-down"
- @click="showReport = true"
- />
- <van-dialog
- v-model:show="showReport"
- title="公安部门管理人员"
- show-cancel-button
- @confirm="reselected"
- >
- <manage-list @selected="selected" :type="0"></manage-list>
- </van-dialog>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="placeActivity.placeData.peopleThreshold"
- center
- label="场所活动人数:"
- placeholder="请填写场所活动人数"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field name="uploader" label-align="top" label="外景照片:">
- <template #input>
- <van-uploader
- v-model="placeActivity.fileList1"
- :after-read="afterRead"
- />
- </template>
- </van-field>
- </van-cell-group>
- <van-cell-group>
- <van-field name="uploader" label-align="top" label="内景照片:">
- <template #input>
- <van-uploader
- v-model="placeActivity.fileList2"
- :after-read="afterRead"
- />
- </template>
- </van-field>
- </van-cell-group>
- </div>
- <div class="subbtn">
- <van-button type="primary" @click="submit">提交</van-button>
- <van-button @click="goback" type="default" hairline>取消</van-button>
- </div>
- </div>
- </template>
- <script>
- import { reactive, ref } from "vue";
- import ManageList from "../placeManage/ManageList.vue"
- import PlaceRegister from "@/api/placeRegister/placeRegister";
- import router from "@/router";
- export default {
- components:{ManageList},
- setup() {
- const goback = () => {
- history.back();
- };
- //场所录入
- const placeActivity = reactive({
- placeData: {
- religiousType: "", //所属宗教
- name: "", //场所名称
- contact: "", //场所联系人
- contactNumber: "", //联系电话
- placeSelectName: "", //场所地点
- place: "", //详细场所地点
- siteType: "", //场所类型
- constructionStage: "", //场所建设阶段
- nature: "", //场所性质
- religiousDeptManaUserName: {
- id:"",
- name:""
- }, //宗教部门管理人员
- securityDeptManaUserName: {
- id:"",
- name:""
- }, //公安部门管理人员
- peopleThreshold: "", //场所活动人数
- scenesImage: "", //内外景图片
- },
- fileList1: [], //外景图片
- fileList2: [], //内景图片
- });
- // 宗教名称
- const places = [
- { text: "伊斯兰教", value: "伊斯兰教" },
- { text: "基督教", value: "基督教" },
- { text: "天主教", value: "天主教" },
- { text: "佛教", value: "佛教" },
- { text: "道教", value: "道教" },
- ];
- let showPicker = ref(false);
- const getPlace = ({ selectedOptions }) => {
- showPicker.value = false;
- placeActivity.placeData.religiousType = selectedOptions[0].text;
- };
- // 场所类型
- const placeType = [
- { text: "线下", value: "线下" },
- { text: "线上", value: "线上" },
- ];
- let showPicker1 = ref(false);
- const getplaceType = ({ selectedOptions }) => {
- showPicker1.value = false;
- placeActivity.placeData.siteType = selectedOptions[0].text;
- };
- // 场所建设
- const construction = [
- { text: "筹备", value: "筹备" },
- { text: "建设完成", value: "建设完成" },
- ];
- let showPicker2 = ref(false);
- const getConstruction = ({ selectedOptions }) => {
- showPicker2.value = false;
- placeActivity.placeData.constructionStage = selectedOptions[0].text;
- };
- // 场所性质
- const property = [
- { text: "固定场所", value: "固定场所" },
- { text: "寺观教堂", value: "寺观教堂" },
- ];
- let showPicker3 = ref(false);
- const getproperty = ({ selectedOptions }) => {
- showPicker3.value = false;
- placeActivity.placeData.nature = selectedOptions[0].text;
- };
- //图片上传
- const afterRead = (file) => {
- // 此时可以自行将文件上传至服务器
- console.log(file);
- };
- // 地区选择
- const customFieldName = {
- text: "name",
- value: "id",
- };
- // 选项列表,children 代表子选项,支持多级嵌套
- const options = ref([]);
- // 获取地区数据树
- new PlaceRegister().treeDate().then((res) => {
- options.value.push(...res);
- });
- let showPlace1 = ref(false);
- const getPlace1 = ({ selectedOptions }) => {
- showPlace1.value = false;
- placeActivity.placeData.placeSelectName =
- selectedOptions[0].name +
- "/" +
- selectedOptions[1].name +
- "/" +
- selectedOptions[2].name;
- };
- //人员选择
- let showPerson = ref(false);
- let showReport = ref(false);
- let list = {
- value: [],
- type: "",
- };
- const selected = (val, type) => {
-
- list.value = val;
- list.type = type;
- console.log(list);
- };
- const reselected = () => {
- let ids = [];
- let names = [];
- if (list.type == 1) {
- list.value.forEach((item) => {
- ids.push(item.id);
- names.push(item.name);
- });
- placeActivity.placeData.religiousDeptManaUserName.id = ids.join(',')
- placeActivity.placeData.religiousDeptManaUserName.name = names.join(',')
- } else {
- placeActivity.placeData.securityDeptManaUserName.id = list.value.id
- placeActivity.placeData.securityDeptManaUserName.name = list.value.name
- }
- };
- //数据提交
- const submit = () => {
- // console.log(placeActivity.placeData.scenesImage);
- new PlaceRegister().sava(placeActivity.placeData).then((res) => {
- console.log("提交成功", res);
- router.push({
- path: "/tabAll",
- });
- });
- };
- return {
- placeActivity,
- // 活动场所
- showPicker,
- places,
- getPlace,
- //场所类型
- showPicker1,
- placeType,
- getplaceType,
- //场所建设阶段
- showPicker2,
- construction,
- getConstruction,
- //场所性质
- showPicker3,
- property,
- getproperty,
- //图片上传
- afterRead,
- // 返回
- goback,
- // 地区选择
- customFieldName,
- showPlace1,
- getPlace1,
- options,
- //人员选择
- showPerson,
- showReport,
- selected,
- reselected,
- //数据提交
- submit,
- };
- },
- };
- </script>
- <style src="../../styles/style.css" scoped></style>
- <style lang="less">
- * {
- margin: 0;
- padding: 0;
- }
- .main {
- background: #fff;
- margin-top: 25pt;
- }
- .main p {
- height: 40px;
- line-height: 40px;
- color: #36a7f3;
- border-bottom: 1px solid #eee;
- }
- .title {
- font-size: 17pt;
- font-weight: 700;
- padding-left: 20px;
- }
- .miniTitle {
- font-size: 14pt;
- }
- .formArea {
- padding: 0px 20px;
- }
- .formArea .van-cell-group .van-field__label {
- height: 40px;
- }
- .formArea .van-cell-group .van-cell {
- line-height: 40px;
- }
- .van-cell__value .van-field__right-icon .van-icon-location {
- color: #36a7f3 !important;
- }
- .rowTextArea::v-deep .van-field__value {
- width: 98%;
- border: 2px solid #ccc;
- border-radius: 10px;
- }
- .rowTextArea::v-deep .van-cell {
- display: flow-root;
- }
- .subbtn {
- margin: 20px;
- text-align: center;
- }
- .subbtn .van-button {
- width: 40%;
- margin: 5px;
- }
- .van-uploader .van-button {
- border: none;
- color: #36a7f3;
- top: -4px;
- }
- .van-radio {
- margin-right: 10px;
- }
- </style>
|