|
@@ -2,7 +2,7 @@
|
|
|
<a-card size="small" :bordered="false" class="frozenProductReportList-wrap">
|
|
|
<!-- 搜索条件 -->
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
+ <div class="table-page-search-wrapper" ref="tableSearch">
|
|
|
<a-form-model
|
|
|
id="frozenProductReportList-form"
|
|
|
ref="ruleForm"
|
|
@@ -15,41 +15,46 @@
|
|
|
@keyup.enter.native="handleSearch" >
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="冻结生成时间">
|
|
|
+ <a-form-model-item label="冻结生成时间" prop="time">
|
|
|
<rangeDate id="frozenProductReportList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="产品编码">
|
|
|
- <a-input id="frozenProductReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
|
|
|
+ <a-input id="frozenProductReportList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="产品名称">
|
|
|
- <a-input id="frozenProductReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
|
|
|
+ <a-input id="frozenProductReportList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="批次号">
|
|
|
+ <a-input id="frozenProductReportList-name" v-model.trim="queryParam.stockBatchNo" allowClear placeholder="请输入批次号"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<template v-if="advanced">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="关联单据号">
|
|
|
- <a-input id="frozenProductReportList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单据号"/>
|
|
|
+ <a-input id="frozenProductReportList-bizNo" v-model.trim="queryParam.outBizNo" allowClear placeholder="请输入关联单据号"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="单据类型">
|
|
|
<v-select
|
|
|
- v-model="queryParam.bizType"
|
|
|
- ref="bizType"
|
|
|
+ v-model="queryParam.outBizType"
|
|
|
+ ref="outBizType"
|
|
|
:isEnable="true"
|
|
|
- id="frozenProductReportList-bizType"
|
|
|
- code="SETTLE_FLOW_BIZ_TYPE"
|
|
|
+ id="frozenProductReportList-outBizType"
|
|
|
+ code="OUT_STOCK_TYPE"
|
|
|
placeholder="请选择单据类型"
|
|
|
allowClear></v-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="单位名称">
|
|
|
- <a-input id="frozenProductReportList-burName" v-model.trim="queryParam.burName" allowClear placeholder="请输入单位名称"/>
|
|
|
+ <a-input id="frozenProductReportList-demanderName" v-model.trim="queryParam.demanderName" allowClear placeholder="请输入单位名称"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -67,7 +72,7 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
|
|
|
<a-button type="primary" @click="handleSearch" :disabled="disabled" id="frozenProductReportList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="frozenProductReportList-reset">重置</a-button>
|
|
|
<a-button
|
|
@@ -90,10 +95,8 @@
|
|
|
<!-- 列表 -->
|
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
|
<div slot="message">
|
|
|
- 冻结数量:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
|
|
|
- 总成本:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
|
|
|
- 总售价:<strong>{{ totalData&&(totalData.discountAmount || totalData.discountAmount==0) ? toThousands(totalData.discountAmount) : '--' }}</strong>;
|
|
|
- 折后总售价:<strong>{{ totalData&&(totalData.discountedAmount || totalData.discountedAmount==0) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
|
|
|
+ 冻结数量:<strong>{{ totalData&&(totalData.outQty || totalData.outQty==0) ? totalData.outQty : '--' }}</strong>;
|
|
|
+ 总成本:<strong>{{ totalData&&(totalData.totalOutPrice || totalData.totalOutPrice==0) ? toThousands(totalData.totalOutPrice) : '--' }}</strong>;
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
<s-table
|
|
@@ -103,7 +106,8 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1500 }"
|
|
|
+ :style="{ height: tableHeight+84+'px' }"
|
|
|
+ :scroll="{ y: tableHeight}"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
</s-table>
|
|
@@ -113,15 +117,15 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import getDate from '@/libs/getDate.js'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
import ProductType from '../../common/productType.js'
|
|
|
import ProductBrand from '../../common/productBrand.js'
|
|
|
-import moment from 'moment'
|
|
|
+// 接口
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
-import { reportPageList, reportStockPutOutCount, reportStockPutOutExport } from '@/api/reportData'
|
|
|
+import { freezeReportPageList, freezeReportExport, freezeReportCount } from '@/api/reportStock'
|
|
|
export default {
|
|
|
components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
|
|
|
mixins: [commonMixin],
|
|
@@ -130,44 +134,42 @@ export default {
|
|
|
return {
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
spinning: false,
|
|
|
- tableHeight: 0,
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false, // 导出加载loading
|
|
|
queryParam: { // 查询条件
|
|
|
- time: [ // 时间
|
|
|
- getDate.getMonthDays(3).starttime,
|
|
|
- getDate.getMonthDays(3).endtime
|
|
|
- ],
|
|
|
- beginDate: getDate.getMonthDays(3).starttime, // 开始时间
|
|
|
- endDate: getDate.getMonthDays(3).endtime, // 结束时间
|
|
|
- productEntity: {
|
|
|
- code: '', // 产品编码
|
|
|
- name: '' // 产品名称
|
|
|
- },
|
|
|
+ time: [],
|
|
|
+ beginDate: undefined, // 开始时间
|
|
|
+ endDate: undefined, // 结束时间
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '', // 产品名称
|
|
|
+ stockBatchNo: '', // 批次号
|
|
|
+ outBizNo: '', // 关联单据号
|
|
|
warehouseCascade: [], // 仓库仓位列表
|
|
|
warehouseSn: undefined, // 仓库
|
|
|
warehouseLocationSn: undefined // 仓位
|
|
|
},
|
|
|
labelCol: { span: 8 },
|
|
|
wrapperCol: { span: 16 },
|
|
|
+ // 必填项验证
|
|
|
rules: {
|
|
|
- 'time': [{ required: true, message: '请选择日期(最多查看一年)', trigger: 'change' }]
|
|
|
+ 'time': [{ required: true, message: '请选择冻结生成时间', trigger: 'change' }]
|
|
|
},
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
- exportLoading: false,
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 50, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', customRender: function (text) { return text || '--' }, sorter: true },
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 120, align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '关联单据号', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单据类型', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单据审核时间', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位名称', dataIndex: 'productEntity.unit', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓库', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '冻结数量', dataIndex: 'freezeQty', width: 100, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '总成本(¥)', dataIndex: 'freezePrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
- { title: '总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
- { title: '折后总售价(¥)', dataIndex: 'freezeAmount', width: 100, align: 'right', sorter: true, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '批次号', dataIndex: 'stockBatchNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '关联单据号', dataIndex: 'outBizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单据类型', dataIndex: 'outBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单位名称', dataIndex: 'demanderName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '冻结数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '成本单价', dataIndex: 'outPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '总成本', dataIndex: 'totalOutPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '冻结生成时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -175,7 +177,7 @@ export default {
|
|
|
const params = Object.assign(parameter, this.queryParam)
|
|
|
this.spinning = true
|
|
|
delete params.warehouseCascade
|
|
|
- return reportPageList(params).then(res => {
|
|
|
+ return freezeReportPageList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -193,6 +195,15 @@ export default {
|
|
|
},
|
|
|
totalData: {}, // 合计
|
|
|
warehouseCascadeData: [] // 仓库仓位
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ advanced (newValue, oldValue) {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -204,11 +215,18 @@ export default {
|
|
|
},
|
|
|
// 查询
|
|
|
handleSearch () {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ const _this = this
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 查询总计
|
|
|
getCount (params) {
|
|
|
- reportStockPutOutCount(params).then(res => {
|
|
|
+ freezeReportCount(params).then(res => {
|
|
|
if (res.status == 200 && res.data) {
|
|
|
this.totalData = res.data
|
|
|
} else {
|
|
@@ -218,21 +236,24 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
+ this.queryParam.time = []
|
|
|
this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
- this.queryParam.beginDate = getDate.getMonthDays(3).starttime
|
|
|
- this.queryParam.endDate = getDate.getMonthDays(3).endtime
|
|
|
+ this.queryParam.beginDate = undefined
|
|
|
+ this.queryParam.endDate = undefined
|
|
|
this.$refs.rangeDate.resetDate()
|
|
|
this.queryParam.beginDate = ''
|
|
|
this.queryParam.endDate = ''
|
|
|
- this.queryParam.productEntity.code = ''
|
|
|
- this.queryParam.productEntity.name = ''
|
|
|
+ this.queryParam.productCode = ''
|
|
|
+ this.queryParam.productName = ''
|
|
|
+ this.queryParam.stockBatchNo = ''
|
|
|
+ this.queryParam.outBizNo = ''
|
|
|
+ this.queryParam.stockBatchNo = ''
|
|
|
this.queryParam.warehouseSn = undefined
|
|
|
this.queryParam.warehouseLocationSn = undefined
|
|
|
this.queryParam.warehouseCascade = []
|
|
|
this.totalData = null
|
|
|
this.$refs.table.clearTable()
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
- this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 导出
|
|
|
handleExport () {
|
|
@@ -242,8 +263,8 @@ export default {
|
|
|
const params = _this.queryParam
|
|
|
_this.exportLoading = true
|
|
|
_this.spinning = true
|
|
|
- reportStockPutOutExport(params).then(res => {
|
|
|
- downloadExcel(res, '收发存报表')
|
|
|
+ freezeReportExport(params).then(res => {
|
|
|
+ downloadExcel(res, '冻结产品报表')
|
|
|
_this.exportLoading = false
|
|
|
_this.spinning = false
|
|
|
})
|
|
@@ -279,17 +300,30 @@ export default {
|
|
|
this.queryParam.warehouseSn = ''
|
|
|
this.queryParam.warehouseLocationSn = ''
|
|
|
}
|
|
|
+ },
|
|
|
+ // 表格高度
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 245
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
this.resetSearchForm()
|
|
|
+ this.getWarehouseCascade()
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ this.setTableH()
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
|
// 如果是新页签打开,则重置当前页面
|
|
|
if (this.$store.state.app.isNewTab) {
|
|
|
this.resetSearchForm()
|
|
|
+ this.getWarehouseCascade()
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ this.setTableH()
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|