+
liuyg
2021-09-17 68f1c1dc749bf424059fa70e09b72fc30bec2ea1
src/views/securityGuard/securityGuardDetail.vue
@@ -10,6 +10,9 @@
        :data="data1"
        :page.sync="page1"
        :table-loading="loading1"
        @row-save="rowSave1"
        @row-update="rowUpdate1"
        @row-del="rowDel1"
        @refresh-change="refreshChange1"
      >
      </avue-crud>
@@ -34,8 +37,8 @@
          <div class="baz-m-body" ref="baoanzheng">
            <div class="bmb-heard">保安员证</div>
            <div class="img">
              <div v-if="!obj0.myPicture">暂无照片</div>
              <img :src="obj0.myPicture" alt="" v-else />
              <div v-if="!obj0.avatar">暂无照片</div>
              <img :src="obj0.avatar" alt="" v-else />
            </div>
            <div class="imgs">
              <div v-if="erweima == ''">暂无二维码</div>
@@ -78,6 +81,9 @@
        </div>
      </div>
    </span>
    <span v-else-if="typeTABS.prop === 'tab5'">
      <securityCertificate :data="obj0"></securityCertificate>
    </span>
  </div>
</template> 
@@ -87,7 +93,14 @@
  practitionersColumn,
  trackRecordColumn,
} from "./data";
import { getUserPractitionersInfo } from "@/api/system/user";
import {
  addExperience,
  updateExperience,
  getExperienceDetail,
  experienceRemove,
  getExperienceList,
} from "@/api/experience/experience";
import {
  getPerformanceInfo,
  add,
@@ -98,8 +111,12 @@
} from "@/api/performance/performance";
// import vueQr from "vue-qr";
import securityCertificate from "./securityCertificate.vue";
export default {
  components: {
    securityCertificate: securityCertificate,
  },
  data() {
    return {
      typeTABS: {}, //标签页
@@ -108,7 +125,7 @@
        column: [
          {
            // icon: "el-icon-info",
            label: "保安员入职登记基本信息",
            label: "保安员基本信息",
            prop: "tab1",
          },
          {
@@ -125,6 +142,11 @@
            // icon: "el-icon-info",
            label: "保安员证",
            prop: "tab4",
          },
          {
            // icon: "el-icon-info",
            label: "保安员证书",
            prop: "tab5",
          },
        ],
      },
@@ -158,12 +180,12 @@
        total: 0,
      },
      query1: {},
      query2: {},
      data1: [],
      data2: [],
      option1: {
        card: true,
        menu: false,
        addBtn: false,
        menu: true,
        height: "auto",
        widtd: "auto",
        calcHeight: 54,
@@ -246,20 +268,21 @@
    },
    //查询当前保安员的从业记录信息
    getPractitionersPageInfo() {
      var that = this;
      var param = {
        securityid: this.id,
      };
      //获取用户从业信息
      console.log(this.id, "cid");
      getUserPractitionersInfo(this.id).then((res1) => {
        that.data1 = res1.data.data;
      getExperienceList(this.current, this.size, param).then((res1) => {
        const data = res1.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
        this.loading1 = false;
      });
    },
    //查询当前保安员的现实表现记录信息
    getPerformancePageInfo() {
      //获取现实表现信息
      // getPerformanceInfo(this.id).then((res) => {
      //   that.data2 = res1.data.data;
      //   console.log(that.data2, 1);
      // });
      var param = {
        securityid: this.id,
      };
@@ -271,11 +294,31 @@
        this.loading2 = false;
      });
    },
    rowSave2(form, done, loading) {
      form.securityid = this.id;
      add(form).then(
        (res) => {
          this.getPerformancePageInfo(this.page2);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
      // }
    },
    //从业记录新增
    rowSave1(form, done, loading) {
      form.securityid = this.id;
      addExperience(form).then(
        (res) => {
          this.getPractitionersPageInfo(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
@@ -306,6 +349,23 @@
        }
      );
    },
    rowUpdate1(row, index, done, loading) {
      row.securityid = this.id;
      updateExperience(row).then(
        () => {
          this.getPractitionersPageInfo(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel2(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
@@ -323,6 +383,23 @@
          });
        });
    },
    rowDel1(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return experienceRemove(row.id);
        })
        .then(() => {
          this.getPractitionersPageInfo(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
  },
  mounted() {
    this.typeTABS = this.optionTABS.column[0];