|
@@ -0,0 +1,299 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false" class="frozenProductReportList-wrap">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form-model
|
|
|
+ id="frozenProductReportList-form"
|
|
|
+ ref="ruleForm"
|
|
|
+ class="form-model-con"
|
|
|
+ layout="inline"
|
|
|
+ :model="queryParam"
|
|
|
+ :rules="rules"
|
|
|
+ :labelCol="labelCol"
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
+ @keyup.enter.native="handleSearch" >
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="冻结生成时间">
|
|
|
+ <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-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-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-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="单据类型">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.bizType"
|
|
|
+ ref="bizType"
|
|
|
+ :isEnable="true"
|
|
|
+ id="frozenProductReportList-bizType"
|
|
|
+ code="SETTLE_FLOW_BIZ_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-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="仓库仓位">
|
|
|
+ <a-cascader
|
|
|
+ v-model="queryParam.warehouseCascade"
|
|
|
+ expand-trigger="hover"
|
|
|
+ :options="warehouseCascadeData"
|
|
|
+ :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
|
|
|
+ id="frozenProductReportList-warehouseCascade"
|
|
|
+ placeholder="请选择仓库仓位"
|
|
|
+ @change="warehouseCascadeChange"
|
|
|
+ allowClear
|
|
|
+ style="width: 100%;" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <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
|
|
|
+ style="margin-left: 5px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ v-if="$hasPermissions('B_receivedSendStorageReportExport')"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="frozenProductReportList-export">导出</a-button>
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 5px" id="frozenProductReportList-advanced">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form-model>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <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>;
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ x: 1500 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<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'
|
|
|
+export default {
|
|
|
+ components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
|
|
|
+ mixins: [commonMixin],
|
|
|
+ data () {
|
|
|
+ const _this = this
|
|
|
+ return {
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ spinning: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ time: [ // 时间
|
|
|
+ getDate.getMonthDays(3).starttime,
|
|
|
+ getDate.getMonthDays(3).endtime
|
|
|
+ ],
|
|
|
+ beginDate: getDate.getMonthDays(3).starttime, // 开始时间
|
|
|
+ endDate: getDate.getMonthDays(3).endtime, // 结束时间
|
|
|
+ productEntity: {
|
|
|
+ code: '', // 产品编码
|
|
|
+ name: '' // 产品名称
|
|
|
+ },
|
|
|
+ warehouseCascade: [], // 仓库仓位列表
|
|
|
+ warehouseSn: undefined, // 仓库
|
|
|
+ warehouseLocationSn: undefined // 仓位
|
|
|
+ },
|
|
|
+ labelCol: { span: 8 },
|
|
|
+ wrapperCol: { span: 16 },
|
|
|
+ rules: {
|
|
|
+ '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) : '--') } }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
+ this.spinning = true
|
|
|
+ delete params.warehouseCascade
|
|
|
+ return reportPageList(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
|
|
|
+ }
|
|
|
+ this.disabled = false
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ totalData: {}, // 合计
|
|
|
+ warehouseCascadeData: [] // 仓库仓位
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.time = date
|
|
|
+ this.queryParam.beginDate = date[0] || ''
|
|
|
+ this.queryParam.endDate = date[1] || ''
|
|
|
+ },
|
|
|
+ // 查询
|
|
|
+ handleSearch () {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 查询总计
|
|
|
+ getCount (params) {
|
|
|
+ reportStockPutOutCount(params).then(res => {
|
|
|
+ if (res.status == 200 && res.data) {
|
|
|
+ this.totalData = res.data
|
|
|
+ } else {
|
|
|
+ this.totalData = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.queryParam.time)
|
|
|
+ this.queryParam.beginDate = getDate.getMonthDays(3).starttime
|
|
|
+ this.queryParam.endDate = getDate.getMonthDays(3).endtime
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ this.queryParam.productEntity.code = ''
|
|
|
+ this.queryParam.productEntity.name = ''
|
|
|
+ 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 () {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.ruleForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const params = _this.queryParam
|
|
|
+ _this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ reportStockPutOutExport(params).then(res => {
|
|
|
+ downloadExcel(res, '收发存报表')
|
|
|
+ _this.exportLoading = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 仓库仓位 级联 列表
|
|
|
+ getWarehouseCascade () {
|
|
|
+ warehouseCascadeList({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ res.data.map(item => {
|
|
|
+ item.sn = item.warehouseSn
|
|
|
+ if (item.warehouseLocationList) {
|
|
|
+ item.warehouseLocationList.map(subItem => {
|
|
|
+ subItem.sn = subItem.warehouseLocationSn
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.warehouseCascadeData = res.data
|
|
|
+ } else {
|
|
|
+ this.warehouseCascadeData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 仓库仓位change
|
|
|
+ warehouseCascadeChange (val) {
|
|
|
+ if (val && val.length > 0) {
|
|
|
+ this.queryParam.warehouseSn = val[0] || ''
|
|
|
+ this.queryParam.warehouseLocationSn = val[1] || ''
|
|
|
+ } else {
|
|
|
+ this.queryParam.warehouseSn = ''
|
|
|
+ this.queryParam.warehouseLocationSn = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|