移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

624 行
18 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="纠纷调请"
  5. left-arrow
  6. fixed
  7. placeholder
  8. @click-left="goBack()"
  9. z-index="998"
  10. >
  11. <template #right>
  12. <van-icon name="../../../static/images/icon/icon_flow.png" size="20" @click="openMenu" v-if="!!id"/>
  13. </template>
  14. </van-nav-bar>
  15. <div class="main" style="padding-bottom: 1rem;">
  16. <van-form ref="form">
  17. <div :class="formEnabled.baseFormEnabled ? '' : 'noModify'">
  18. <p class="topTit">纠纷调请</p>
  19. <template> <!-- 申请 基本信息 -->
  20. <div>
  21. <p class="main_title">基本信息</p>
  22. <div class="main_box">
  23. <van-field :readonly="true" v-model="arbitrationData.applicant" label="申请人" placeholder="申请人" input-align="right" required :rules="[{ required: true }]"/>
  24. <van-field required :readonly="true" v-model="arbitrationData.applicantPhone" label="联系电话" placeholder="联系电话" input-align="right" type="digit" :rules="[{pattern: /(^\d{7}(\d{4})?$)/}]"/>
  25. <field-select
  26. v-model="arbitrationData.applyProposerId"
  27. label="宅基地申请"
  28. value-key="projectName"
  29. data-key="id"
  30. placeholder="选择宅基地申请"
  31. :rules="[{ required: true }]"
  32. required
  33. :readonly="!formEnabled.baseFormEnabled"
  34. :columns="userHouseApplyProposer"
  35. />
  36. <van-field :readonly="!formEnabled.baseFormEnabled" v-model="arbitrationData.disputant" label="纠纷人" placeholder="纠纷人" input-align="right" required :rules="[{ required: true }]"/>
  37. <field-date-picker
  38. v-model="arbitrationData.applyTime"
  39. label="申请时间"
  40. placeholder="请选择申请时间"
  41. :rules="[{ required: true }]"
  42. formatter="yyyy-MM-dd"
  43. required
  44. :readonly="!formEnabled.baseFormEnabled"
  45. />
  46. </div>
  47. </div>
  48. <div>
  49. <p class="main_title">纠纷事项</p>
  50. <div class="main_box">
  51. <van-field
  52. rows="3"
  53. autosize
  54. type="textarea"
  55. placeholder="纠纷事项"
  56. input-align="left"
  57. v-model="arbitrationData.disputes"
  58. :readonly="!formEnabled.baseFormEnabled"
  59. :rules="[{ required: true }]" required
  60. />
  61. </div>
  62. </div>
  63. <div>
  64. <p class="main_title">备注说明</p>
  65. <div class="main_box">
  66. <van-field
  67. rows="3"
  68. autosize
  69. type="textarea"
  70. placeholder="备注说明"
  71. input-align="left"
  72. v-model="arbitrationData.remark"
  73. :readonly="!formEnabled.baseFormEnabled"
  74. :rules="[{ required: true }]" required
  75. />
  76. </div>
  77. </div>
  78. </template>
  79. </div>
  80. </van-form>
  81. </div>
  82. <!-- 底部按钮 -->
  83. <van-goods-action style="z-index: 999;" v-if="formVisible.editVisible || formVisible.operationVisible || formVisible.approvalVisible">
  84. <template v-if="formVisible.editVisible">
  85. <van-goods-action-button type="primary" text="保存" @click="onSubmit('add')" :disabled="!formEnabled.baseFormEnabled" v-if="formEnabled.baseFormEnabled"/>
  86. <van-goods-action-button type="primary" :text="formEnabled.baseFormEnabled ? '保存并提交' : '提交'" @click="onSubmit(formEnabled.baseFormEnabled ? 'save_and_submit' : 'submit')" v-if="formEnabled.submitEnabled"/>
  87. </template>
  88. <template v-if="formVisible.approvalVisible">
  89. <van-goods-action-button type="primary" text="受理" @click="onSubmit('agree')" :disabled="!formEnabled.approvalEnabled"/>
  90. <van-goods-action-button type="danger" text="驳回" @click="onSubmit('reject')" v-if="formEnabled.rejectEnabled"/>
  91. </template>
  92. <template v-if="formVisible.operationVisible">
  93. <van-goods-action-button type="primary" text="调解" @click="onSubmit('mediate')" v-if="formEnabled.mediateEnabled"/>
  94. <van-goods-action-button type="danger" text="仲裁" @click="onSubmit('arbitrate')" v-if="formEnabled.arbitrateEnabled"/>
  95. <van-goods-action-button type="primary" text="归档" @click="onSubmit('archive')" v-if="formEnabled.archiveEnabled"/>
  96. </template>
  97. </van-goods-action>
  98. <van-popup
  99. v-model="menuVisible"
  100. closeable
  101. position="bottom"
  102. :close-on-click-overlay="true"
  103. :lazy-render="false"
  104. >
  105. <van-cell title="菜单"></van-cell>
  106. <van-cell-group inset>
  107. <van-cell title="调解/冲裁员" is-link @click="openArbitrationHandlerPage()"/>
  108. <van-cell title="处理过程" is-link @click="openArbitrationProcessPage()"/>
  109. </van-cell-group>
  110. </van-popup>
  111. </div>
  112. </template>
  113. <script>
  114. import FieldSelect from "@/components/form/FieldSelect";
  115. import FieldDatePicker from "@/components/form/FieldDatePicker";
  116. import {formatDate} from "element-ui/src/utils/date-util.js";
  117. import {getInfo} from '@/api/login/index'
  118. import {Notify} from "vant";
  119. import { getList } from "@/api/onlineHome/homestead/application";
  120. import { addArbitration, getArbitrationDetail, submitArbitration, editArbitration } from "@/api/onlineHome/homestead/arbitration";
  121. // 意图
  122. const INTENT_VIEW = 1;
  123. const INTENT_EDIT = 2;
  124. const INTENT_ADD = 3;
  125. export default {
  126. name: "ArbitrationDetail",
  127. components: {
  128. FieldDatePicker, FieldSelect},
  129. data() {
  130. return {
  131. // 申请ID
  132. id: '',
  133. // 表单数据
  134. arbitrationData: {
  135. applicantPhone: '',
  136. applyProposerId: '',
  137. applicant: '',
  138. disputant: '',
  139. disputes: '',
  140. remark: '',
  141. applyTime: '',
  142. deptName: '',
  143. disputeStatus: '1',
  144. },
  145. // 表单意图
  146. operationIntent: INTENT_ADD,
  147. // 显示控制
  148. formVisible: {
  149. editVisible: false,
  150. approvalVisible: false,
  151. operationVisible: false,
  152. finishVisible: false,
  153. },
  154. // 表单启用控制
  155. formEnabled: {
  156. baseFormEnabled: false,
  157. submitEnabled: false,
  158. approvalEnabled: false,
  159. rejectEnabled: false,
  160. mediateEnabled: false,
  161. arbitrateEnabled: false,
  162. archiveEnabled: false,
  163. },
  164. currentUserRole: null,
  165. userHouseApplyProposer: [],
  166. menuVisible: false,
  167. };
  168. },
  169. created() {
  170. this.id = this.$route.query.id;
  171. this.type = this.$route.query.type;
  172. this.getFormIntent();
  173. this.getDetail();
  174. this.getUserHouseApplyProposer();
  175. },
  176. methods: {
  177. // 初始化当前数据, 有ID则查询, 否则新增
  178. getDetail(){
  179. this.reset();
  180. if(this.id)
  181. {
  182. getArbitrationDetail(this.id).then(response => {
  183. this.init(response.data);
  184. });
  185. }
  186. else
  187. {
  188. this.init();
  189. this.getApplyerDetail();
  190. }
  191. },
  192. // 全局初始化
  193. init(value) {
  194. const role = this.$store.getters.roles;
  195. this.currentUserRole = role[0];
  196. // 默认状态
  197. this.formVisible.editVisible = false;
  198. this.formVisible.approvalVisible = false;
  199. this.formVisible.operationVisible = false;
  200. this.formEnabled.baseFormEnabled = false;
  201. this.formEnabled.submitEnabled = false;
  202. this.formEnabled.approvalEnabled = false;
  203. this.formEnabled.rejectEnabled = false;
  204. this.formEnabled.mediateEnabled = false;
  205. this.formEnabled.arbitrateEnabled = false;
  206. this.formEnabled.archiveEnabled = false;
  207. switch (this.operationIntent) {
  208. // 查看
  209. case INTENT_VIEW:
  210. this.arbitrationData = value;
  211. switch(value.disputeStatus)
  212. {
  213. case '1': // 草稿
  214. this.formEnabled.submitEnabled = true;
  215. this.formVisible.editVisible = true;
  216. break;
  217. case '2': // 待审
  218. this.formVisible.approvalVisible = true;
  219. this.formEnabled.approvalEnabled = true;
  220. this.formEnabled.rejectEnabled = true;
  221. break;
  222. case '3': // 受理
  223. this.formVisible.operationVisible = true;
  224. this.formEnabled.mediateEnabled = true;
  225. this.formEnabled.arbitrateEnabled = true;
  226. break;
  227. case '4': // 驳回
  228. this.formVisible.approvalVisible = true;
  229. this.formEnabled.approvalEnabled = true;
  230. break;
  231. case '5': // 调解
  232. this.formVisible.operationVisible = true;
  233. this.formEnabled.arbitrateEnabled = true;
  234. this.formEnabled.archiveEnabled = true;
  235. break;
  236. case '6': // 仲裁
  237. this.formVisible.operationVisible = true;
  238. this.formEnabled.archiveEnabled = true;
  239. break;
  240. case '7': // 归档
  241. break;
  242. default:
  243. break;
  244. }
  245. break;
  246. // 编辑/审批
  247. case INTENT_EDIT:
  248. this.arbitrationData = value;
  249. this.formEnabled.baseFormEnabled = true;
  250. this.formVisible.editVisible = true;
  251. this.formEnabled.submitEnabled = true;
  252. break;
  253. // 新建
  254. case INTENT_ADD:
  255. this.formEnabled.baseFormEnabled = true;
  256. this.formVisible.editVisible = true;
  257. break;
  258. }
  259. },
  260. // 获取query的意图
  261. getFormIntent() {
  262. console.log(this.type);
  263. switch (this.type) {
  264. case 'done':
  265. case 'view':
  266. this.operationIntent = INTENT_VIEW;
  267. break;
  268. case 'modify':
  269. case 'audit':
  270. case 'todo':
  271. this.operationIntent = INTENT_EDIT;
  272. break;
  273. case 'add':
  274. default:
  275. this.operationIntent = INTENT_ADD;
  276. break;
  277. }
  278. return this.operationIntent;
  279. },
  280. // 获取日期, yyyy-MM-dd
  281. getDate(d) {
  282. return formatDate(d ? d : new Date(), 'yyyy-MM-dd');
  283. },
  284. // 初始化基础表单
  285. reset() {
  286. this.$set(this.arbitrationData, 'applicantPhone', '');
  287. this.$set(this.arbitrationData, 'applyProposerId', '');
  288. this.$set(this.arbitrationData, 'applicant', '');
  289. this.$set(this.arbitrationData, 'disputant', '');
  290. this.$set(this.arbitrationData, 'disputes', '');
  291. this.$set(this.arbitrationData, 'remark', '');
  292. this.$set(this.arbitrationData, 'deptName', '');
  293. this.$set(this.arbitrationData, 'disputeStatus', 1);
  294. this.$set(this.arbitrationData, 'applyTime', this.getDate());
  295. },
  296. //返回上一步操作
  297. goBack(){
  298. this.$router.push({name: this.$router.back(-1)});
  299. },
  300. // 全局提交
  301. onSubmit(intent){
  302. console.log(this.arbitrationData, intent);
  303. switch (intent) {
  304. case 'add':
  305. case 'modify':
  306. this.saveArbitration();
  307. break;
  308. case 'submit':
  309. this.submitArbitration();
  310. break;
  311. case 'save_and_submit':
  312. this.saveArbitration(true);
  313. break;
  314. case 'agree':
  315. this.agreeArbitration();
  316. break;
  317. case 'reject':
  318. this.rejectArbitration();
  319. break;
  320. case 'mediate':
  321. this.mediateArbitration();
  322. break;
  323. case 'arbitrate':
  324. this.arbitrateArbitration();
  325. break;
  326. case 'archive':
  327. this.archiveArbitration();
  328. break;
  329. default:
  330. console.error('Unknown intent! ', intent);
  331. break;
  332. }
  333. },
  334. // 获取申请人信息
  335. getApplyerDetail(){
  336. getInfo().then(res => {
  337. let user = res.user;
  338. console.log(user);
  339. this.$set(this.arbitrationData, 'applicantPhone', user.phonenumber);
  340. this.$set(this.arbitrationData, 'applicant', user.nickName);
  341. });
  342. },
  343. // 检查字符串, 不符合返回true
  344. checkString(value, regexp) {
  345. let res = value === undefined || value === null || value === '' || value.toString().trim().length === 0;
  346. if(res)
  347. return true;
  348. if(regexp)
  349. res = !value.match(regexp);
  350. return res;
  351. },
  352. // 保存申请(是否提交)
  353. saveArbitration(submit) {
  354. this.$refs.form.validate().then(() => {
  355. /*if(this.checkString(this.arbitrationData.tHouseApplyProposedSituation.theGeom))
  356. {
  357. this.notify("请标注宅基地位置!", 'danger');
  358. return;
  359. }*/
  360. console.log("进行保存", this.arbitrationData);
  361. (this.arbitrationData.id ? editArbitration : addArbitration)(this.arbitrationData).then((response) => {
  362. if(submit && this.arbitrationData.id)
  363. {
  364. this.submitArbitration();
  365. }
  366. else
  367. {
  368. this.notify("保存成功", 'success');
  369. this.goBack();
  370. }
  371. }).catch((e) => {
  372. this.notify("保存失败!", 'danger');
  373. }).finally(() => {
  374. });
  375. }).catch(e => {
  376. this.notify('请填写完整表单', 'danger');
  377. return;
  378. });
  379. },
  380. submitArbitration() {
  381. this.setArbitrationStatus('2', '提交');
  382. },
  383. agreeArbitration() {
  384. this.setArbitrationStatus('3', '受理');
  385. },
  386. rejectArbitration() {
  387. this.setArbitrationStatus('4', '驳回');
  388. },
  389. mediateArbitration() {
  390. this.setArbitrationStatus('5', '调解');
  391. },
  392. arbitrateArbitration() {
  393. this.setArbitrationStatus('6', '仲裁');
  394. },
  395. archiveArbitration() {
  396. this.setArbitrationStatus('7', '归档');
  397. },
  398. setArbitrationStatus(status, reason) {
  399. submitArbitration(this.arbitrationData.id, status).then((response) => {
  400. this.notify(`${reason}成功`, 'success');
  401. this.goBack();
  402. }).catch((e) => {
  403. this.notify(`${reason}成功失败!`, 'danger');
  404. }).finally(() => {
  405. });
  406. },
  407. // 请求结果提示工具函数
  408. notify(message, type) {
  409. Notify.clear();
  410. Notify({ type: type || 'primary', message: message });
  411. },
  412. getUserHouseApplyProposer()
  413. {
  414. getList().then((resp) => {
  415. this.userHouseApplyProposer = resp.rows;
  416. });
  417. },
  418. openMenu() {
  419. this.menuVisible = true;
  420. },
  421. openArbitrationProcessPage()
  422. {
  423. this.$router.push({name:'arbitrationProcessList', query: {
  424. arbitrationId: this.arbitrationData.id,
  425. }});
  426. },
  427. openArbitrationHandlerPage()
  428. {
  429. this.$router.push({name:'arbitrationHandlerList', query: {
  430. arbitrationId: this.arbitrationData.id,
  431. }});
  432. },
  433. },
  434. watch: {
  435. }
  436. }
  437. </script>
  438. <style scoped lang="scss">
  439. .app-container {
  440. padding-bottom: 5%;
  441. }
  442. .examine_box{
  443. background-color: #1D6FE9!important;
  444. padding: 0.18rem!important;
  445. padding-left: 0!important;
  446. border-radius: 0.15rem!important;
  447. margin-top: 0.3rem!important;
  448. }
  449. .examine_box .van-col:first-child{
  450. color: #FFF!important;
  451. font-size: 0.45rem!important;
  452. text-align: center!important;
  453. }
  454. .examine_box .van-col:last-child{
  455. background-color: #FFF!important;
  456. border-radius: 0.15rem!important;
  457. overflow: hidden!important;
  458. .van-radio-group--horizontal{
  459. padding: 0.2rem 0;
  460. border-bottom: 1px solid #eee;
  461. }
  462. }
  463. #mapWrap{
  464. width: 96%;
  465. margin: 0 auto;
  466. border-bottom-left-radius: 12px;
  467. border-bottom-right-radius: 12px;
  468. overflow: hidden;
  469. }
  470. .mapBox{
  471. position: relative;
  472. .mapBox_button{
  473. position: absolute;
  474. top: 0.2rem;
  475. right: 2%;
  476. }
  477. }
  478. .van-steps{
  479. padding: 2% 6% 0;
  480. }
  481. .topTit{
  482. font-size: 0.45rem;
  483. background-color: #1D6FE9;
  484. color: #FFFFFF;
  485. line-height: 58px;
  486. text-align: center;
  487. padding: 15px 0;
  488. box-shadow: 0px 3px 6px 0px rgba(15,67,145,0.40);
  489. }
  490. .main_title{
  491. font-size: 0.4rem;
  492. color: #1D6FE9;
  493. margin: 0.2rem 6%;
  494. position: relative;
  495. }
  496. .main_box{
  497. width: 96%;
  498. margin: 0 auto;
  499. border-radius: 6px;
  500. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  501. overflow: hidden;
  502. background-color: #FFF;
  503. }
  504. .collapse{
  505. width: 96%;
  506. margin: 0 auto;
  507. border-radius: 6px;
  508. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  509. overflow: hidden;
  510. margin-bottom: 15px;
  511. }
  512. /deep/.van-radio--horizontal{
  513. margin-left: 20px;
  514. margin-right: 0;
  515. }
  516. .file-box{
  517. padding: 2% 5% 0;
  518. }
  519. .submitButton{
  520. width: 80%;
  521. margin: 0 auto;
  522. border-radius: 14px;
  523. }
  524. .timeTit{
  525. text-align: center;
  526. font-size: 16px;
  527. line-height: 27px;
  528. }
  529. .action-box{
  530. padding: 15px 0!important;
  531. margin-top: 0.4rem;
  532. }
  533. .check-box{
  534. margin-top: 0.4rem;
  535. }
  536. .addFamily{
  537. position: absolute;
  538. top: -2px;
  539. right: 0;
  540. border-radius: 50%;
  541. display: inline-block;
  542. width: 0.7rem;
  543. height: 0.7rem;
  544. }
  545. .deleteFamily{
  546. position: absolute;
  547. top: -0.35rem;
  548. right: 6%;
  549. z-index: 9;
  550. border-radius: 50%;
  551. display: inline-block;
  552. width: 0.7rem;
  553. height: 0.7rem;
  554. }
  555. .familyList{
  556. margin-top: 0.4rem;
  557. position: relative;
  558. }
  559. .noModify{
  560. .topTit{
  561. background-color:#ABABAB ;
  562. box-shadow: 0px 3px 6px 0px rgba(171,171,171,0.40);
  563. }
  564. .van-cell__title{
  565. color: #B4B0B0;
  566. }
  567. }
  568. .flow_main_box{
  569. width: 96%;
  570. margin: 0 auto;
  571. border-radius: 6px;
  572. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  573. overflow: hidden;
  574. background-color: #FFF;
  575. margin-top: 2%;
  576. padding: 5% 1%;
  577. .van-col{
  578. text-align: center;
  579. }
  580. .tit{
  581. background: #1d6fe9;
  582. border-radius: 12px;
  583. font-size: 0.4rem;
  584. font-family: Source Han Sans CN, Source Han Sans CN-Regular;
  585. font-weight: 400;
  586. color: #ffffff;
  587. line-height: 0.65rem;
  588. letter-spacing: 0px;
  589. width: 70%;
  590. margin: 0 auto;
  591. }
  592. .van-step--vertical{
  593. padding-right: 0;
  594. text-align: left;
  595. }
  596. .van-step--vertical:not(:last-child)::after{
  597. border: none;
  598. }
  599. .van-step--finish{
  600. color: #1d6fe9;
  601. }
  602. }
  603. .van-goods-action {
  604. justify-content: center;
  605. }
  606. </style>