123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <template>
- <a-card size="small" :bordered="false" class="signWarehousingList-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="创建时间">
- <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="采购单号">
- <a-input id="signWarehousingList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="发货单号">
- <a-input id="signWarehousingList-sendBillNo" v-model.trim="queryParam.sendBillNo" allowClear placeholder="请输入发货单号"/>
- </a-form-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="业务状态">
- <v-select
- v-model="queryParam.auditState"
- ref="auditState"
- id="chainTransferOutList-auditState"
- code="RECEIVING_BILL_STATUS"
- placeholder="请选择业务状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="signWarehousingList-refresh">查询</a-button>
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="signWarehousingList-reset">重置</a-button>
- <a @click="advanced=!advanced" style="margin-left: 5px">
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type="advanced ? 'up' : 'down'"/>
- </a>
- </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="purchaseBillNo" slot-scope="text, record">
- <span class="table-td-link" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo || '--' }}</span>
- <span v-else>{{ record.purchaseBillNo || '--' }}</span>
- </template>
- <!-- 发货单号 -->
- <template slot="sendBillNo" slot-scope="text, record">
- <span class="table-td-link" v-if="$hasPermissions('B_signWarehousingDetail')" @click="handleStockDetail(record)">{{ record.sendBillNo || '--' }}</span>
- <span v-else>{{ record.sendBillNo || '--' }}</span>
- </template>
- <!-- 审核 -->
- <template slot="audit" slot-scope="text, record">
- <stateIcon :title="record.auditStateDictValue" v-if="record.auditState!='PUT_WAREHOUSE_AUDIT_REJECT'" :state="record.auditState == 'FINISH'?'1':'2'"></stateIcon>
- <stateIcon :title="record.auditStateDictValue" v-else :state="0"></stateIcon>
- </template>
- <!-- 入库 -->
- <template slot="waitIn" slot-scope="text, record">
- <stateIcon :title="record.auditStateDictValue" :state="record.auditState == 'FINISH'?'1':'2'"></stateIcon>
- </template>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button
- size="small"
- type="link"
- class="button-primary"
- v-if="(record.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT' || record.auditState == 'WAIT_PUT_WAREHOUSE')&&$hasPermissions('B_signWarehousingSign')"
- @click="handleWarehouse(record)"
- >签收入库</a-button>
- <span v-if="!((record.auditState == 'PUT_WAREHOUSE_AUDIT_REJECT' || record.auditState == 'WAIT_PUT_WAREHOUSE')&&$hasPermissions('B_signWarehousingSign'))">--</span>
- </template>
- </s-table>
- </a-spin>
- </a-card>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { STable, VSelect } from '@/components'
- import rangeDate from '@/views/common/rangeDate.vue'
- import stateIcon from '@/views/common/stateIcon'
- import getDate from '@/libs/getDate.js'
- import { receivingStockList } from '@/api/receiving'
- export default {
- name: 'SignWarehousingList',
- components: { STable, VSelect, rangeDate, stateIcon },
- mixins: [commonMixin],
- data () {
- return {
- spinning: false,
- advanced: true, // 高级搜索 展开/关闭
- time: [
- getDate.getCurrMonthDays().starttime,
- getDate.getCurrMonthDays().endtime
- ],
- queryParam: { // 查询条件
- beginDate: getDate.getCurrMonthDays().starttime,
- endDate: getDate.getCurrMonthDays().endtime,
- purchaseBillNo: '', // 采购单号
- sendBillNo: '', // 发货单号
- auditState: undefined
- },
- disabled: false, // 查询、重置按钮是否可操作
- tableHeight: 0,
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- return receivingStockList(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
- this.spinning = false
- return data
- })
- },
- purchaseTragetType: []
- }
- },
- computed: {
- columns () {
- const _this = this
- const arr = [
- { title: '采购单号', scopedSlots: { customRender: 'purchaseBillNo' }, width: '14%', align: 'center' },
- { title: '发货单号', scopedSlots: { customRender: 'sendBillNo' }, width: '14%', align: 'center' },
- { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '发货数量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '入库数量', dataIndex: 'totalRealPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '入库时间', dataIndex: 'stockPutTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '业务状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '入库', scopedSlots: { customRender: 'waitIn' }, width: '3%', align: 'center' },
- { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
- ]
- if (this.$hasPermissions('M_ShowAllCost')) {
- arr.splice(4, 0, { title: '发货金额', dataIndex: 'totalPutAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
- arr.splice(6, 0, { title: '入库金额', dataIndex: 'totalRealPutAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
- }
- return arr
- }
- },
- methods: {
- // 时间 change
- dateChange (date) {
- this.queryParam.beginDate = date[0]
- this.queryParam.endDate = date[1]
- },
- // 重置
- resetSearchForm () {
- this.$refs.rangeDate.resetDate(this.time)
- this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
- this.queryParam.endDate = getDate.getCurrMonthDays().endtime
- this.queryParam.purchaseBillNo = ''
- this.queryParam.sendBillNo = ''
- this.queryParam.auditState = undefined
- this.$refs.table.refresh(true)
- },
- // 详情
- handleDetail (row) {
- this.$router.push({ path: `/purchasingManagement/purchaseOrder/detail/${row.purchaseBillSn}`, query: { pageType: 'signWarehousingList' } })
- },
- // 备货单详情
- handleStockDetail (row) {
- this.$router.push({ path: `/purchasingManagement/signWarehousing/stockOrderDetail/${row.receivingBillSn}` })
- },
- // 签收入库
- handleWarehouse (row) {
- this.$router.push({ path: `/purchasingManagement/signWarehousing/edit/${row.receivingBillSn}` })
- },
- pageInit () {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- setTableH () {
- const tableSearchH = this.$refs.tableSearch.offsetHeight
- this.tableHeight = window.innerHeight - tableSearchH - 200
- }
- },
- watch: {
- advanced (newValue, oldValue) {
- const _this = this
- this.$nextTick(() => { // 页面渲染完成后的回调
- _this.setTableH()
- })
- },
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
- this.setTableH()
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
- this.pageInit()
- this.resetSearchForm()
- }
- },
- activated () {
- // 如果是新页签打开,则重置当前页面
- if (this.$store.state.app.isNewTab) {
- this.pageInit()
- this.resetSearchForm()
- }
- // 仅刷新列表,不重置页面
- if (this.$store.state.app.updateList) {
- this.pageInit()
- this.$refs.table.refresh()
- }
- },
- beforeRouteEnter (to, from, next) {
- next(vm => {})
- }
- }
- </script>
|