house.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="">
  3. <view class="data-from" v-for="(item,index) in houseList">
  4. <view class="p-t30">
  5. <view class="sys-from-background-color p-20 r-20">
  6. <view class="row-justify-sb center">
  7. <text class="size-28 sys-weight-600">房产信息({{index+1}})</text>
  8. <view class="row-c sys-background-fff r-100 p-lr40 p-tb10">
  9. <image class="wh-30"
  10. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/edit.png"
  11. mode="aspectFill" @click="onEditInfo(index)"></image>
  12. <view class="title-line m-lr20"></view>
  13. <image class="wh-30"
  14. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/delete.png"
  15. mode="aspectFill" @click="onDeleteInfo(index)">
  16. </image>
  17. </view>
  18. </view>
  19. <view class="row p-t30">
  20. <view class="text-color-666"><text></text>产权人:</view>
  21. <text class="flex">产权人</text>
  22. </view>
  23. <view class="row p-t30">
  24. <view class="text-color-666"><text></text>房产证号:</view>
  25. <text class="flex">产权人</text>
  26. </view>
  27. <view class="row p-t30">
  28. <view class="text-color-666"><text></text>房产地址:</view>
  29. <text class="flex">重庆市 渝中区 大坪龙湖时代天街5栋3-1</text>
  30. </view>
  31. <view class="row p-t30">
  32. <view class="text-color-666"><text></text>房屋用途:</view>
  33. <text class="flex">产权人</text>
  34. </view>
  35. <view class="row p-t30">
  36. <view class="text-color-666"><text></text>建成年份:</view>
  37. <text class="flex">产权人</text>
  38. </view>
  39. <view class="row p-t30">
  40. <view class="text-color-666"><text></text>建筑面积:</view>
  41. <text class="flex">产权人</text>
  42. </view>
  43. <view class="row p-t30">
  44. <view class="text-color-666"><text></text>房产证件:</view>
  45. <image class="wh-110" src="/static/img/index/top-nav.png" mode=""></image>
  46. <EnImage></EnImage>
  47. </view>
  48. <view class="row p-t30">
  49. <view class="text-color-666"><text></text>备注:</view>
  50. <text class="flex">产权人</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="p-t30">
  55. <view class="row-justify-sb center p-b10">
  56. <text class="size-28 sys-weight-600">房产信息({{index+1}})</text>
  57. <view class="row-c sys-background-fff r-100">
  58. <image class="wh-30"
  59. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/information/delete.png"
  60. mode="aspectFill" @click="onDeleteInfo(index)">
  61. </image>
  62. </view>
  63. </view>
  64. <en-input label="产权人" type="text" placeholder="请输入产权人" v-model="item.data.property_owner"
  65. v-if="verifyKey('property_owner')"></en-input>
  66. <en-input label="房产证号" v-model="item.data.deed_num" v-if="verifyKey('deed_num')" type="text"
  67. placeholder="请输入房产证号"></en-input>
  68. <en-city label="房产城市" v-model="item.data.house_city" v-if="verifyKey('house_city')"
  69. placeholder="请选择省、市、区"></en-city>
  70. <en-input label="房产地址" v-model="item.data.house_address" v-if="verifyKey('house_address')" type="text"
  71. placeholder="请输入房产详细地址"></en-input>
  72. <en-select label="房屋用途" v-model="item.data.house_use" v-if="verifyKey('house_use')"
  73. placeholder="请选择房屋用途" :local-data="houseTypeData"></en-select>
  74. <en-date label="建成年份" v-model="item.data.build_date" v-if="verifyKey('build_date')"
  75. placeholder="选择房屋建成年份"></en-date>
  76. <en-radio label="材料费" v-model="item.data.is_pay" v-if="verifyKey('is_pay')"
  77. :radio-data="payData"></en-radio>
  78. <en-input label="建筑面积" v-model="item.data.covered_area" v-if="verifyKey('covered_area')" type="digit"
  79. placeholder="请输入建筑面积" rightText="㎡"></en-input>
  80. <en-upload label="上传房产证件" v-model="item.data.certificate_img" v-if="verifyKey('certificate_img')"
  81. :imageWidth="180"></en-upload>
  82. <en-upload label="上传房产关联图片" v-model="item.data.property" v-if="verifyKey('property')"
  83. :imageWidth="180"></en-upload>
  84. <en-input label="备注" v-model="item.data.remark" v-if="verifyKey('remark')" type="text"
  85. placeholder="请输入备注信息" :noBox="true"></en-input>
  86. </view>
  87. </view>
  88. <en-blank message="暂无房产信息,快来添加吧!" v-if="houseList.length<=0"></en-blank>
  89. <button class="size-26 r-10 button-color house-button m-t30" hover-class="is-hover"
  90. @click="addHouse">+添加房产</button>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. getTaskOptions
  96. } from "@/api/task";
  97. import {
  98. getSn
  99. } from "@/api/common";
  100. import md5 from "js-md5";
  101. import tools from "@/service/tools";
  102. import enInput from "@/components/en-from/en-input/en-input.vue"
  103. import EnCity from "@/components/en-from/en-city/en-city.vue";
  104. import EnUpload from "@/components/en-from/en-upload/en-upload.vue";
  105. import EnSelect from "@/components/en-from/en-select/en-select.vue";
  106. import EnDate from "@/components/en-from/en-date/en-date.vue";
  107. import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
  108. import EnImage from "@/components/en-utils/en-image/en-image.vue";
  109. export default {
  110. name: 'property-house',
  111. components: {
  112. EnBlank,
  113. EnDate,
  114. EnSelect,
  115. EnUpload,
  116. EnCity,
  117. enInput,
  118. EnImage
  119. },
  120. props: {
  121. 'showKeys': {
  122. default: []
  123. },
  124. 'value': {
  125. default: {
  126. }
  127. },
  128. 'itemKey': {
  129. default: 0
  130. }
  131. },
  132. data() {
  133. return {
  134. payData: [{
  135. 'id': 1,
  136. 'name': '已支付'
  137. }, {
  138. 'id': 2,
  139. 'name': '未支付'
  140. }],
  141. houseTypeData: [],
  142. houseItem: {
  143. 'property_owner': '',
  144. 'deed_num': '',
  145. 'house_city': '',
  146. 'house_address': '',
  147. 'house_use': '',
  148. 'build_date': '',
  149. 'is_pay': '',
  150. 'covered_area': '',
  151. 'certificate_img': [],
  152. 'property': [],
  153. 'remark': '',
  154. },
  155. houseList: []
  156. }
  157. },
  158. watch: {
  159. 'houseList': {
  160. handler() {
  161. this.$emit("input", this.houseList);
  162. },
  163. deep: true
  164. },
  165. 'value': {
  166. handler() {
  167. if (this.value) {
  168. this.setValue()
  169. }
  170. },
  171. deep: true
  172. },
  173. },
  174. mounted() {
  175. this.getTaskOptions()
  176. this.setValue()
  177. },
  178. methods: {
  179. addHouse() {
  180. tools.showLoading()
  181. getSn().then((res) => {
  182. if (res.code === 1) {
  183. this.houseList.push({
  184. 'property_type': 1,
  185. 'property_sn': res.data,
  186. 'data': JSON.parse(JSON.stringify(this.houseItem))
  187. })
  188. this.$emit('onResize')
  189. } else {
  190. tools.error('编号生成失败')
  191. }
  192. tools.hideLoading()
  193. })
  194. },
  195. setSendMd5() {
  196. let str = JSON.stringify(this.value)
  197. this.sendMd5 = md5(JSON.stringify(this.houseList))
  198. return md5(str)
  199. },
  200. setValue() {
  201. if (this.value) {
  202. let sendMd5 = this.setSendMd5()
  203. if (sendMd5 !== this.sendMd5) {
  204. this.houseList = this.value
  205. }
  206. }
  207. },
  208. verifyKey(field) {
  209. return this.showKeys.indexOf(field) >= 0
  210. },
  211. async getTaskOptions() {
  212. const res = await getTaskOptions({
  213. 'type': 3
  214. })
  215. if (res.code === 1) {
  216. res.data.houseTypeArr.forEach((val) => {
  217. this.houseTypeData.push({
  218. 'text': val.name,
  219. 'value': val.value
  220. })
  221. })
  222. }
  223. },
  224. delItem() {
  225. uni.showModal({
  226. title: '警告',
  227. content: '是否删除当前资产信息!',
  228. success: (res) => {
  229. if (res.confirm) {
  230. this.$emit('delItem', this.itemKey)
  231. }
  232. }
  233. });
  234. }
  235. }
  236. }
  237. </script>
  238. <style>
  239. .house-button {
  240. height: 70rpx;
  241. line-height: 70rpx;
  242. background: #FFFFFF;
  243. border: 1rpx solid #0FB160;
  244. }
  245. </style>