ReligiousPeopleReportView.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <van-nav-bar
  3. fixed
  4. title="信息上报中心"
  5. left-text=""
  6. left-arrow
  7. @click-left="onClickLeft"
  8. />
  9. <van-loading size="16px" v-if="isLoading">加载中...</van-loading>
  10. <div class="main" v-if="!isLoading">
  11. <p class="title">信教异常群众上报</p>
  12. <div class="formArea">
  13. <p class="miniTitle">基础信息</p>
  14. <van-cell-group>
  15. <van-field
  16. v-model="inputForm.abnormalName"
  17. center
  18. label="异常人员:"
  19. placeholder="请填写异常人员姓名"
  20. input-align="right"
  21. />
  22. </van-cell-group>
  23. <van-cell-group>
  24. <van-field
  25. v-model="inputForm.abnormalIdcar"
  26. center
  27. label="身份证号:"
  28. placeholder="请填写身份证号"
  29. input-align="right"
  30. type="digit"
  31. />
  32. </van-cell-group>
  33. <van-cell-group>
  34. <van-field
  35. v-model="inputForm.abnormalPhone"
  36. center
  37. label="手机号:"
  38. placeholder="请填写手机号"
  39. input-align="right"
  40. type="tel"
  41. />
  42. </van-cell-group>
  43. <van-cell-group>
  44. <van-cell title="性别:">
  45. <template #right-icon>
  46. <van-radio-group v-model="inputForm.sex" direction="horizontal">
  47. <van-radio name="1">男</van-radio>
  48. <van-radio name="2">女</van-radio>
  49. </van-radio-group>
  50. </template>
  51. </van-cell>
  52. </van-cell-group>
  53. <van-cell-group>
  54. <van-field
  55. v-model="inputForm.nativePlace"
  56. center
  57. readonly
  58. label="籍贯:"
  59. placeholder="请选择"
  60. input-align="right"
  61. right-icon="arrow-down"
  62. @click="showArea = true"
  63. />
  64. <van-popup v-model:show="showArea" round position="bottom">
  65. <van-cascader
  66. v-model="cascaderValue"
  67. title="请选择籍贯"
  68. :options="options"
  69. @close="showArea = false"
  70. @finish="onFinish"
  71. />
  72. </van-popup>
  73. </van-cell-group>
  74. <van-cell-group>
  75. <van-field
  76. v-model="inputForm.currentResidence"
  77. center
  78. readonly
  79. label="现居地:"
  80. placeholder="请选择"
  81. input-align="right"
  82. right-icon="arrow-down"
  83. @click="showArea = true"
  84. />
  85. <van-popup v-model:show="showArea" round position="bottom">
  86. <van-cascader
  87. v-model="cascaderValue"
  88. title="请选择现居地"
  89. :options="options"
  90. @close="showArea = false"
  91. @finish="onFinish"
  92. />
  93. </van-popup>
  94. </van-cell-group>
  95. <van-cell-group>
  96. <van-field
  97. v-model="inputForm.currentResidenceDetail"
  98. center
  99. label="现居地详情:"
  100. placeholder="请填写现居地详情"
  101. input-align="right"
  102. right-icon="location"
  103. />
  104. </van-cell-group>
  105. <van-cell-group>
  106. <div class="rowTextArea">
  107. <van-field
  108. v-model="inputForm.abnormalBehavior"
  109. placeholder="请填写异常行为"
  110. center
  111. rows="2"
  112. type="textarea"
  113. label="异常行为:"
  114. label-align="top"
  115. />
  116. </div>
  117. </van-cell-group>
  118. </div>
  119. <div class="subbtn">
  120. <van-button type="primary" @click="submit">提交</van-button>
  121. <van-button type="default" hairline>取消</van-button>
  122. </div>
  123. </div>
  124. </template>
  125. <script>
  126. import { ref, onMounted } from "vue";
  127. import { useCascaderAreaData } from "@vant/area-data";
  128. import ReligiousPeopleReportService from "@/api/differentbelievers/ReligiousPeopleReportService";
  129. import { useRoute } from "vue-router";
  130. export default {
  131. setup() {
  132. // 返回
  133. const onClickLeft = () => {
  134. history.back();
  135. };
  136. // 加载
  137. let isLoading = ref(true);
  138. // 异常人员信息
  139. const inputForm = ref({
  140. id: "",
  141. abnormalName: "",
  142. abnormalIdcar: "",
  143. sex: "",
  144. abnormalPhone: "",
  145. nativePlace: "",
  146. currentResidence: "",
  147. currentResidenceDetail: "",
  148. abnormalBehavior: "",
  149. state: "0",
  150. assessment: "0",
  151. currentResidenceId: "",
  152. currentResidenceLevel1: "",
  153. currentResidenceLevel2: "",
  154. currentResidenceLevel3: "",
  155. currentResidenceLevel4: "",
  156. currentResidenceLevel5: "",
  157. currentResidenceLevel6: "",
  158. });
  159. // 根据路由初始化
  160. let route = useRoute();
  161. onMounted(() => {
  162. if (route.query.id) {
  163. new ReligiousPeopleReportService()
  164. .queryById(route.query.id)
  165. .then((data) => {
  166. inputForm.value = data;
  167. isLoading.value = false;
  168. });
  169. } else {
  170. isLoading.value = false;
  171. }
  172. });
  173. // 地区选择
  174. let showArea = ref(false);
  175. const cascaderValue = ref("");
  176. // 选项列表,children 代表子选项,支持多级嵌套
  177. const options = useCascaderAreaData();
  178. // 全部选项选择完毕后,会触发 finish 事件
  179. const onFinish = ({ selectedOptions }) => {
  180. showArea.value = false;
  181. inputForm.value.currentResidence = selectedOptions
  182. .map((option) => option.text)
  183. .join("/");
  184. };
  185. // 提交数据
  186. const submit = () => {
  187. isLoading.value = true;
  188. new ReligiousPeopleReportService().save(inputForm.value).then((res) => {
  189. console.log("提交", res);
  190. onClickLeft();
  191. isLoading.value = false;
  192. });
  193. };
  194. return {
  195. inputForm,
  196. // 返回
  197. onClickLeft,
  198. // 地区选择
  199. showArea,
  200. options,
  201. onFinish,
  202. cascaderValue,
  203. isLoading,
  204. submit,
  205. };
  206. },
  207. };
  208. </script>
  209. <style scoped>
  210. * {
  211. margin: 0;
  212. padding: 0;
  213. }
  214. .main {
  215. background: #fff;
  216. position: relative;
  217. top: 40px;
  218. }
  219. .title,
  220. .miniTitle {
  221. height: 40px;
  222. line-height: 40px;
  223. color: #36a7f3;
  224. border-bottom: 1px solid #eee;
  225. }
  226. .title {
  227. font-size: 20px;
  228. font-weight: 700;
  229. padding-left: 20px;
  230. }
  231. .miniTitle {
  232. font-size: 16px;
  233. }
  234. .formArea {
  235. padding: 0px 20px;
  236. }
  237. .formArea .van-cell-group .van-field__label {
  238. height: 40px;
  239. }
  240. .formArea .van-cell-group .van-cell {
  241. line-height: 40px;
  242. }
  243. .van-cell__value .van-field__right-icon .van-icon-location {
  244. color: #36a7f3 !important;
  245. }
  246. .rowTextArea::v-deep .van-field__value {
  247. width: 98%;
  248. border: 2px solid #ccc;
  249. border-radius: 10px;
  250. }
  251. .rowTextArea::v-deep .van-cell {
  252. display: flow-root;
  253. }
  254. .subbtn {
  255. margin: 20px;
  256. text-align: center;
  257. }
  258. .subbtn .van-button {
  259. width: 40%;
  260. margin: 5px;
  261. }
  262. .van-uploader .van-button {
  263. border: none;
  264. color: #36a7f3;
  265. top: -4px;
  266. }
  267. .van-radio {
  268. margin-right: 10px;
  269. }
  270. .van-loading {
  271. text-align: center;
  272. margin-top: 80px;
  273. }
  274. </style>