123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <div class="warehouseAllocationDetail-wrap">
- <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationDetail-back">
- <!-- 自定义的二级文字标题 -->
- <template slot="subTitle">
- <a id="warehouseAllocationDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
- </template>
- <!-- 操作区,位于 title 行的行尾 -->
- <template slot="extra">
- <a-button key="2" id="warehouseAllocationDetail-preview-btn">打印预览</a-button>
- <a-button key="1" type="primary" id="warehouseAllocationDetail-print-btn">快速打印</a-button>
- <a-button key="3" type="danger" @click="handleExport" :loading="exportLoading" id="warehouseAllocationDetail-export-btn">导出</a-button>
- </template>
- </a-page-header>
- <!-- 基础信息 -->
- <a-card :bordered="false" class="warehouseAllocationDetail-cont">
- <a-collapse :activeKey="['1']">
- <a-collapse-panel key="1" header="基础信息">
- <a-descriptions :column="3">
- <a-descriptions-item label="调出仓库">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="调入仓库">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="调拨单号">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="关联单号">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="审核状态">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="完结状态">箭冠营销中心</a-descriptions-item>
- <a-descriptions-item label="备注">箭冠营销中心</a-descriptions-item>
- </a-descriptions>
- </a-collapse-panel>
- </a-collapse>
- </a-card>
- <!-- 详情 -->
- <a-card :bordered="false" class="warehouseAllocationDetail-cont">
- <a-collapse :activeKey="['1']">
- <a-collapse-panel key="1" header="详情">
- <!-- 总计 -->
- <a-alert type="info" showIcon style="margin-bottom:15px">
- <div slot="message">总款数: <strong>6</strong> ,总数量: <strong>6</strong> ,总成本:¥<strong>6.33</strong></div>
- </a-alert>
- <!-- 列表 -->
- <s-table
- class="sTable"
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- bordered>
- <!-- 采购数量 -->
- <template slot="purchaseNum" slot-scope="text, record">
- <span>{{record.purchaseNum}}</span>
- </template>
- <!-- 缺货数量 -->
- <template slot="outOfStockNum" slot-scope="text, record">
- <span>{{record.outOfStockNum}}</span>
- </template>
- </s-table>
- </a-collapse-panel>
- </a-collapse>
- </a-card>
- </div>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- export default{
- components: { STable, VSelect },
- data(){
- return{
- exportLoading: false, // 导出loading
- // 表头
- columns: [
- { title: '序号', dataIndex: 'no', align: 'center' },
- { title: '产品编码', dataIndex: 'creatDate', align: 'center' },
- { title: '产品名称', dataIndex: 'custName', align: 'center' },
- { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
- { title: '类别', dataIndex: 'tostalP', align: 'center' },
- { title: '数量', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
- { title: '单位', dataIndex: 'mementPay', align: 'center' },
- { title: '成本小计', dataIndex: 'totalNums', align: 'center' },
- { title: '调出仓位', dataIndex: 'shDate', align: 'center' },
- { title: '调入仓位', dataIndex: 'shDsate', align: 'center' },
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
- // const data = res.data
- // const no = (data.pageNo - 1) * data.pageSize
- // for (var i = 0; i < data.list.length; i++) {
- // data.list[i].no = no + i + 1
- // }
- // this.disabled = false
- // return data
- // })
- const _this = this
- return new Promise(function(resolve, reject){
- const data = {
- pageNo: 1,
- pageSize: 10,
- list: [
- { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
- ],
- count: 10
- }
- const no = (data.pageNo - 1) * data.pageSize
- for (var i = 0; i < data.list.length; i++) {
- data.list[i].no = no + i + 1
- }
- _this.disabled = false
- resolve(data)
- })
- },
- }
- },
- methods: {
- // 返回列表
- handleBack(){
- this.$router.push({ path: '/inventoryManagement/warehouseAllocation/list'})
- },
- // 导出
- handleExport () {
- const params = this.queryParam
- if (this.oldTime && this.oldTime.length > 0) {
- params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
- params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
- } else {
- params.beginOldExpiryDate = ''
- params.endOldExpirydDate = ''
- }
- if (this.newTime && this.newTime.length > 0) {
- params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
- params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
- } else {
- params.beginDate = ''
- params.endDate = ''
- }
- this.exportLoading = true
- customerBundleExportDelay(params).then(res => {
- this.exportLoading = false
- this.download(res)
- })
- },
- download (data) {
- if (!data) { return }
- const url = window.URL.createObjectURL(new Blob([data]))
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- const a = moment().format('YYYYMMDDHHmmss')
- const fname = '仓库调拨' + a
- link.setAttribute('download', fname + '.xlsx')
- document.body.appendChild(link)
- link.click()
- }
- }
- }
- </script>
- <style lang="less">
- .warehouseAllocationDetail-cont, .warehouseAllocationDetail-back{
- margin-bottom: 15px;
- }
- </style>
|