Ver Fonte

盘点盈亏明细报表

chenrui há 3 anos atrás
pai
commit
9d1271e900

+ 19 - 0
src/api/reportData.js

@@ -204,6 +204,25 @@ export const reportCheckWarehouseCount = (params) => {
     method: 'post'
   })
 }
+// 盘点报表  盘点明细报表 列表 分页
+export const reportCheckWarehouseDetailList = (params) => {
+  const url = `/report/reportCheckWarehouse/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 盘点报表  盘点明细报表 合计
+export const reportCheckWarehouseDetailCount = (params) => {
+  return axios({
+    url: '/report/reportCheckWarehouse/reportDetailCount',
+    data: params,
+    method: 'post'
+  })
+}
 // 采购入库报表  采购入库单报表 列表 分页
 export const reportReceivingBillList = (params) => {
   const url = `/report/reportReceivingBill/reportPage/${params.pageNo}/${params.pageSize}`

+ 231 - 0
src/views/reportData/inventoryReport/inventoryDetail.vue

@@ -0,0 +1,231 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="inventoryReportList-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="财务审核时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="productPricingList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="productPricingList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <ProductType id="productPricingList-productType" @change="changeProductType" v-model="productType"></ProductType>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryReportList-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-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        库存总数量:<strong>{{ (totalData && (totalData.stockQty || totalData.stockQty==0)) ? totalData.stockQty : '--' }}</strong>;
+        盘盈总数量:<strong>{{ (totalData && (totalData.checkProfitQty || totalData.checkProfitQty==0)) ? totalData.checkProfitQty : '--' }}</strong>;
+        盘亏总数量:<strong>{{ (totalData && (totalData.checkLossQty || totalData.checkLossQty==0)) ? totalData.checkLossQty : '--' }}</strong>;
+        盈亏总数量:<strong>{{ (totalData && (totalData.checkProfitLossQty || totalData.checkProfitLossQty==0)) ? totalData.checkProfitLossQty : '--' }}</strong>;
+        盈亏总成本:<strong>{{ (totalData && (totalData.checkProfitLossCost || totalData.checkProfitLossCost==0)) ? '¥'+totalData.checkProfitLossCost : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.checkWarehouseSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { reportCheckWarehouseDetailList, reportCheckWarehouseDetailCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0,
+      advanced: true, // 高级搜索 展开/关闭
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          name: '',
+          code: '',
+          productBrandSn: undefined,
+          productTypeSn1: '',
+          productTypeSn2: '',
+          productTypeSn3: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '19%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '库存数量', dataIndex: 'stockQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘点数量', dataIndex: 'checkQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏数量', dataIndex: 'checkProfitLossQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总成本', dataIndex: 'checkProfitLossCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportCheckWarehouseDetailList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const 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.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
+      },
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportCheckWarehouseDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    }
+  },
+  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>
+
+<style>
+</style>

+ 119 - 119
src/views/reportData/inventoryReport/inventoryOrder.vue

@@ -43,7 +43,7 @@
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.salesTargetSn"
+      :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
       :defaultLoadData="false"
@@ -53,132 +53,132 @@
 </template>
 
 <script>
-  import { STable, VSelect } from '@/components'
-  import rangeDate from '@/views/common/rangeDate.vue'
-  import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
-  export default {
-    components: { STable, VSelect, rangeDate },
-    data () {
-      return {
-        labelCol: { span: 8 },
-        wrapperCol: { span: 16 },
-        queryParam: { //  查询条件
-          time: [],
-          beginDate: '',
-          endDate: ''
-        },
-        productType: [],
-        rules: {
-          'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
-        },
-        disabled: false, //  查询、重置按钮是否可操作
-        exportLoading: false,
-        columns: [
-          { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-          { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        ],
-        // 加载数据方法 必须为 Promise 对象
-        loadData: parameter => {
-          this.disabled = true
-          const params = Object.assign(parameter, this.queryParam)
-          // this.spinning = true
-          this.$emit('spinning', true)
-          delete params.time
-          if (params.beginDate) {
-            return reportCheckWarehouseList(params).then(res => {
-              // 总计
-              this.getCount(params)
-              const 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
-              this.$emit('spinning', false)
-              return data
-            })
-          } else {
-            const _this = this
-            return new Promise(function (resolve, reject) {
-              const data = {
-                pageNo: 1,
-                pageSize: 10,
-                list: [],
-                count: 0
-              }
-              _this.disabled = false
-              // _this.spinning = false
-              _this.$emit('spinning', false)
-              _this.$message.info('请选择财务审核时间')
-              resolve(data)
-            })
-          }
-        },
-        totalData: null //  合计
-      }
-    },
-    methods: {
-      // 合计
-      getCount (params) {
-        reportCheckWarehouseCount(params).then(res => {
-          if (res.status == 200) {
-            this.totalData = res.data
-          } else {
-            this.totalData = null
-          }
-        })
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate },
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: ''
       },
-      //  创建时间  change
-      dateChange (date) {
-        this.queryParam.time = date
-        this.queryParam.beginDate = date[0] || ''
-        this.queryParam.endDate = date[1] || ''
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
       },
-      //  查询
-      handleSearch () {
-        this.$refs.ruleForm.validate(valid => {
-          if (valid) {
-            this.$refs.table.refresh(true)
-          } else {
-            console.log('error submit!!')
-            return false
-          }
-        })
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        // this.spinning = true
+        this.$emit('spinning', true)
+        delete params.time
+        if (params.beginDate) {
+          return reportCheckWarehouseList(params).then(res => {
+            // 总计
+            this.getCount(params)
+            const 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
+            this.$emit('spinning', false)
+            return data
+          })
+        } else {
+          const _this = this
+          return new Promise(function (resolve, reject) {
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 0
+            }
+            _this.disabled = false
+            // _this.spinning = false
+            _this.$emit('spinning', false)
+            _this.$message.info('请选择财务审核时间')
+            resolve(data)
+          })
+        }
       },
-      //  重置
-      resetSearchForm () {
-        this.$refs.rangeDate.resetDate()
-        this.queryParam.time = []
-        this.queryParam.beginDate = ''
-        this.queryParam.endDate = ''
-        this.$refs.ruleForm.resetFields()
-        this.totalData = null
-        this.$refs.table.clearTable()
-      }
+      totalData: null //  合计
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      reportCheckWarehouseCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
     },
-    mounted () {
-      if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-        this.resetSearchForm()
-      }
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
-    activated () {
-      // 如果是新页签打开,则重置当前页面
-      if (this.$store.state.app.isNewTab) {
-        this.resetSearchForm()
-      }
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
-    beforeRouteEnter (to, from, next) {
-      next(vm => {})
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    }
+  },
+  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>
 
 <style>

+ 36 - 5
src/views/reportData/inventoryReport/list.vue

@@ -1,24 +1,55 @@
 <template>
   <a-card size="small" :bordered="false" class="inventoryReportList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <inventoryOrder @spinning="spinningFun" />
+      <!-- 标签页 -->
+      <a-tabs type="card" :default-active-key="nowKey" @change="handleTabChange" class="purchaseReceiptReportList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.val">
+          <span slot="tab">{{ item.name }}</span>
+        </a-tab-pane>
+      </a-tabs>
+      <inventoryOrder v-show="nowKey=='1'" @spinning="spinningFun" />
+      <inventoryDetail v-show="nowKey=='2'" @spinning="spinningFun" />
     </a-spin>
   </a-card>
 </template>
 
 <script>
-  import inventoryOrder from './inventoryOrder.vue'
+import inventoryOrder from './inventoryOrder.vue'
+import inventoryDetail from './inventoryDetail.vue'
 export default {
-  components: { inventoryOrder },
+  components: { inventoryOrder, inventoryDetail },
   data () {
     return {
-      spinning: false
+      spinning: false,
+      tabPaneData: [
+        { name: '盘点单报表', val: '1' },
+        { name: '盘点盈亏明细报表', val: '2' }
+      ],
+      nowKey: '1'
     }
   },
   methods: {
-    spinningFun(val){
+    spinningFun (val) {
       this.spinning = val
+    },
+    // tab切换
+    handleTabChange (key) {
+      this.nowKey = key
     }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.nowKey = '1'
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.nowKey = '1'
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
 }
 </script>

+ 2 - 2
src/views/salesManagement/productPricing/list.vue

@@ -33,8 +33,8 @@
           </template>
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>