|
|
@@ -39,8 +39,16 @@
|
|
|
<span :style="{ color: row.direction === 1 ? '#67c23a' : '#f56c6c' }">{{ row.direction === 1 ? '+' : '-' }}{{ row.quantity }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="beforeStock" label="变动前" width="70" />
|
|
|
- <el-table-column prop="afterStock" label="变动后" width="70" />
|
|
|
+ <el-table-column prop="beforeStock" label="变动前" width="70">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('beforeStock', $event)">变动前<span v-if="sortIndex('beforeStock') !== null" class="sort-index" :class="sortClass('beforeStock') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('beforeStock') }}</span>{{ sortIcon('beforeStock') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="afterStock" label="变动后" width="70">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('afterStock', $event)">变动后<span v-if="sortIndex('afterStock') !== null" class="sort-index" :class="sortClass('afterStock') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('afterStock') }}</span>{{ sortIcon('afterStock') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" min-width="150" show-overflow-tooltip />
|
|
|
<el-table-column prop="createdAt" label="时间" width="160">
|
|
|
<template slot-scope="{ row }">{{ formatTime ? formatTime(row.createdAt) : row.createdAt }}</template>
|
|
|
@@ -55,15 +63,27 @@
|
|
|
<!-- 入库单 -->
|
|
|
<el-tab-pane label="入库单" name="inbound">
|
|
|
<el-table :data="inboundList" v-loading="inboundLoading" border stripe max-height="500">
|
|
|
- <el-table-column prop="orderNo" label="入库单号" width="180" />
|
|
|
- <el-table-column prop="supplierName" label="供应商" width="120" />
|
|
|
+ <el-table-column prop="orderNo" label="入库单号" width="180">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('orderNo', $event)">入库单号<span v-if="sortIndex('orderNo') !== null" class="sort-index" :class="sortClass('orderNo') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('orderNo') }}</span>{{ sortIcon('orderNo') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="supplierName" label="供应商" width="120">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('supplierName', $event)">供应商<span v-if="sortIndex('supplierName') !== null" class="sort-index" :class="sortClass('supplierName') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('supplierName') }}</span>{{ sortIcon('supplierName') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="入库日期" width="100">
|
|
|
<template slot-scope="{ row }">{{ row.inboundDate || '-' }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="总金额" width="100">
|
|
|
<template slot-scope="{ row }">{{ row.totalAmount ? '¥' + (row.totalAmount / 100).toFixed(2) : '-' }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="totalItems" label="商品项数" width="80" />
|
|
|
+ <el-table-column prop="totalItems" label="商品项数" width="80">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('totalItems', $event)">商品项数<span v-if="sortIndex('totalItems') !== null" class="sort-index" :class="sortClass('totalItems') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('totalItems') }}</span>{{ sortIcon('totalItems') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="状态" width="90">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-tag :type="row.status === 'completed' ? 'success' : row.status === 'cancelled' ? 'info' : 'warning'" size="mini">
|
|
|
@@ -71,7 +91,12 @@
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="createdAt" label="创建时间" width="160" />
|
|
|
+ <el-table-column prop="createdAt" label="创建时间" width="160">
|
|
|
+ <template slot-scope="{ row }">{{ formatTime ? formatTime(row.createdAt) : row.createdAt }}</template>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('createdAt', $event)">创建时间<span v-if="sortIndex('createdAt') !== null" class="sort-index" :class="sortClass('createdAt') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('createdAt') }}</span>{{ sortIcon('createdAt') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" width="200" fixed="right">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-button size="mini" @click="showInboundDetail(row)">详情</el-button>
|
|
|
@@ -102,15 +127,27 @@
|
|
|
<el-tab-pane label="出库单" name="outbound">
|
|
|
<el-button type="primary" size="mini" @click="showCreateOutbound = true" style="margin-bottom:12px;">新建出库单</el-button>
|
|
|
<el-table :data="outboundList" v-loading="outboundLoading" border stripe max-height="500">
|
|
|
- <el-table-column prop="id" label="ID" width="60" />
|
|
|
+ <el-table-column prop="id" label="ID" width="60">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('id', $event)">ID<span v-if="sortIndex('id') !== null" class="sort-index" :class="sortClass('id') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('id') }}</span>{{ sortIcon('id') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="商品" min-width="150">
|
|
|
<template slot-scope="{ row }">{{ row.productName || 'ID:' + row.productId }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="数量" width="70">
|
|
|
<template slot-scope="{ row }"><span style="color:#f56c6c;">-{{ row.quantity }}</span></template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="remark" label="出库原因" min-width="200" show-overflow-tooltip />
|
|
|
- <el-table-column prop="createdAt" label="时间" width="160" />
|
|
|
+ <el-table-column prop="remark" label="出库原因" min-width="200" show-overflow-tooltip>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('remark', $event)">出库原因<span v-if="sortIndex('remark') !== null" class="sort-index" :class="sortClass('remark') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('remark') }}</span>{{ sortIcon('remark') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="createdAt" label="时间" width="160">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('createdAt', $event)">时间<span v-if="sortIndex('createdAt') !== null" class="sort-index" :class="sortClass('createdAt') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('createdAt') }}</span>{{ sortIcon('createdAt') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination @size-change="outboundPageSize=$event;loadOutboundList()" @current-change="outboundPage=$event;loadOutboundList()" :current-page="outboundPage" :page-sizes="[10,20,50]" :page-size="outboundPageSize" :total="outboundTotal" layout="total, sizes, prev, pager, next, jumper" class="pagination-wrap" />
|
|
|
</el-tab-pane>
|
|
|
@@ -119,7 +156,11 @@
|
|
|
<el-tab-pane label="盘点记录" name="counting">
|
|
|
<el-button type="primary" size="mini" @click="showCreateCounting = true" style="margin-bottom:12px;">新建盘点</el-button>
|
|
|
<el-table :data="countingList" v-loading="countingLoading" border stripe max-height="500">
|
|
|
- <el-table-column prop="id" label="ID" width="60" />
|
|
|
+ <el-table-column prop="id" label="ID" width="60">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('id', $event)">ID<span v-if="sortIndex('id') !== null" class="sort-index" :class="sortClass('id') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('id') }}</span>{{ sortIcon('id') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="系统库存" width="80">
|
|
|
<template slot-scope="{ row }">{{ row.expectedStock }}</template>
|
|
|
</el-table-column>
|
|
|
@@ -136,8 +177,16 @@
|
|
|
<el-tag :type="row.status === 'confirmed' ? 'success' : 'warning'" size="mini">{{ row.status === 'confirmed' ? '已确认' : '待确认' }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="remark" label="备注" min-width="150" />
|
|
|
- <el-table-column prop="createdAt" label="时间" width="160" />
|
|
|
+ <el-table-column prop="remark" label="备注" min-width="150" show-overflow-tooltip>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('remark', $event)">备注<span v-if="sortIndex('remark') !== null" class="sort-index" :class="sortClass('remark') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('remark') }}</span>{{ sortIcon('remark') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="createdAt" label="时间" width="160">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('createdAt', $event)">时间<span v-if="sortIndex('createdAt') !== null" class="sort-index" :class="sortClass('createdAt') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('createdAt') }}</span>{{ sortIcon('createdAt') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" width="100" fixed="right">
|
|
|
<template slot-scope="{ row }">
|
|
|
<el-button v-if="row.status === 'pending'" size="mini" type="success" @click="handleConfirmCounting(row)">确认</el-button>
|
|
|
@@ -243,7 +292,7 @@ export default {
|
|
|
outboundList: [], outboundLoading: false, outboundPage: 1, outboundPageSize: 20, outboundTotal: 0,
|
|
|
showCreateOutbound: false, outboundProductOptions: [], outboundSkuOptions: [],
|
|
|
outboundForm: { productId: '', skuId: '', quantity: 1, reason: '', remark: '' },
|
|
|
- sortableColumns: { id: 'ID', createdAt: '时间' }
|
|
|
+ sortableColumns: { id: 'ID', createdAt: '时间', beforeStock: '变动前', afterStock: '变动后', orderNo: '入库单号', supplierName: '供应商', totalItems: '商品项数', remark: '备注' }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|