linwe
2024-08-08 1a5c9d89d7a1347046692ce5086a1391027c8593
src/views/place/components/baseAllInfo.vue
@@ -5,9 +5,10 @@
        <box-title class="m10" :classVal="9" :title="'基本信息'"></box-title>
        <avue-form v-if="baseShow" ref="baseForm" :option="option" v-model="form">
          <template slot-scope="{ row, size, index }" slot="houseCodeBinds">
            <el-select v-model="form.houseCodeBinds" filterable remote  multiple  :remote-method="onRemoteMethod"
              @change="onSelectChange" placeholder="请选择标准地址"    reserve-keyword>
              <el-option v-for="item in standardAddressList"   :key="item.addressCode" :label="item.addressName" :value="item.addressCode">
            <el-select v-model="form.houseCodeBinds" filterable remote multiple :remote-method="onRemoteMethod"
              @change="onSelectChange" placeholder="请选择标准地址" reserve-keyword>
              <el-option v-for="item in standardAddressList" :key="item.addressCode" :label="item.addressName"
                :value="item.addressCode">
              </el-option>
            </el-select>
          </template>
@@ -15,10 +16,10 @@
        <box-title class="m10" :classVal="9" :title="'房东信息'"></box-title>
        <avue-form v-if="restShow" ref="restForm" :option="houseOwnerOption" v-model="form"></avue-form>
        <avue-form v-if="restShow" ref="restForm" :option="houseOwnerOption" v-model="placeForm"></avue-form>
        <box-title class="m10" :classVal="9" :title="'其他信息'"></box-title>
        <avue-form v-if="restShow" ref="restForm" :option="optionDetail" v-model="placeForm"></avue-form>
        <box-title class="m10" :classVal="9" :title="'学校信息'" v-if="schoolShow"></box-title>
        <avue-form v-if="schoolShow" ref="restForm" :option="optionDetail" v-model="placeForm"></avue-form>
        <box-title class="m10" :classVal="9" :title="'从业人员'"></box-title>
        <avue-crud :option="placeOption" :table-loading="loading" :data="placeExt" ref="crud" v-model="houseHoldForm"
@@ -29,7 +30,7 @@
      </div>
      <div class="footer-btn-box">
        <el-button size="small" type="primary" @click="dataUpdate">保 存</el-button>
        <el-button size="small" :disabled="disabled" type="primary" @click="dataUpdate">保 存</el-button>
        <el-button size="small" @click="roleBoxClose">关 闭</el-button>
      </div>
@@ -38,1074 +39,1112 @@
</template>
<script>
import {
  getPlaceDetaill,
  getPlaceExt,
  holdRemove,
  holdAdd,
  holdUpdate,
  getHoldList,
  update,
  updatePlaceExt,
  getPlaceAddressList
} from "@/api/place/place"
import {
  getPlaceList
} from "@/api/doorplateAddress/doorplateAddress"
import website from "@/config/website"
  import {
    getPlaceDetaill,
    getPlaceExt,
    holdRemove,
    holdAdd,
    holdUpdate,
    getHoldList,
    update,
    updatePlaceExt,
    getPlaceAddressList
  } from "@/api/place/place"
  import {
    getPlaceList
  } from "@/api/doorplateAddress/doorplateAddress"
  import website from "@/config/website"
import boxTitle from "./boxTitle"
  import boxTitle from "./boxTitle"
export default {
  data() {
    //手机号格式校验
    let validatorPhone = function (rule, value, callback) {
      if (value) {
        if (!/^1[3456789]\d{9}$/.test(value)) {
          callback(new Error("手机号格式有误!"))
        } else {
          callback()
        }
      }
      callback()
    }
    return {
      roleBox: false,
      baseShow: false,
      restShow: false,
      placeExt: [],
      form: {},
      option: {
        submitBtn: false,
        emptyBtn: false,
        column: [{
          span: 12,
          label: "场所名称",
          prop: "placeName",
          labelWidth: 120,
          rules: [{
            required: true,
            message: "请输入场所名称",
            trigger: "blur",
          },],
        },
        {
          label: "负责人",
          prop: "principal",
          labelWidth: 120,
          rules: [{
            required: false,
            message: "请输入负责人",
            trigger: "blur",
          },],
        },
        {
          width: 96,
          label: "手机号码",
          prop: "principalPhone",
          labelWidth: 120,
          search: true,
          searchSpan: 4,
          slot: true,
          overHidden: true,
          rules: [{
            validator: validatorPhone,
            trigger: "blur",
          },],
        },
        {
          width: 120,
          overHidden: true,
          label: "身份证号",
          labelWidth: 120,
          prop: "principalIdCard",
          search: true,
          searchSpan: 4,
          slot: true,
          rules: [{
            required: false,
            message: "请输身份证号",
            trigger: "blur",
          }],
        },
        {
          hide: true,
          parent: false,
          label: "所属社区",
          labelWidth: 120,
          prop: "neiCode",
          search: false,
          type: "tree",
          dicUrl: "/api/blade-system/region/tree",
          props: {
            label: "name",
            value: "id",
          },
          cascader: ["gridCode"],
          // dicFormatter: (res) => {
          //  return dsposeData(res.data)
          // },
          rules: [{
            required: true,
            message: "请选择所属社区",
            trigger: "blur",
          },],
        },
        {
          hide: true,
          label: "所属网格",
          prop: "gridCode",
          type: "tree",
          labelWidth: 120,
          cell: true,
          props: {
            label: "gridName",
            value: "gridCode",
          },
          // dataType: 'string',
          dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
          rules: [{
            required: true,
            message: "请选择所属网格",
            trigger: "blur",
          },],
        },
        {
          span: 7,
          label: "场所标签",
          prop: "label",
          labelWidth: 120,
          type: "select",
          dicUrl: "/api/blade-category/category/getCategory?level=2",
          cascader: ["smallLabel"],
          props: {
            label: "categoryName",
            value: "categoryNo",
          },
          dataType: "string",
          hide: true,
          rules: [{
            required: true,
            message: "请输入场所标签",
            trigger: "blur",
          },],
        },
        {
          span: 5,
          label: "",
          labelWidth: 20,
          prop: "smallLabel",
          type: "select",
          dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
          props: {
            label: "categoryName",
            value: "categoryNo",
          },
          dataType: "string",
          hide: true,
        },
        {
          span: 12,
          label: "标签颜色",
          prop: "color",
          type: "select",
          labelWidth: 120,
          dicData: [{
            label: "绿",
            value: "green",
          },
          {
            label: "黄",
            value: "yellow",
          },
          {
            label: "红",
            value: "red",
          },
          ],
          props: {
            label: "label",
            value: "value",
          },
          hide: true,
        },
        {
          span: 12,
          label: "九小场所",
          prop: "isNine",
          labelWidth: 120,
          type: "select",
          dicData: [{
            label: "是",
            value: 1,
          },
          {
            label: "否",
            value: 2,
          }
          ],
          rules: [{
            required: true,
            message: "请选择九小分类",
            trigger: "blur",
          },],
          hide: true,
        },
        {
          span: 12,
          label: "九小分类",
          prop: "nineType",
          labelWidth: 120,
          type: "select",
          display: false,
          dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
          dataType: "number",
          hide: true,
          props: {
            label: "dictValue",
            value: "dictKey",
          },
        },
        {
          span: 12,
          label: "阵地",
          prop: "isFront",
          labelWidth: 120,
          type: "select",
          dicData: [{
            label: "是",
            value: 1,
          },
          {
            label: "否",
            value: 2,
          }
          ],
          hide: true,
          rules: [{
            required: true,
            message: "请选择阵地",
            trigger: "blur",
          },],
        },
        {
          span: 12,
          label: "阵地类型",
          prop: "frontType",
          type: "select",
          labelWidth: 120,
          display: false,
          row: true,
          dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
          dataType: "number",
          hide: true,
          props: {
            label: "dictValue",
            value: "dictKey",
          },
        },
        {
          span: 12,
          label: "三级消防单位",
          prop: "threeFireProtection",
          labelWidth: 120,
          type: "select",
          dicData: [{
            label: "是",
            value: 1,
          },
          {
            label: "否",
            value: 2,
          }
          ],
          hide: true,
          rules: [{
            required: false,
            message: "请选择三级消防单位",
            trigger: "blur",
          },],
        },
        {
          label: "场所照片",
          prop: "imageUrls",
          width: 80,
          type: "upload",
          labelWidth: 120,
          listType: "picture-card",
          dataType: "string",
          multiple: true,
          action: "/api/blade-resource/oss/endpoint/put-file",
          propsHttp: {
            res: "data",
            name: "name",
            url: "link",
          },
          span: 24,
        },
        {
          width: 160,
          overHidden: true,
          slot: true,
          label: "地址",
          prop: "location",
          type: "map",
          dataType: "string",
          labelWidth: 120,
          span: 24,
          value: [117.96646, 28.431002, ""],
          cascader: ['houseCodeBinds'],
          rules: [{
            required: true,
            message: "请选择地址",
            trigger: "blur",
          },],
        },
        {
          width: 160,
          overHidden: true,
          display: false,
          labelWidth: 120,
          hide: true,
          label: "地址",
          prop: "addressName",
          span: 12
        },
        // {
        //   width: 160,
        //   overHidden: true,
        //   slot: true,
        //   label: "标准地址",
        //   prop: "houseCodeBinds",
        //   span: 24,
        //   type: 'select',
        //   labelWidth:120,
        //   dataType: "object",
        //   remote: true,
        //   multiple: true,
        //   hide: true,
        //   display: false,
        //   filterable:true,
        //   dicUrl: `/api/blade-doorplateAddress/doorplateAddress/getPlaceList`,
        //   props: {
        //     label: 'addressName',
        //     value: 'addressCode',
        //   },
        //   dicData: [],
        //   rules: [{
        //     required: false,
        //     message: "请选择标准地址",
        //     trigger: "blur",
        //   }, ]
        // },
        {
          span: 24,
          hide: true,
          prop: "houseCodeBinds",
          slot: true,
          label: "标准地址",
          labelWidth: 120,
        },
        {
          label: "备注",
          prop: "remark",
          type: 'textarea',
          labelWidth: 120,
          hide: true,
          span: 24,
          rules: [{
            required: false,
            message: "请输入场所备注",
            trigger: "blur",
          },],
        },
        ],
      },
      placeForm: {},
      optionDetail: {
        submitBtn: false,
        emptyBtn: false,
        column: [{
          labelWidth: 100,
          label: "法人信息",
          prop: "legalPerson",
        },
        {
          labelWidth: 100,
          label: "法人电话",
          prop: "legalTel",
          search: true,
          searchSpan: 4,
          slot: true,
          overHidden: true,
          rules: [{
            validator: validatorPhone,
            trigger: "blur",
          },],
        },
        {
          label: "营业执照",
          prop: "imageUrls",
          width: 80,
          type: "upload",
          listType: "picture-card",
          dataType: "string",
          multiple: true,
          action: "/api/blade-resource/oss/endpoint/put-file",
          propsHttp: {
            res: "data",
            name: "name",
            url: "link",
          },
          span: 24,
        },
        {
          label: "场所平面图",
          prop: "planImageUrls",
          width: 80,
          type: "upload",
          listType: "picture-card",
          dataType: "string",
          multiple: true,
          action: "/api/blade-resource/oss/endpoint/put-file",
          propsHttp: {
            res: "data",
            name: "name",
            url: "link",
          },
          span: 24,
        },
        ],
      },
      loading: true,
      placeOption: {
        menu: true,
        height: 300,
        calcHeight: 54,
        dialogWidth: 950,
        tip: false,
        searchShow: false,
        addBtn: true,
        delBtn: true,
        editBtn: true,
        border: true,
        index: true,
        dialogClickModal: false,
        column: [{
          labelWidth: 100,
          label: "姓名",
          prop: "name",
          searchSpan: 4,
          search: true,
        },
        {
          labelWidth: 100,
          label: "电话号码",
          prop: "telephone",
          search: true,
          searchSpan: 4,
          slot: true,
          overHidden: true,
          rules: [{
            validator: validatorPhone,
            trigger: "blur",
          },],
        },
        {
          labelWidth: 100,
          label: "身份证号",
          prop: "idCard",
        },
        {
          labelWidth: 100,
          label: "现居住地",
          prop: "tempAddress",
          searchSpan: 4,
          search: true,
        },
        {
          labelWidth: 100,
          label: "性别",
          prop: "gender",
          type: "select",
          dicData: [{
            label: "男",
            value: 1
          },
          {
            label: "女",
            value: 0
          },
          {
            label: "未知",
            value: "3"
          }
          ],
        },
        {
          labelWidth: 100,
          span: 12,
          label: "民族",
          prop: "ethnicity",
          type: "select",
          row: true,
          dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationType",
          dataType: "number",
          props: {
            label: "dictValue",
            value: "dictKey",
          },
        },
        {
          labelWidth: 100,
          label: "岗位",
          prop: "jobNature",
          // hide: true
        },
        {
          labelWidth: 100,
          label: "状态",
          prop: "resignationFlag",
          // hide: true
          type: "select",
          dicData: [{
            label: "在职",
            value: 1
          },
          {
            label: "离职",
            value: 2
          }
          ],
        },
        ]
      },
      holdPage: {
        pageSize: 20,
        currentPage: 1,
        total: 0,
      },
      houseHoldForm: {},
      houseOwnerOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            width: 96,
            label: "姓名",
            prop: "landlordName",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true
          },
          {
            width: 96,
            label: "身份证号",
            prop: "landlordIdCard",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true,
            rules: [{
              validator: validatorPhone,
              trigger: "blur",
            },],
          },
          {
            width: 96,
            label: "手机号",
            prop: "landlordPhone",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true,
            rules: [{
              validator: validatorPhone,
              trigger: "blur",
            },],
          },
          {
            width: 96,
            label: "微信号",
            prop: "legalTel",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true,
            rules: [{
              validator: validatorPhone,
              trigger: "blur",
            },],
          },
        ],
      },
      userOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            width: 96,
            label: "电话",
            prop: "legalTel",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true,
            rules: [{
              validator: validatorPhone,
              trigger: "blur",
            },],
          },
          {
            width: 96,
            label: "微信号",
            prop: "legalTel",
            search: true,
            searchSpan: 4,
            slot: true,
            overHidden: true,
            rules: [{
              validator: validatorPhone,
              trigger: "blur",
            },],
          },
        ],
      },
      standardAddressList:[] , //标准地址数据
      standardAddress:"",
      standardAddressSearchKey:""
    }
  },
  components: {
    boxTitle
  },
  inject: ["placeElement"],
  watch: {
    'form.houseBindList': {
      handler(newData) {
        console.log("=======>", newData)
      }
    },
    'form.isNine': {
      handler(newData) {
        if (newData) {
          let nineTypeColumn = this.findObject(
            this.option.column,
            'nineType'
          )
          if (newData == 1) {
            nineTypeColumn.display = true
  export default {
    data() {
      //手机号格式校验
      let validatorPhone = function(rule, value, callback) {
        if (value) {
          if (!/^1[3456789]\d{9}$/.test(value)) {
            callback(new Error("手机号格式有误!"))
          } else {
            nineTypeColumn.display = false
            callback()
          }
        }
      },
    },
    'form.isFront': {
      handler(newData) {
        if (newData) {
          let frontTypeColumn = this.findObject(
            this.option.column,
            'frontType'
          )
          if (newData == 1) {
            frontTypeColumn.display = true
          } else {
            frontTypeColumn.display = false
          }
        }
        callback()
      }
    },
    'form.addressName': {
      handler(newData) {
        console.log("111111")
        const column = this.findObject(this.option.column, "houseCodeBinds")
        if (newData) {
          column.display = true;
        } else {
          column.display = false
        }
      }
    }
  },
  methods: {
    initOpen(newData) {
      console.log("item==>", newData);
      this.curRow = newData
      this.roleBox = true
      this.baseShow = false
      this.restShow = false
      this.form = {}
      this.placeForm = {}
      const that = this
      that.$axios
        .all([getPlaceDetaill(newData["houseCode"]), getPlaceExt({
          placeId: newData["id"]
        }), getPlaceList()])
        .then(
          that.$axios.spread(function (baseInfo, restInfo) {
            console.log("houseCodeBinds===>",baseInfo.data.data.houseCodeBinds)
            that.form = baseInfo.data.data
            that.form.addressName = that.form.location;
            that.form.location = [
              that.form.lng,
              that.form.lat,
              that.form.location,
            ].join(",")
            if(baseInfo.data.data.houseCodeBinds){
              that.standardAddressList  = baseInfo.data.data.houseBindList;
              that.form.houseCodeBinds = baseInfo.data.data.houseCodeBinds.split(",")
            }
            if (that.form.imageUrls && that.form.imageUrls.length) {
              that.form.imageUrls = that.form.imageUrls
                .split(",")
                .filter((item) => item != "")
                .map((item) => website.minioUrl + item)
                .join(",")
            }
            if (
              that.form.placePoiLabelVOList &&
              that.form.placePoiLabelVOList.length
            ) {
              let lebelTwo = that.form.placePoiLabelVOList.find((item) => {
                return item.type == 2
              })
              if (lebelTwo) that.form.label = String(lebelTwo.poiCode)
              let lebelThree = that.form.placePoiLabelVOList.find((item) => {
                return item.type == 3
              })
              if (lebelThree) that.form.smallLabel = String(lebelThree.poiCode)
            }
            that.baseShow = true
            const data = restInfo.data.data
            if (data) {
              let imageUrls = data.imageUrls
              let planImageUrls = data.planImageUrls
              if (imageUrls && imageUrls.length) {
                imageUrls = imageUrls
                  .split(",")
                  .filter((item) => item != "")
                  .map((item) => website.minioUrl + item)
                  .join(",")
              }
              if (planImageUrls && planImageUrls.length) {
                planImageUrls = planImageUrls
                  .split(",")
                  .filter((item) => item != "")
                  .map((item) => website.minioUrl + item)
                  .join(",")
              }
              that.placeForm = {
                ...data,
                imageUrls,
                planImageUrls,
              }
            }
            that.restShow = true
          })
        )
        that.getPlaceAddressListRequest()
    },
    locationDispose(data) {
      data = data.split(",")
      return {
        longitude: data[0],
        latitude: data[1],
        location: data[2],
      }
    },
        disabled: false,
        roleBox: false,
        baseShow: false,
        restShow: false,
        schoolShow: false,
    selectionClear() {
      this.$nextTick(() => {
        this.$refs.crud && this.$refs.crud.toggleSelection()
      })
    },
        placeExt: [],
    houseHoldRowUpdate(row, index, done, loading) {
      holdUpdate(row).then(
        () => {
          this.holdOnLoad(this.holdPage)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
        form: {},
        option: {
          submitBtn: false,
          emptyBtn: false,
          dialogMenuPosition: 'right',
          column: [{
              span: 12,
              label: "场所名称",
              prop: "placeName",
              labelWidth: 120,
              rules: [{
                required: true,
                message: "请输入场所名称",
                trigger: "blur",
              }, ],
            },
            {
              label: "负责人",
              prop: "principal",
              labelWidth: 120,
              rules: [{
                required: false,
                message: "请输入负责人",
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "手机号码",
              prop: "principalPhone",
              labelWidth: 120,
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              width: 120,
              overHidden: true,
              label: "身份证号",
              labelWidth: 120,
              prop: "principalIdCard",
              search: true,
              searchSpan: 4,
              slot: true,
              rules: [{
                required: false,
                message: "请输身份证号",
                trigger: "blur",
              }],
            },
            {
              hide: true,
              parent: false,
              label: "所属社区",
              labelWidth: 120,
              prop: "neiCode",
              search: false,
              type: "tree",
              dicUrl: "/api/blade-system/region/treeToCommunity",
              props: {
                label: "name",
                value: "id",
              },
              cascader: ["gridCode"],
              // dicFormatter: (res) => {
              //  return dsposeData(res.data)
              // },
              rules: [{
                required: true,
                message: "请选择所属社区",
                trigger: "blur",
              }, ],
            },
            {
              hide: true,
              label: "所属网格",
              prop: "gridCode",
              type: "tree",
              labelWidth: 120,
              cell: true,
              props: {
                label: "gridName",
                value: "gridCode",
              },
              // dataType: 'string',
              dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
              rules: [{
                required: true,
                message: "请选择所属网格",
                trigger: "blur",
              }, ],
            },
            {
              span: 7,
              label: "场所标签",
              prop: "label",
              labelWidth: 120,
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?level=2",
              cascader: ["smallLabel"],
              props: {
                label: "categoryName",
                value: "categoryNo",
              },
              dataType: "string",
              hide: true,
              rules: [{
                required: true,
                message: "请输入场所标签",
                trigger: "blur",
              }, ],
            },
            {
              collapseTags: true,
              maxCollapseTags: 3,
              collapseTagsTooltip: true,
              multiple: true,
              span: 5,
              labelWidth: 20,
              prop: "smallLabel",
              type: "select",
              dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
              props: {
                label: "categoryName",
                value: "categoryNo",
              },
              dataType: "string",
              hide: true,
            },
            {
              span: 12,
              label: "标签颜色",
              prop: "color",
              type: "select",
              labelWidth: 120,
              dicData: [{
                  label: "绿",
                  value: "green",
                },
                {
                  label: "黄",
                  value: "yellow",
                },
                {
                  label: "红",
                  value: "red",
                },
              ],
              props: {
                label: "label",
                value: "value",
              },
              hide: true,
            },
            {
              span: 12,
              label: "九小场所",
              prop: "isNine",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              rules: [{
                required: true,
                message: "请选择九小分类",
                trigger: "blur",
              }, ],
              hide: true,
            },
            {
              span: 12,
              label: "九小分类",
              prop: "nineType",
              labelWidth: 120,
              type: "select",
              display: false,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "阵地",
              prop: "isFront",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: true,
                message: "请选择阵地",
                trigger: "blur",
              }, ],
            },
            {
              span: 12,
              label: "阵地类型",
              prop: "frontType",
              type: "select",
              labelWidth: 120,
              display: false,
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              span: 12,
              label: "三级消防单位",
              prop: "threeFireProtection",
              labelWidth: 120,
              type: "select",
              dicData: [{
                  label: "是",
                  value: 1,
                },
                {
                  label: "否",
                  value: 2,
                }
              ],
              hide: true,
              rules: [{
                required: false,
                message: "请选择三级消防单位",
                trigger: "blur",
              }],
            },
            {
              span: 12,
              label: "无炸类型",
              prop: "noExplosionCategory",
              type: "select",
              labelWidth: 120,
              display: true,
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=noExplosionCategory",
              dataType: "number",
              hide: true,
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              label: "场所照片",
              prop: "imageUrls",
              width: 80,
              type: "upload",
              labelWidth: 120,
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
            {
              width: 160,
              overHidden: true,
              slot: true,
              label: "地址",
              prop: "location",
              type: "map",
              dataType: "string",
              labelWidth: 120,
              span: 24,
              value: [117.96646, 28.431002, ""],
              cascader: ['houseCodeBinds'],
              rules: [{
                required: true,
                message: "请选择地址",
                trigger: "blur",
              }, ],
            },
            {
              width: 160,
              overHidden: true,
              display: false,
              labelWidth: 120,
              hide: true,
              label: "地址",
              prop: "addressName",
              span: 12
            },
            {
              span: 24,
              hide: true,
              prop: "houseCodeBinds",
              slot: true,
              label: "标准地址",
              labelWidth: 120,
            },
            {
              label: "备注",
              prop: "remark",
              type: 'textarea',
              labelWidth: 120,
              hide: true,
              span: 24,
              rules: [{
                required: false,
                message: "请输入场所备注",
                trigger: "blur",
              }, ],
            },
          ],
        },
        (error) => {
          window.console.log(error)
          loading()
        }
      )
    },
    houseHoldRowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return holdRemove(row.id)
        })
        .then(() => {
          this.holdOnLoad(this.holdPage)
        placeForm: {},
        optionDetail: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              label: "学生人数",
              prop: "studentNumber",
            },
            {
              label: "教职工人数",
              prop: "workersNumber",
            },
            {
              label: "专职保安",
              prop: "securityNumber",
            },
            {
              label: "专职门卫",
              prop: "guardNumber",
            },
            {
              label: "专兼职保卫人员",
              prop: "temporarySecurityNumber",
            },
            {
              label: "走读/寄宿",
              prop: "dayStudentsNumber",
            },
            {
              label: "住校生人数",
              prop: "residentialStudentsNumber",
            },
            {
              label: "宿舍管理人员",
              prop: "housemasterNumber",
            }, {
              labelWidth: 100,
              label: "法人信息",
              prop: "legalPerson",
            },
            {
              labelWidth: 100,
              label: "法人电话",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              label: "营业执照",
              prop: "imageUrls",
              width: 80,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
          this.$message({
            type: "success",
            message: "操作成功!",
          })
        })
    },
    houseHoldRowSave(row, done, loading) {
      holdAdd({
        ...row,
        placeId: this.curRow.id,
      }).then(
        () => {
          this.holdOnLoad(this.holdPage)
          this.$message({
            type: "success",
            message: "操作成功!",
          })
          done()
            {
              label: "场所平面图",
              prop: "planImageUrls",
              width: 80,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
            },
          ],
        },
        (error) => {
          window.console.log(error)
          loading()
        }
      )
    },
        loading: true,
        placeOption: {
          menu: true,
          height: 300,
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          searchShow: false,
          addBtn: true,
          delBtn: true,
          editBtn: true,
          border: true,
          index: true,
          dialogClickModal: false,
          column: [{
              labelWidth: 100,
              label: "姓名",
              prop: "name",
              searchSpan: 4,
              search: true,
            },
            {
              labelWidth: 100,
              label: "性别",
              prop: "gender",
              type: "select",
              dicData: [{
                  label: "男",
                  value: 1
                },
                {
                  label: "女",
                  value: 0
                },
                {
                  label: "未知",
                  value: "3"
                }
              ],
            },
            {
              labelWidth: 100,
              span: 12,
              label: "民族",
              prop: "ethnicity",
              type: "select",
              row: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationType",
              dataType: "number",
              props: {
                label: "dictValue",
                value: "dictKey",
              },
            },
            {
              labelWidth: 100,
              label: "身份证号",
              prop: "idCard",
            },
            {
              labelWidth: 100,
              label: "电话号码",
              prop: "telephone",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              labelWidth: 100,
              label: "现居住地",
              prop: "tempAddress",
              searchSpan: 4,
              search: true,
            },
            {
              labelWidth: 100,
              label: "岗位",
              prop: "jobNature",
              // hide: true
            },
            {
              label: "从业人员照片",
              prop: "employerImg",
              labelWidth: 100,
              type: "upload",
              listType: "picture-card",
              dataType: "string",
              multiple: true,
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                name: "name",
                url: "link",
              },
              span: 24,
              hide: true
            },
            {
              label: "入职时间",
              labelWidth: 100,
              hide: true,
              row: true,
              prop: "resignationTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              // format: "yyyy-MM-dd hh:mm:ss",
              // valueFormat: "yyyy-MM-dd hh:mm:ss",
              rules: [{
                required: false,
                message: "请选择入职时间",
                trigger: "blur",
              }]
            },
            {
              label: "离职时间",
              labelWidth: 100,
              hide: true,
              row: true,
              prop: "employmentTime",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd",
              rules: [{
                required: false,
                message: "请选择离职时间",
                trigger: "blur",
              }]
            },
            {
              labelWidth: 100,
              label: "状态",
              prop: "resignationFlag",
              // hide: true
              type: "select",
              display: false,
              dicData: [{
                  label: "在职",
                  value: 1
                },
                {
                  label: "离职",
                  value: 2
                }
              ],
            },
          ]
        },
        holdPage: {
          pageSize: 20,
          currentPage: 1,
          total: 0,
        },
        houseHoldForm: {},
        houseOwnerOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [
    refreshHoldChange() {
      this.holdOnLoad(this.holdPage)
    },
    holdOnLoad(holdPage, params = {}) {
      if (!this.curRow.id) return
      let values = {
        ...params,
        placeId: this.curRow.id,
            {
              width: 96,
              label: "姓名",
              prop: "landlordName",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true
            },
            {
              width: 96,
              label: "身份证号",
              prop: "landlordIdCard",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "手机号",
              prop: "landlordPhone",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
          ],
        },
        userOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              width: 96,
              label: "电话",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
            {
              width: 96,
              label: "微信号",
              prop: "legalTel",
              search: true,
              searchSpan: 4,
              slot: true,
              overHidden: true,
              rules: [{
                validator: validatorPhone,
                trigger: "blur",
              }, ],
            },
          ],
        },
        standardAddressList: [], //标准地址数据
        standardAddress: "",
        standardAddressSearchKey: ""
      }
    },
      getHoldList(holdPage.currentPage, holdPage.pageSize, values).then(
        (res) => {
          const data = res.data.data
    components: {
      boxTitle
    },
          this.holdPage.total = data.total
          this.placeExt = data.records
    inject: ["placeElement"],
          this.loading = false
          this.selectionClear()
    watch: {
      'form.houseBindList': {
        handler(newData) {
          console.log("=======>", newData)
        }
      )
    },
      },
    holdCurrentChange(currentPage) {
      this.holdPage.currentPage = currentPage
    },
      'form.isNine': {
        handler(newData) {
          if (newData) {
            let nineTypeColumn = this.findObject(
              this.option.column,
              'nineType'
            )
    holdSizeChange(pageSize) {
      this.holdPage.pageSize = pageSize
    },
            if (newData == 1) {
              nineTypeColumn.display = true
            } else {
              nineTypeColumn.display = false
            }
          }
        },
      },
      'form.isFront': {
        handler(newData) {
          if (newData) {
            let frontTypeColumn = this.findObject(
              this.option.column,
              'frontType'
            )
    desposeImage(data) {
      if (data) {
        if (data.length > 0) {
          var urls = []
          var split = data.split(",").filter((item) => item != "")
          split.forEach((url) => {
            var names = url.split("jczz/")
            urls.push(names[1])
          })
          data = urls.join(",")
            if (newData == 1) {
              frontTypeColumn.display = true
            } else {
              frontTypeColumn.display = false
            }
          }
        }
      },
      'form.addressName': {
        handler(newData) {
          console.log("111111")
          const column = this.findObject(this.option.column, "houseCodeBinds")
          if (newData) {
            column.display = true;
          } else {
            column.display = false
          }
        }
      }
      return data
    },
    methods: {
      initOpen(newData) {
        console.log("item==>", newData);
        this.curRow = newData
        this.roleBox = true
        this.baseShow = false
        this.restShow = false
        this.schoolShow = false
        this.form = {}
        this.placeForm = {}
    dataUpdate() {
      const that = this
        const that = this
      let imageUrls = this.desposeImage(this.form.imageUrls)
      let placeImages = this.desposeImage(this.placeForm.imageUrls)
      let placePlanImageUrls = this.desposeImage(this.placeForm.planImageUrls)
        that.$axios
          .all([getPlaceDetaill(newData["houseCode"]), getPlaceExt({
            placeId: newData["id"]
          }), getPlaceList()])
          .then(
            that.$axios.spread(function(baseInfo, restInfo) {
              console.log("houseCodeBinds===>", baseInfo.data.data.houseCodeBinds)
              that.form = baseInfo.data.data
              that.form.addressName = that.form.location;
              that.form.location = [
                that.form.lng,
                that.form.lat,
                that.form.location,
              ].join(",")
              if (baseInfo.data.data.houseCodeBinds) {
                that.standardAddressList = baseInfo.data.data.houseBindList;
                that.form.houseCodeBinds = baseInfo.data.data.houseCodeBinds.split(",")
              }
      let label = this.form.label
              if (that.form.imageUrls && that.form.imageUrls.length) {
                that.form.imageUrls = that.form.imageUrls
                  .split(",")
                  .filter((item) => item != "")
                  .map((item) => website.minioUrl + item)
                  .join(",")
              }
      if (this.form.smallLabel != "") {
        label = label + "," + this.form.smallLabel
      }
      delete this.form.smallLabel
      if (Array.isArray(this.form.houseCodeBinds)) {
        this.form.houseCodeBinds = this.form.houseCodeBinds.join(",")
      }
      this.$refs.baseForm.validate((valid, done, msg) => {
        if (valid) {
          that.$axios
            .all([
              update({
                // ...this.placeElement.curRow,
                ...this.form,
                imageUrls,
                label,
                ...this.locationDispose(this.form.location),
              }),
              updatePlaceExt({
                ...this.placeForm,
                imageUrls: placeImages,
                planImageUrls: placePlanImageUrls,
              }),
            ])
            .then(
              that.$axios.spread(function () {
                that.$message({
                  type: "success",
                  message: "操作成功!",
              if (that.form.placePoiLabelVOList && that.form.placePoiLabelVOList.length) {
                let lebelTwo = that.form.placePoiLabelVOList.find((item) => {
                  return item.type == 2
                })
                that.roleBoxClose()
                if (lebelTwo) that.form.label = String(lebelTwo.poiCode)
                that.placeElement.onLoad(
                  that.placeElement.page,
                  that.placeElement.query
                )
                let lebelThree = that.form.placePoiLabelVOList.find((item) => {
                  return item.type == 3
                })
                done()
              })
            )
        } else {
          console.log("error submit!!")
          return false
                if (lebelThree) that.form.smallLabel = String(lebelThree.poiCode)
              }
              that.baseShow = true
              const data = restInfo.data.data
              if (data) {
                let imageUrls = data.imageUrls
                let planImageUrls = data.planImageUrls
                if (imageUrls && imageUrls.length) {
                  imageUrls = imageUrls
                    .split(",")
                    .filter((item) => item != "")
                    .map((item) => website.minioUrl + item)
                    .join(",")
                }
                if (planImageUrls && planImageUrls.length) {
                  planImageUrls = planImageUrls
                    .split(",")
                    .filter((item) => item != "")
                    .map((item) => website.minioUrl + item)
                    .join(",")
                }
                that.placeForm = {
                  ...data,
                  imageUrls,
                  planImageUrls,
                }
              }
              console.log("***********1**********", that.form)
              if (that.form.label === '1601') {
                that.schoolShow = true
              }
              that.restShow = true
            })
          )
        that.getPlaceAddressListRequest()
      },
      locationDispose(data) {
        data = data.split(",")
        return {
          longitude: data[0],
          latitude: data[1],
          location: data[2],
        }
      })
    },
      },
    roleBoxClose() {
      this.form = {}
      this.placeForm = {}
      selectionClear() {
        this.$nextTick(() => {
          this.$refs.crud && this.$refs.crud.toggleSelection()
        })
      },
      this.$refs.baseForm && this.$refs.baseForm.resetForm()
      this.$refs.restForm && this.$refs.restForm.resetForm()
      this.baseShow = false
      this.restShow = false
      this.roleBox = false
    },
      houseHoldRowUpdate(row, index, done, loading) {
        holdUpdate(row).then(
          () => {
            this.holdOnLoad(this.holdPage)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
    getPlaceAddressListRequest(query){
      getPlaceAddressList({
        addressName:query
      }).then(res=>{
           this.standardAddressList = res.data.data;
      })
    },
      houseHoldRowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(() => {
            return holdRemove(row.id)
          })
          .then(() => {
            this.holdOnLoad(this.holdPage)
    onSelectChange(e){
        console.log("selectChange===>",e);
            this.$message({
              type: "success",
              message: "操作成功!",
            })
          })
      },
      houseHoldRowSave(row, done, loading) {
        holdAdd({
          ...row,
          placeId: this.curRow.id,
        }).then(
          () => {
            this.holdOnLoad(this.holdPage)
            this.$message({
              type: "success",
              message: "操作成功!",
            })
            done()
          },
          (error) => {
            window.console.log(error)
            loading()
          }
        )
      },
      refreshHoldChange() {
        this.holdOnLoad(this.holdPage)
      },
      holdOnLoad(holdPage, params = {}) {
        if (!this.curRow.id) return
        let values = {
          ...params,
          placeId: this.curRow.id,
        }
        getHoldList(holdPage.currentPage, holdPage.pageSize, values).then(
          (res) => {
            const data = res.data.data
            this.holdPage.total = data.total
            this.placeExt = data.records
            this.loading = false
            this.selectionClear()
          }
        )
      },
      holdCurrentChange(currentPage) {
        this.holdPage.currentPage = currentPage
      },
      holdSizeChange(pageSize) {
        this.holdPage.pageSize = pageSize
      },
      desposeImage(data) {
        if (data) {
          if (data.length > 0) {
            var urls = []
            var split = data.split(",").filter((item) => item != "")
            split.forEach((url) => {
              var names = url.split("jczz/")
              urls.push(names[1])
            })
            data = urls.join(",")
          }
        }
        return data
      },
      dataUpdate() {
        const that = this
        that.disabled = true;
        let imageUrls = this.desposeImage(this.form.imageUrls)
        let placeImages = this.desposeImage(this.placeForm.imageUrls)
        let placePlanImageUrls = this.desposeImage(this.placeForm.planImageUrls)
        let label = this.form.label
        if (this.form.smallLabel != "") {
          label = label + "," + this.form.smallLabel
        }
        delete this.form.smallLabel
        if (Array.isArray(this.form.houseCodeBinds)) {
          this.form.houseCodeBinds = this.form.houseCodeBinds.join(",")
        }
        this.form.placeExtEntity = null
        this.$refs.baseForm.validate((valid, done, msg) => {
          if (valid) {
            that.$axios
              .all([
                update({
                  // ...this.placeElement.curRow,
                  ...this.form,
                  imageUrls,
                  label,
                  ...this.locationDispose(this.form.location),
                }),
                updatePlaceExt({
                  ...this.placeForm,
                  imageUrls: placeImages,
                  planImageUrls: placePlanImageUrls,
                }),
              ])
              .then(
                that.$axios.spread(function() {
                  that.$message({
                    type: "success",
                    message: "操作成功!",
                  })
                  that.roleBoxClose()
                  that.placeElement.onLoad(
                    that.placeElement.page,
                    that.placeElement.query
                  )
                  done()
                })
              )
          } else {
            console.log("error submit!!")
            that.disabled = false;
            return false
          }
        })
      },
      roleBoxClose() {
        this.form = {}
        this.placeForm = {}
        this.disabled = false
        this.$refs.baseForm && this.$refs.baseForm.resetForm()
        this.$refs.restForm && this.$refs.restForm.resetForm()
        this.baseShow = false
        this.restShow = false
        this.schoolShow = false
        this.roleBox = false
      },
      getPlaceAddressListRequest(query) {
        getPlaceAddressList({
          addressName: query
        }).then(res => {
          this.standardAddressList = res.data.data;
        })
      },
      onSelectChange(e) {
        console.log("selectChange===>", e);
        // this.getPlaceAddressListRequest()
      },
      onRemoteMethod(query) {
        console.log("remote===>", query)
        this.getPlaceAddressListRequest(query)
      },
    },
    onRemoteMethod(query){
      console.log("remote===>",query)
      this.getPlaceAddressListRequest(query)
    },
  },
}
  }
</script>
<style lang="scss" scoped>
.cur-container-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  .content-box {
    margin: 0 4px;
    padding: 0 10px;
    height: 0;
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
  }
  .footer-btn-box {
    margin-top: 10px;
  .cur-container-box {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    .content-box {
      margin: 0 4px;
      padding: 0 10px;
      height: 0;
      flex: 1;
      overflow: hidden;
      overflow-y: auto;
    }
    .footer-btn-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
    }
  }
}
</style>