<template>
  <div class="addcompany">
    <div class="list">
      <div class="list-row" style="padding-top: 0">
        <div style="height: auto" class="width100">
          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
          >
            <view class="input_title float_left">
              <span style="color: red">*&nbsp;</span> 企业名称</view
            >
            <input
              style="color: #777"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.qymc"
            />
          </view>
          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
          >
            <view class="input_title float_left" style="width: 41%"
              ><span style="color: red">*&nbsp;</span>统一社会信用代码：</view
            >
            <input
              style="color: #777; width: 59%"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.shxydm"
            />
          </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.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">
                {{ 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">
              <span style="color: red">*&nbsp;</span>
              注册时间：
            </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 }}
              </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.legalPersonPhone"
            />
          </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 height40rpx"
          >
            <view class="input_title float_left"
              ><span style="color: red">*&nbsp;</span>企业联系人</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"
              ><span style="color: red">*&nbsp;</span>联系人手机：</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"
              ><span style="color: red">*&nbsp;</span>联系人邮箱：</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"
              ><span style="color: red">*&nbsp;</span>财务负责人：</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"
              ><span style="color: red">*&nbsp;</span>负责人电话：</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.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 list_date height300rpx">
            <view class="input_title mb16rpx">经营范围：</view>
            <textarea
              v-model="form.jyfw"
              :maxlength="2000"
              placeholder="请输入"
              type="textarea"
              style="
                height: 200rpx;
                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;
              "
            >
              {{ form.jyfw.length }}/2000
            </div>
          </view>

          <view class="width100 mt24rpx list_date height40rpx">
            <view class="input_title float_left" style="width: 52%"
              >营业执照副本：（限1张）</view
            >
          </view>
          <view class="custom-image-box" style="position: relative">
            <van-icon
              v-if="form.YYZZFBZP != '../../../static/unuploadzhizhao.png'"
              @click="spliceYYZZFBZP()"
              name="cross"
              style="position: absolute; top: 0; left: 282rpx; font-size: 42rpx"
            />
            <img
              @click="chooseYYZZFBZP()"
              :src="
                form.YYZZFBZP == '../../../static/unuploadzhizhao.png'
                  ? form.YYZZFBZP
                  : BASE_URI + '/FileController/download/' + form.YYZZFBZP
              "
              style="color: #777; width: 300rpx; height: 260rpx"
              placeholder="请输入"
            />
          </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;
                margi-bottom: 10rpx;
              "
            >
              {{ form.honorInformation.length }}/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 height300rpxs"
            style="height: 170rpx"
          >
            <view class="input_title float_left" style="width: 100%"
              >法人身份证</view
            >

            <view class="width100" style="position: relative">
              <van-icon
                v-if="form.FRSFZHZM != '../../../static/idzhengmian.png'"
                @click="spliceFRSFZHZM()"
                name="cross"
                style="
                  position: absolute;
                  top: 32rpx;
                  left: 133rpx;
                  font-size: 42rpx;
                "
              />
              <van-icon
                v-if="form.FRSFZHFM != '../../../static/idfanmian.png'"
                @click="spliceFRSFZHFM()"
                name="cross"
                style="
                  position: absolute;
                  top: 32rpx;
                  left: 300rpx;
                  font-size: 23px;
                "
              />
              <img
                @click="chooseFRSFZHZM()"
                :src="
                  form.FRSFZHZM == '../../../static/idzhengmian.png'
                    ? form.FRSFZHZM
                    : BASE_URI + '/FileController/download/' + form.FRSFZHZM
                "
                class="idclass margin12rpx float_left"
                placeholder="请输入"
              />

              <img
                @click="chooseFRSFZHFM()"
                :src="
                  form.FRSFZHFM == '../../../static/idfanmian.png'
                    ? form.FRSFZHFM
                    : BASE_URI + '/FileController/download/' + form.FRSFZHFM
                "
                class="idclass margin12rpx float_left"
                placeholder="请输入"
              />
            </view>
          </view>
        </div>
      </div>
      <div class="list-row" style="padding-top: 0">
        <div style="height: auto" class="width100">
          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left height80rpx">
              全年研发投入：
              <br />
              （万元）
            </view>
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.rdInvestment"
            />
          </view>

          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left height80rpx"
              >全年技改投入：<br />（万元）</view
            >
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.jgInvestment"
            />
          </view>

          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left height80rpx"
              >拥有知识产权：<br />（个数）</view
            >
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.zscqgs"
            />
          </view>
          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left"
              >四技合同金额：<br />(技术开发)(万元)</view
            >
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.fourOpennessAmount"
            />
          </view>

          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left"
              >四技合同金额：<br />(转让)(万元)</view
            >
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.fourTransferenceAmount"
            />
          </view>

          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left"
              >四技合同金额：<br />(服务)（万元）</view
            >
            <input
              style="color: #777; height: 80rpx; line-height: 80rpx"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.fourServiceAmount"
            />
          </view>

          <view
            class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height80rpx"
          >
            <view class="input_title float_left">
              四技合同金额：<br />(咨询)（万元）
            </view>
            <input
              style="color: #777"
              class="input_value float_left"
              placeholder="请输入"
              v-model="form.fourConsultAmount"
            />
          </view>
        </div>
      </div>
      <div class="form">
        <div
          class="form_row pdt32 pdb32 border_bottom_ccc width100"
          @click="chosseAboutCompany()"
        >
          <div class="float_left width30 first_title height50rpx">关联企业</div>
          <div
            class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
          >
            {{ form.associationCompanyString }}
          </div>
          <img
            class="height40rpx width40rpx float_right"
            src="../../../static/mine/youjiantou.png"
            alt=""
          />
        </div>

        <div
          class="form_row pdt32 pdb32 border_bottom_ccc width100"
          @click="getSelectUserTwo('selectDengjiyuan')"
        >
          <div class="float_left width30 first_title height50rpx">招商经理</div>
          <div
            class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
          >
            {{ form.investmentManagerString }}
          </div>
          <img
            class="height40rpx width40rpx float_right"
            src="../../../static/mine/youjiantou.png"
            alt=""
          />
        </div>
        <div class="form_row pdt32 pdb32 border_bottom_ccc width100">
          <div class="float_left width30 first_title height50rpx">入驻类型</div>
          <div
            class="float_left width60 whitespacenowrap first_title height50rpx font28rpx color292d98"
          >
            <picker
              style="float: left; width: 300rpx; height: 40rpx; color: #777"
              @change="getSettleInType"
              range-key="label"
              :range="dic_SelectList.MNP_BUILDING_TYPE"
            >
              <span style="color: #292d98">
                {{ dic_SelectList.MNP_BUILDING_TYPE[settleInTypeIndex].label }}
              </span>
            </picker>
          </div>

          <img
            class="height40rpx width40rpx float_right"
            src="../../../static/mine/youjiantou.png"
            alt=""
          />
        </div>
      </div>
      <div class="save_button" @click="save()">保存</div>
    </div>
    <tki-tree
      ref="selectDengjiyuan"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="name"
      idKey="id"
      @confirm="selectDengjiyuan"
    >
    </tki-tree>

    <select-dengjiren
      ref="selectXiangmanger"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="name"
      idKey="id"
      @xiangmudengji="xiangmudengji"
    >
    </select-dengjiren>
    <select-genzongdep
      ref="selectGenzongDep"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="name"
      idKey="id"
      @selectGenzongDep="selectGenzongDep"
    />
    <select-xiangguandep
      ref="selectXiangguanDep"
      :multiple="true"
      :range="range"
      :selectParent="true"
      :foldAll="true"
      rangeKey="name"
      idKey="id"
      @selectXiangguanDep="selectXiangguanDep"
    />
    <uni-file-picker v-show="false" ref="files" :auto-upload="false" />
    <multiple-select
      v-model="show"
      @getCompanyAll="getCompanyAll"
      :data="companyAllList"
      :default-selected="defaultSelected"
      @confirm="confirm"
      ref="multipleSelect"
    ></multiple-select>
  </div>
</template>
      
  <script>
const form = {
  settleInType: null,
  FRSFZHZM: "../../../static/idzhengmian.png",
  FRSFZHFM: "../../../static/idfanmian.png",
  YYZZFBZP: "../../../static/unuploadzhizhao.png",
  investmentManagerString: "",
  investmentManager: "",
  associationCompanyString: "",
  associationCompany: "",
  zcsj: "",
  createdBy: "",
  projectType: 1,
  successTime: "",
  companyId: null,
  xiangguanren: "",
  xinxidengji: "",
  xiangmudengji: "",
  relevantUserId: "",
  manageMessengerId: "",
  xiangmudengjiIds: "",
  genzongbumen: "",
  genzongbumenIds: "",
  xiangguanbumen: "",
  relevantDepId: "",
  fangyuanlistIds: "",
  zaitilistIds: "",
  projectManager: "",
  managerPhone: "",
  projectName: "",
  projectInfo: "",
  projectRemark: "",
  honorInformation: "",
  jyfw: "",
  RYXXZPList: [],
  RYXXZP: "",
  frEmail: "",
  zscqgs: "",
};
import multipleSelect from "./momo-multipleSelect";

import tkiTree from "../../subPackages/components/tkitree/tkitree.vue";
import selectDengjiyuan from "../../subPackages/components/select_dengjiyuan/tkitree.vue";
import selectDengjiren from "../../subPackages/components/select_dengjiren/tkitree.vue";
import selectGenzongdep from "../../subPackages/components/selectGenzongDep/tkitree.vue";
import selectXiangguandep from "../../subPackages/components/selectXiangguanDep/tkitree.vue";
import tools from "../../subPackages/components/tkitree/tools.js";
import {
  companyExamineAdd,
  getSelectUserTwo,
  getSelectDeptTwo,
  getByCodes,
  getCompanyAll,
  getUserLocalStorageInfo,
} from "@/js_sdk/http";
export default {
  components: {
    multipleSelect,
    tkiTree,
    selectDengjiyuan,
    selectDengjiren,
    selectGenzongdep,
    selectXiangguandep,
  },
  data() {
    return {
      BASE_URI: this.$constant.BASE_URI,
      companyAllList: [],
      defaultSelected: [],
      show: false,
      bizhongIndex: 0,
      settleInTypeIndex: 0,
      range: [],
      zaitiList: [],
      imageStyles: {},
      listStyles: {},
      fileLists: [],
      activeNames: [],
      StatusBar: 0,
      dic_key: [
        "PROPERTY_NATURE",
        "HOUSE_USAGE",
        "CURRENCY",
        "MNP_BUILDING_TYPE",
      ],
      dic_SelectList: {},
      search: {
        pageSize: 10,
        pageNum: 1,
      },
      form: { ...form },
      companyAllList: [],
      value: ["0"],
      modeIndex: -1,
      styleIndex: -1,
      current: 0,
      mode: "default",
      dotsStyles: {},
      swiperDotIndex: 0,
    };
  },
  onLoad() {
    this.getByCodes();
    this.getCompanyAll();
  },
  onShow() {},
  methods: {
    chooseFRSFZHFM() {
      let that = this;
      if (that.form.FRSFZHFM == "../../../static/idfanmian.png") {
        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.FRSFZHFM = data.data[0];
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            this.BASE_URI + "/FileController/download/" + that.form.FRSFZHFM,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },
    spliceFRSFZHZM() {
      this.form.FRSFZHZM = "../../../static/idzhengmian.png";
    },
    spliceFRSFZHFM() {
      this.form.FRSFZHFM = "../../../static/idfanmian.png";
    },
    chooseFRSFZHZM() {
      let that = this;
      if (that.form.FRSFZHZM == "../../../static/idzhengmian.png") {
        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.FRSFZHZM = data.data[0];
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            this.BASE_URI + "/FileController/download/" + that.form.FRSFZHZM,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },
    deleteRYXXZP(event) {
      this.form.RYXXZPList.splice(event.detail.index, 1);
    },
    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,
          });
        },
        fail(res) {},
      });
    },
    spliceYYZZFBZP() {
      this.form.YYZZFBZP = "../../../static/unuploadzhizhao.png";
    },
    chooseYYZZFBZP() {
      let that = this;
      if (that.form.YYZZFBZP == "../../../static/unuploadzhizhao.png") {
        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];
              },
              fail(res) {},
            });
          },
        });
      } else {
        uni.previewImage({
          urls: [
            this.BASE_URI + "/FileController/download/" + that.form.YYZZFBZP,
          ],
          longPressActions: {
            itemList: ["发送给朋友", "保存图片", "收藏"],
            success: function (data) {},
            fail: function (err) {},
          },
        });
      }
    },

    confirm(e) {
      var associationCompanyString = [];
      var associationCompany = [];
      for (var p in e) {
        associationCompanyString.push(e[p].label);
        associationCompany.push(e[p].value);
      }

      this.form.associationCompanyString = associationCompanyString.join(",");
      this.form.associationCompany = associationCompany.join(",");
    },
    chosseAboutCompany() {
      this.show = true;
      this.$refs.multipleSelect.getAllList(this.companyAllList);
    },
    async getCompanyAll(e) {
      let name = e ? e : "";
      let companyAllList = await getCompanyAll(name);
      this.companyAllList = companyAllList.map((e) => {
        return {
          label: e.qymc,
          value: e.id,
        };
      });
      this.$refs.multipleSelect.getAllList(this.companyAllList);
    },
    async getByCodes() {
      let data = await getByCodes(JSON.stringify(this.dic_key));
      this.dic_SelectList = this.$common.handleDicList(data);
      this.form.settleInType = this.dic_SelectList.MNP_BUILDING_TYPE[0].value;
      this.form.currency = this.dic_SelectList.CURRENCY[0].value;
      this.bizhongIndex = 0;
    },
    getjieduan(e) {},
    getZcsj: function (e) {
      this.form.zcsj = e.detail.value;
    },
    async addyixiang() {
      let data = await addyixiang(this.form);
      if (data.code == 200) {
        uni.navigateBack({});
      }
    },
    getQymc(index) {
      let that = this;
      that.form.companyId = that.companyList[index].id;
      return that.companyList[index].qymc;
    },
    getBizhongtype(e) {
      let that = this;
      that.form.currency = that.dic_SelectList.CURRENCY[e.detail.value].value;
      that.bizhongIndex = e.detail.value;
    },
    getSettleInType(e) {
      let that = this;
      that.form.settleInType =
        that.dic_SelectList.MNP_BUILDING_TYPE[e.detail.value].value;
      that.settleInTypeIndex = e.detail.value;
    },
    async findCompanyList() {
      let data = await findCompanyList();
      this.companyList = data;
      this.companyList[0].id;
    },
    zaitiListSplice(index) {
      this.zaitiList.splice(index, 1);
    },
    // /wx/SaleController/findRoomInfoListByIds
    async findRoomInfoListByIds() {
      let data = await findRoomInfoListByIds(ids);
      return data;
    },
    xiangmudengji(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.xiangmudengji = names.join(",");
      this.form.xiangmudengjiIds = ids.join(",");
    },
    selectGenzongDep(e) {
      var names = [];
      var ids = [];
      for (var p in e) {
        names.push(e[p].name);
        ids.push(e[p].id);
      }
      this.form.genzongbumen = names.join(",");
      this.form.genzongbumenIds = ids.join(",");
    },
    selectXiangguanDep(e) {
      var names = [];
      var ids = [];
      for (var p in e) {
        names.push(e[p].name);
        ids.push(e[p].id);
      }
      this.form.xiangguanbumen = names.join(",");
      this.form.relevantDepId = ids.join(",");
    },
    selectDengjiyuan(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.investmentManagerString = names.join(",");
      this.form.investmentManager = ids.join(",");
    },
    userSelectorConfirm(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.xiangguanren = names.join(",");
      this.form.relevantUserId = ids.join(",");
    },
    // 取消回调事件
    treeCancel(e) {},

    async getSelectUserTwo(key) {
      let that = this;
      let departmentList = await getSelectUserTwo("");
      that.range = tools.transData(
        departmentList.data,
        "id",
        "parentid",
        "children"
      );
      that.$refs[key]._show();
    },
    async getSelectDeptTwo(key) {
      let that = this;
      let departmentList = await getSelectDeptTwo("");
      that.range = tools.transData(
        departmentList.data,
        "id",
        "parentid",
        "children"
      );
      that.$refs[key]._show();
    },
    jumpChosseHouse(e) {
      uni.navigateTo({
        url: "/pages/subPackages/chosseHouse/chosseHouse?type=" + e,
      });
    },
    binddata() {},
    submit() {},
    checkFormValue() {
      let that = this;
      if (that.form.zcsj == "") {
        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;
    },
    async save() {
      let that = this;
      if (!this.checkFormValue()) return; //判断一下有没有没填的字段
      let RYXXZP = [];
      if (that.form.RYXXZPList.length > 0) {
        RYXXZP = that.form.RYXXZPList.map((e) => e.id);
      }
      that.form.ryxxzp = RYXXZP.toString();
      let zm = that.form.FRSFZHZM == form.FRSFZHZM ? "" : that.form.FRSFZHZM;
      let fm = that.form.FRSFZHFM == form.FRSFZHFM ? "" : that.form.FRSFZHFM;
      that.form.frsfzh = zm + "," + fm;
      that.form.yyzzfbzp = that.form.YYZZFBZP;
      that.form.czr = getUserLocalStorageInfo().user.truename;
      that.form.czrid = getUserLocalStorageInfo().user.id;

      let data = await companyExamineAdd(that.form);
      if (data.code == 200) {
        that.$showToast("新增成功");
        uni.navigateBack({});
      }
    },
    chossseFile() {
      this.$refs.files.upload();
    },
    onChange(event) {
      this.activeNames = event.detail;
    },
  },
};
</script>   
  <style scoped lang="scss" scpoed>
.save_button {
  width: calc(100% - 64rpx);
  margin: 64rpx 32rpx 0 32rpx;
  background: #1d18bc;
  border-radius: 50rpx;
  height: 88rpx;
  color: white;
  text-align: center;
  line-height: 88rpx;
}
.form {
  width: calc(100% - 64rpx);
  background: #ffffff;
  padding: 32rpx;
  margin-top: 64rpx;
  .label {
    height: 53rpx;
    line-height: 53rpx;
  }
}
.form_row {
  height: 40rpx;
  font-weight: 400;
  font-size: 24rpx;
}
.zaiti_list {
  width: 100%;
  height: 50rpx;
  line-height: 50rpx;
}
.idclass {
  width: 147rpx;
  height: 100rpx;
}
.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;
}
.addcompany {
  margin-bottom: 200rpx;
}
.addcompany {
  .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">
::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;
}
</style>
<style lang="scss">
.example-body {
  padding: 10px;
  padding-top: 0;
}

.custom-image-box {
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
  color: #333;
}
.uni-file-picker__item {
  display: none;
}
.uploadbutton {
  width: 162rpx;
  height: 44rpx;
}
</style>