| | |
| | | } |
| | | |
| | | // 房屋标签撤销 |
| | | export const removeHouseLabel = (ids) => { |
| | | export const removeHouseLabel = (data) => { |
| | | return http.request({ |
| | | url: 'blade-houseLabel/houseLabel/remove', |
| | | url: 'blade-houseLabel/houseLabel/removeHouseLabel', |
| | | method: 'POST', |
| | | params: { |
| | | ids |
| | | } |
| | | data |
| | | }) |
| | | } |
| | |
| | | <box-title title="房屋标签"></box-title>
|
| | | <view class="mt-20 flex label-btn-box b-c-w">
|
| | | <view v-for="(item, index) in labelBtnList" :key="index">
|
| | | <u-button color="#000" size="mini" type="primary" :plain="true" :text="item.name"
|
| | | <u-button color="#000" size="mini" type="primary" |
| | | :style="{background: item.color}"
|
| | | :plain="true" :text="item.name"
|
| | | @click="showLabelPopup(item)"></u-button>
|
| | | </view>
|
| | | </view>
|
| | |
| | | </u-radio>
|
| | | </u-radio-group>
|
| | |
|
| | | <u--textarea class="mt-40" v-model="value1" placeholder="请输入内容"></u--textarea>
|
| | | <u--textarea class="mt-40" v-model="remark" placeholder="请输入内容"></u--textarea>
|
| | | </view>
|
| | | </u-modal>
|
| | |
|
| | |
| | | import {
|
| | | updateHouseLabel,
|
| | | removeHouseLabel
|
| | | } from "@/api/houseRental/houseRental.js";
|
| | | } from "@/api/house/houseLabel.js";
|
| | | import {
|
| | | getHouseDetail,saveOrUpdateHouse
|
| | | } from "@/api/house/house.js";
|
| | | import {
|
| | | minioBaseUrl
|
| | | } from '@/common/setting'
|
| | | import { number } from "echarts"; |
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | data() {
|
| | |
| | | title: '',
|
| | | selectedColor: ''
|
| | | },
|
| | | labelValue: '苹果',
|
| | | value1: ''
|
| | | labelValue: '',
|
| | | remark: '',
|
| | | // 标记
|
| | | number:0
|
| | | }
|
| | | },
|
| | | created() {
|
| | |
| | | this.houseCode = code
|
| | | },
|
| | | onShow() {
|
| | | this.getLabelList()
|
| | | // this.getLabelList()
|
| | | this.getHouseDetailInfo()
|
| | | },
|
| | | methods: {
|
| | | // 获取房屋详情
|
| | | async getHouseDetailInfo() {
|
| | | var that = this;
|
| | | const param = {
|
| | | houseCode : this.houseCode
|
| | | }
|
| | | const res = await getHouseDetail(param)
|
| | | if(null != res.data){
|
| | | const images = []
|
| | | const {
|
| | | phone,
|
| | | address,
|
| | | propertyPrice,
|
| | | serviceDue,
|
| | | imageUrls,
|
| | | houseLabelVOList
|
| | | } = res.data
|
| | | if(imageUrls.length>0){
|
| | | const urls = imageUrls.split(',')
|
| | | // 遍历
|
| | | urls.forEach(e=>{
|
| | | images.push({
|
| | | url:minioBaseUrl + e,
|
| | | name: e
|
| | | })
|
| | | })
|
| | | }
|
| | | // 房屋标签处理
|
| | | if(houseLabelVOList.length>0){
|
| | | const param = {
|
| | | parentId:1001
|
| | | }
|
| | | const res = await getLabelListByParentId(param)
|
| | | this.labelBtnList = res.data
|
| | | that.labelBtnList.forEach(e=>{
|
| | | houseLabelVOList.forEach(f=>{
|
| | | if(Number(e.id) == f.labelId){
|
| | | e['color'] = f.color
|
| | | e['remark'] = f.remark
|
| | | }
|
| | | })
|
| | | })
|
| | | }
|
| | | this.form = {
|
| | | phone,
|
| | | address,
|
| | | propertyPrice,
|
| | | serviceDue,
|
| | | imageUrls,
|
| | | images
|
| | | }
|
| | | }
|
| | | },
|
| | | // 获取房屋标签信息
|
| | | async getLabelList() {
|
| | | const param = {
|
| | | parentId:1001
|
| | | }
|
| | | const res = await getLabelListByParentId(param)
|
| | | this.labelBtnList = res.data
|
| | | },
|
| | | // 更新房屋数据
|
| | | async updateHouseInfo(){
|
| | | this.form['houseCode'] = this.houseCode
|
| | |
| | | duration: 1500,
|
| | | success: () => {
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | // uni.navigateBack()
|
| | | }, 1500)
|
| | | }
|
| | | })
|
| | | },
|
| | | // 房屋弹窗
|
| | | showLabelPopup(item) {
|
| | | // 先清空
|
| | | this.number = 0
|
| | | this.labelValue = ""
|
| | | this.remark = ""
|
| | | this.popupShow = true
|
| | | this.labelModelInfo.title = item.name
|
| | | this.currentLabelInfo = item
|
| | | // 遍历标签集合
|
| | | this.labelList.forEach(e=>{
|
| | | if(e.color == item.color){
|
| | | this.labelValue = e.name
|
| | | this.remark = item.remark
|
| | | this.number = 1
|
| | | }
|
| | | })
|
| | | },
|
| | |
|
| | | popupConfirm() {
|
| | |
| | | radioChange(item) {
|
| | | this.currentColorInfo = item
|
| | | },
|
| | | // 更新房屋标签
|
| | | async popupConfirm() {
|
| | | const {
|
| | | id
|
| | |
| | | } = this.currentColorInfo
|
| | | let res = null
|
| | | if (name === '撤销') {
|
| | | res = await removeHouseLabel(id)
|
| | | if(this.number==1){
|
| | | const data = {
|
| | | labelId:id,
|
| | | houseCode: this.houseCode
|
| | | }
|
| | | res = await removeHouseLabel(data)
|
| | | }else{
|
| | | uni.showToast({
|
| | | title: "无可撤销项",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | })
|
| | | return
|
| | | }
|
| | | } else {
|
| | | res = await updateHouseLabel({
|
| | | houseCode: this.houseCode,
|
| | | labelId: id,
|
| | | remark:this.remark,
|
| | | color
|
| | | })
|
| | | }
|
| | |
| | | })
|
| | | return
|
| | | }
|
| | | this.getLabelList()
|
| | | // 刷新页面
|
| | | this.getHouseDetailInfo()
|
| | | this.popupShow = false
|
| | | },
|
| | | // 获取房屋详情
|
| | | async getHouseDetailInfo() {
|
| | | const param = {
|
| | | houseCode : this.houseCode
|
| | | }
|
| | | const res = await getHouseDetail(param)
|
| | | if(null != res.data){
|
| | | const images = []
|
| | | const {
|
| | | phone,
|
| | | address,
|
| | | propertyPrice,
|
| | | serviceDue,
|
| | | imageUrls
|
| | | } = res.data
|
| | | if(imageUrls.length>0){
|
| | | const urls = imageUrls.split(',')
|
| | | // 遍历
|
| | | urls.forEach(e=>{
|
| | | images.push({
|
| | | url:minioBaseUrl + e,
|
| | | name: e
|
| | | })
|
| | | })
|
| | | }
|
| | | this.form = {
|
| | | phone,
|
| | | address,
|
| | | propertyPrice,
|
| | | serviceDue,
|
| | | imageUrls,
|
| | | images
|
| | | }
|
| | | }
|
| | | },
|
| | | // 获取房屋标签信息
|
| | | async getLabelList() {
|
| | | const param = {
|
| | | parentId:1001
|
| | | }
|
| | | const res = await getLabelListByParentId(param)
|
| | | this.labelBtnList = res.data
|
| | | },
|
| | | |
| | | }
|
| | | }
|
| | | </script>
|