保安服务单位许可和备案申请系统
lin
2024-05-08 5455230326af3e930771fbb688536b3483f076b7
src/components/cardPopup/cardPopup.vue
@@ -5,37 +5,38 @@
      <slot name="close"></slot>
      <div class="heards">{{ name }}</div>
      <basic-container>
        <!-- <div v-show="forms == 1" class="first-box-outer">
          <div class="f-b-o-in">
            <div class="handling-guideline">
              <h2 class="hand-title">{{ name }}办理指南</h2>
              <div class="hand-content" ref="handcontent" id="handcontent" v-html="htmls">
                {{ htmls }}
              </div>
            </div>
          </div>
          <div class="hand-next">
            <el-button type="primary" @click="tip0">下一步</el-button>
            <el-button type="primary" @click="qx">取消</el-button>
          </div>
        </div> -->
        <div class="first-box-outer">
          <div class="f-b-o-in">
            <el-collapse v-model="activeNames" @change="handleChange">
              <el-collapse-item title="公司基本信息" name="1">
              <el-collapse-item title="基本信息" name="1">
                <avue-form ref="form1" v-model="obj0" :option="option" @submit="submit" class="cardButs"></avue-form>
              </el-collapse-item>
              <el-collapse-item title="附件上传" name="2">
                <div v-for="(item,index) in patrolGroup">
                  <div style="font-weight: bold;font-size: 20px;">
                    {{item.title}}
                  </div>
                  <div v-for="(item1,index1) in item.children">
                    <div>
                      {{index1+1}} {{item1.title}}
                    </div>
                    <div style="margin: 10px;">
                      <el-upload class="upload-demo" :limit="1" :data="item1" :on-change="handleChange"
                        :http-request="uploadFile">
                        <el-button size="small" type="primary">点击上传</el-button>
                      </el-upload>
                    </div>
                  </div>
                </div>
                <!-- <attach :type="imgType" :ptype="type" :opens="opens" :enclosure="enclosure"></attach> -->
                <avue-form :option="optionFile" v-model="form"></avue-form>
                <!-- <avue-form :option="optionFile" v-model="obj0"></avue-form> -->
              </el-collapse-item>
            </el-collapse>
          </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="tip1" :disabled="!opens">暂存</el-button> -->
            <el-button type="primary" @click="up()" :disabled="!opens">{{
              //canDoIt ? "提交审批" : "已成功提交"
              opens ? "提交审批" : "提交审批"
@@ -54,12 +55,12 @@
  } from "vuex";
  import {
    add,
    adds,
    selectIn
    patrolGroupTree,
    selectIn,
    uploadFile
  } from "@/api/recordOur/outCardPopup";
  import attach from "@/components/attach/attach";
  import {
    // getDetail,
    getList,
    getListre,
    getListrek,
@@ -81,7 +82,9 @@
        apiName: [],
        forms: 2,
        data0: {},
        obj0: {},
        obj0: {
          type: 2
        },
        page: {
          pageSize: 10,
          currentPage: 1,
@@ -123,16 +126,6 @@
                trigger: "blur"
              }]
            },
            // {
            //   label: "位置",
            //   prop: "location",
            //   span: 24,
            //   rules: [{
            //     required: true,
            //     message: "请选择位置",
            //     trigger: "blur"
            //   }]
            // },
            {
              labelWidth: 100,
              // width: 160,
@@ -173,26 +166,48 @@
              }]
            },
            {
              // width: 156,
              labelWidth: 100,
              overHidden: true,
              label: "社区名称",
              prop: "communityName",
              // span: 24,
              parent: false,
              prop: "communityCode",
              // search: true,
              searchSpan: 4,
              searchType: 'input',
              type: "tree",
              dicUrl: "/api/blade-system/region/treeToCommunity",
              props: {
                label: "name",
                value: "id"
              },
              nodeClick: (data, node, nodeComp) => {
                this.obj0.communityName = data.name
              },
              rules: [{
                required: true,
                message: "请输入社区名称",
                trigger: "blur"
              }]
                message: "请选择社区名称",
                trigger: "blur",
              }, ],
            },
            {
              labelWidth: 100,
              label: "社区名称",
              prop: "communityName",
              // span: 24,
              rules: [{
                required: true,
                message: "请输入社区名称",
                trigger: "blur"
              }]
              disabled: true,
              // label: "无诈类型",
              // prop: "noFraudType",
              label: "无诈类别",
              prop: "noFraudType",
              align: 'center',
              dicUrl: "/api/blade-system/dict-biz/tree?code=noExplosionCategory",
              props: {
                label: "title",
                value: "key",
              },
              type: 'select',
              search: true,
              searchSpan: 4,
              searchLabelWidth: 96,
              align: 'center'
            },
          ]
        },
@@ -217,7 +232,7 @@
            // },
            {
              label: '附件',
              prop: 'constructionSchemeUrls',
              prop: 'fileUrls',
              type: 'upload',
              span: 24,
              hide: true,
@@ -240,7 +255,7 @@
                trigger: "blur",
              }, ],
            },
          ]
          ],
        },
        activeNames: ["1", "2"],
@@ -254,7 +269,10 @@
          overtimef: "",
          overtimec: ""
        },
        enclosure: [] //附件上传 基础数据
        enclosure: [], //附件上传 基础数据
        patrolGroup: [],
        taskPlaceRecordVOList: [],
      };
    },
    computed: {
@@ -272,6 +290,7 @@
            // console.log("选择");
          }
        }
        // console.log("**********noFraudType*****************" + JSON.stringify(this.data))
        if (this.OnceChouse) {
          this.choseType = this.useWhere;
          for (var k in this.data) {
@@ -284,6 +303,10 @@
        } else {
          this.see = true;
          // this.openS();
          this.getPatrolGroupTree();
          this.obj0.noFraudType = this.data[0].type
          console.table(this.data);
          console.log(this.data[0].type);
        }
        if (this.useWhere == "close") {
@@ -292,6 +315,32 @@
      }
    },
    methods: {
      uploadFile(param) {
        console.log("自定义上传", param);
        const formData = new FormData()
        formData.append('file', param.file)
        formData.append('suffix', "pdf,ppt,doc,docx")
        let data = param.data
        uploadFile(formData).then(res => {
          if (res.data.code == 200) {
            this.taskPlaceRecordVOList.push({
              itemId: data.id,
              imageUrls: res.data.data.link
            })
          }
          console.log('上传图片成功' + JSON.stringify(res))
          // console.log('上传图片成功2' + JSON.stringify(this.patrolGroup))
          console.log('上传图片成功2' + JSON.stringify(this.taskPlaceRecordVOList))
        }).catch(response => {
          console.log('图片上传失败')
        })
      },
      handleChange(file, fileList) {
        console.table(fileList)
        // this.fileList = fileList.slice(-3);
      },
      tipchose() {
        this.OnceChouse = false;
        this.openS(this.choseType, this.cardData);
@@ -318,44 +367,7 @@
      },
      onLoad(page, params = {}, val, d) {
        params["cardid"] = this.userInfo.Id;
        // getList(page.currentPage, page.pageSize, params).then(res => {
        //   const data = res.data.data;
        //   this.data = data.records;
        //   getListre(page.currentPage, page.pageSize, params).then(ress => {
        //     this.data = this.data.concat(ress.data.data.records);
        //     getListrek(page.currentPage, page.pageSize, params).then(resk => {
        //       this.data = this.data.concat(resk.data.data.records);
        //       getListrev(page.currentPage, page.pageSize, params).then(resv => {
        //         this.data = this.data.concat(resv.data.data.records);
        //         getListrel(page.currentPage, page.pageSize, params).then(resl => {
        //           this.data = this.data.concat(resl.data.data.records);
        //           // console.log("已有申请数量:", this.data.length);
        //           // console.log(val, "当前type");
        //           if (this.data.kservicetime) {
        //             this.data.kservicetime.split(",");
        //           }
        //           this.changeBut(true, d);
        //           if (this.data.length == 0) {
        //             // console.log("一条数据都没有");
        //           } else {
        //             this.data.forEach(item => {
        //               // console.log(item.ptype);
        //               if (item.ptype == val) {
        //                 if (item.type == 0 || item.type == 2) {
        //                   this.changeBut(false, d);
        //                   // console.log(item, "有数据未审核或者审核通过");
        //                 } else {
        //                   this.changeBut(true, d);
        //                   // console.log(item, "审核不通过");
        //                 }
        //               }
        //             });
        //           }
        //         });
        //       });
        //     });
        //   });
        // });
      },
      changeBut(val, d) {
        this.opens = val;
@@ -386,6 +398,23 @@
      tip1up1() {
        this.forms = 2;
      },
      getPatrolGroupTree() {
        let data = {
          childType: 6,
          type: 2
        }
        patrolGroupTree(data).then((res) => {
          console.log("*****res********" + JSON.stringify(res))
          this.patrolGroup = res.data.data
          // this.qx();
          // this.$message({
          //   message: "暂存申请成功",
          //   type: "success"
          // });
        });
      },
      tip1() {
        //暂存申请
        var d = {};
@@ -400,7 +429,7 @@
        this.data0 = d;
        this.data0.cardid = this.$store.getters.userInfo.Id;
        this.data0.ptype = this.type;
        adds(this.apiName[1], this.data0).then(() => {
        adds().then(() => {
          this.qx();
          this.$message({
            message: "暂存申请成功",
@@ -415,79 +444,21 @@
        this.up(0);
      },
      up(val = 1) {
        //提交申请
        // this.submit();
        if (val == 1) {
          this.$refs.form1.submit(); //解决点击提交不能显示那个字段输入错误的问题
          return;
        }
        var d = {};
        for (var k in this.obj0) {
          for (var i in this.option.column) {
            if (k == this.option.column[i].prop && k != "title0") {
              d[k] = this.obj0[k];
            }
          }
        if (this.obj0.fileUrls) {
          this.obj0.fileUrls = JSON.stringify(this.obj0.fileUrls)
        }
        this.data0 = d;
        this.data0.ptype = this.type;
        this.data0.cardid = this.$store.getters.userInfo.Id;
        //验证数据
        var commin = true;
        var a = this.data0;
        for (var k in a) {
          if (k == "representativecell" || k == "contactscell") {
            //电话验证
            if (!yanzhengphons.test(a[k])) {
              // console.log(a[k], k);
              commin = false;
              console.log(1);
              break;
            }
            // } else if (k == "creditcode" || k == "registeredcapital") {
          } else if (k == "registeredcapital") {
            //数字验证
            if (!yanzhengnumbers.test(a[k])) {
              // console.log(a[k], k);
              commin = false;
              console.log(2);
              break;
            }
          } else if (k == "address" || k == "business") {
            //跳过验证
            continue;
          } else {
            //空值验证
            // if (a[k] == "" && k != "ptype" && k != "creditcode") {
            //   console.log(a[k], k);
            //   commin = false;
            //   console.log(3);
            //   break;
            // }
          }
        if (this.obj0.location) {
          let arr = this.obj0.location.split(",")
          this.obj0.lng = arr[0]
          this.obj0.lat = arr[1]
          this.obj0.location = arr[2]
        }
        if (!commin) {
          this.$message({
            message: "请检查输入数据是否正确!",
            type: "warning"
          });
          return;
        }
        a["overtime"] = this.getNowTime(this.overtime.overtimec);
        // console.log(a);
        // return;
        // console.log(typeof this.data0.kservicetime);
        if (
          this.data0.kservicetime &&
          typeof this.data0.kservicetime != "string"
        ) {
          this.data0.kservicetime = this.data0.kservicetime.join(",");
        }
        // console.log(this.apiName[0], this.data0);
        // return;
        add(this.apiName[0], this.data0).then(() => {
        this.obj0.taskPlaceRecordVOList = this.taskPlaceRecordVOList
        add(this.obj0).then(() => {
          this.qx();
          this.$message({
            message: "提交申请成功",