<template>
  <div class="housedetailsedit">
    <div class="list">
      <div class="list-row" style="padding-top: 0">
        <uni-collapse v-model="value" style="width: 100%">
          <uni-collapse-item title="基础信息">
            <div style="height: auto; padding-bottom: 200rpx">
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">公司名称：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.qymc"
                />
              </view>
              <view
                style="min-height: 40px"
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">统一社会信用代码：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.shxydm"
                />
              </view>

              <view
                style="min-height: 40px"
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">注册资金（万元）：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.zczj"
                />
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">币别：</view>
                <picker
                  style="float: left; width: 360rpx; height: 40rpx; color: #777"
                  @change="getBizhongtype"
                  range-key="label"
                  :range="dic_SelectList.CURRENCY"
                >
                  <div style="width: 315rpx; float: left">
                    {{
                      bizhongIndex == null
                        ? "请选择"
                        : dic_SelectList.CURRENCY[bizhongIndex].label
                    }}
                  </div>
                  <img
                    class="height40rpx width40rpx float_left"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </picker>
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">注册时间：</view>
                <picker
                  style="float: left; width: 360rpx; height: 40rpx; color: #777"
                  mode="date"
                  :value="form.zcsj"
                  @change="getZcsj"
                >
                  <div style="width: 315rpx; float: left">
                    {{
                      form.zcsj == "" || form.zcsj == null
                        ? "请选择"
                        : form.zcsj
                    }}
                  </div>
                  <img
                    class="height40rpx width40rpx float_left"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </picker>
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">法定代表人：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.fddbr"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">法人电话 ：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.lxdh"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">法人邮箱 ：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.frEmail"
                />
              </view>
              <!-- <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date"
                style="height: 194rpx"
              >
                <view class="input_title">法人身份证：</view>
                <view class="width100" style="position: relative">
                  <van-icon
                    v-if="
                      form.frsfzh_zhenmian != '../../../static/idzhengmian.png'
                    "
                    @click="splicefrsfzh_zhenmian()"
                    name="cross"
                    style="
                      position: absolute;
                      top: -5rpx;
                      left: 133rpx;
                      font-size: 42rpx;
                    "
                  />
                  <van-icon
                    v-if="
                      form.frsfzh_fanmian != '../../../static/idfanmian.png'
                    "
                    @click="splicefrsfzh_fanmian()"
                    name="cross"
                    style="
                      position: absolute;
                      top: -5rpx;
                      left: 300rpx;
                      font-size: 23px;
                    "
                  />
                  <img
                    @click="choosefrsfzh_zhenmian()"
                    :src="
                      form.frsfzh_zhenmian == '../../../static/idzhengmian.png'
                        ? form.frsfzh_zhenmian
                        : BASE_URI +
                          '/FileController/download/' +
                          form.frsfzh_zhenmian
                    "
                    class="idclass margin12rpx float_left"
                    placeholder="请输入"
                  />

                  <img
                    @click="choosefrsfzh_fanmian()"
                    :src="
                      form.frsfzh_fanmian == '../../../static/idfanmian.png'
                        ? form.frsfzh_fanmian
                        : BASE_URI +
                          '/FileController/download/' +
                          form.frsfzh_fanmian
                    "
                    class="idclass margin12rpx float_left"
                    placeholder="请输入"
                  />
                </view>
              </view> -->

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">企业联系人</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.qylxr"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">联系人电话：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.lxdh"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">联系人邮箱：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.email"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">财务负责人：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.cwfzr"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">负责人电话：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.cwfzrdh"
                />
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">其他联系方式：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="请输入"
                  v-model="form.otherContact"
                />
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">股票代码:</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="请输入"
                  v-model="form.shareCertificateCode"
                />
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">土地面积:</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="请输入"
                  v-model="form.leaseArea"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">入驻类型</view>

                <picker
                  style="float: left; width: 300rpx; height: 40rpx; color: #777"
                  @change="getSettleInType"
                  range-key="label"
                  :range="dic_SelectList.MNP_BUILDING_TYPE"
                >
                  <span>
                    {{
                      settleInTypeIndex != -1
                        ? dic_SelectList.MNP_BUILDING_TYPE[settleInTypeIndex]
                            .label
                        : "请选择"
                    }}
                  </span>
                </picker>
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view
                  class="input_title float_left"
                  @click="getSelectUserTwo('selectDengjiren')"
                  >招商经理：</view
                >
                <input
                  @click="getSelectUserTwo('selectDengjiren')"
                  disabled="true"
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.investmentManagerName"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">所属楼盘：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.areaName"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">注册地址：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.zcdz"
                />
              </view>

              <!-- <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
              >
                <view class="input_title float_left">经营地址：</view>
                <input
                  style="color: #777"
                  class="input_value float_left"
                  placeholder="暂无"
                  v-model="form.jydz"
                />
              </view> -->

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height300rpxs"
              >
                <view class="input_title float_left">荣誉信息（限6张）</view>
                <textarea
                  :maxlength="2000"
                  placeholder="请输入"
                  v-model="form.honorInformation"
                  type="textarea"
                  style="
                    height: 270rpx;
                    background: rgba(249, 249, 249, 1);
                    padding: 20rpx;
                    width: calc(100% - 40rpx);
                  "
                />
                <div
                  style="
                    background: rgba(249, 249, 249, 1);
                    text-align: right;
                    padding-right: 10px;
                    padding-bottom: 10rpx;
                    margin-bottom: 10rpx;
                  "
                >
                  {{
                    form.honorInformation ? form.honorInformation.length : 0
                  }}/2000
                </div>
                <view class="custom-image-box" style="margin-top: 20rpx">
                  <van-uploader
                    :max-count="6"
                    @delete="deleteRYXXZP"
                    :file-list="form.RYXXZPList"
                    @after-read="uploadRYXXZP"
                    :show-upload="true"
                  />
                </view>
              </view>
              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date"
                style="display: flex"
              >
                <view class="input_title mb16rpx float_left" style="width: 30%"
                  >经营范围：</view
                >
                <div style="width: 100%">
                  <div
                    style="display: flex; justify-self: flex-end"
                    v-for="(item, index) in form.jyfwAry"
                    :key="index"
                  >
                    <input
                      style="color: #050505; width: 80%"
                      class="input_value"
                      placeholder="请输入"
                      v-model="item.name"
                    />
                    <van-button
                      v-if="index == 0"
                      type="default"
                      size="small"
                      color="#1f1fbe"
                      @click="addJyfw()"
                      >添加</van-button
                    >
                    <van-button
                      v-if="index != 0"
                      type="default"
                      size="small"
                      color="rgba(236, 128, 141, 1)"
                      @click="deleteJyfw(index)"
                      >删除</van-button
                    >
                  </div>
                </div>
              </view>

              <view class="width100 mt24rpx list_date height40rpx">
                <view class="input_title float_left" style="width: 100%"
                  >营业执照副本：（限1张）</view
                >
              </view>
              <view class="custom-image-box" style="position: relative">
                <van-icon
                  v-if="form.YYZZFBZP"
                  @click="spliceYYZZFBZP()"
                  name="cross"
                  style="
                    position: absolute;
                    top: 0;
                    left: 282rpx;
                    font-size: 42rpx;
                  "
                />

                <img
                  v-if="form.YYZZFBZP"
                  @click="chooseYYZZFBZP()"
                  :src="BASE_URI + '/FileController/download/' + form.YYZZFBZP"
                  style="color: #777; width: 300rpx; height: 260rpx"
                  placeholder="请输入"
                />
                <img
                  v-else
                  @click="chooseYYZZFBZP()"
                  src="../../../static/unuploadzhizhao.png"
                  style="color: #777; width: 300rpx; height: 260rpx"
                  placeholder="请输入"
                />
              </view>

              <view
                class="width100 mt24rpx padb24rpx border_bottom_ccc list_date"
                style="display: flex"
                @click="chosseAboutCompany()"
              >
                <view class="input_title float_left">关联企业：</view>

                <div style="color: #777; width: 60%" class="float_left">
                  {{
                    form.associationCompanyName
                      ? form.associationCompanyName
                      : "请选择"
                  }}
                </div>
              </view>

              <div class="form border_bottom_ccc">
                <div class="width100 mt24rpx padb24rpx list_date">附件：</div>
                <div
                  class="width100 mt24rpx padb24rpx list_date _div data-v-6c6f8f24"
                >
                  <div class="fujian">
                    <van-uploader
                      accept="all"
                      :max-count="6"
                      :file-list="form.fileList"
                      @after-read="uploadFileList"
                      :show-upload="false"
                    >
                      <van-button
                        type="primary"
                        size="small"
                        style="margin-bottom: 15rpx"
                        >文件选择</van-button
                      >
                    </van-uploader>
                    <div
                      @click="openFile(item)"
                      class="file"
                      v-for="(item, index) in form.fileList"
                      :key="index"
                    >
                      <div class="filename">{{ item.name }}</div>

                      <uni-icons
                        type="closeempty"
                        size="20"
                        @click="deleteFileList(index)"
                      ></uni-icons>
                    </div>
                  </div>
                </div>
                <div class="first_title" style="height: auto">
                  关联社会载体：
                </div>

                <div
                  class="form_row pdt32 pdb32 border_bottom_ccc width100"
                  style="display: flex; height: auto; align-items: center"
                >
                  <div class="width30 first_title" style="height: auto">
                    自有：
                  </div>
                  <div
                    @click="jumpChosseHouse('自有')"
                    style="width: 65%"
                    class="float_left font28rpx color292d98"
                  >
                    {{
                      form.socialCarrierStrName
                        ? form.socialCarrierStrName
                        : "请选择"
                    }}
                  </div>
                  <img
                    @click="jumpChosseHouse('自有')"
                    class="height40rpx width40rpx"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </div>
                <div
                  class="form_row pdt32 pdb32 border_bottom_ccc width100"
                  style="display: flex; height: auto; align-items: center"
                >
                  <div class="width30 first_title" style="height: auto">
                    租赁：
                  </div>
                  <div
                    @click="jumpChosseHouse('租赁')"
                    style="width: 65%"
                    class="float_left font28rpx color292d98"
                  >
                    {{
                      form.socialCarrierLeaseStrName
                        ? form.socialCarrierLeaseStrName
                        : "请选择"
                    }}
                  </div>
                  <img
                    @click="jumpChosseHouse('租赁')"
                    class="height40rpx width40rpx"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </div>
                <div
                  class="form_row pdt32 pdb32 border_bottom_ccc width100"
                  style="display: flex; height: auto; align-items: center"
                >
                  <div class="width30 first_title" style="height: auto">
                    未确定：
                  </div>
                  <div
                    @click="jumpChosseHouse('未确定')"
                    style="width: 65%"
                    class="float_left font28rpx color292d98"
                  >
                    {{
                      form.socialCarrierNoTrueName
                        ? form.socialCarrierNoTrueName
                        : "请选择"
                    }}
                  </div>
                  <img
                    @click="jumpChosseHouse('未确定')"
                    class="height40rpx width40rpx"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </div>
                <div
                  class="first_title"
                  style="height: auto; margin-top: 32rpx"
                >
                  关联自有载体：
                </div>
                <div
                  class="form_row pdt32 pdb32 border_bottom_ccc width100"
                  style="display: flex; height: auto"
                >
                  <div class="width30 first_title">有合同</div>
                  <div
                    style="width: 60%"
                    class="float_left font28rpx color292d98"
                  >
                    {{ form.socialCarrierName }}
                  </div>
                </div>
                <div
                  class="form_row pdt32 pdb32 border_bottom_ccc width100"
                  style="display: flex; height: auto; align-items: center"
                >
                  <div class="width30 first_title" style="height: auto">
                    无合同：
                  </div>
                  <div
                    @click="jumpChosseHouse('无合同')"
                    style="width: 65%"
                    class="float_left font28rpx color292d98"
                  >
                    {{
                      form.contractCarrierNoStrName
                        ? form.contractCarrierNoStrName
                        : "请选择"
                    }}
                  </div>
                  <img
                    @click="jumpChosseHouse('无合同')"
                    class="height40rpx width40rpx"
                    src="../../../static/mine/youjiantou.png"
                    alt=""
                  />
                </div>
              </div>
            </div>
            <div class="form">
              <!-- <div
          style="height: 45px; width: 500px; background: black"
          
        ></div> -->
            </div>
          </uni-collapse-item>
        </uni-collapse>
      </div>
    </div>
    <view class="‘btn-view‘">
      <div class="btn" @click="edit()">编辑</div>
    </view>
    <handle-report ref="handleReport" @changeActive="changeActive" />
    <select-dengjiren
      ref="selectDengjiren"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="name"
      idKey="id"
      @xiangmudengji="selectDengjiren"
    >
    </select-dengjiren>
    <multiple-select
      v-model="show"
      @getCompanyAll="getCompanyAll"
      :data="companyAllList"
      :default-selected="defaultSelected"
      @confirm="confirm"
      ref="multipleSelect"
    ></multiple-select>
    <zaiti-tree
      ref="zaitiTree"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="label"
      idKey="id"
      @confirm="selectZaiti"
    />
  </div>
</template>
    
<script>
const form = {
  id: "",
  YYZZFBZP: null,
  FRSFZHZM: "../../../static/idzhengmian.png",
  FRSFZHFM: "../../../static/idfanmian.png",
  frsfzh_zhenmian: "../../../static/idzhengmian.png",
  frsfzh_fanmian: "../../../static/idfanmian.png",
  RYXXZPList: [],
  id: "",
  qymc: "",
  shxydm: "",
  zczj: "",
  fddbr: "",
  lxdh: "",
  frsfzh: "",
  qylxr: "",
  lxdh: "",
  email: "",
  cwfzr: "",
  cwfzrdh: "",
  investmentManagerName: "",
  investmentManager: "",
  area: "",
  zcdz: "",
  jydz: "",
  ryxxzp: "",
  rdInvestment: "",
  jgInvestment: "",
  jgInvestment: "",
  fourOpennessAmount: "",
  fourTransferenceAmount: "",
  fourServiceAmount: "",
  fourConsultAmount: "",
  associationCompany: "",
  settleInType: "",
  frEmail: "",
  zscqgs: "",
  fileLists: [],
  file: "",
};
import {
  getCompanyHouseDetails,
  getByCodes,
  companyECdit,
  interviewEscalationListAll,
  getSelectUserTwo,
  getCompanyAll,
  selectByCompanyId,
  getTreeData6,
  findRoomInfoListByIds,
  getRoomNameByCompanyId,
} from "@/js_sdk/http";
// import multipleSelect from "../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
import multipleSelect from "./momo-multipleSelect.vue";
import zaitiTree from "@/components/zaiti-tree/index.vue";
import handleReport from "../companyreport/components/handlereport.vue";
import selectDengjiren from "../../subPackages/components/select_dengjiren/tkitree.vue";
import tools from "../../subPackages/components/tkitree/tools.js";
export default {
  components: {
    handleReport,
    selectDengjiren,
    multipleSelect,
    zaitiTree,
  },
  data() {
    return {
      show: false,
      bizhongIndex: null,
      BASE_URI: this.$constant.BASE_URI,
      range: [],
      companyAllList: [],
      settleInTypeIndex: null,
      id: "",
      interviewList: [],
      dic_key: [
        "MNP_BUILDING_TYPE",
        "SETTLE_IN_STATUS",
        "interviewType",
        "CURRENCY",
      ],
      dic_SelectList: {},
      activeNames: [],
      StatusBar: 0,
      search: {
        pageSize: 10,
        pageNum: 1,
      },
      form: {
        ...form,
      },
      value: true,
      value1: true,
      list: [],
      value: ["0"],
      modeIndex: -1,
      styleIndex: -1,
      current: 0,
      mode: "default",
      dotsStyles: {},
      swiperDotIndex: 0,
    };
  },
  onShow() {
    let that = this;
    uni.$on("getuser", function (e) {
      console.log(e);
      findRoomInfoListByIds(e.result.join(",")).then((data) => {
        let roomString = data.map((e) => {
          return e.roomString;
        });
        let ids = data.map((e) => {
          return e.id;
        });
        if (e.housetype == "自有") {
          that.form.socialCarrierStr = ids.join(",");
          that.form.socialCarrierStrName = roomString.join(",");
          console.log(roomString);
        }
        if (e.housetype == "租赁") {
          that.form.socialCarrierLeaseStr = ids.join(",");
          that.form.socialCarrierLeaseStrName = roomString.join(",");
          console.log(roomString);
        }
        if (e.housetype == "未确定") {
          that.form.socialCarrierNoTrue = ids.join(",");
          that.form.socialCarrierNoTrueName = roomString.join(",");
          console.log(roomString);
        }
        if (e.housetype == "无合同") {
          that.form.contractCarrierNoStr = ids.join(",");
          that.form.contractCarrierNoStrName = roomString.join(",");
          console.log("无合同", roomString);
        }
      });
    });
  },
  onLoad(option) {
    this.id = option.id;
    this.getCompanyAll();
    this.getByCodes();
  },
  methods: {
    openFile(item) {
      uni.downloadFile({
        url: item.url,
        success: function (res) {
          var filePath = res.tempFilePath;
          console.log("下载文件：", res);
          uni.openDocument({
            filePath: filePath,
            success: function (res) {
              console.log("打开文档成功");
            },
            fail: function (res) {
              console.log("uni.openDocument,fail");
              console.log(res);
            },
            complete: function (res) {
              console.log("uni.openDocument,complete");
              console.log(res);
            },
          });
        },
        fail: function (res) {
          console.log("uni.downloadFile,fail");
          console.log(res);
        },
        complete: function (res) {
          console.log("uni.downloadFile,complete");
          console.log(res);
        },
      });
      console.log(item);
    },
    jumpChosseHouse(e) {
      uni.navigateTo({
        url: "/pages/subPackages/chosseHouse/chosseHouse?housetype=" + e,
      });
    },
    spliceYYZZFBZP() {
      console.log("this.form.YYZZFBZP", this.form.YYZZFBZP);
      this.form.YYZZFBZP = null;
      this.form = { ...this.form };
      console.log("form.YYZZFBZP", this.form.YYZZFBZP);
    },
    async selectZaiti(e) {
      console.log(e);
      let ids = [];
      let names = [];
      for (let i = 0; i < e.length; i++) {
        ids.push(e[i].id);
        names.push(e[i].label);
      }
      // socialCarrierName
      //   let selectedList = await selectByCom
      this.form.socialCarrierStr = ids.join(",");
      this.form.socialCarrierName = names.join(",");
      //   console.log(selectedList);
      //   this.form.investmentManagerString = names.join(",");
      //   this.form.investmentManager = ids.join(",");
    },
    async openZaitiTree(key) {
      let that = this;
      let departmentList = await getTreeData6("");
      that.range = tools.transData(
        departmentList.data,
        "id",
        "parentid",
        "children"
      );
      that.$refs.zaitiTree._show();
    },

    async selectByCompanyId1() {
      let zaiti = await selectByCompanyId({ companyId: this.id });
      console.log("zaitizaitizaitizaiti", zaiti);
      let socialCarrierStr = [];
      let socialCarrierStrName = [];
      let socialCarrierLeaseStr = [];
      let socialCarrierLeaseStrName = [];
      let socialCarrierNoTrue = [];
      let socialCarrierNoTrueName = [];
      let contractCarrierNoStr = [];
      let contractCarrierNoStrName = [];
      for (let i = 0; i < zaiti.length; i++) {
        let item = zaiti[i];
        console.log(item.propertyNature, item.socialType);
        if (item.propertyNature === "2" && item.socialType === "1") {
          socialCarrierStr.push(item.houseId);
          socialCarrierStrName.push(
            item.discName + item.groupName + item.buildName + item.houseName
          );
        }
        if (item.propertyNature === "2" && item.socialType === "2") {
          socialCarrierLeaseStr.push(item.houseId);
          socialCarrierLeaseStrName.push(
            item.discName + item.groupName + item.buildName + item.houseName
          );
        }
        if (item.propertyNature === "2" && item.socialType === "3") {
          socialCarrierNoTrue.push(item.houseId);
          socialCarrierNoTrueName.push(
            item.discName + item.groupName + item.buildName + item.houseName
          );
        }
        if (item.propertyNature === "1" && item.ownType === "2") {
          contractCarrierNoStr.push(item.houseId);
          contractCarrierNoStrName.push(
            item.discName + item.groupName + item.buildName + item.houseName
          );
        }
      }
      this.form.socialCarrierStr = socialCarrierStr.join(",");
      this.form.socialCarrierStrName = socialCarrierStrName.join(",");
      this.form.socialCarrierLeaseStr = socialCarrierLeaseStr.join(",");
      this.form.socialCarrierLeaseStrName = socialCarrierLeaseStrName.join(",");
      this.form.socialCarrierNoTrue = socialCarrierNoTrue.join(",");
      this.form.socialCarrierNoTrueName = socialCarrierNoTrueName.join(",");
      this.form.contractCarrierNoStr = contractCarrierNoStr.join(",");
      this.form.contractCarrierNoStrName = contractCarrierNoStrName.join(",");
    },
    async getRoomNameByCompanyId() {
      let socialCarrierName = await getRoomNameByCompanyId({
        companyId: this.id,
      });
      this.form.socialCarrierName = socialCarrierName;
    },

    addJyfw() {
      console.log(this.form.jyfwAry);
      this.form.jyfwAry = [...this.form.jyfwAry, { name: "" }];
      this.$forceUpdate();
    },
    deleteJyfw(i) {
      this.form.jyfwAry.splice(i, 1);
    },
    chosseAboutCompany() {
      console.log(123);
      try {
        this.show = true;
        this.$refs.multipleSelect.getAllList(this.companyAllList);
      } catch (error) {
        console.log("error", error);
      }
    },
    confirm(e) {
      console.log(e);
      var associationCompanyString = [];
      var associationCompany = [];
      for (var p in e) {
        associationCompanyString.push(e[p].label);
        associationCompany.push(e[p].value);
      }

      this.form.associationCompanyName = associationCompanyString.join(",");
      this.form.associationCompany = associationCompany.join(",");
      console.log(associationCompanyString.join(","));
      this.$forceUpdate();
    },
    async getCompanyAll() {
      let companyAllList = await getCompanyAll();
      this.companyAllList = companyAllList.map((e) => {
        return {
          label: e.qymc,
          value: e.id,
        };
      });
    },
    deleteFileList(i) {
      this.form.fileList.splice(i, 1);
    },
    uploadFileList(event) {
      let that = this;
      that.form.fileList = !that.form.fileList ? [] : that.form.fileList;
      const { file } = event.detail;
      uni.uploadFile({
        url: that.$constant.BASE_URI + "/wx/fileController/upload2",
        filePath: file.url,
        name: "file",
        formData: { user: "test" },
        success(res) {
          try {
            // 上传完成需要更新 fileList
            let { data } = JSON.parse(res.data);
            console.log(data);
            let name = JSON.parse(data[0]).name;
            let size = JSON.parse(data[0]).size;

            that.form.fileList.push({
              name: name,
              size: size,
              imgUrl: "/FileController/download/" + data[1],
              id: data[1],
              url:
                that.$constant.BASE_URI + "/FileController/download/" + data[1],
            });
            console.log("that.form.fileList", that.form.fileList);
            that.form = { ...that.form };
          } catch (error) {
            console.log(error);
          }
        },
        fail(res) {},
      });
    },
    getBizhongtype(e) {
      let that = this;
      that.form.currency = that.dic_SelectList.CURRENCY[e.detail.value].value;
      that.bizhongIndex = e.detail.value;
    },
    uploadRYXXZP(event) {
      let that = this;
      const { file } = event.detail;
      uni.uploadFile({
        url: that.$constant.BASE_URI + "/wx/fileController/upload",
        filePath: file.url,
        name: "file",
        formData: { user: "test" },
        success(res) {
          // 上传完成需要更新 fileList
          let data = JSON.parse(res.data);
          that.form.RYXXZPList.push({
            imgUrl: "/FileController/download/" + data.data[0],
            id: data.data[0],
            url:
              that.$constant.BASE_URI +
              "/FileController/download/" +
              data.data[0],
            isImage: true,
          });
          that.$forceUpdate();
        },
        fail(res) {},
      });
    },
    splicefrsfzh_zhenmian() {
      this.form.frsfzh_zhenmian = form.FRSFZHZM;
      this.$forceUpdate();
    },
    splicefrsfzh_fanmian() {
      this.form.frsfzh_fanmian = form.FRSFZHFM;
      this.$forceUpdate();
    },
    choosefrsfzh_zhenmian() {
      let that = this;
      if (that.form.frsfzh_zhenmian == form.FRSFZHZM) {
        uni.chooseImage({
          count: 1, //默认9
          sizeType: "original", //可以指定是原图还是压缩图，默认二者都有
          success: function (res) {
            uni.uploadFile({
              url: that.$constant.BASE_URI + "/wx/fileController/upload",
              filePath: res.tempFilePaths[0],
              name: "file",
              formData: { user: "test" },
              success(res) {
                // 上传完成需要更新 fileList
                let data = JSON.parse(res.data);
                that.form.frsfzh_zhenmian = data.data[0];
                that.$forceUpdate();
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            that.BASE_URI +
              "/FileController/download/" +
              that.form.frsfzh_zhenmian,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },
    getZcsj: function (e) {
      this.form.zcsj = e.detail.value;
    },
    chooseYYZZFBZP() {
      let that = this;
      console.log(that.form.YYZZFBZP);
      if (!that.form.YYZZFBZP) {
        uni.chooseImage({
          count: 1, //默认9
          sizeType: "original", //可以指定是原图还是压缩图，默认二者都有
          success: function (res) {
            uni.uploadFile({
              url: that.$constant.BASE_URI + "/wx/fileController/upload",
              filePath: res.tempFilePaths[0],
              name: "file",
              formData: { user: "test" },
              success(res) {
                // 上传完成需要更新 fileList
                let data = JSON.parse(res.data);
                that.form.YYZZFBZP = data.data[0];
                that.$forceUpdate();
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            this.BASE_URI + "/FileController/download/" + that.form.YYZZFBZP,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },
    choosefrsfzh_fanmian() {
      let that = this;
      if (that.form.frsfzh_fanmian == form.FRSFZHFM) {
        uni.chooseImage({
          count: 1, //默认9
          sizeType: "original", //可以指定是原图还是压缩图，默认二者都有
          success: function (res) {
            uni.uploadFile({
              url: that.$constant.BASE_URI + "/wx/fileController/upload",
              filePath: res.tempFilePaths[0],
              name: "file",
              formData: { user: "test" },
              success(res) {
                // 上传完成需要更新 fileList
                let data = JSON.parse(res.data);
                that.form.frsfzh_fanmian = data.data[0];
                that.$forceUpdate();
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            that.BASE_URI +
              "/FileController/download/" +
              that.form.frsfzh_fanmian,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },
    checkFormValue() {
      let that = this;
      //   if (that.form.zcsj == "") {
      //     that.$showToast("请选择注册时间");
      //     return false;
      //   }
      if (that.form.fddbr == "" || !that.form.fddbr) {
        that.$showToast("请输入法人电话");
        return false;
      }
      if (that.form.fddbr == "" || !that.form.fddbr) {
        that.$showToast("请输入法定代表人");
        return false;
      }
      if (that.form.jyfwAry.length == 0 || !that.form.fddbr) {
        that.$showToast("请输入主营业务");
        return false;
      }
      if (that.form.qymc == "" || !that.form.qymc) {
        that.$showToast("请输入企业名称");
        return false;
      }

      if (that.form.shxydm == "" || !that.form.shxydm) {
        that.$showToast("请输入社会统一信用代码");
        return false;
      }

      if (that.form.qylxr == "" || !that.form.qylxr) {
        that.$showToast("请输入企业联系人");
        return false;
      }

      if (that.form.email == "" || !that.form.email) {
        that.$showToast("请输入企业邮箱");
        return false;
      }

      if (that.form.cwfzr == "" || !that.form.cwfzr) {
        that.$showToast("请输入财务负责人");
        return false;
      }

      if (that.form.cwfzrdh == "" || !that.form.cwfzrdh) {
        that.$showToast("请输入负责人电话");
        return false;
      }

      return true;
    },
    selectDengjiren(e) {
      var names = [];
      var ids = [];
      for (var p in e) {
        if (e[p].type == "u") {
          names.push(e[p].name);
          ids.push(e[p].id);
        }
      }
      this.form.investmentManagerName = names.join(",");
      this.form.investmentManager = ids.join(",");
    },
    async edit() {
      let that = this;
      if (!that.changeActive()) return;
      let jyfwAry = [];

      if (that.form.jyfwAry.length > 0) {
        jyfwAry = that.form.jyfwAry.map((e) => e.name);
      }

      let fileList = [];
      if (that.form.fileList.length > 0) {
        fileList = that.form.fileList.map((e) => e.id);
      }
      that.form.file = fileList.toString();
      let formData = {
        id: that.form.id,
        file: fileList,
        socialCarrierStr: that.form.socialCarrierStr
          ? that.form.socialCarrierStr
          : "",
        socialCarrierLeaseStr: that.form.socialCarrierLeaseStr
          ? that.form.socialCarrierLeaseStr
          : "",
        socialCarrierNoTrue: that.form.socialCarrierNoTrue
          ? that.form.socialCarrierNoTrue
          : "",
        contractCarrierNoStr: that.form.contractCarrierNoStr
          ? that.form.contractCarrierNoStr
          : "",
        otherContact: that.form.otherContact ? that.form.otherContac : "",
        shareCertificateCode: that.form.shareCertificateCode
          ? that.form.shareCertificateCode
          : "",
        leaseArea: that.form.leaseArea ? that.form.leaseArea : 0,
        zcdz: that.form.zcdz,
        qymc: that.form.qymc,
        shxydm: that.form.shxydm,
        zczj: that.form.zczj ? that.form.zczj : 0,
        fddbr: that.form.fddbr,
        lxdh: that.form.lxdh,
        jyfw: jyfwAry.join(","),
        frsfzh: that.form.frsfzh_zhenmian + "," + that.form.frsfzh_fanmian,
        qylxr: that.form.qylxr ? that.form.qylxr : "",
        lxdh: that.form.lxdh,
        email: that.form.email,
        cwfzr: that.form.cwfzr,
        cwfzrdh: that.form.cwfzrdh,
        investmentManagerName: that.form.investmentManagerName,
        investmentManager: that.form.investmentManager,
        area: that.form.area,
        zcdz: that.form.zcdz,
        jydz: that.form.jydz,
        ryxxzp: that.form.ryxxzp,
        rdInvestment: that.form.rdInvestment,
        jgInvestment: that.form.jgInvestment,
        jgInvestment: that.form.jgInvestment,
        fourOpennessAmount: that.form.fourOpennessAmount,
        fourTransferenceAmount: that.form.fourTransferenceAmount,
        fourServiceAmount: that.form.fourServiceAmount,
        fourConsultAmount: that.form.fourConsultAmount,
        associationCompany: that.form.associationCompany,
        settleInType: that.form.settleInType,
        zscqgs: !that.form.zscqgs ? 0 : that.form.zscqgs,
        frEmail: that.form.frEmail ? that.form.frEmail : "",
      };
      let RYXXZP = [];
      if (that.form.RYXXZPList.length > 0) {
        RYXXZP = that.form.RYXXZPList.map((e) => e.id);
      }
      formData.ryxxzp = RYXXZP.toString();
      let zm =
        that.form.frsfzh_zhenmian == form.FRSFZHZM
          ? ""
          : that.form.frsfzh_zhenmian;
      let fm =
        that.form.frsfzh_fanmian == form.FRSFZHFM
          ? ""
          : that.form.frsfzh_fanmian;
      that.form.yyzzfbzp = that.form.YYZZFBZP;
      formData.frsfzh = zm + "," + fm;
      if (!formData.rdInvestment) delete formData.rdInvestment;
      if (!formData.jgInvestment) delete formData.jgInvestment;
      if (!formData.fourOpennessAmount) delete formData.fourOpennessAmount;
      if (!formData.fourTransferenceAmount)
        delete formData.fourTransferenceAmount;
      if (!formData.fourServiceAmount) delete formData.fourServiceAmount;
      if (!formData.fourConsultAmount) delete formData.fourConsultAmount;

      let data = await companyECdit(formData);
      if (data.code == 200) {
        this.$showToast("修改成功");
        uni.navigateBack({});
      }
    },
    async getSelectUserTwo(key) {
      let that = this;
      let departmentList = await getSelectUserTwo("");
      that.range = tools.transData(
        departmentList.data,
        "id",
        "parentid",
        "children"
      );
      that.$refs[key]._show();
    },
    jumpEditCompanyDetails(e) {
      // uni.navigateTo({
      //     url
      // })
    },
    jumpChosseTags() {
      uni.navigateTo({
        url: "/pages/subPackages/chooseCompanyTags/index",
      });
    },
    openHandleReportDialog(item) {
      let that = this;
      that.$refs.handleReport.openDianlog(item);
    },
    getSettleInType(e) {
      let that = this;
      that.form.settleInType =
        that.dic_SelectList.MNP_BUILDING_TYPE[e.detail.value].value;
      that.settleInTypeIndex = e.detail.value;
    },
    getDicTypeZoufang(value) {
      if (!value) return;
      if (!this.dic_SelectList.interviewType) return;
      let interviewType = this.dic_SelectList.interviewType;
      let index = interviewType.findIndex((e) => e.value == value);
      if (index != -1) return interviewType[index].label;
    },
    getDicType(type, value) {
      if (type == "type" && this.dic_SelectList.MNP_BUILDING_TYPE) {
        let MNP_BUILDING_TYPE = this.dic_SelectList.MNP_BUILDING_TYPE;
        let index = MNP_BUILDING_TYPE.findIndex((e) => e.value == value);
        if (index != -1) return MNP_BUILDING_TYPE[index].label;
        else return "暂无";
      }
      if (type == "zt" && this.dic_SelectList.SETTLE_IN_STATUS) {
        let SETTLE_IN_STATUS = this.dic_SelectList.SETTLE_IN_STATUS;
        let index = SETTLE_IN_STATUS.findIndex((e) => e.value == value);
        if (index != -1) return SETTLE_IN_STATUS[index].label;
        else return "暂无";
      }
    },

    async getByCodes() {
      this.search.pageNum = 1;
      let data = await getByCodes(JSON.stringify(this.dic_key));
      this.dic_SelectList = this.$common.handleDicList(data);

      this.getCompanyHouseDetails(this.id);
    },
    async changeActive() {
      let interviewList = await interviewEscalationListAll(this.id);
      this.interviewList = interviewList;
    },
    selectItems(e) {
      this.$nextTick(() => {
        this.$refs.collapse.resize();
      });
    },
    async selectByCompanyId() {
      let zaiti = await selectByCompanyId({ companyId: this.id });
      console.log({ zaiti });
      let socialCarrierAry = zaiti.map((e) => {
        return e.discName + e.groupName + e.buildName + e.houseName;
      });
      let socialCarrierName = socialCarrierAry.join(",");
      this.form.socialCarrierName = socialCarrierName;
      this.$forceUpdate();
      console.log(this.form.socialCarrierName);
    },
    async getCompanyHouseDetails(e) {
      let that = this;
      try {
        let detail = await getCompanyHouseDetails(e);
        that.selectByCompanyId1();
        that.getRoomNameByCompanyId();
        let index = that.dic_SelectList.MNP_BUILDING_TYPE.findIndex(
          (e) => e.value == detail.data.settleInType
        );
        if (detail.data.contractNumber > 0) {
          this.getRoomNameByCompanyId();
        }
        that.settleInTypeIndex = index;
        that.form = detail.data;
        that.form.associationCompany = that.form.associationCompany
          ? that.form.associationCompany.split(",")
          : [];
        if (detail.data.ryxxzp && detail.data.ryxxzp.length > 0) {
          let ryxxzp = detail.data.ryxxzp.split(",");
          // this.form.RYXXZPList
          that.form.RYXXZPList = ryxxzp.map((e) => {
            return {
              imgUrl: "/FileController/download/" + e,
              id: e,
              url: that.$constant.BASE_URI + "/FileController/download/" + e,
              isImage: true,
            };
          });
        } else {
          that.form.RYXXZPList = [];
        }
        if (detail.data.file && detail.data.file.length > 0) {
          let file = detail.data.file.split(",");
          // this.form.RYXXZPList
          that.form.fileList = file.map((e) => {
            return {
              imgUrl: "/FileController/download/" + e,
              id: e,
              name: e,
              url: that.$constant.BASE_URI + "/FileController/download/" + e,
              isImage: true,
            };
          });
        } else {
          that.form.fileList = [];
        }
        let bizhongIndex = this.dic_SelectList.CURRENCY.findIndex(
          (e) => e.value == detail.data.currency
        );

        that.bizhongIndex = bizhongIndex == -1 ? null : bizhongIndex;
        that.form.YYZZFBZP =
          !detail.data.yyzzfbzp || detail.data.yyzzfbzp == "undefined"
            ? form.YYZZFBZP
            : detail.data.yyzzfbzp;
        console.log(
          "detail.data.yyzzfbzp",
          detail.data.yyzzfbzp,
          detail.data.yyzzfbzp
        );
        if (
          detail.data.frsfzh &&
          detail.data.frsfzh.length > 0 &&
          detail.data.frsfzh != ","
        ) {
          let sfzlist = detail.data.frsfzh.split(",");
          that.form.frsfzh_fanmian = sfzlist[0];
          that.form.frsfzh_zhenmian = sfzlist[1];
        } else {
          that.form.frsfzh_fanmian = form.FRSFZHFM;
          that.form.frsfzh_zhenmian = form.FRSFZHZM;
        }

        if (detail.data.jyfw.length > 0) {
          let jyfw = detail.data.jyfw.split(",").map((e) => {
            return {
              name: e,
            };
          });
          that.form.jyfwAry = jyfw;
        } else {
          that.form.jyfwAry = [];
        }
      } catch (error) {
        console.log(error);
      }
    },
    onChange(event) {
      this.activeNames = event.detail;
    },
  },
};
</script>
<style scoped lang="scss">
.dengjibutton {
  margin-top: 24rpx;
  margin-left: 60rpx;
  margin-right: 60rpx;
  width: calc(100% - 120rpx);
  height: 60rpx;
  text-align: center;
  background: #1d18bc;
  color: white;
  line-height: 60rpx;
}
.housedetailsedit {
  margin-bottom: 200rpx;
}
.housedetailsedit {
  .btn-view {
    width: 100%;
    height: 100rpx;
    padding: 20rpx 10%;
    background-color: #ffffff;
    position: fixed;
    bottom: 0;
    z-index: 100;
    left: 0;
  }
  .btn {
    width: 80%;
    height: 90rpx;
    border-radius: 50rpx 50rpx 50rpx 50rpx;
    background: #1d18bc;
    line-height: 90rpx;
    text-align: center;
    color: white;
  }
  .detailstitle {
    height: 42rpx;
    font-size: 30rpx;
    font-weight: 500;
    color: #333333;
    padding-bottom: 16rpx;
  }
  .typestitle {
    height: 42rpx;
    font-size: 24rpx;
    font-weight: 500;
    padding-bottom: 16rpx;
    margin-bottom: 16rpx;
  }
}
</style>
 <style lang="scss">
.filename {
  width: 80%;
  overflow: hidden;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fujian {
  .van-uploader__preview {
    display: none;
  }
}
.file {
  display: flex;
  width: 100%;
  flex: 1;
  font-size: 14px;
  color: #666;
  /* margin-right: 25px; */
  word-break: break-all;
  word-wrap: break-word;
  margin-bottom: 15rpx;
  align-items: center;
  justify-content: space-between;
}
.filename {
  width: 80%;
  overflow: hidden;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
::v-deep .is-open + .uni-collapse-item__wrap {
  height: auto !important;
}
::v-deep .uni-collapse-item__wrap-content {
  height: auto !important;
}
.pageconfig {
  background: #ffffff;
  padding: 32rpx;
}
.input_title {
  width: 40%;
  font-size: 28rpx;
  height: 40rpx;
  line-height: 40rpx;
  color: #333333;
}
.input_value {
  width: 60%;
  font-size: 28rpx;
  height: 40rpx;
  line-height: 40rpx;
  color: #777777;
}
.uni-collapse-item__title-box {
  padding: 0 !important;
}
.uni-collapse-item__title-text {
  color: #1d18bc !important;
  font-size: 32rpx !important;
}
.idclass {
  width: 147rpx;
  height: 100rpx;
}
</style>