Browse Source

no message

USER-20230908AJ\Administrator 1 year ago
parent
commit
023cf87a29

+ 149 - 0
page_task/property/components/add-register.vue

@@ -0,0 +1,149 @@
+<template>
+  <view class="license-box">
+    <view class="account-name">
+      {{imgType==='1'?'车辆登记证书':'行驶证'}}
+    </view>
+    <view class="credentials-box" @click="showUploadingImg(true)">
+      <view class="credentials-img" v-if="register_img">
+        <image class="credentials-imgs" :src="register_img" mode="aspectFill"></image>
+      </view>
+      <view class="credentials-img" v-else>
+        <image class="credentials-imgs" src="/pages-task/static/add-client/scmb.png" mode=""></image>
+      </view>
+    </view>
+    <uni-popup ref="popup" :safeArea="false" type="bottom" @change="closePopup">
+      <view class="popup-block">
+        <view class="popup-row" @click="uploadingImg(1)">拍照</view>
+        <view class="popup-row" @click="uploadingImg(2)">从手机里面选择</view>
+        <view class="popup-row" @click="showUploadingImg(false,0)">取消</view>
+      </view>
+    </uni-popup>
+  </view>
+</template>
+
+<script>
+import txUploadFile from "@/common/js/txOssSts";
+import tools from "@/common/js/tools";
+import {getBaiDuImgRecognition} from "@/api/common";
+
+export default {
+  name: "add-register",
+  components: {},
+  props: {
+    'value': {
+      default: '',
+    },
+    'imgType':{
+      default: '1'
+    }
+  },
+  data() {
+    return {
+      'register_img': '',
+      'carData': {}
+    }
+  },
+  watch: {
+    'register_img': function () {
+      this.$emit("input", this.register_img);
+    },
+    'value': function () {
+      this.setValue()
+    },
+  },
+  mounted() {
+    this.setValue()
+  },
+  methods: {
+    setValue() {
+      console.log(this.value)
+      this.register_img = this.value
+    },
+    uploadingImg(sourceType) {
+      uni.chooseMedia({
+        mediaType: 'image',
+        count: 1, //默认9
+        sizeType: "compressed",
+        sourceType: [sourceType === 1 ? 'camera' : 'album'],
+        success: (res) => {
+          if (res.tempFiles.length > 0) {
+            res.tempFiles.forEach((tempFile) => {
+              txUploadFile(tempFile.tempFilePath).then((data) => {
+                if (!data) {
+                  tools.error('图片上传失败')
+                  tools.hideLoading()
+                } else {
+                  tools.showLoading()
+                  getBaiDuImgRecognition({
+                    'imgUrl': data.Location,
+                    'imgType': this.imgType==='1'?'5':'6'
+                  }).then((res) => {
+                    tools.hideLoading()
+                    if (res.code === 1) {
+                      this.register_img = data.Location;
+                      this.carData = res.data;
+                      this.$emit('setCarData', this.carData)
+                    } else {
+                      tools.error(res.msg)
+                    }
+                  })
+                }
+              })
+            })
+            this.showUploadingImg(false, 0);
+          } else {
+            tools.error("请选择上传的图片")
+          }
+        },
+      });
+    },
+    showUploadingImg(showImg) {
+      if (showImg) {
+        if (this.isUploading) {
+          return
+        }
+        this.isUploading = true
+        this.$refs.popup.open("bottom");
+      } else {
+        this.$refs.popup.close();
+        this.isUploading = false
+      }
+    },
+    closePopup(e) {
+      if (e.show === false) {
+        this.isUploading = false
+      }
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+@import "../../../static/css/common/wh-common";
+
+.license-box {
+  .account-name {
+    font-size: 32rpx;
+    padding: 16px 0 0 0;
+    color: #232A35;
+  }
+
+  .credentials-box {
+    padding: 24rpx 0 0 0;
+    border-bottom: 1px solid #F0F0F0;
+
+    .credentials-img {
+      width: 160rpx;
+      height: 160rpx;
+      margin: 0 16rpx 30rpx 0;
+
+      .credentials-imgs {
+        width: 100%;
+        height: 100%;
+        display: block;
+      }
+    }
+  }
+}
+
+</style>

+ 169 - 11
page_task/property/components/car.vue

@@ -1,19 +1,177 @@
 <template>
-	<view class="">
-		dasd
-	</view>
+  <view class="">
+    <view class="data-from" v-for="item in carList">
+      <en-input label="车辆品牌" type="text" placeholder="请输入车辆品牌" v-model="item.brand_id"
+                v-if="verifyKey('brand_id')"></en-input>
+      <en-radio label="车牌类型" :radio-data="carTypeData" v-model="item.car_type"
+                v-if="verifyKey('car_type')"></en-radio>
+      <en-input label="车牌号" type="text" placeholder="请输入车牌号" v-model="carItem.car_num"
+                v-if="verifyKey('car_num')"></en-input>
+      <en-input label="车架号" type="text" placeholder="请输入车架号" v-model="item.car_vin"
+                v-if="verifyKey('car_vin')"></en-input>
+      <en-input label="车辆颜色" type="text" placeholder="请输入车俩颜色" v-model="item.colour"
+                v-if="verifyKey('colour')"></en-input>
+      <en-input label="裸车价格" type="number" placeholder="请输入金额" v-model="item.car_price"
+                v-if="verifyKey('car_price')" rightText="元"></en-input>
+      <en-date label="登记时间" placeholder="选择车辆登记时间" v-model="item.register_date"
+               v-if="verifyKey('register_date')"></en-date>
+      <add-register img-type="2" v-model="item.register_img" @setCarData="setCarData" v-if="verifyKey('register_img')"></add-register>
+      <add-register v-model="item.driving_img" @setCarData="setCarData" v-if="verifyKey('driving_img')"></add-register>
+      <en-upload label="上传车辆相关图片" :imageWidth="180" v-model="item.car_img" v-if="verifyKey('car_img')"></en-upload>
+      <en-input label="备注" type="text" placeholder="请输入备注信息" v-model="item.remark"
+                v-if="verifyKey('remark')" :noBox="true"></en-input>
+    </view>
+    <en-blank message="暂无车辆信息,快来添加吧!" v-if="carList.length<=0"></en-blank>
+    <button class="size-26 r-10 button-color house-button m-t30" hover-class="is-hover"
+            @click="addItem">+添加车辆</button>
+  </view>
 </template>
 
 <script>
-	export default {
-		props: {
+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";
+import EnDate from "@/components/en-from/en-date/en-date.vue";
+import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+import AddRegister from "@/page_task/property/components/add-register.vue";
 
-		},
-		data() {
-			return {}
-		},
-	}
+export default {
+  name:'property-car',
+  components: {
+    AddRegister,
+    EnBlank,
+    EnDate,
+    EnSelect,
+    EnUpload,
+    EnCity,
+    enInput
+  },
+  props: {
+    'showKeys': {
+      default: []
+    },
+    'value': {
+      default: {
+
+      }
+    },
+    'itemKey': {
+      default: 0
+    }
+  },
+  data() {
+    return {
+      carTypeData: [{'id': 1, 'name': '运营车'}, {'id': 2, 'name': '非运营车'}],
+      carBrandData: [],
+      carItem: {
+        'car_type': '2',
+        'brand_id': '',
+        'car_num': '',
+        'car_vin': '',
+        'colour': '',
+        'car_price': '',
+        'register_date': '',
+        'register_img': '',
+        'driving_img': '',
+        'car_img': [],
+        'remark': '',
+      },
+      carList:[]
+    }
+  },
+  watch: {
+    'carList': {
+      handler() {
+        this.$emit("input", this.carList);
+      },
+      deep: true
+    },
+    'value': {
+      handler() {
+        if (this.value) {
+          this.setValue()
+        }
+      },
+      deep: true
+    },
+  },
+  mounted() {
+    this.getTaskOptions()
+    this.setValue()
+  },
+  methods: {
+    setCarData(carData){
+      console.log('carData')
+      console.log(this.carData)
+      if(carData.car_num){
+        this.carItem.car_num=carData.car_num
+      }
+      if(carData.car_vin){
+        this.carItem.car_vin=carData.car_vin
+      }
+      if(carData.colour){
+        this.carItem.colour=carData.colour
+      }
+      if(carData.register_date){
+        this.carItem.register_date=carData.register_date
+      }
+      if(carData.car_type){
+        this.carItem.car_type=carData.car_type
+      }
+      if(carData.brand_id){
+        this.carItem.brand_id=carData.brand_id
+      }
+    },
+    addItem(){
+      this.carList.push(this.carItem)
+    },
+    setSendMd5() {
+      let str = JSON.stringify(this.value)
+      this.sendMd5=md5(JSON.stringify(this.carList))
+      return md5(str)
+    },
+    setValue(){
+      if (this.value) {
+        let sendMd5 = this.setSendMd5()
+        if (sendMd5 !== this.sendMd5) {
+          this.carList=this.value
+        }
+      }
+    },
+    verifyKey(field) {
+      return this.showKeys.indexOf(field) >= 0
+    },
+    async getTaskOptions() {
+      const res = await getTaskOptions({'type':3})
+      if (res.code === 1) {
+        res.data.carBrand.forEach((val) => {
+          this.carBrandData.push({'text': val.name, 'value': val.value})
+        })
+      }
+    },
+    delItem(){
+      uni.showModal({
+        title: '警告',
+        content: '是否删除当前资产信息!',
+        success: (res) => {
+          if (res.confirm) {
+            this.$emit('delItem',this.itemKey)
+          }
+        }
+      });
+    }
+  }
+}
 </script>
 
 <style>
-</style>
+.house-button {
+  height: 70rpx;
+  line-height: 70rpx;
+  background: #FFFFFF;
+  border: 1rpx solid #0FB160;
+}
+</style>

+ 138 - 1
page_task/property/components/company.vue

@@ -1,8 +1,145 @@
 <template>
+  <view class="">
+    <view class="data-from" v-for="item in houseList">
+      <en-input label="产权人" type="text" placeholder="请输入产权人" v-model="item.property_owner" v-if="verifyKey('property_owner')"></en-input>
+      <en-input label="房产证号" v-model="item.deed_num" v-if="verifyKey('deed_num')" type="text" placeholder="请输入房产证号"></en-input>
+      <en-city label="房产城市" v-model="item.house_city" v-if="verifyKey('house_city')"  placeholder="请选择省、市、区"></en-city>
+      <en-input label="房产地址" v-model="item.house_address" v-if="verifyKey('house_address')" type="text" placeholder="请输入房产详细地址"></en-input>
+      <en-select label="房屋用途"  v-model="item.house_use" v-if="verifyKey('house_use')" placeholder="请选择房屋用途" :local-data="houseTypeData" ></en-select>
+      <en-date label="建成年份" v-model="item.build_date" v-if="verifyKey('build_date')" placeholder="选择房屋建成年份"></en-date>
+      <en-radio label="材料费" v-model="item.is_pay" v-if="verifyKey('is_pay')" :radio-data="payData"></en-radio>
+      <en-input label="建筑面积" v-model="item.covered_area" v-if="verifyKey('covered_area')" type="digit" placeholder="请输入建筑面积" rightText="㎡"></en-input>
+      <en-upload label="上传房产证件" v-model="item.certificate_img" v-if="verifyKey('certificate_img')" :imageWidth="180"></en-upload>
+      <en-upload label="上传房产关联图片" v-model="item.property" v-if="verifyKey('property')" :imageWidth="180"></en-upload>
+      <en-input label="备注" v-model="item.remark" v-if="verifyKey('remark')" type="text" placeholder="请输入备注信息" :noBox="true"></en-input>
+    </view>
+    <en-blank message="暂无房产信息,快来添加吧!" v-if="houseList.length<=0"></en-blank>
+    <button class="size-26 r-10 button-color house-button m-t30" hover-class="is-hover"
+            @click="addHouse">+添加房产</button>
+  </view>
 </template>
 
 <script>
+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";
+import EnDate from "@/components/en-from/en-date/en-date.vue";
+import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+
+export default {
+  name:'property-company',
+  components: {
+    EnBlank,
+    EnDate,
+    EnSelect,
+    EnUpload,
+    EnCity,
+    enInput
+  },
+  props: {
+    'showKeys': {
+      default: []
+    },
+    'value': {
+      default: {
+
+      }
+    },
+    'itemKey': {
+      default: 0
+    }
+  },
+  data() {
+    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() {
+        if (this.value) {
+          this.setValue()
+        }
+      },
+      deep: true
+    },
+  },
+  mounted() {
+    this.getTaskOptions()
+    this.setValue()
+  },
+  methods: {
+    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>
 
 <style>
-</style>
+.house-button {
+  height: 70rpx;
+  line-height: 70rpx;
+  background: #FFFFFF;
+  border: 1rpx solid #0FB160;
+}
+</style>

+ 138 - 1
page_task/property/components/guarantee.vue

@@ -1,8 +1,145 @@
 <template>
+  <view class="">
+    <view class="data-from" v-for="item in houseList">
+      <en-input label="产权人" type="text" placeholder="请输入产权人" v-model="item.property_owner" v-if="verifyKey('property_owner')"></en-input>
+      <en-input label="房产证号" v-model="item.deed_num" v-if="verifyKey('deed_num')" type="text" placeholder="请输入房产证号"></en-input>
+      <en-city label="房产城市" v-model="item.house_city" v-if="verifyKey('house_city')"  placeholder="请选择省、市、区"></en-city>
+      <en-input label="房产地址" v-model="item.house_address" v-if="verifyKey('house_address')" type="text" placeholder="请输入房产详细地址"></en-input>
+      <en-select label="房屋用途"  v-model="item.house_use" v-if="verifyKey('house_use')" placeholder="请选择房屋用途" :local-data="houseTypeData" ></en-select>
+      <en-date label="建成年份" v-model="item.build_date" v-if="verifyKey('build_date')" placeholder="选择房屋建成年份"></en-date>
+      <en-radio label="材料费" v-model="item.is_pay" v-if="verifyKey('is_pay')" :radio-data="payData"></en-radio>
+      <en-input label="建筑面积" v-model="item.covered_area" v-if="verifyKey('covered_area')" type="digit" placeholder="请输入建筑面积" rightText="㎡"></en-input>
+      <en-upload label="上传房产证件" v-model="item.certificate_img" v-if="verifyKey('certificate_img')" :imageWidth="180"></en-upload>
+      <en-upload label="上传房产关联图片" v-model="item.property" v-if="verifyKey('property')" :imageWidth="180"></en-upload>
+      <en-input label="备注" v-model="item.remark" v-if="verifyKey('remark')" type="text" placeholder="请输入备注信息" :noBox="true"></en-input>
+    </view>
+    <en-blank message="暂无房产信息,快来添加吧!" v-if="houseList.length<=0"></en-blank>
+    <button class="size-26 r-10 button-color house-button m-t30" hover-class="is-hover"
+            @click="addHouse">+添加房产</button>
+  </view>
 </template>
 
 <script>
+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";
+import EnDate from "@/components/en-from/en-date/en-date.vue";
+import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+
+export default {
+  name:'property-guarantee',
+  components: {
+    EnBlank,
+    EnDate,
+    EnSelect,
+    EnUpload,
+    EnCity,
+    enInput
+  },
+  props: {
+    'showKeys': {
+      default: []
+    },
+    'value': {
+      default: {
+
+      }
+    },
+    'itemKey': {
+      default: 0
+    }
+  },
+  data() {
+    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() {
+        if (this.value) {
+          this.setValue()
+        }
+      },
+      deep: true
+    },
+  },
+  mounted() {
+    this.getTaskOptions()
+    this.setValue()
+  },
+  methods: {
+    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>
 
 <style>
-</style>
+.house-button {
+  height: 70rpx;
+  line-height: 70rpx;
+  background: #FFFFFF;
+  border: 1rpx solid #0FB160;
+}
+</style>

+ 1 - 1
page_task/property/components/house.vue

@@ -30,6 +30,7 @@
   import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
 
 	export default {
+    name:'property-house',
 		components: {
       EnBlank,
       EnDate,
@@ -80,7 +81,6 @@
       },
       'value': {
         handler() {
-          console.log('houseItem:', this.value)
           if (this.value) {
             this.setValue()
           }

+ 9 - 9
page_task/property/property.vue

@@ -41,7 +41,7 @@
 							</view>
 						</template>
 						<view class="content">
-							<House ></House>
+							<property-car v-model="carList" :show-keys="propertyKey"></property-car>
 						</view>
 					</uni-collapse-item>
 					<uni-collapse-item titleBorder="none" :border="false"
@@ -55,7 +55,7 @@
 							</view>
 						</template>
 						<view class="content">
-							<House></House>
+							<property-guarantee></property-guarantee>
 						</view>
 					</uni-collapse-item>
 					<uni-collapse-item titleBorder="none" :border="false"
@@ -69,7 +69,7 @@
 							</view>
 						</template>
 						<view class="content">
-							<House></House>
+							<property-company></property-company>
 						</view>
 					</uni-collapse-item>
 				</uni-collapse>
@@ -81,17 +81,17 @@
 </template>
 
 <script>
-	import Car from "./components/car.vue"
-	import Company from "./components/company.vue"
 	import House from "./components/house.vue"
-	import Guarantee from "./components/guarantee.vue"
+  import PropertyCar from "@/page_task/property/components/car.vue";
+  import PropertyGuarantee from "@/page_task/property/components/guarantee.vue";
+  import PropertyCompany from "@/page_task/property/components/company.vue";
 
 	export default {
 		components: {
-			Car,
+      PropertyCompany,
+      PropertyGuarantee,
+      PropertyCar,
 			House,
-			Company,
-			Guarantee
 		},
 		data() {
 			return {