保安服务单位许可和备案申请系统
liuyg
2021-08-28 53cc07834ed1b7eb65f1f539fa94269b11b61f14
src/components/cardPopup/cardPopup.vue
@@ -1,57 +1,80 @@
<template>
  <div v-if="see && useWhere != 'close'" class="securityPermit">
    <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 class="once">
    <div v-if="OnceChouse && useWhere != 'close'" class="OnceChouse">
      <slot name="close"></slot>
      <div class="heards"></div>
      <basic-container>
        <div v-for="(item, index) in cardData" :key="index">
          <!-- <div class="chouseHide"> -->
          <el-radio v-model="choseType" :label="item.type">{{
            item.menuName
          }}</el-radio>
          <div class="choseTitle">{{ item.datas.msg }}</div>
          <!-- </div> -->
        </div>
        <div class="hand-next">
          <el-button type="primary" @click="tipchose">确认</el-button>
          <!-- <el-button type="primary" @click="qx">取消</el-button> -->
        </div>
      </basic-container>
    </div>
    <div
      v-if="see && useWhere != 'close' && !OnceChouse"
      class="securityPermit"
    >
      <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="hand-next">
          <el-button type="primary" @click="tip0">下一步</el-button>
          <el-button type="primary" @click="qx">取消</el-button>
        </div>
      </div>
      <div v-show="forms == 2" class="first-box-outer">
        <div class="f-b-o-in" v-if="active">
          <el-collapse v-model="activeNames" @change="handleChange">
            <el-collapse-item title="公司基本信息" name="1">
              <avue-form
                ref="form1"
                v-model="obj0"
                :option="option"
              ></avue-form>
            </el-collapse-item>
            <el-collapse-item title="附件上传/查询" name="2">
              <attach :type="imgType" :opens="opens"></attach>
            </el-collapse-item>
          </el-collapse>
        </div>
        <div v-show="forms == 2" class="first-box-outer">
          <div class="f-b-o-in" v-if="active">
            <el-collapse v-model="activeNames" @change="handleChange">
              <el-collapse-item title="公司基本信息" name="1">
                <avue-form
                  ref="form1"
                  v-model="obj0"
                  :option="option"
                ></avue-form>
              </el-collapse-item>
              <el-collapse-item title="附件上传/查询" name="2">
                <attach :type="imgType" :opens="opens"></attach>
              </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="up()" :disabled="!opens">{{
            //canDoIt ? "提交审批" : "已成功提交"
            opens ? "提交审批" : "提交审批"
          }}</el-button>
          <el-button type="info" @click="qx">取消</el-button>
          <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="info" @click="qx">取消</el-button>
          </div>
        </div>
      </div>
    </basic-container>
      </basic-container>
    </div>
  </div>
</template>
@@ -70,7 +93,7 @@
  components: {
    attach: attach,
  },
  props: ["data"],
  props: ["data", "together"],
  data() {
    return {
      htmls: "",
@@ -96,6 +119,10 @@
      activeNames: ["1", "2"],
      opens: true,
      active: false,
      OnceChouse: false, //选择武装押运或者保安服务许可
      cardData: [],
      choseType: "",
    };
  },
  computed: {
@@ -103,8 +130,44 @@
  },
  watch: {
    useWhere() {
      var d = [];
      // console.log(this.together, "fromWhere");
      for (var i in this.together) {
        if (this.useWhere == this.together[i].fromWhere) {
          this.OnceChouse = true;
          d.push(this.together[i]);
          console.log("选择");
        }
      }
      if (this.OnceChouse) {
        this.choseType = this.useWhere;
        for (var k in this.data) {
          if (this.data[k].type == this.useWhere) {
            d.unshift(this.data[k]);
          }
        }
        this.cardData = d;
        console.log(this.cardData);
      } else {
        this.openS();
      }
      if (this.useWhere == "close") {
        this.tipover();
      }
    },
  },
  methods: {
    tipchose() {
      this.OnceChouse = false;
      this.openS(this.choseType, this.cardData);
    },
    openS(chose, datas) {
      var n = chose || this.useWhere;
      this.data = datas || this.data;
      for (var k in this.data) {
        if (this.useWhere == this.data[k].type) {
        if (n == this.data[k].type) {
          this.see = true;
          this.type = this.data[k].type;
          this.imgType = this.data[k].imgType;
@@ -112,30 +175,12 @@
          this.apiName = this.data[k].datas.apiName;
          this.name = this.data[k].menuName;
          var d = this.data[k].datas.column;
          // this.option.column = d;
          this.onLoad(this.page, {}, this.useWhere, d);
          // //判断是否禁用按钮
          // for (var k in this.canDoIt) {
          //   if (this.canDoIt[k].type == this.type) {
          //     console.log(this.type + "-------" + this.canDoIt[k].opens);
          //     this.opens = this.canDoIt[k].opens;
          //   }
          // }
          // //是否禁用按钮
          // for (var k in d) {
          //   d[k]["disabled"] = !this.opens;
          // }
          console.log("已选择type:" + this.useWhere + "--" + this.name);
          this.onLoad(this.page, {}, n, d);
          console.log("已选择type:" + n + "--" + this.name);
          this.convert();
        }
      }
      if (this.useWhere == "close") {
        this.tipover();
      }
    },
  },
  methods: {
    onLoad(page, params = {}, val, d) {
      params["cardid"] = this.userInfo.Id;
      getList(page.currentPage, page.pageSize, params).then((res) => {
@@ -148,7 +193,7 @@
            getListrev(page.currentPage, page.pageSize, params).then((resv) => {
              this.data = this.data.concat(resv.data.data.records);
              console.log("已有申请数量:", this.data.length);
              console.log(val);
              console.log(val, "当前type");
              this.changeBut(true, d);
              if (this.data.length == 0) {
                console.log("一条数据都没有");
@@ -277,6 +322,7 @@
      var d = {};
      this.data0 = d;
      this.active = false;
      this.OnceChouse = false;
    },
  },
};