USER-20230908AJ\Administrator преди 1 година
родител
ревизия
6e9c08114b
променени са 2 файла, в които са добавени 165 реда и са изтрити 55 реда
  1. 149 48
      page_task/property/components/car.vue
  2. 16 7
      page_task/property/components/house.vue

+ 149 - 48
page_task/property/components/car.vue

@@ -1,57 +1,131 @@
 <template>
 	<view class="">
-		<view class="data-from" v-for="item in carList">
-			<en-input label="车辆品牌" type="text" placeholder="请输入车辆品牌" v-model="item.data.brand_id"
-				v-if="verifyKey('brand_id')"></en-input>
-			<en-radio label="车牌类型" :radio-data="carTypeData" v-model="item.data.car_type"
-				v-if="verifyKey('car_type')"></en-radio>
-			<en-input label="车牌号" type="text" placeholder="请输入车牌号" v-model="caritem.data.car_num"
-				v-if="verifyKey('car_num')"></en-input>
-			<en-input label="车架号" type="text" placeholder="请输入车架号" v-model="item.data.car_vin"
-				v-if="verifyKey('car_vin')"></en-input>
-			<en-input label="车辆颜色" type="text" placeholder="请输入车俩颜色" v-model="item.data.colour"
-				v-if="verifyKey('colour')"></en-input>
-			<en-input label="裸车价格" type="number" placeholder="请输入金额" v-model="item.data.car_price"
-				v-if="verifyKey('car_price')" rightText="元"></en-input>
-			<en-date label="登记时间" placeholder="选择车辆登记时间" v-model="item.data.register_date"
-				v-if="verifyKey('register_date')"></en-date>
-			<add-register img-type="2" v-model="item.data.register_img" @setCarData="setCarData"
-				v-if="verifyKey('register_img')"></add-register>
-			<add-register v-model="item.data.driving_img" @setCarData="setCarData"
-				v-if="verifyKey('driving_img')"></add-register>
-			<en-upload label="上传车辆相关图片" :imageWidth="180" v-model="item.data.car_img"
-				v-if="verifyKey('car_img')"></en-upload>
-			<en-input label="备注" type="text" placeholder="请输入备注信息" v-model="item.data.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>
+		<view class="data-from" v-for="(item,index) in carList">
+      <view class="p-t30" v-if="editIndex!==index">
+        <view  class="sys-from-background-color p-20 r-20">
+          <view class="row-justify-sb center">
+            <text class="size-28 sys-weight-600">车辆信息({{index+1}})</text>
+            <view class="row-c sys-background-fff r-100 p-lr40 p-tb10">
+              <image class="wh-30"
+                     src="/page_task/static/img/information/edit.png"
+                     mode="aspectFill" @click="onEditInfo(index)"></image>
+              <view class="title-line m-lr20"></view>
+              <image class="wh-30"
+                     src="/page_task/static/img/information/delete.png"
+                     mode="aspectFill" @click="onDeleteInfo(index)">
+              </image>
+            </view>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('brand_id')">
+            <view class="text-color-666"><text></text>车辆品牌:</view>
+            <text class="flex">{{getTypeText(item.data.brand_id,1)}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('car_type')">
+            <view class="text-color-666"><text></text>车牌类型:</view>
+            <text class="flex">{{getTypeText(item.data.car_type,2)}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('car_num')">
+            <view class="text-color-666"><text></text>车牌号:</view>
+            <text class="flex">{{item.data.car_num}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('car_vin')">
+            <view class="text-color-666"><text></text>车架号:</view>
+            <text class="flex">{{item.data.car_vin}}</text>
+          </view>
+          <view class="row p-t30"  v-if="verifyKey('colour')">
+            <view class="text-color-666"><text></text>车辆颜色:</view>
+            <text class="flex">{{item.data.colour}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('car_price')">
+            <view class="text-color-666"><text></text>裸车价格:</view>
+            <text class="flex">{{item.data.car_price}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('register_date')">
+            <view class="text-color-666"><text></text>登记时间:</view>
+            <text class="flex">{{item.data.register_date}}</text>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('register_img')">
+            <view class="text-color-666"><text></text>登记证书:</view>
+            <EnImage :img="item.data.register_img"></EnImage>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('driving_img')">
+            <view class="text-color-666"><text></text>行驶证:</view>
+            <EnImage :img="item.data.driving_img"></EnImage>
+          </view>
+          <view class="row p-t30" v-if="verifyKey('car_img')">
+            <view class="text-color-666"><text></text>辆相关图片:</view>
+            <EnImage :img="item.data.car_img"></EnImage>
+          </view>
+          <view class="row p-t30">
+            <view class="text-color-666"><text></text>备注:</view>
+            <text class="flex">{{item.data.remark}}</text>
+          </view>
+        </view>
+      </view>
+      <view class="p-t30" v-else>
+        <view class="row-justify-sb center p-b10">
+          <text class="size-28 sys-weight-600">房产信息({{index+1}})</text>
+          <view class="row-c sys-background-fff r-100">
+            <image class="wh-30"
+                   src="/page_task/static/img/information/delete.png"
+                   mode="aspectFill" @click="onDeleteInfo(index)">
+            </image>
+          </view>
+        </view>
+        <en-input label="车辆品牌" type="text" placeholder="请输入车辆品牌" v-model="item.data.brand_id"
+                  v-if="verifyKey('brand_id')"></en-input>
+        <en-radio label="车牌类型" :radio-data="carTypeData" v-model="item.data.car_type"
+                  v-if="verifyKey('car_type')"></en-radio>
+        <en-input label="车牌号" type="text" placeholder="请输入车牌号" v-model="item.data.car_num"
+                  v-if="verifyKey('car_num')"></en-input>
+        <en-input label="车架号" type="text" placeholder="请输入车架号" v-model="item.data.car_vin"
+                  v-if="verifyKey('car_vin')"></en-input>
+        <en-input label="车辆颜色" type="text" placeholder="请输入车俩颜色" v-model="item.data.colour"
+                  v-if="verifyKey('colour')"></en-input>
+        <en-input label="裸车价格" type="number" placeholder="请输入金额" v-model="item.data.car_price"
+                  v-if="verifyKey('car_price')" rightText="元"></en-input>
+        <en-date label="登记时间" placeholder="选择车辆登记时间" v-model="item.data.register_date"
+                 v-if="verifyKey('register_date')"></en-date>
+        <add-register img-type="2" v-model="item.data.register_img" @setCarData="setCarData"
+                      v-if="verifyKey('register_img')"></add-register>
+        <add-register v-model="item.data.driving_img" @setCarData="setCarData"
+                      v-if="verifyKey('driving_img')"></add-register>
+        <en-upload label="上传车辆相关图片" :imageWidth="180" v-model="item.data.car_img"
+                   v-if="verifyKey('car_img')"></en-upload>
+        <en-input label="备注" type="text" placeholder="请输入备注信息" v-model="item.data.remark" v-if="verifyKey('remark')"
+                  :noBox="true"></en-input>
+      </view>
+    </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>
-	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";
-	import tools from "@/service/tools";
-	import {
-		getSn
-	} from "@/api/common";
+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";
+import tools from "@/service/tools";
+import {
+  getSn
+} from "@/api/common";
+import EnImage from "@/components/en-utils/en-image/en-image.vue";
 
-	export default {
-		name: 'property-car',
-		components: {
-			AddRegister,
-			EnBlank,
+export default {
+  name: 'property-car',
+  components: {
+    EnImage,
+    AddRegister,
+    EnBlank,
 			EnDate,
 			EnSelect,
 			EnUpload,
@@ -73,6 +147,7 @@
 		},
 		data() {
 			return {
+        editIndex:0,
 				carTypeData: [{
 					'id': 1,
 					'name': '运营车'
@@ -118,6 +193,31 @@
 			this.setValue()
 		},
 		methods: {
+      getTypeText(val){
+        val=val*1
+        for (const typeKey in   this.houseTypeData) {
+          if(val===this.houseTypeData[typeKey].value){
+            return this.houseTypeData[typeKey].text
+          }
+        }
+
+      },
+      onDeleteInfo(itemKey) {
+        uni.showModal({
+          title: '是否删除当前资产信息',
+          content: '确定删除?',
+          success: (res) => {
+            if (res.confirm) {
+              this.carList.splice(itemKey, 1)
+              this.editIndex = itemKey-1
+            }
+          }
+        })
+
+      },
+      onEditInfo(index){
+        this.editIndex = index
+      },
 			setCarData(carData) {
 				console.log('carData')
 				console.log(this.carData)
@@ -149,6 +249,7 @@
 							'property_sn': res.data,
 							'data': JSON.parse(JSON.stringify(this.carItem))
 						})
+            this.editIndex = this.carList.length-1
 						this.$emit('onResize')
 					} else {
 						tools.error('编号生成失败')

+ 16 - 7
page_task/property/components/house.vue

@@ -16,34 +16,42 @@
 							</image>
 						</view>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30" v-if="verifyKey('property_owner')">
 						<view class="text-color-666"><text></text>产权人:</view>
 						<text class="flex">{{item.data.property_owner}}</text>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30" v-if="verifyKey('deed_num')">
 						<view class="text-color-666"><text></text>房产证号:</view>
 						<text class="flex">{{item.data.deed_num}}</text>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30" v-if="verifyKey('house_city')">
 						<view class="text-color-666"><text></text>房产地址:</view>
 						<text class="flex">{{item.data.house_city}}{{item.data.house_address}}</text>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30"  v-if="verifyKey('house_use')">
 						<view class="text-color-666"><text></text>房屋用途:</view>
 						<text class="flex">{{getHouseUse(item.data.house_use)}}</text>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30" v-if="verifyKey('build_date')">
 						<view class="text-color-666"><text></text>建成年份:</view>
 						<text class="flex">{{item.data.covered_area}}</text>
 					</view>
-					<view class="row p-t30">
+          <view class="row p-t30" v-if="verifyKey('is_pay')">
+            <view class="text-color-666"><text></text>材料费:</view>
+            <text class="flex">{{item.data.is_pay===1?'已支付':'未支付'}}</text>
+          </view>
+					<view class="row p-t30" v-if="verifyKey('covered_area')" >
 						<view class="text-color-666"><text></text>建筑面积:</view>
 						<text class="flex">{{item.data.covered_area}}</text>
 					</view>
-					<view class="row p-t30">
+					<view class="row p-t30" v-if="verifyKey('certificate_img')">
 						<view class="text-color-666"><text></text>房产证件:</view>
 						<EnImage :img="item.data.certificate_img"></EnImage>
 					</view>
+          <view class="row p-t30" v-if="verifyKey('property')">
+            <view class="text-color-666"><text></text>房产证件:</view>
+            <EnImage :img="item.data.property"></EnImage>
+          </view>
 					<view class="row p-t30">
 						<view class="text-color-666"><text></text>备注:</view>
 						<text class="flex">{{item.data.remark}}</text>
@@ -195,6 +203,7 @@
           success: (res) => {
             if (res.confirm) {
               this.houseList.splice(itemKey, 1)
+              this.editIndex = itemKey-1
             }
           }
         })