|
@@ -1,8 +1,395 @@
|
|
<template>
|
|
<template>
|
|
|
|
+ <a-card size="small" :bordered="false" class="replenishmentManagementList-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" @change="dateChange" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="补货单号"><a-input id="replenishmentManagementList-settleNo" v-model.trim="queryParam.settleNo" allowClear placeholder="请输入补货单号" /></a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="货架名称">
|
|
|
|
+ <custList ref="custList" @change="custChange" :itemSn="queryParam.customerSn"></custList>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <template v-if="advanced">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="产品编码"><a-input id="replenishmentManagementList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号" /></a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="产品名称">
|
|
|
|
+ <a-input id="replenishmentManagementList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入商户名称" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </template>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <span class="table-page-search-submitButtons">
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="replenishmentManagementList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="replenishmentManagementList-reset">重置</a-button>
|
|
|
|
+ <a @click="advanced = !advanced" style="margin-left: 5px">
|
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'" />
|
|
|
|
+ </a>
|
|
|
|
+ </span>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 标签页 -->
|
|
|
|
+ <a-tabs type="card" v-model="queryParam.bizType" @change="handleTabChange" class="replenishmentManagementList-tabs ">
|
|
|
|
+ <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
|
|
|
|
+ <span slot="tab">{{ item.bizName }}({{ item.countNum }})</span>
|
|
|
|
+ </a-tab-pane>
|
|
|
|
+ </a-tabs>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <!-- <s-table
|
|
|
|
+ class="sTable fixPagination"
|
|
|
|
+ ref="table"
|
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ @expand="expandFun"
|
|
|
|
+ :expandRowByClick="true"
|
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
|
+ :expandIcon="(props) => this.customExpandIcon(props)"
|
|
|
|
+ :showPagination="false"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered> -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable fixPagination"
|
|
|
|
+ ref="table"
|
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ @expand="expandFun"
|
|
|
|
+ :expandRowByClick="true"
|
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
|
+ :showPagination="false"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered>
|
|
|
|
+ <a-table
|
|
|
|
+ slot="expandedRowRender"
|
|
|
|
+ slot-scope="record, index"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="subColumns"
|
|
|
|
+ :data-source="listData[index].subList"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </a-table>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click.stop="handleConfirm(record)">确认</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click.stop="handlePrintSticker(record)">打印贴签</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click.stop="handleOutWarehousing(record)">出库</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click.stop="handlePutWarehousing(record)">入库</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click.stop="handleCancelOrder(record)">取消补货单</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
|
|
+ <!-- 确认 -->
|
|
|
|
+ <confirm-modal :openModal="openConfirmModal" :nowData="nowData" @ok="handleValidate" @close="handleCancel" />
|
|
|
|
+ <!-- 库存不足,确认弹框 -->
|
|
|
|
+ <stock-modal :openModal="openStockModal" :nowData="nowData" @ok="handleStockOk" @close="handleStockCancel" />
|
|
|
|
+ <!-- 打印贴签 -->
|
|
|
|
+ <print-sticker-modal :openModal="openPrintStickerModal" :nowData="nowData" @ok="handlePrintStickerOk" @close="handleCancel" />
|
|
|
|
+ <!-- 出库 -->
|
|
|
|
+ <out-warehousing-modal :openModal="openOutWarehousingModal" :nowData="nowData" @ok="handleValidate" @close="handleCancel" />
|
|
|
|
+ <!-- 入库 -->
|
|
|
|
+ <put-warehousing-modal :openModal="openPutWarehousingModal" :nowData="nowData" @ok="handlePutWarehousingOk" @close="handleCancel" />
|
|
|
|
+ </a-spin>
|
|
|
|
+ </a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
|
+import confirmModal from './confirmModal.vue'
|
|
|
|
+import stockModal from './stockModal.vue'
|
|
|
|
+import printStickerModal from './printStickerModal.vue'
|
|
|
|
+import outWarehousingModal from './outWarehousingModal.vue'
|
|
|
|
+import putWarehousingModal from './putWarehousingModal.vue'
|
|
|
|
+import { settleReceiptQuery, queryByTypeSum } from '@/api/settleReceipt'
|
|
|
|
+import { storeCallOutTypeList } from '@/api/storeCallOutType'
|
|
|
|
+export default {
|
|
|
|
+ components: { STable, VSelect, rangeDate, custList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal },
|
|
|
|
+ mixins: [commonMixin],
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ spinning: false,
|
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
|
+ tableHeight: 0,
|
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
+ curBizType: 'ALL',
|
|
|
|
+ queryParam: {
|
|
|
|
+ bizType: 'ALL',
|
|
|
|
+ beginDate: null,
|
|
|
|
+ endDate: null,
|
|
|
|
+ customerSn: undefined,
|
|
|
|
+ billStatus: undefined
|
|
|
|
+ },
|
|
|
|
+ columns: [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '补货单号', dataIndex: 'salesBfillNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '货架名称', dataIndex: 'dealerProductEntity.name', width: '21%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '状态', dataIndex: 'salesBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '补货应发总量', dataIndex: 'qsty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '实发总量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '入库总量', dataIndex: 'qtssy', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '18%', align: 'center' }
|
|
|
|
+ ],
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ this.disabled = true
|
|
|
|
+ this.spinning = true
|
|
|
|
+ return settleReceiptQuery(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
|
|
|
|
+ data.list[i].subList = []
|
|
|
|
+ }
|
|
|
|
+ this.listData = data.list || []
|
|
|
|
+ this.disabled = false
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ subColumns: [
|
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'salesBilslNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'name', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '补货应发总量', dataIndex: 'qsty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '实发总量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '入库总量', dataIndex: 'qtssy', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'salesBisslslNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
+ ],
|
|
|
|
+ listData: [],
|
|
|
|
+ tabPaneData: [],
|
|
|
|
+ nowData: null,
|
|
|
|
+ openConfirmModal: false,
|
|
|
|
+ openStockModal: false,
|
|
|
|
+ openPrintStickerModal: false,
|
|
|
|
+ openOutWarehousingModal: false,
|
|
|
|
+ openPutWarehousingModal: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 确认
|
|
|
|
+ handleConfirm (row) {
|
|
|
|
+ this.nowData = row
|
|
|
|
+ this.openConfirmModal = true
|
|
|
|
+ },
|
|
|
|
+ // 确认 ok
|
|
|
|
+ handleConfirmOk () {
|
|
|
|
+ // 校验产品库存是否足够
|
|
|
|
+ this.openStockModal = true
|
|
|
|
+ },
|
|
|
|
+ // cancel
|
|
|
|
+ handleCancel () {
|
|
|
|
+ this.nowData = null
|
|
|
|
+ this.openConfirmModal = false
|
|
|
|
+ this.openStockModal = false
|
|
|
|
+ this.openPrintStickerModal = false
|
|
|
|
+ this.openOutWarehousingModal = false
|
|
|
|
+ this.openPutWarehousingModal = false
|
|
|
|
+ },
|
|
|
|
+ // 库存不足 确认 ok
|
|
|
|
+ handleStockOk () {
|
|
|
|
+ this.openStockModal = false
|
|
|
|
+ this.openConfirmModal = false
|
|
|
|
+ this.openOutWarehousingModal = false
|
|
|
|
+ },
|
|
|
|
+ // 库存不足 确认 cancel
|
|
|
|
+ handleStockCancel () {
|
|
|
|
+ this.openStockModal = false
|
|
|
|
+ },
|
|
|
|
+ // 打印贴签
|
|
|
|
+ handlePrintSticker (row) {
|
|
|
|
+ this.nowData = row
|
|
|
|
+ this.openPrintStickerModal = true
|
|
|
|
+ },
|
|
|
|
+ // 打印贴签 ok
|
|
|
|
+ handlePrintStickerOk () {},
|
|
|
|
+ // 出库
|
|
|
|
+ handleOutWarehousing (row) {
|
|
|
|
+ this.nowData = row
|
|
|
|
+ this.openOutWarehousingModal = true
|
|
|
|
+ },
|
|
|
|
+ // 出库 ok
|
|
|
|
+ handleOutWarehousingOk () {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ handleValidate (type) {
|
|
|
|
+ // 校验产品库存是否足够
|
|
|
|
+ this.openStockModal = true
|
|
|
|
+ },
|
|
|
|
+ // 入库
|
|
|
|
+ handlePutWarehousing (row) {
|
|
|
|
+ this.nowData = row
|
|
|
|
+ this.openPutWarehousingModal = true
|
|
|
|
+ },
|
|
|
|
+ // 入库 ok
|
|
|
|
+ handlePutWarehousingOk () {
|
|
|
|
+ this.openPutWarehousingModal = false
|
|
|
|
+ },
|
|
|
|
+ // 取消补货单
|
|
|
|
+ handleCancelOrder (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认取消补货单吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ // _this.spinning = true
|
|
|
|
+ // storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).then(res => {
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // _this.$message.success(res.message)
|
|
|
|
+ // _this.$refs.table.refresh()
|
|
|
|
+ // _this.spinning = false
|
|
|
|
+ // } else {
|
|
|
|
+ // _this.spinning = false
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 自定义展开图标
|
|
|
|
+ customExpandIcon (props) {
|
|
|
|
+ if (props.expanded) {
|
|
|
|
+ return <a style={{ color: 'black', marginRight: 8 }} onClick={e => { props.onExpand(props.record, e) }}><a-button size="small" type="link" class="button-primary">收起</a-button></a>
|
|
|
|
+ } else {
|
|
|
|
+ return <a style={{ color: 'black', marginRight: 8 }} onClick={e => { props.onExpand(props.record, e) }}><a-button size="small" type="link" class="button-primary">展开</a-button></a>
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ expandFun (expanded, record) {
|
|
|
|
+ if (expanded) {
|
|
|
|
+ this.getSubItem(record) // 获取表格内部数据
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 获取子节点数据
|
|
|
|
+ getSubItem (record) {
|
|
|
|
+ this.spinning = true
|
|
|
|
+ storeCallOutTypeList({ pageNo: 1, pageSize: 20 }).then(res => {
|
|
|
|
+ const ind = this.listData.findIndex(item => item.id == record.id)
|
|
|
|
+ if (ind >= 0) {
|
|
|
|
+ // if (res.status == 200 && res.data && res.data.length) {
|
|
|
|
+ if (res.status == 200 && res.data && res.data.list.length) {
|
|
|
|
+ // this.listData[ind].subList = res.data
|
|
|
|
+ this.listData[ind].subList = res.data.list
|
|
|
|
+ } else {
|
|
|
|
+ this.listData[ind].subList = []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 重置
|
|
|
|
+ resetSearchForm () {
|
|
|
|
+ this.resetData()
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ },
|
|
|
|
+ // 重置数据
|
|
|
|
+ resetData () {
|
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
|
+ this.queryParam.bizType = this.curBizType
|
|
|
|
+ this.queryParam.customerSn = undefined
|
|
|
|
+ this.queryParam.beginDate = null
|
|
|
|
+ this.queryParam.endDate = null
|
|
|
|
+ },
|
|
|
|
+ // 时间 change
|
|
|
|
+ dateChange (date) {
|
|
|
|
+ this.queryParam.beginDate = date[0] || null
|
|
|
|
+ this.queryParam.endDate = date[1] || null
|
|
|
|
+ },
|
|
|
|
+ // 选择类型
|
|
|
|
+ handleTabChange (key) {
|
|
|
|
+ this.queryParam.bizType = key
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ this.curBizType = key
|
|
|
|
+ },
|
|
|
|
+ // 客户 change
|
|
|
|
+ custChange (obj) {
|
|
|
|
+ this.queryParam.customerSn = obj.key || undefined
|
|
|
|
+ },
|
|
|
|
+ // 获取类型
|
|
|
|
+ queryByTypeSum () {
|
|
|
|
+ queryByTypeSum({}).then(res => {
|
|
|
|
+ if (res.data && res.status == 200) {
|
|
|
|
+ this.tabPaneData = res.data
|
|
|
|
+ this.queryParam.bizType = res.data[0].bizType
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ setTableH () {
|
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 240
|
|
|
|
+ },
|
|
|
|
+ pageInit () {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
|
+ _this.setTableH()
|
|
|
|
+ })
|
|
|
|
+ this.queryByTypeSum()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ 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.resetData()
|
|
|
|
+ this.pageInit()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated () {
|
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
|
+ this.resetData()
|
|
|
|
+ this.pageInit()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
|
|
+<style lang="less">
|
|
|
|
+ .replenishmentManagementList-wrap{
|
|
|
|
+ .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-bar{
|
|
|
|
+ margin: 0 0 10px 0!important;
|
|
|
|
+ }
|
|
|
|
+ .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
|
|
|
|
+ height: 30px!important;
|
|
|
|
+ }
|
|
|
|
+ .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
|
|
|
|
+ height: 30px!important;
|
|
|
|
+ }
|
|
|
|
+ .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
|
|
|
|
+ line-height: 26px!important;
|
|
|
|
+ height: 30px!important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|