瀏覽代碼

no message

USER-20230908AJ\Administrator 1 年之前
父節點
當前提交
5b513cb75b
共有 3 個文件被更改,包括 261 次插入69 次删除
  1. 115 0
      components/en-from/en-date/en-date.vue
  2. 113 25
      page_task/property/components/house.vue
  3. 33 44
      page_task/property/property.vue

+ 115 - 0
components/en-from/en-date/en-date.vue

@@ -0,0 +1,115 @@
+<template>
+  <view class="box"  :class="{'no-box':noBox}">
+    <view class="input-box">
+      <view class="input-box-left" :style="{'letter-spacing':labelWidth}">
+        {{ label }}
+      </view>
+      <uni-datetime-picker
+          :type="type"
+          :value="inputValue"
+          :start="startDate"
+          :end="endDate"
+          :border="border"
+          :placeholder="placeholder"
+          @change="change"
+      />
+    </view>
+
+  </view>
+</template>
+
+<script>
+export default {
+  name: 'en-date',
+  props: {
+    type: {
+      //date/daterange/datetime/datetimerange
+      type: String,
+      default: 'date'
+    },
+    label: {
+      type: String,
+      default: '标题'
+    },
+    placeholder:{
+      type: String,
+      default: '选择日期'
+    },
+    startDate: {
+      type: String,
+      default: '1950-01-01'
+    },
+    endDate: {
+      type: String,
+      default: '2099-12-13'
+    },
+    disabled: {
+      default: false
+    },
+    border: {
+      default: false
+    },
+    value: {
+      default: ''
+    },
+    noBox:{
+      type:Boolean,
+      default:false
+    }
+  },
+  data() {
+    return {
+      inputValue: '',
+      labelWidth: 0
+    }
+  },
+  components: {},
+  mounted() {
+    this.inputValue = this.value
+    this.setLabelWidth()
+  },
+  watch: {
+    'value': function () {
+      if (this.inputValue !== this.value) {
+        console.log('this.value:'+this.value)
+        this.inputValue = this.value
+      }
+    },
+    'inputValue': function () {
+      this.$emit('input', this.inputValue)
+    }
+  },
+  methods: {
+    setLabelWidth() {
+      let differenceNum = 4 - this.label.length;
+      if (differenceNum === 2) {
+        this.labelWidth = '2em'
+      } else if (differenceNum === 1) {
+        this.labelWidth = '0.5em'
+      }
+    },
+    change(e){
+      this.inputValue=e
+    }
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+@import url("../../static/css/en-common.css");
+
+.box {
+  padding: 20rpx 0 20rpx 0;
+  .input-box {
+    display: flex;
+    align-items: center;
+    .input-box-left {
+      width: 210rpx;
+      font-size: 30rpx;
+      color: #333333;
+    }
+  }
+}
+
+</style>

+ 113 - 25
page_task/property/components/house.vue

@@ -1,43 +1,131 @@
 <template>
 	<view class="">
-		<WhInput :name="'产权人'"></WhInput>
-		<WhInput :name="'房产证号'"></WhInput>
-		<WhInput :name="'房产城市'" disabled is_select></WhInput>
-		<WhInput :name="'房产地址'" disabled is_select></WhInput>
-		<WhInput :name="'房屋用途'" disabled is_select></WhInput>
-		<WhInput :name="'建成年份'" disabled is_select></WhInput>
-		<WhInput :name="'材料费'"></WhInput>
-		<WhInput :name="'建筑面积'"></WhInput>
-		<view class=" p-tb30 bor-bottom-1">
-			<view class="wh-text size-28">房产证件<text></text> </view>
-			<view class="row-c flex m-t20 m-b10" style="flex-wrap: wrap;">
-				<image class="wh-110 m-r16" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/logo.png" mode="aspectFill" v-for="(item,index) in 2"
-					:key="index">
-				</image>
-				<image class="wh-110" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/logo.png" mode="aspectFill"></image>
-			</view>
-		</view>
-		<WhInput :name="'备注'" :is_border="false"></WhInput>
+    <view class="data-from">
+      <en-input label="产权人" type="text" placeholder="请输入产权人" v-model="houseItem.property_owner" v-if="verifyKey('property_owner')"></en-input>
+      <en-input label="房产证号" v-model="houseItem.deed_num" v-if="verifyKey('deed_num')" type="text" placeholder="请输入房产证号"></en-input>
+      <en-city label="房产城市" v-model="houseItem.house_city" v-if="verifyKey('house_city')"  placeholder="请选择省、市、区"></en-city>
+      <en-input label="房产地址" v-model="houseItem.house_address" v-if="verifyKey('house_address')" type="text" placeholder="请输入房产详细地址"></en-input>
+      <en-select label="房屋用途"  v-model="houseItem.house_use" v-if="verifyKey('house_use')" placeholder="请选择房屋用途" :local-data="houseTypeData" ></en-select>
+      <en-date label="建成年份" v-model="houseItem.build_date" v-if="verifyKey('build_date')" placeholder="选择房屋建成年份"></en-date>
+      <en-radio label="材料费" v-model="houseItem.is_pay" v-if="verifyKey('is_pay')" :radio-data="payData"></en-radio>
+      <en-input label="建筑面积" v-model="houseItem.covered_area" v-if="verifyKey('covered_area')" type="digit" placeholder="请输入建筑面积" rightText="㎡"></en-input>
+      <en-upload label="上传房产证件" v-model="houseItem.certificate_img" v-if="verifyKey('certificate_img')" :imageWidth="180"></en-upload>
+      <en-upload label="上传房产关联图片" v-model="houseItem.property" v-if="verifyKey('property')" :imageWidth="180"></en-upload>
+      <en-input label="备注" v-model="houseItem.remark" v-if="verifyKey('remark')" type="text" placeholder="请输入备注信息" :noBox="true"></en-input>
+    </view>
 		<button class="size-26 r-10 button-color house-button m-t30" hover-class="is-hover"
-			@click="onAddHouse">+添加房产</button>
+			@click="addHouse">+添加房产</button>
 	</view>
 </template>
 
 <script>
-	import WhInput from "@/components/en-from/en-input/en-input.vue"
+	import enInput from "@/components/en-from/en-input/en-input.vue"
+  import EnCity from "@/components/en-from/en-city/en-city.vue";
+  import EnUpload from "@/components/en-from/en-upload/en-upload.vue";
+  import EnSelect from "@/components/en-from/en-select/en-select.vue";
+  import {getTaskOptions} from "@/api/task";
+  import md5 from "js-md5";
 
 	export default {
 		components: {
-			WhInput
+      EnSelect,
+      EnUpload,
+      EnCity,
+      enInput
 		},
-		props: {
+    props: {
+      'showKeys': {
+        default: []
+      },
+      'value': {
+        default: {
 
-		},
+        }
+      },
+      'itemKey': {
+        default: 0
+      }
+    },
 		data() {
-			return {}
+			return {
+        payData:[{'id':1,'name':'已支付'},{'id':2,'name':'未支付'}],
+        houseTypeData:[],
+        houseItem:{
+          'property_owner':'',
+          'deed_num':'',
+          'house_city':'',
+          'house_address':'',
+          'house_use':'',
+          'build_date':'',
+          'is_pay':'',
+          'covered_area':'',
+          'certificate_img':[],
+          'property':[],
+          'remark':'',
+        },
+        houseList:[]
+      }
 		},
+    watch: {
+      'houseList': {
+        handler() {
+          this.$emit("input", this.houseList);
+        },
+        deep: true
+      },
+      'value': {
+        handler() {
+          console.log('houseItem:', this.value)
+          if (this.value) {
+            this.setValue()
+          }
+        },
+        deep: true
+      },
+    },
+    mounted() {
+      this.getTaskOptions()
+      this.setValue()
+    },
 		methods: {
-			onAddHouse() {}
+      addHouse(){
+        this.houseList.push(this.houseItem)
+      },
+      setSendMd5() {
+        let str = JSON.stringify(this.value)
+        this.sendMd5=md5(JSON.stringify(this.houseList))
+        return md5(str)
+      },
+      setValue(){
+        if (this.value) {
+          let sendMd5 = this.setSendMd5()
+          if (sendMd5 !== this.sendMd5) {
+            this.houseList=this.value
+          }
+        }
+      },
+      verifyKey(field) {
+        return this.showKeys.indexOf(field) >= 0
+      },
+      async getTaskOptions() {
+        const res = await getTaskOptions({'type':3})
+        if (res.code === 1) {
+          res.data.houseTypeArr.forEach((val)=>{
+            this.houseTypeData.push({'text':val.name,'value':val.value})
+          })
+        }
+      },
+      delItem(){
+        uni.showModal({
+          title: '警告',
+          content: '是否删除当前资产信息!',
+          success: (res) => {
+            if (res.confirm) {
+              this.$emit('delItem',this.itemKey)
+            }
+          }
+        });
+      }
 		}
 	}
 </script>

+ 33 - 44
page_task/property/property.vue

@@ -28,7 +28,7 @@
 							</view>
 						</template>
 						<view class="content">
-							<House></House>
+							<House v-model="houseList" :show-keys="propertyKey"></House>
 						</view>
 					</uni-collapse-item>
 					<uni-collapse-item titleBorder="none" :border="false" class="collapse-item-car   p-30 r-30">
@@ -41,7 +41,7 @@
 							</view>
 						</template>
 						<view class="content">
-							<House></House>
+							<House ></House>
 						</view>
 					</uni-collapse-item>
 					<uni-collapse-item titleBorder="none" :border="false"
@@ -95,57 +95,46 @@
 		},
 		data() {
 			return {
-				show: false,
-				showTitlt: false,
 				title: '',
 				fixedHeight: 0,
 				scrollTop: 0,
-				informationList: [{
-					name: '身份信息',
-					explain: '身份证、婚姻、职业、社保信息',
-					icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-identity.png',
-					path: '/page_task/identity/identity',
-					type: 1,
-					is_finish: false
-				}, {
-					name: '资产信息',
-					explain: '房产、车辆等资产',
-					icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-property.png',
-					type: 2,
-					is_finish: false
-				}, {
-					name: '申请信息',
-					explain: '贷款额度信息',
-					icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-apply.png',
-					type: 3,
-					is_finish: false
-				}, {
-					name: '联系人信息',
-					explain: '其他联系人',
-					icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-contacts.png',
-					type: 4,
-					is_finish: false
-				}, {
-					name: '征信信息',
-					explain: '银行征信信息',
-					icon: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-credit.png',
-					type: 5,
-					is_finish: false
-				}, ]
+        propertyKey:[],
+        propertyData:[],
+        houseList:[],
+        insuranceList:[],
+        firmList:[],
+        carList:[],
 			}
 		},
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop / 120
 		},
-		onLoad(options) {
-			this.title = options.title
-		},
+
+    onLoad(options) {
+      this.title = options.title
+      let propertyData = uni.getStorageSync('propertyData')
+      let propertyKey = uni.getStorageSync('propertyKey')
+      this.propertyData=propertyData
+      this.propertyKey=propertyKey
+      this.setPropertyData()
+
+    },
 		methods: {
-			onAuthentication(item) {
-				uni.navigateTo({
-					url: `${item.path}?title=${item.name}`
-				})
-			},
+      setPropertyData(){
+        if(this.propertyData.length>0){
+          this.propertyData.forEach(item=>{
+            if(item.property_type*1===1){
+              this.houseList.push(item)
+            }else if(item.property_type*1===2){
+              this.carList.push(item)
+            }else if(item.property_type*1===3){
+              this.insuranceList.push(item)
+            }else if(item.property_type*1===4){
+              this.firmList.push(item)
+            }
+          })
+        }
+      },
 			onLeftSubmit() {
 				console.log('预览');
 			},