保安服务单位许可和备案申请系统
liuyg
2021-09-10 e3ab7d6f6c122f56d099cac700448d6f85987dd1
src/components/cardPopup/cardPopup.vue
@@ -56,7 +56,12 @@
                ></avue-form>
              </el-collapse-item>
              <el-collapse-item title="附件上传/查询" name="2">
                <attach :type="imgType" :opens="opens"></attach>
                <attach
                  :type="imgType"
                  :ptype="type"
                  :opens="opens"
                  :enclosure="enclosure"
                ></attach>
              </el-collapse-item>
            </el-collapse>
          </div>
@@ -123,6 +128,11 @@
      OnceChouse: false, //选择武装押运或者保安服务许可
      cardData: [],
      choseType: "",
      overtime: {
        overtimef: "",
        overtimec: "",
      },
      enclosure: [], //附件上传 基础数据
    };
  },
  computed: {
@@ -170,6 +180,8 @@
        if (n == this.data[k].type) {
          this.see = true;
          this.type = this.data[k].type;
          this.enclosure = this.data[k].enclosure;
          this.overtime = this.data[k].overtime;
          this.imgType = this.data[k].imgType;
          this.htmls = this.data[k].datas.htmls;
          this.apiName = this.data[k].datas.apiName;
@@ -283,13 +295,6 @@
      this.data0.ptype = this.type;
      this.data0.cardid = this.$store.getters.userInfo.Id;
      // if (!this.tipover(1, this.data0)) {
      //   console.log("不通过");
      //   return;
      // }
      // console.log(this.tipover(1, this.data0));
      // return;
      //验证数据
      var commin = true;
      var a = this.data0;
@@ -299,20 +304,27 @@
          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 == "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") {
            // console.log(a[k], k);
            commin = false;
            console.log(3);
            break;
          }
        }
@@ -322,9 +334,12 @@
          message: "请检查输入数据是否正确!",
          type: "warning",
        });
        return;
      }
      a["overtime"] = this.getNowTime(this.overtime.overtimec);
      console.log(a);
      // return;
      add(this.apiName[0], this.data0).then(() => {
        this.qx();
        this.$message({
@@ -334,7 +349,22 @@
        this.$store.commit("changecanDoIt", false);
      });
    },
    getNowTime(form) {
      var DaysToAdd = form;
      var now = new Date();
      var newdate = new Date();
      var newtimems = newdate.getTime() + DaysToAdd * 24 * 60 * 60 * 1000;
      newdate.setTime(newtimems);
      //只得到年月日的
      var time =
        newdate.getFullYear() +
        "-" +
        (newdate.getMonth() + 1) +
        "-" +
        newdate.getDate();
      //得到具体时间
      return time;
    },
    tipover(a, b) {
      if (a == 1) {
        console.log(b);