stockQuantityDialog.vue 1.96 KB
Newer Older
wangdanlei's avatar
wangdanlei committed
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92
<template>
  <dee-drawer
    width="40%"
    :title="title"
    :dialog-visible="visibile"
    @handleClose="onClose"
  >
    <dee-as-com v-if="visibile" :lay-config="layConfig" :extra-params="extraParams" />
    <div slot="footer">
      <el-button size="small" @click="onClose">关闭</el-button>
    </div>
  </dee-drawer>
</template>

<script>
import _get from 'lodash.get'

export default {
  name: 'StockQuantityDialog',
  props: {
    visibile: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '库存明细'
    },
    record: {
      type: Object,
      default: null
    }
  },
  data() {
    return {}
  },
  computed: {
    layConfig() {
      return {
        typeName: 'DxStInvAccountDetail',
        layKey: '2358296c-8eab-4531-a95a-997cbab1cc8d'
      }
    },
    extraParams() {
      return [
        {
          'fieldName': 'invAccountId',
          'operator': 'EQ',
          'valueType': 'basicData',
          'value': this.record.id
        }
      ]
    },
    _extraParams() {
      const dxStLocationId = _get(this.record, 'dxStLocation.id', '')
      const batchNumber = _get(this.record, 'batchNumber', '')
      const dxResInstId = _get(this.record, 'dxResInstId', '')
      return [
        {
          'fieldName': 'dxStLocationId',
          'operator': 'EQ',
          'valueType': 'basicData',
          'value': dxStLocationId
        },
        {
          'fieldName': 'batchNumber',
          'operator': 'EQ',
          'valueType': 'basicData',
          'value': batchNumber
        },
        {
          'fieldName': 'dxResInstId',
          'operator': 'EQ',
          'valueType': 'basicData',
          'value': dxResInstId
        },
        {
          'fieldName': 'dxStRdBaseAFIdType',
          'operator': 'EQ',
          'valueType': 'basicData',
          'value': 'DxStInComeAF'
        }
      ]
    }
  },
  methods: {
    onClose() {
      this.$emit('update:visibile', false)
    }
  }
}
</script>