index.vue 2.48 KB
Newer Older
1 2 3 4 5 6 7 8 9
/**
* @Description:  流程编辑
* @author xioln
* @date 2023-09-16
* @FilePath: applications/dee-mes/src/privateComponents/components/FlowEdit/index.vue
*/
<template>
  <div class="flow-edit">
    <edit-purchase v-if="purchaseVis" :basic-data="basicData" />
10 11 12 13 14 15 16 17 18
    <div v-else>
      <InStorageRecalEdit v-if="InStorageRecallVis" :basic-data="basicData" />
      <dee-as-com
        v-else
        style="border:none;"
        :lay-config="cmpOptions"
        :basic-data="{...basicData,InStorageApplyProcessId:InStorageApplyProcessInfo.id}"
      />
    </div>
19 20 21
  </div>
</template>
<script>
xioln's avatar
xioln committed
22
import EditPurchase from '@/privateComponents/components/PurchasingWarehousingNewOrEdit'
23
import InStorageRecalEdit from '@/privateComponents/components/InStorageRecallItemCom'
24 25
export default {
  name: 'FlowEdit', // name写在组件的最前方,自定义组件为必填
26
  components: { EditPurchase, InStorageRecalEdit },
27 28 29 30 31 32 33 34 35 36
  props: {
    basicData: {
      type: Object,
      default: () => null
    }
  },
  data() {
    return {
      cmpOptions: {
        typeName: 'InStorageRecall',
37
        layKey: 'edit_applyApproval'
38
      },
39 40
      purchaseVis: false,
      InStorageRecallVis: false
41 42
    }
  },
43 44 45 46 47 48 49
  inject: {
    'InStorageApplyProcessInfo': {
      default: () => {
        return { InStorageApplyProcessInfo: null }
      }
    } // 流程basicData的id
  },
50 51 52 53 54 55 56 57 58
  computed: {},
  watch: {
    basicData: {
      immediate: true,
      deep: true,
      handler(val) {
        if (val && val.subTypeName) {
          switch (val.subTypeName) {
            case 'InStorageRecall':
59 60 61 62 63 64
              // this.cmpOptions = {
              //   typeName: 'InStorageRecall', // 返厂入库
              //   layKey: 'edit_applyApproval'
              // }
              // 采购入库
              this.InStorageRecallVis = true
65 66 67 68
              break
            case 'InStorageExpire':
              this.cmpOptions = {
                typeName: 'InStorageExpire', // 三期入库
69
                layKey: 'approvalApply_edit_sanqiruku'
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
              }
              break
            case 'InStoragePurchase':
              // 采购入库
              this.purchaseVis = true
              break
            default:
              break
          }
        }
      }
    }
  },
  created() {
    // 初始化数据
xioln's avatar
xioln committed
85
    this.$bus.$on('refreshPurchaseData', this.handleCustomEvent)
86 87
  },
  methods: {
xioln's avatar
xioln committed
88 89 90 91
    handleCustomEvent() {
      this.$emit('cancel')
      this.$parent.$parent.$parent.$parent.getData()
    }
92 93 94 95
  }
}
</script>
<style lang='scss'></style>