|
@@ -1,8 +1,331 @@
|
|
|
<template>
|
|
|
+ <div class="allocateBillList-wrap">
|
|
|
+ <div style="background-color: #fff;margin-bottom: 5px;">
|
|
|
+ <a-tabs v-model="currentTab" @change="changeTab">
|
|
|
+ <a-tab-pane :key="1" tab="全部">
|
|
|
+ </a-tab-pane>
|
|
|
+ <a-tab-pane :key="2" tab="待打印">
|
|
|
+ </a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+ </div>
|
|
|
+ <a-card size="small" :bordered="false">
|
|
|
+ <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="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="调拨类型">
|
|
|
+ <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="收货客户名称">
|
|
|
+ <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="业务状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.state"
|
|
|
+ ref="state"
|
|
|
+ id="allocateBillList-state"
|
|
|
+ code="ALLOCATE_STATUS"
|
|
|
+ placeholder="请选择业务状态"
|
|
|
+ allowClear
|
|
|
+ ></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="调拨单号">
|
|
|
+ <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="打印状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.printState"
|
|
|
+ ref="printState"
|
|
|
+ id="allocateBillList-printState"
|
|
|
+ code="PRINT_STATUS"
|
|
|
+ placeholder="请选择打印状态"
|
|
|
+ allowClear
|
|
|
+ ></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-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"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ bordered>
|
|
|
+ <!-- 单号 -->
|
|
|
+ <template slot="allocateNo" slot-scope="text, record">
|
|
|
+ <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
|
|
|
+ <span v-else>{{ record.allocateNo }}</span>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.printState == 'NO_PRINT'"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handlePrint(record)"
|
|
|
+ id="allocateBillList-printState">调拨分类打印</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-else-if="record.printState == 'PRINT'"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handlePrintRecord(record)"
|
|
|
+ id="allocateBillList-printRecord">打印记录</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+ <!-- 打印导出 -->
|
|
|
+ <print-modal :openModal="openModal" :itemData="itemData" nowType="dbflPrint" @ok="handleOk" @close="openModal=false" />
|
|
|
+ <!-- 打印记录 -->
|
|
|
+ <recordModal ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import moment from 'moment'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
+import printModal from '@/views/allocationManagement/transferOut/printModal.vue'
|
|
|
+import recordModal from './recordModal.vue'
|
|
|
+import { allocateBillList, allocateBillDetailPrint } from '@/api/allocateBill'
|
|
|
+import AllocateType from '@/views/common/allocateType.js'
|
|
|
+import { printFun } from '@/libs/JGPrint.js'
|
|
|
+export default {
|
|
|
+ name: 'TransferOutList',
|
|
|
+ mixins: [commonMixin],
|
|
|
+ components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList, printModal, recordModal },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ tableHeight: 0,
|
|
|
+ itemData: null,
|
|
|
+ showRecordModal: false,
|
|
|
+ time: [
|
|
|
+ moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
+ moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
+ ],
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ beginDate: getDate.getThreeMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ targetName: '', // 调往对象
|
|
|
+ allocateTypeSn: undefined, // 调拨类型
|
|
|
+ state: undefined, // 业务状态
|
|
|
+ allocateNo: '', // 调拨单号
|
|
|
+ receiverSn: undefined,
|
|
|
+ checkStatus: undefined,
|
|
|
+ printState: 'NO_PRINT'
|
|
|
+ },
|
|
|
+ currentTab: 2,
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ return allocateBillList(Object.assign(parameter, this.queryParam)).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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ visibleAudit: false,
|
|
|
+ auditInfo: null,
|
|
|
+ spinningAudit: false,
|
|
|
+ openModal: false // 打印弹框
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ columns () {
|
|
|
+ const arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '13.5%' },
|
|
|
+ { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
+ ]
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ custChange (val) {
|
|
|
+ this.form.receiverSn = val.key || ''
|
|
|
+ this.form.receiverName = val.name || ''
|
|
|
+ },
|
|
|
+ changeTab (v) {
|
|
|
+ this.currentTab = v
|
|
|
+ this.resetSearchForm()
|
|
|
+ },
|
|
|
+ // 创建时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
+ this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
+ this.queryParam.targetName = ''
|
|
|
+ this.queryParam.allocateTypeSn = undefined
|
|
|
+ this.queryParam.state = undefined
|
|
|
+ this.queryParam.allocateNo = ''
|
|
|
+ this.queryParam.receiverName = ''
|
|
|
+ this.queryParam.receiverSn = ''
|
|
|
+ this.queryParam.printState = this.currentTab == 2 ? 'NO_PRINT' : undefined
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 分类打印
|
|
|
+ handlePrint (row) {
|
|
|
+ this.itemData = row
|
|
|
+ this.openModal = true
|
|
|
+ },
|
|
|
+ // 打印记录
|
|
|
+ handlePrintRecord (row) {
|
|
|
+ this.showRecordModal = true
|
|
|
+ this.$refs.recordModal.setData(row, {
|
|
|
+ billType: 'ALLOCATE',
|
|
|
+ billSn: row.allocateSn
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 确定打印
|
|
|
+ handleOk (objs) {
|
|
|
+ const _this = this
|
|
|
+ const params = JSON.parse(JSON.stringify(objs))
|
|
|
+ delete params.type
|
|
|
+ _this.spinning = true
|
|
|
+ printFun(
|
|
|
+ allocateBillDetailPrint,
|
|
|
+ params,
|
|
|
+ objs.isPreview ? 'preview' : 'print',
|
|
|
+ '调拨分类',
|
|
|
+ {
|
|
|
+ billType: 'ALLOCATE',
|
|
|
+ billSn: objs.allocateSn,
|
|
|
+ billNo: objs.allocateNo,
|
|
|
+ printType: '调拨分类打印'
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ _this.spinning = false
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ _this.$message.info(res.message)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ handleDetail (row) {
|
|
|
+ if (this.$hasPermissions('M_transferOut_detail')) {
|
|
|
+ this.$router.push({ path: `/allocationManagement/transferOut/detail/${row.allocateSn}` })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ this.openModal = false
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 240
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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>
|
|
|
-
|
|
|
-<style>
|
|
|
-</style>
|
|
|
+<style lang="less">
|
|
|
+ .allocateBillList-wrap{
|
|
|
+ .ant-tabs-bar{
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|