移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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