|
@@ -15,13 +15,12 @@
|
|
|
@keyup.enter.native="handleSearch" >
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="日期" prop="month">
|
|
|
+ <a-form-model-item label="日期" prop="billDate">
|
|
|
<a-month-picker
|
|
|
- v-model="queryParam.month"
|
|
|
+ v-model="queryParam.billDate"
|
|
|
:disabled-date="disabledDate"
|
|
|
:allowClear="false"
|
|
|
@change="onChange"
|
|
|
- :defaultValue="moment().subtract(1, 'month')"
|
|
|
style="width: 100%;" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -35,6 +34,7 @@
|
|
|
@click="handleExport"
|
|
|
:disabled="disabled"
|
|
|
:loading="exportLoading"
|
|
|
+ v-if="$hasPermissions('B_storeReceivedSendStorageReport_export')"
|
|
|
id="storeReceivedSendStorageReportList-export">导出</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -45,19 +45,12 @@
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
+ :rowKey="(record) => record.no"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
+ :showPagination="false"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
- <template slot="footer">
|
|
|
- <a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">期初余额成本:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
|
|
|
- <a-col :md="6" :sm="24">入库成本:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
|
|
|
- <a-col :md="6" :sm="24">出库成本:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
|
|
|
- <a-col :md="6" :sm="24">月末余额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
|
|
|
- </a-row>
|
|
|
- </template>
|
|
|
</s-table>
|
|
|
</a-spin>
|
|
|
</a-card>
|
|
@@ -68,7 +61,7 @@ import moment from 'moment'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
-import { reportChainSalesBillDetailList, linkageGroupList } from '@/api/reportData'
|
|
|
+import { reportStockPutOutMonthList, reportStockPutOutMonthExport } from '@/api/reportData'
|
|
|
export default {
|
|
|
components: { STable, VSelect, rangeDate },
|
|
|
data () {
|
|
@@ -79,31 +72,42 @@ export default {
|
|
|
wrapperCol: { span: 16 },
|
|
|
tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- month: moment().subtract(1, 'month').format('YYYY-MM')
|
|
|
+ billDate: null
|
|
|
},
|
|
|
rules: {
|
|
|
- 'month': [{ required: true, message: '请选择月份', trigger: 'change' }]
|
|
|
+ 'billDate': [{ required: true, message: '请选择月份', trigger: 'change' }]
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false,
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '序号', dataIndex: 'no', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '期初余额',
|
|
|
align: 'center',
|
|
|
children: [
|
|
|
{
|
|
|
title: '明细',
|
|
|
- dataIndex: 'ngkAmount',
|
|
|
+ dataIndex: 'beginDetail',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return text || '--' }
|
|
|
+ width: '9%'
|
|
|
},
|
|
|
{
|
|
|
title: '成本',
|
|
|
- dataIndex: 'flpAmount',
|
|
|
+ dataIndex: 'beginAmount',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
|
|
|
+ width: '14%',
|
|
|
+ customRender: function (text, record) {
|
|
|
+ let str
|
|
|
+ if (record.beginDetail) {
|
|
|
+ if (text || text == 0) {
|
|
|
+ str = '¥' + text
|
|
|
+ } else {
|
|
|
+ str = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -112,17 +116,28 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
title: '明细',
|
|
|
- dataIndex: 'ngkAmo3unt',
|
|
|
+ dataIndex: 'putDetail',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return text || '--' }
|
|
|
+ width: '9%'
|
|
|
},
|
|
|
{
|
|
|
title: '成本',
|
|
|
- dataIndex: 'flpAmo4unt',
|
|
|
+ dataIndex: 'putAmount',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
|
|
|
+ width: '14%',
|
|
|
+ customRender: function (text, record) {
|
|
|
+ let str
|
|
|
+ if (record.putDetail) {
|
|
|
+ if (text || text == 0) {
|
|
|
+ str = '¥' + text
|
|
|
+ } else {
|
|
|
+ str = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -131,17 +146,28 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
title: '明细',
|
|
|
- dataIndex: 'ngkwAmount',
|
|
|
+ dataIndex: 'outDetail',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return text || '--' }
|
|
|
+ width: '9%'
|
|
|
},
|
|
|
{
|
|
|
title: '成本',
|
|
|
- dataIndex: 'flpAmrount',
|
|
|
+ dataIndex: 'outAmount',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
|
|
|
+ width: '14%',
|
|
|
+ customRender: function (text, record) {
|
|
|
+ let str
|
|
|
+ if (record.outDetail) {
|
|
|
+ if (text || text == 0) {
|
|
|
+ str = '¥' + text
|
|
|
+ } else {
|
|
|
+ str = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -150,17 +176,28 @@ export default {
|
|
|
children: [
|
|
|
{
|
|
|
title: '明细',
|
|
|
- dataIndex: 'ngkAtmount',
|
|
|
+ dataIndex: 'endDetail',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return text || '--' }
|
|
|
+ width: '9%'
|
|
|
},
|
|
|
{
|
|
|
title: '成本',
|
|
|
- dataIndex: 'flpAmouunt',
|
|
|
+ dataIndex: 'endAmount',
|
|
|
align: 'center',
|
|
|
- width: '12%',
|
|
|
- customRender: function (text) { return (text || text == 0) ? ('¥' + text) : '--' }
|
|
|
+ width: '14%',
|
|
|
+ customRender: function (text, record) {
|
|
|
+ let str
|
|
|
+ if (record.endDetail) {
|
|
|
+ if (text || text == 0) {
|
|
|
+ str = '¥' + text
|
|
|
+ } else {
|
|
|
+ str = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ str = ''
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -168,18 +205,32 @@ export default {
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- const params = Object.assign(parameter, this.queryParam)
|
|
|
+ const params = JSON.parse(JSON.stringify(this.queryParam))
|
|
|
+ params.billDate = params.billDate + '-01'
|
|
|
this.spinning = true
|
|
|
- return reportChainSalesBillDetailList(params).then(res => {
|
|
|
+ return reportStockPutOutMonthList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
- data = res.data
|
|
|
- // 总计
|
|
|
- this.getCount(params)
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = no + i + 1
|
|
|
+ if (res.data.beginAmountHide) { // 是否隐藏期初金额
|
|
|
+ res.data.beginAmount = null
|
|
|
}
|
|
|
+ if (res.data.endAmountHide) { // 是否隐藏结存金额
|
|
|
+ res.data.endAmount = null
|
|
|
+ }
|
|
|
+ // 组装数据
|
|
|
+ data = [
|
|
|
+ { no: 1, beginDetail: '期初余额', beginAmount: res.data.beginAmount, putDetail: '采购入库', putAmount: res.data.putPurchaseAmount, outDetail: '采购退货', outAmount: res.data.outPurchaseReturnAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 2, beginDetail: null, beginAmount: null, putDetail: '散件入库', putAmount: res.data.putSparePartsAmount, outDetail: '散件退货', outAmount: res.data.outSparePartsReturnAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 3, beginDetail: null, beginAmount: null, putDetail: '销售退货', putAmount: res.data.putSalesReturnAmount, outDetail: '销售', outAmount: res.data.outSalesAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 4, beginDetail: null, beginAmount: null, putDetail: '仓库调入', putAmount: res.data.putWarehouseCallInAmount, outDetail: '仓库调出', outAmount: res.data.outWarehouseCallOutAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 5, beginDetail: null, beginAmount: null, putDetail: '库存盘点盘盈', putAmount: res.data.putStockCheckInAmount, outDetail: '库存盘点盘亏', outAmount: res.data.outCheckOrderOutAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 6, beginDetail: null, beginAmount: null, putDetail: '连锁调入', putAmount: res.data.putLinkageCallInAmount, outDetail: '连锁调出', outAmount: res.data.outLinkageCallOutAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 7, beginDetail: null, beginAmount: null, putDetail: '库存导入', putAmount: res.data.putStockImportAmount, outDetail: null, outAmount: null, endDetail: null, endAmount: null },
|
|
|
+ { no: 8, beginDetail: null, beginAmount: null, putDetail: '散件导入', putAmount: res.data.putSparePartsImportAmount, outDetail: null, outAmount: null, endDetail: null, endAmount: null },
|
|
|
+ { no: 9, beginDetail: null, beginAmount: null, putDetail: null, putAmount: null, outDetail: '店内调出', outAmount: res.data.outShopCallOutAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: 10, beginDetail: null, beginAmount: null, putDetail: null, putAmount: null, outDetail: '急件冲减', outAmount: res.data.outDispatchDeductAmount, endDetail: null, endAmount: null },
|
|
|
+ { no: '成本合计', beginDetail: ' ', beginAmount: res.data.beginAmount, putDetail: ' ', putAmount: res.data.putAmount, outDetail: ' ', outAmount: res.data.outAmount, endDetail: '月末余额', endAmount: res.data.endAmount }
|
|
|
+ ]
|
|
|
this.disabled = false
|
|
|
}
|
|
|
this.spinning = false
|
|
@@ -195,17 +246,7 @@ export default {
|
|
|
},
|
|
|
// 月份 change
|
|
|
onChange (date, dateString) {
|
|
|
- this.queryParam.month = dateString || null
|
|
|
- },
|
|
|
- // 合计
|
|
|
- getCount (params) {
|
|
|
- reportRebateCount(params).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.totalData = res.data
|
|
|
- } else {
|
|
|
- this.totalData = null
|
|
|
- }
|
|
|
- })
|
|
|
+ this.queryParam.billDate = dateString || null
|
|
|
},
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
@@ -220,7 +261,7 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.month = moment().format('YYYY-MM')
|
|
|
+ this.queryParam.billDate = null
|
|
|
this.totalData = null
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
this.$refs.table.clearTable()
|
|
@@ -230,10 +271,11 @@ export default {
|
|
|
const _this = this
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- const params = _this.queryParam
|
|
|
+ const params = JSON.parse(JSON.stringify(this.queryParam))
|
|
|
+ params.billDate = params.billDate + '-01'
|
|
|
_this.exportLoading = true
|
|
|
_this.spinning = true
|
|
|
- reportReceivingBillExport(params).then(res => {
|
|
|
+ reportStockPutOutMonthExport(params).then(res => {
|
|
|
downloadExcel(res, '门店收发存汇总报表')
|
|
|
_this.exportLoading = false
|
|
|
_this.spinning = false
|