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

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