保安服务单位许可和备案申请系统
linwe
2024-07-09 4bd19a5df18f763c9b89c06b60ed42d11baede2a
src/components/cardPopup/cardPopup.vue
@@ -9,18 +9,29 @@
          <div class="f-b-o-in">
            <el-collapse v-model="activeNames" @change="handleChange">
              <el-collapse-item title="基本信息" name="1">
                <avue-form ref="form1" v-model="obj0" :option="option" @submit="submit" class="cardButs"></avue-form>
                <avue-form ref="form1" v-model="obj0" :option="option" @submit="submit" class="cardButs">
                  <template slot-scope="{size}" slot="houseCode">
                    <el-select v-model="obj0.addressName" clearable filterable remote :remote-method="onRemoteMethod"
                      @change="onSelectChange" placeholder="请输入与门牌地址二维码地址一致" reserve-keyword>
                      <el-option v-for="item in standardAddressList" :key="item.addressCode" :label="item.addressName"
                        :value="item">
                      </el-option>
                    </el-select>
                  </template>
                </avue-form>
              </el-collapse-item>
              <el-collapse-item title="附件上传" name="2">
                <div v-for="(item,index) in patrolGroup">
                <div v-for="(item, index) in patrolGroup">
                  <div style="font-weight: bold;font-size: 20px;">
                    {{item.title}}
                    {{ item.title }}
                  </div>
                  <div v-for="(item1,index1) in item.children">
                    <div>
                      {{index1+1}} {{item1.title}}
                  <div v-for="(item1, index1) in item.children" class="attach_row">
                    <div class="attach_row_title">
                      {{ index1 + 1 }}. {{ item1.title }}
                    </div>
                    <div style="margin: 10px;">
                    <div style="margin: 10px;" class="attach_row_btn">
                      <el-upload class="upload-demo" :limit="1" :data="item1" :on-change="handleChange"
                        :http-request="uploadFile">
                        <el-button size="small" type="primary">点击上传</el-button>
@@ -35,12 +46,8 @@
          </div>
          <div class="hand-next">
            <!-- <el-button type="primary" @click="tip1up1">上一页</el-button> -->
            <!-- <el-button type="primary" @click="tip1" :disabled="!opens">暂存</el-button> -->
            <el-button type="primary" @click="up()" :disabled="!opens">{{
              //canDoIt ? "提交审批" : "已成功提交"
              opens ? "提交审批" : "提交审批"
            }}</el-button>
            <el-button type="primary" @click="up()" :disabled="!opens">{{opens ? "提交审批" : "提交审批"
              }}</el-button>
            <el-button type="info" @click="qx">取消</el-button>
          </div>
        </div>
@@ -65,7 +72,8 @@
    getListre,
    getListrek,
    getListrev,
    getListrel
    getListrel,
    getDoorplateAddressList
  } from "@/api/permit/permit";
  export default {
    components: {
@@ -74,6 +82,7 @@
    props: ["data", "together"],
    data() {
      return {
        standardAddressList: [], //标准地址数据
        htmls: "",
        see: false,
        name: "",
@@ -98,7 +107,6 @@
              labelWidth: 100,
              label: "场所名称",
              prop: "placeName",
              // span: 24,
              rules: [{
                required: true,
                message: "请输入场所名称",
@@ -108,7 +116,6 @@
              labelWidth: 100,
              label: "负责人名称",
              prop: "principal",
              // span: 24,
              rules: [{
                required: true,
                message: "请输入场所负责人姓名",
@@ -119,7 +126,6 @@
              labelWidth: 100,
              label: "负责人电话",
              prop: "principalPhone",
              // span: 24,
              rules: [{
                required: true,
                message: "请输入场所负责人联系方式",
@@ -128,17 +134,13 @@
            },
            {
              labelWidth: 100,
              // width: 160,
              overHidden: true,
              slot: true,
              label: "位置",
              prop: "location",
              type: "map",
              dataType: "string",
              // labelWidth: 120,
              // span: 24,
              value: [117.96646, 28.431002, ""],
              // cascader: ['houseCodeBinds'],
              mapChange: (params) => {
                console.log('高德回调参数', params)
              },
@@ -156,9 +158,21 @@
            },
            {
              labelWidth: 100,
              overHidden: true,
              label: "派出所名称",
              prop: "pcsName",
              // span: 24,
              parent: false,
              prop: "pcsCode",
              searchSpan: 4,
              searchType: 'input',
              type: "tree",
              dicUrl: "/api/blade-policeStation/policeStation/tree",
              props: {
                label: "name",
                value: "id"
              },
              nodeClick: (data, node, nodeComp) => {
                this.obj0.pcsName = data.name
              },
              rules: [{
                required: true,
                message: "请输入派出所名称",
@@ -166,17 +180,16 @@
              }]
            },
            {
              // width: 156,
              labelWidth: 100,
              overHidden: true,
              label: "社区名称",
              parent: false,
              prop: "communityCode",
              // search: true,
              searchSpan: 4,
              searchType: 'input',
              type: "tree",
              dicUrl: "/api/blade-system/region/treeToCommunity",
              dicUrl: "/api/blade-system/region/treeToCommunity?isFiter='1'",
              defaultExpandedKeys: ["361102"],
              props: {
                label: "name",
                value: "id"
@@ -193,8 +206,6 @@
            {
              labelWidth: 100,
              disabled: true,
              // label: "无诈类型",
              // prop: "noFraudType",
              label: "无诈类别",
              prop: "noFraudType",
              align: 'center',
@@ -209,6 +220,41 @@
              searchLabelWidth: 96,
              align: 'center'
            },
            {
              labelWidth: 110,
              prop: "houseCode",
              slot: true,
              label: "场所标准地址",
              rules: [{
                required: true,
                message: "请选择场所标准地址",
                trigger: "blur",
              }, ],
            },
            {
              labelWidth: 110,
              label: '二维码图片',
              type: 'upload',
              listType: 'picture-img',
              propsHttp: {
                res: 'data',
                url: 'link',
              },
              canvasOption: {
                text: ' ',
                ratio: 0.1
              },
              action: '/api/blade-resource/oss/endpoint/put-file',
              tip: '只能上传jpg/png图片',
              span: 12,
              row: true,
              prop: 'qrImg',
              rules: [{
                required: true,
                message: "请上传二维码图片",
                trigger: "blur",
              }, ],
            },
          ]
        },
@@ -216,46 +262,31 @@
          emptyBtn: false,
          submitBtn: true,
          gutter: 50,
          column: [
            //   {
            //   label: "附件",
            //   prop: "parentCode",
            //   type: 'upload',
            //   span: 24,
            //   dragFile: true,
            //   // action: action,
            //   rules: [{
            //     required: true,
            //     message: "请上传附件",
            //     trigger: "blur"
            //   }]
            // },
            {
              label: '附件',
              prop: 'fileUrls',
              type: 'upload',
              span: 24,
              hide: true,
              labelWidth: 140,
              multiple: true,
              listType: "text",
              // showFileList: true,
              propsHttp: {
                res: 'data',
                name: "originalName",
                url: "link"
              },
              data: {
                suffix: 'pdf,ppt,doc,docx'
              },
              action: '/api/blade-resource/oss/endpoint/put-file-attach-suffix',
              rules: [{
                required: true,
                message: "请上传附件",
                trigger: "blur",
              }, ],
          column: [{
            label: '附件',
            prop: 'fileUrls',
            type: 'upload',
            span: 24,
            hide: true,
            labelWidth: 140,
            multiple: true,
            listType: "text",
            // showFileList: true,
            propsHttp: {
              res: 'data',
              name: "originalName",
              url: "link"
            },
          ],
            data: {
              suffix: 'pdf,ppt,doc,docx'
            },
            action: '/api/blade-resource/oss/endpoint/put-file-attach-suffix',
            rules: [{
              required: true,
              message: "请上传附件",
              trigger: "blur",
            }, ],
          }, ],
        },
        activeNames: ["1", "2"],
@@ -281,6 +312,7 @@
    watch: {
      useWhere() {
        var d = [];
        // console.log("********6666********" + JSON.stringify(this.useWhere))
        // console.log(this.together, "fromWhere");
        for (var i in this.together) {
          if (this.useWhere == this.together[i].fromWhere) {
@@ -299,14 +331,17 @@
            }
          }
          this.cardData = d;
          console.log(this.cardData);
          // console.log(this.cardData);
        } else {
          this.see = true;
          // this.openS();
          // console.log("********6666********" + JSON.stringify(this.useWhere))
          this.obj0.noFraudType = this.useWhere
          this.getPatrolGroupTree();
          this.obj0.noFraudType = this.data[0].type
          console.table(this.data);
          console.log(this.data[0].type);
          // console.table(this.data);
          this.taskPlaceRecordVOList = []
          // console.log(this.data[0].type);
        }
        if (this.useWhere == "close") {
@@ -315,8 +350,26 @@
      }
    },
    methods: {
      onSelectChange(e) {
        // console.log("selectChange===>", e);
        this.obj0.addressName = e.addressName
        this.obj0.houseCode = e.addressCode
        // this.getPlaceAddressListRequest()
      },
      onRemoteMethod(query) {
        // console.log("remote===>", query)
        this.getPlaceAddressListRequest(query)
      },
      getPlaceAddressListRequest(query) {
        getDoorplateAddressList(1, 50, {
          addressName: query
        }).then(res => {
          this.standardAddressList = res.data.data.records;
        })
      },
      uploadFile(param) {
        console.log("自定义上传", param);
        // console.log("自定义上传", param);
        const formData = new FormData()
        formData.append('file', param.file)
        formData.append('suffix', "pdf,ppt,doc,docx")
@@ -328,9 +381,9 @@
              imageUrls: res.data.data.link
            })
          }
          console.log('上传图片成功' + JSON.stringify(res))
          // console.log('上传图片成功' + JSON.stringify(res))
          // console.log('上传图片成功2' + JSON.stringify(this.patrolGroup))
          console.log('上传图片成功2' + JSON.stringify(this.taskPlaceRecordVOList))
          // console.log('上传图片成功2' + JSON.stringify(this.taskPlaceRecordVOList))
        }).catch(response => {
          console.log('图片上传失败')
@@ -338,7 +391,7 @@
      },
      handleChange(file, fileList) {
        console.table(fileList)
        // console.table(fileList)
        // this.fileList = fileList.slice(-3);
      },
      tipchose() {
@@ -346,6 +399,8 @@
        this.openS(this.choseType, this.cardData);
      },
      openS(chose, datas) {
        console.log("****111*****" + JSON.stringify(chose))
        console.log("****222*****" + JSON.stringify(datas))
        var n = chose || this.useWhere;
        this.data = datas || this.data;
        for (var k in this.data) {
@@ -400,12 +455,15 @@
      },
      getPatrolGroupTree() {
        if (this.obj0.noFraudType && this.obj0.noFraudType == 'close') {
          return
        }
        let data = {
          childType: 6,
          childType: this.obj0.noFraudType,
          type: 2
        }
        patrolGroupTree(data).then((res) => {
          console.log("*****res********" + JSON.stringify(res))
          // console.log("*****res********" + JSON.stringify(res))
          this.patrolGroup = res.data.data
        });
      },
@@ -452,6 +510,7 @@
          this.obj0.lat = arr[1]
          this.obj0.location = arr[2]
        }
        this.obj0.type = 2
        this.obj0.taskPlaceRecordVOList = this.taskPlaceRecordVOList
        add(this.obj0).then(() => {
          this.qx();
@@ -509,4 +568,26 @@
  };
</script>
<style lang="scss"></style>
<style lang="scss">
  .attach_row {
    display: flex;
    border: 0.2px solid rgba(221, 223, 229, 0.5);
    height: 54px;
    .attach_row_title {
      width: 85%;
      border-right: 0.2px solid rgba(221, 223, 229, 0.5);
      display: flex;
      justify-content: left;
      align-items: center;
      margin-left: 12px;
    }
    .attach_row_btn {
      width: 15%;
      margin: 10px;
      display: flex;
      justify-content: center;
    }
  }
</style>