移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

434 行
14 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">自主经营</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form ref="_Form">
  14. <div class="main_box">
  15. <van-field
  16. readonly
  17. v-model="circulation.zcfmc"
  18. label="申请人姓名"
  19. placeholder="请输入申请人姓名"
  20. @input="remoteTransfereeMethod"
  21. />
  22. <van-cell v-for="item in getObligeeOptions"
  23. :key="item.shyqrdbxm"
  24. @click="shyqrdmxmChange(item)"
  25. >
  26. {{item.shyqrdbxm}}
  27. </van-cell>
  28. <van-popup v-model="showshyqrdm" position="bottom">
  29. <van-picker
  30. show-toolbar
  31. :columns="shyqrdmDictionaries"
  32. @confirm="onConfirmShyqrdm"
  33. @cancel="showshyqrdm = false"
  34. />
  35. </van-popup>
  36. <van-field
  37. readonly
  38. v-model="circulation.zjddm"
  39. label="宅基地代码"
  40. input-align="right"
  41. >
  42. <template #button>
  43. <van-button size="small" @click="mapLook" type="primary">查看地图</van-button>
  44. </template>
  45. </van-field>
  46. <van-popup v-model="showzjddm" position="bottom" >
  47. <van-picker
  48. show-toolbar
  49. :columns="zjdDictionaries"
  50. @confirm="onConfirmZjddm"
  51. @cancel="showzjddm = false"
  52. />
  53. </van-popup>
  54. <van-field
  55. v-if="circulation.phrqType == 1"
  56. readonly
  57. v-model="circulation.zcfxb"
  58. label="性别"
  59. input-align="right"
  60. label-width="auto"
  61. />
  62. <van-field readonly v-model="circulation.zcfdh" label="联系电话" placeholder="请输入联系电话" input-align="right" label-width="auto" />
  63. <van-field v-if="circulation.phrqType == 1" readonly v-model="circulation.zcfzjhm" label="证件号码" placeholder="证件号码" input-align="right" label-width="auto" />
  64. <van-cell v-if="circulation.phrqType == 1" title="是否本集体经济组织成员" >
  65. <template #right-icon>
  66. <van-radio-group disabled v-model="circulation.zcfzz" direction="horizontal" >
  67. <van-radio name="1">是</van-radio>
  68. <van-radio name="0">否</van-radio>
  69. </van-radio-group>
  70. </template>
  71. </van-cell>
  72. <van-field
  73. readonly
  74. v-model ="circulation.zjdmj"
  75. type = "number"
  76. @keyup = "circulation.zjdmj=circulation.zjdmj.replace(circulation.zjdmj,RestrictedMoney(circulation.zjdmj))"
  77. label="经营面积(㎡)"
  78. input-align="right"
  79. label-width="auto"
  80. />
  81. <van-field
  82. readonly
  83. v-model="circulation.phtime"
  84. label="备案时间"
  85. placeholder="选择备案时间"
  86. input-align="right"
  87. label-width="auto"
  88. />
  89. <van-field readonly v-model="circulation.fwms" type="textarea" label="地上房屋描述" placeholder="请输入地上房屋描述" input-align="right" label-width="auto" />
  90. <van-field readonly v-model="circulation.bz" type="textarea" label="备注" placeholder="请输入备注" input-align="right" label-width="auto" />
  91. <van-dialog v-model:show="mapShow" show-cancel-button>
  92. <MapGisLyDrawing ref="zjdProductResh" :message="circulation.zjddm" @closeMoule="closeMoule"></MapGisLyDrawing>
  93. </van-dialog>
  94. </div>
  95. </van-form>
  96. </div>
  97. </template>
  98. <script>
  99. import { zjdzd, obligeeList } from "@/api/onlineHome/homestead/circulation";
  100. import { addPhxxb,updatePhxxb,getPhxxb } from "@/api/onlineHome/phfs/phfs";
  101. import { ycsyAdd , listByDeptId } from "@/api/onlineHome/homestead/paidUtilize";
  102. import MapGisLyDrawing from "@/components/Map/MapGisLyDrawing";
  103. import {Notify} from "vant";
  104. export default {
  105. name: "paidUtilizeAdd",
  106. components: { MapGisLyDrawing,},
  107. props: {
  108. columns: {
  109. type: Array,
  110. default: function () {
  111. return []
  112. }
  113. },
  114. selectValue: {
  115. type: [String, Number],
  116. default: ''
  117. },
  118. option: {
  119. type: Object,
  120. default: function () {
  121. return { label: 'label', value: 'value' }
  122. }
  123. },
  124. isSearch: {
  125. type: Boolean,
  126. default: false
  127. },
  128. offOption: { // 关闭option配置key-value;当数据是非集合的数组的时候,开启
  129. type: Boolean,
  130. default: false
  131. }
  132. },
  133. data() {
  134. return {
  135. tcqllxDictionaries:[],//退出权利类型
  136. tclxDictionaries:[],//退出类型
  137. tcfsDictionaries:[],//退出方式
  138. sexDictionaries:[],//申请人证件类型
  139. bcfsDictionaries:[],//补偿方式
  140. zjdDictionaries:[],//宅基地代码
  141. shyqrdmDictionaries:[],//使用权人
  142. getObligeeOptions:[],
  143. tcqllx:'',
  144. tclx:'',
  145. tcfs:'',
  146. xb:'',
  147. bcfs:'',
  148. zjddm:'',
  149. showzcfmc:false,
  150. showtcqllx: false,
  151. showtclx: false,
  152. showtcfs: false,
  153. showXb: false,
  154. showbcfs: false,
  155. showzjddm: false,
  156. showshyqrdm: false,
  157. showbasj: false,
  158. showycsydqsj: false,
  159. columnsData: [],
  160. circulation:{id: null},
  161. mapShow: false,
  162. };
  163. },
  164. created() {
  165. this.circulation.id = this.$route.query.id;
  166. this.getDetail();
  167. },
  168. methods: {
  169. getDictionaries(){
  170. //退出权利类型
  171. this.houseGetDicts("tcqllx").then((res) => {
  172. for (var i = 0; i < res.data.length; i++) {
  173. this.tcqllxDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  174. }
  175. });
  176. //退出类型
  177. this.houseGetDicts("tclx").then((res) => {
  178. for (var i = 0; i < res.data.length; i++) {
  179. this.tclxDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  180. }
  181. });
  182. //退出方式
  183. this.houseGetDicts("tcfs").then((res) => {
  184. for (var i = 0; i < res.data.length; i++) {
  185. this.tcfsDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  186. }
  187. });
  188. //性别
  189. this.houseGetDicts("sex").then((res) => {
  190. for (var i = 0; i < res.data.length; i++) {
  191. this.sexDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  192. }
  193. });
  194. //补偿方式
  195. this.houseGetDicts("bcfs").then((res) => {
  196. for (var i = 0; i < res.data.length; i++) {
  197. this.bcfsDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  198. }
  199. });
  200. //宅基地代码
  201. zjdzd().then(zjdRes => {
  202. for (let i = 0; i < zjdRes.rows.length; i++) {
  203. this.zjdDictionaries.push(zjdRes.rows[i].zjddm);
  204. }
  205. });
  206. //使用权人代码
  207. listByDeptId().then(zjdRes => {
  208. for (let i = 0; i < zjdRes.rows.length; i++) {
  209. this.shyqrdmDictionaries.push(zjdRes.rows[i].shyqrdm);
  210. }
  211. });
  212. },
  213. getDetail()
  214. {
  215. getPhxxb(this.$route.query.id).then(response => {
  216. this.circulation = response.data;
  217. //性别
  218. this.houseGetDicts("sex").then((res) => {
  219. this.circulation.zcfxb = this.selectDictLabel(res.data, response.data.zcfxb);
  220. });
  221. });
  222. },
  223. plusOrMinus(values) {
  224. let newValue
  225. if (!(/[^0-9.-]/g.test(values))) {
  226. newValue = values.replace(/[^\-\d.]/g, '').replace(/\b(0+){2,}/g, '0').replace(/\-{2,}/g, '-').replace(/^\./g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')
  227. if (newValue.toString().indexOf('.') > 0 && Number(newValue.toString().split('.')[1].length) > 2) {
  228. newValue = parseInt(parseFloat(newValue) * 100) / 100
  229. }
  230. if ((newValue.toString().split('-').length - 1) > 1) {
  231. newValue = parseFloat(newValue) || ''
  232. }
  233. if ((newValue.toString().split('-').length) > 1 && newValue.toString().split('-')[0].length > 0) {
  234. newValue = parseFloat(newValue) || ''
  235. }
  236. if (newValue.toString().length > 1 && (newValue.toString().charAt(0) === '0' || (newValue.toString().length > 2 && newValue.toString().charAt(0) === '-' && newValue.toString().charAt(1) === '0' && newValue.toString().charAt(2) !== '.')) && newValue.toString().indexOf('.') < 1) {
  237. newValue = parseFloat(newValue) || ''
  238. }
  239. // 判断整数位最多为9位
  240. if (newValue.toString().indexOf('.') > 0 && Number(newValue.toString().split('.')[0].length) > 9) {
  241. newValue = newValue.toString().substring(0, 9) + '.' + newValue.toString().split('.')[1]
  242. } else if (newValue.toString().indexOf('.') < 0 && Number(newValue.toString().split('.')[0].length) > 9) {
  243. newValue = newValue.toString().substring(0, 9)
  244. }
  245. } else {
  246. newValue = values.replace(/[^0-9.-]/g, '')
  247. }
  248. return newValue
  249. }, materielExtraCostChange(item) {
  250. // 防止删除为空
  251. if (!item) {
  252. item = '0.00'
  253. }
  254. // 一些错误金额输入的判断
  255. if (item.toString().indexOf('.') > 0 && Number(item.toString().split('.')[1].length) < 1) {
  256. item = item.toString().split('.')[0]
  257. }
  258. // 一些错误金额输入的判断
  259. if (!item || item === '-' || item === '-0') {
  260. item = '0.00'
  261. return
  262. }
  263. item = parseFloat(item).toFixed(2)
  264. },RestrictedMoney(values) {
  265. return this.plusOrMinus(values.toString())
  266. },
  267. onConfirmZjddm(data){
  268. console.log(data)
  269. this.circulation.zjddm = data;
  270. this.showzjddm = false;
  271. },
  272. onConfirmXb(data){
  273. this.xb = data.text;
  274. this.circulation.zcfxb = data.value;
  275. this.showXb = false;
  276. },
  277. onConfirmTcqllx(data){
  278. this.tcqllx = data.text;
  279. this.circulation.tcqllx = data.value;
  280. this.showtcqllx = false;
  281. },
  282. onConfirmTclx(data){
  283. this.tclx = data.text;
  284. this.circulation.tclx = data.value;
  285. this.showtclx = false;
  286. },
  287. onConfirmTcfs(data){
  288. this.tcfs = data.text;
  289. this.circulation.tcfs = data.value;
  290. this.showtcfs = false;
  291. },
  292. onConfirmBcfs(data){
  293. this.bcfs = data.text;
  294. this.circulation.bcfs = data.value;
  295. this.showbcfs = false;
  296. },
  297. onConfirmShyqrdm(data){
  298. this.circulation.shyqrdm = data;
  299. this.showshyqrdm = false;
  300. },
  301. onConfirmBasj(data){
  302. this.circulation.phtime = this.getNowFormatDate(data).substr(0,10);
  303. this.showbasj = false;
  304. },
  305. onConfirmYcsydqsj(data){
  306. this.circulation.ycsydqsj = this.getNowFormatDate(data).substr(0,10);
  307. this.showycsydqsj = false;
  308. },
  309. goEdit(){
  310. window.location.replace("paidUtilizeList")
  311. },
  312. mapLook(){
  313. this.mapShow =true;
  314. setTimeout(() => {
  315. this.$refs.zjdProductResh.drawingLyPaceCountryDarw();
  316. },1000)
  317. },
  318. /** 查找地图中宅基地 */
  319. closeMoule: function (data) {
  320. this.circulation.zjddm = data;
  321. },
  322. /** 模糊查询人员信息 */
  323. remoteTransfereeMethod(query) {
  324. let _this = this;
  325. if (query !== "") {
  326. let queryMember = {
  327. hzxm : query,
  328. };
  329. this.searchLoading = true;
  330. obligeeList({shyqrdbxm:query,status:2}).then((response) => {
  331. this.searchLoading = false;
  332. if (response.code == 200) {
  333. this.getObligeeOptions = response.rows.map((item) => {
  334. // _this.$set(_this.form, "zcfxb", item.xb);
  335. // _this.$set(_this.form, "zcfdh", item.dh);
  336. // _this.$set(_this.form, "zcfzjhm", item.shyqrdbzjhm);
  337. // _this.$set(_this.form, "zcfdm", item.nhdm);
  338. return {
  339. zcfxb:item.xb,
  340. zcfdh:item.dh,
  341. zcfzjhm:item.shyqrdbzjhm,
  342. zcfdm:item.nhdm,
  343. shyqrdbxm: item.shyqrdbxm,
  344. shyqrdm: item.shyqrdm,
  345. zcfzz: item.sfbncjtjjzzcy
  346. };
  347. });
  348. }
  349. });
  350. } else {
  351. this.getObligeeOptions = [];
  352. }
  353. },
  354. clearFrom() {
  355. // this.initData();
  356. this.getObligeeOptions = [];
  357. },
  358. shyqrdmxmChange(val){
  359. let _this = this;
  360. this.sexDictionaries.map(function (item) {
  361. if(item.value === val.zcfxb){
  362. _this.xb = item.text;
  363. }
  364. })
  365. this.$set(this.circulation, "zcfdh", val.zcfdh);
  366. this.$set(this.circulation, "zcfzjhm", val.zcfzjhm);
  367. this.$set(this.circulation, "zcfdm", val.zcfdm);
  368. this.$set(this.circulation, "zcfmc", val.shyqrdbxm);
  369. this.$set(this.circulation, "zcfzz", val.zcfzz);
  370. this.getObligeeOptions=[];
  371. },
  372. goSubmit(){
  373. console.info( this.$refs._Form.validate());
  374. this.$refs._Form.validate().then(() => {
  375. if (this.circulation.id != null) {
  376. updatePhxxb(this.circulation).then(response => {
  377. this.$toast.success("修改成功");
  378. setTimeout(function(){
  379. window.location.replace("zzjyList")
  380. },1000)
  381. });
  382. } else {
  383. addPhxxb(this.circulation).then(response => {
  384. this.$toast.success("新增成功");
  385. setTimeout(function(){
  386. window.location.replace("zzjyList")
  387. },1000)
  388. });
  389. }
  390. }).catch((e) => {
  391. Notify({ type: 'danger', message: '请填写完整的表单项' });
  392. });
  393. }
  394. },
  395. }
  396. </script>
  397. <style scoped lang="scss">
  398. .app-container {
  399. padding: 2% 0;
  400. }
  401. .main_title{
  402. font-size: 0.4rem;
  403. color: #1D6FE9;
  404. margin: 0.2rem 6%;
  405. position: relative;
  406. }
  407. .main_box{
  408. width: 96%;
  409. margin: 0 auto;
  410. border-radius: 6px;
  411. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  412. overflow: hidden;
  413. background-color: #FFF;
  414. }
  415. .submitButton{
  416. width: 80%;
  417. margin: 0 auto;
  418. background-color: #1D6FE9;
  419. }
  420. </style>