index.vue 1.96 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
/**
* @Description:检验界面履历本信息
* @author gjn
* @date 2023/11/10
*/
<template>
  <div class="biographicDataForInTest">
    <dee-as-com
      style="display:block"
      :lay-config="config"
      :basic-data="rowData"
    />
  </div>
</template>
<script>
export default {
  name: 'BiographicDataForInTest',
  components: {},
  props: {
    basicData: {
      type: Object,
      default: () => null
    }
  },
  data() {
    return {
      config: {},
      rowData: {}
    }
  },
  computed: {},
  watch: {
    basicData: {
      immediate: true,
      deep: true,
      handler(row) {
        // 查看履历单之前需完成检验单的填写
        const responseInTest = this.$utils.getTargetJobResponses(row, 'JobResponseInTest')
        if (!responseInTest || !responseInTest.testNo) return this.$utils.showMessageWarning('检验单号不能为空!')
        this.getBiographicData(responseInTest, row) // 查询履历本信息  如有则查看没有则新建
        if (responseInTest && responseInTest.biographicDataVOS && responseInTest.biographicDataVOS.length) {
          this.rowData = responseInTest.biographicDataVOS[0]
        } else {
          this.rowData = row
        }
      }
    }
  },
  created() {},
  mounted() {

  },
  methods: {
    getBiographicData(responseInTest, row) {
      const params = {
        searchItems: {
          items: [{ 'fieldName': 'responseInTestId', operator: 'EQ', value: responseInTest.id }],
          operator: 'AND'
        }
      }
      this.$api.searchApi('BiographicData', params).then(res => {
        if (res.items && res.items.content && res.items.content.length) {
          this.config = { typeName: 'BiographicData', layKey: 'defaultInfo' }
        } else {
          this.config = { typeName: 'BiographicData', layKey: 'addBiographicData' }
        }
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>
  <style  lang="scss">
  .biographicDataForInTest{
    height: 100%;
  }
 </style>