123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <a-card size="small" :bordered="false" class="supervisionDiskList-wrap">
- <a-spin :spinning="spinning" tip="Loading...">
- <!-- 搜索条件 -->
- <div ref="tableSearch" class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-item label="盘点单号">
- <a-input id="supervisionDiskList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="supervisionDiskList-refresh">查询</a-button>
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="supervisionDiskList-reset">重置</a-button>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 列表 -->
- <s-table
- class="sTable fixPagination"
- ref="table"
- :style="{ height: tableHeight+84.5+'px' }"
- size="small"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- :scroll="{ y: tableHeight }"
- :defaultLoadData="false"
- bordered>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- v-if="$hasPermissions('B_supervisionDiskCheck')"
- class="button-info"
- @click="handleCheck(record)"
- id="supervisionDiskList-audit-btn">监盘</a-button>
- <span v-else>--</span>
- </template>
- </s-table>
- </a-spin>
- </a-card>
- </template>
- <script>
- import { STable, VSelect } from '@/components'
- import { checkWarehouseList } from '@/api/checkWarehouse'
- export default {
- components: { STable, VSelect },
- data () {
- return {
- spinning: false,
- tableHeight: 0,
- disabled: false, // 查询、重置按钮是否可操作
- queryParam: { // 查询条件
- deleteFlag: '0',
- checkWarehouseNo: ''
- },
- columns: [
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
- { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '15%', align: 'center' },
- { title: '盘点状态', dataIndex: 'checkStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '盘点人', dataIndex: 'checkPersonName', align: 'center', width: '12%', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '盘点时间', dataIndex: 'checkTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '监盘状态', dataIndex: 'checkSuperviseStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品款数', dataIndex: 'productTotalCategory', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '库存数量', dataIndex: 'totalStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '盘点数量', dataIndex: 'checkTotalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '监盘数量', dataIndex: 'checkSuperviseTotalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '监盘盈亏数量', dataIndex: 'totalProfitLossQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- return checkWarehouseList(Object.assign(parameter, this.queryParam, { state: 'WAIT_SUPERVISE_CHECK' })).then(res => {
- let data
- if (res.status == 200) {
- 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
- }
- this.spinning = false
- return data
- })
- }
- }
- },
- methods: {
- // 监盘
- handleCheck (row) {
- this.$router.push({ path: `/inventoryManagement/supervisionDisk/check/${row.checkWarehouseSn}` })
- },
- resetSearchForm () {
- this.queryParam.checkWarehouseNo = ''
- this.$refs.table.refresh(true)
- },
- pageInit () {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- setTableH () {
- this.tableHeight = window.innerHeight - 240
- }
- },
- watch: {
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
- this.setTableH()
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
- this.pageInit()
- this.$refs.table.refresh(true)
- }
- },
- activated () {
- // 如果是新页签打开,则重置当前页面
- if (this.$store.state.app.isNewTab) {
- this.pageInit()
- this.$refs.table.refresh(true)
- }
- // 仅刷新列表,不重置页面
- if (this.$store.state.app.updateList) {
- this.pageInit()
- this.$refs.table.refresh()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {
- const _this = vm
- if (vm.$route.query.isRefresh) {
- setTimeout(() => {
- _this.$refs.table.refresh(true)
- }, 300)
- }
- })
- }
- }
- </script>
- <style lang="less">
- .supervisionDiskList-wrap{
- .active{
- color: #ed1c24;
- cursor: pointer;
- }
- .common{
- color: rgba(0, 0, 0, 0.65);
- }
- }
- </style>
|