allocationDetailDialog.vue 5.3 KB
<!-- 盘点详情弹窗弹窗 -->
<template>
  <GLDialog bigTitle="详细信息" width="1008px" :visible.sync="allocationDetailVisible" class="inventoryDetailDailog" mode="big" okText="关闭" @onCancel="handleClose" @onOk="handleClose" :before-close="handleClose" :hasFooter="false">
    <div>
      <div>
        单据状态:
        <span :class="billStatusName()" style="margin-right: 4px;" />
        {{ baseData.billStatusObj[allocationInfo.billStatus]?.name || '-' }}
      </div>
      <div class="receipt-box">
        <div v-for="(item, index) in infoForm" :class="item.class" :key="index">
          <span :style="{ 'flex-shrink': 0, display: 'inline-block', ...item.labelStyle }">{{ item.label }}</span>
          <el-tooltip v-if="allocationInfo[item.name]" class="item" effect="light" :content="allocationInfo[item.name]" placement="top">
            <span class="ellipsis">{{ allocationInfo[item.name] }}</span>
          </el-tooltip>
          <span v-else>-</span>
        </div>
      </div>
      <div class="header" slot="header" style="padding: 10px 20px"></div>
      <div class="d2-container-content">
        <GLTable ref="recordTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf"></GLTable>
      </div>
    </div>
    <!-- <span slot="footer" class="dialog-footer">
      <el-button type="primary" size="small" @click="handleClose">关闭</el-button>
    </span> -->
  </GLDialog>
</template>

<script>
// import { membraneTypeList } from '@/utils/constants.js'
import constData from './constant/data.js'
export default {
  name: 'allocationDetailDialog',
  data() {
    return {
      // membraneTypeList: membraneTypeList,
      infoForm: [
        { name: 'receiver', label: '收货人:', class: 'receiver', labelStyle: { width: '56px' } },
        { name: 'phone', label: '收货人电话:', class: 'phone', labelStyle: { width: '84px' } },
        { name: 'address', label: '收货地址:', class: 'address', labelStyle: { width: '70px' } }
      ],
      searchForm: {
        id: ''
      },
      searchFormSearch: {},
      searchSelectObj: {},
      showFormData: [],
      getListApi: this.$apis.stockManage.stockAllocateDetailPage,
      tableParams: {
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        tableOption: false,
        tableColumns: [
          {
            label: '商品名称',
            prop: 'goodsName',
            width: 180,
            line: 1
          },
          {
            label: '规格',
            prop: 'specificationData',
            width: 180,
            line: 1
          },
          {
            label: '商品编码',
            prop: 'productCode'
            // width: 250
          },
          {
            label: '系列',
            prop: 'sourceMaterialName'
          },
          {
            label: '所属分类',
            prop: 'goodsTypeName'
          },
          {
            label: '调拨数量',
            prop: 'allocateNumber',
            formatter: cellValue => {
              return cellValue.allocateNumber || cellValue.allocateNumber == 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.$membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
            }
          },
          {
            label: '膜卷号',
            prop: 'filmRollNo'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
      baseData: {
        billStatusObj: constData.billStatusObj
      }
    }
  },

  props: {
    allocationDetailVisible: {
      type: Boolean,
      default: false
    },
    allocationInfo: {
      type: Object,
      default: () => { }
    }
  },

  computed: {},
  mounted() {
    console.log(11111111)
  },

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        this.searchForm.id = this.allocationInfo.id
        this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
        resolve()
      })
    },

    billStatusName() {
      console.log(this.allocationInfo.billStatus)
      return this.baseData.billStatusObj[this.allocationInfo.billStatus]?.class || '-'
    },

    handleClose() {
      this.$emit('dialogClose')
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.count-txt {
  font-weight: 700;
  color: #2a58ad;
  margin: 0 2px;
}

.inventoryDetailDailog .el-dialog {
  margin-top: 20vh !important;
  min-width: 700px;
}
/* 深度选择器不生效时,可改用 ::v-deep 或 :deep() 写法 */
.inventoryDetailDailog {
  /deep/.el-dialog__body {
    max-height: 660px;
  }
}

.receipt-box {
  display: flex;
  margin-top: 9.5px;
  color: #666666;
  font-size: 14px;
  line-height: 16px;
  .receiver {
    display: flex;
    width: 210px;
    margin-right: 20px;
  }
  .phone {
    display: flex;
    width: 257px;
    margin-right: 20px;
  }
  .address {
    display: flex;
    width: 461px;
  }
  .ellipsis {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.greenSpot {
  @include dot;
  background: $color-green;
}

.yellowSpot {
  @include dot;
  background: $color-yellow;
}

.ashSpot {
  @include dot;
  background: $color-gray;
}

.redSpot {
  @include dot;
  background: $color-red;
}
</style>