| | |
| | | </u-form-item>
|
| | | <view class="pic">
|
| | | <view class="title">合同上传</view>
|
| | | <u-upload :fileList="imagesList" :previewFullImage="uploadConfig.previewFullImage"
|
| | | <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
|
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
|
| | | @delete="deletePic">
|
| | |
| | | <rentForm ref="rentform" />
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | </u-form>
|
| | |
|
| | |
|
| | | <!-- 事件类型下拉框 -->
|
| | | <select-bus v-if="typeShow" :show="typeShow" v-model="form[selectBusModel]" type="radio"
|
| | | :popupTitle="selectBusTitle" :dataLists="selectBusList" @cancel="typeShow = false" @submit="typeSelect">
|
| | |
| | | import {
|
| | | update
|
| | | } from "../../../api/system/role";
|
| | | import {
|
| | | minioBaseUrl
|
| | | } from '@/common/setting'
|
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | components: {
|
| | |
| | | houseTypeName: "", |
| | | rentalUseName: "",
|
| | | dueTime: "",
|
| | | fileUrls:"",
|
| | | images:[]
|
| | | },
|
| | | imagesList: [],
|
| | | rules: {
|
| | |
| | | this.rentId = id
|
| | | this.getCurrentRentInfo()
|
| | | }
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | this.currentRole = uni.getStorageSync("activeRole")
|
| | |
| | | const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
|
| | | this.form.dueTime = time
|
| | | this.dueTimeShow = false
|
| | | },
|
| | | async afterReadImg(e) { |
| | | console.log(this.$store); |
| | | |
| | | },
|
| | | addRentForm() {
|
| | | this.rentFormNum++
|
| | |
| | | }
|
| | | },
|
| | | saveOrUpdate() { |
| | | console.log(this.rentalUseName, this.houseTypeName);
|
| | | this.$refs.form.validate().then(res => {
|
| | | let rentFormValidGroup = []
|
| | | this.$refs.rentform.forEach(item => {
|
| | |
| | | })
|
| | | })
|
| | | },
|
| | | // 新增操作
|
| | | async save() {
|
| | | let houseTenantVOList = []
|
| | | this.$refs.rentform.forEach(item => {
|
| | | houseTenantVOList.push(item.form)
|
| | | })
|
| | | if (this.form.images.length > 0) {
|
| | | let urls = []
|
| | | this.form.images.forEach(e => {
|
| | | urls.push(e.name)
|
| | | })
|
| | | this.form.fileUrls = urls.join(",")
|
| | | }
|
| | | const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
|
| | | const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
|
| | | const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
|
| | |
| | | dueTime: this.form.dueTime,
|
| | | houseStatus: this.dataList.houseType[statusIndex].value,
|
| | | rentalUse: this.dataList.rentalUse[rentalIndex].value,
|
| | | fileUrls:this.form.fileUrls,
|
| | | houseTenantVOList
|
| | | }
|
| | | const {
|
| | |
| | | }
|
| | | })
|
| | | },
|
| | | // 更新操作
|
| | | async update() {
|
| | | let houseTenantVOList = []
|
| | | this.$refs.rentform.forEach(item => {
|
| | | houseTenantVOList.push(item.form)
|
| | | })
|
| | | if (this.form.images.length > 0) {
|
| | | let urls = []
|
| | | this.form.images.forEach(e => {
|
| | | urls.push(e.name)
|
| | | })
|
| | | this.form.fileUrls = urls.join(",")
|
| | | }
|
| | | const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
|
| | | const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
|
| | | const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
|
| | |
| | | dueTime: this.form.dueTime,
|
| | | houseStatus: this.dataList.houseType[statusIndex].value,
|
| | | rentalUse: this.dataList.rentalUse[rentalIndex].value,
|
| | | fileUrls:this.form.fileUrls,
|
| | | houseTenantVOList
|
| | | }
|
| | | const res = await updateRetalInfo(data)
|
| | |
| | | })
|
| | | return res.name
|
| | | },
|
| | | // 获取租赁相关信息
|
| | | async getCurrentRentInfo() {
|
| | | const {
|
| | | code,
|
| | |
| | | houseRentalList
|
| | | }
|
| | | } = await getHouseRentInfo(this.houseCode)
|
| | | const images = []
|
| | | const {
|
| | | houseStatus,
|
| | | tenantRelationship,
|
| | | rentalUse,
|
| | | rentalTime,
|
| | | dueTime,
|
| | | houseTenantVOList
|
| | | houseTenantVOList,
|
| | | fileUrls
|
| | | } = houseRentalList.find(item => item.id === this.rentId)
|
| | | // 合同展示处理
|
| | | if(fileUrls!=null && fileUrls.length>0){
|
| | | const urls = fileUrls.split(',')
|
| | | // 遍历
|
| | | urls.forEach(e=>{
|
| | | images.push({
|
| | | url:minioBaseUrl + e,
|
| | | name: e
|
| | | })
|
| | | })
|
| | | }
|
| | | this.form = {
|
| | | relation: tenantRelationship,
|
| | | rentTime: rentalTime,
|
| | | dueTime: dueTime, |
| | | houseTypeName: houseStatus, |
| | | rentalUseName: rentalUse
|
| | | rentalUseName: rentalUse,
|
| | | images:images
|
| | | }
|
| | | this.rentalUseName = this.findObjValue(rentalUse, this.dataList.rentalUse)
|
| | | this.relationName = this.findObjValue(tenantRelationship, this.dataList.relation)
|