Sfoglia il codice sorgente

入库明细报表

chenrui 3 anni fa
parent
commit
eeaff13425

+ 28 - 0
src/api/reportData.js

@@ -279,3 +279,31 @@ export const reportSalesBillExport = (params) => {
     responseType: 'blob'
   })
 }
+//  入库单报表
+export const reportStockPutDetailList = (params) => {
+  const url = `/report/reportStockPut/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  入库单报表  合计
+export const reportStockPutDetailCount = (params) => {
+  return axios({
+    url: '/report/reportStockPut/detail/queryCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 入库单报表 导出
+export const reportStockPutDetailExport = (params) => {
+  return axios({
+    url: '/report/reportStockPut/detail/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 50 - 0
src/config/router.config.js

@@ -1125,6 +1125,56 @@ export const asyncRouterMap = [
               }
             ]
           },
+          // {
+          //   path: '/reportData/warehousingOrder',
+          //   redirect: '/reportData/warehousingOrder/list',
+          //   name: 'warehousingOrder',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '入库单报表',
+          //     icon: 'profile'
+          //     // permission: 'M_warehousingOrderList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'warehousingOrderList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/warehousingOrder/list.vue'),
+          //       meta: {
+          //         title: '入库单报表列表',
+          //         icon: 'profile',
+          //         hidden: true
+          //         // permission: 'M_warehousingOrderList'
+          //       }
+          //     }
+          //   ]
+          // },
+          {
+            path: '/reportData/warehousingOrderDetail',
+            redirect: '/reportData/warehousingOrderDetail/list',
+            name: 'warehousingOrderDetail',
+            component: BlankLayout,
+            meta: {
+              title: '入库单明细报表',
+              icon: 'profile',
+              permission: 'M_warehousingOrderDetailList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'warehousingOrderDetailList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/warehousingOrderDetail/list.vue'),
+                meta: {
+                  title: '入库单明细报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_warehousingOrderDetailList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/provinceTypeSalesDetails',
             redirect: '/reportData/provinceTypeSalesDetails/list',

+ 229 - 0
src/views/reportData/warehousingOrder/list.vue

@@ -0,0 +1,229 @@
+<template>
+  <a-card size="small" :bordered="false" class="warehousingOrderList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="warehousingOrderList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="完成日期" prop="time">
+                <rangeDateTime ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库单号">
+                <a-input id="warehousingOrderList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库类型">
+                <v-select
+                  v-model="queryParam.dealerLevel"
+                  ref="dealerLevel"
+                  id="warehousingOrderList-dealerLevel"
+                  code="PUT_STOCK_TYPE"
+                  placeholder="请选择入库类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+              <a-button
+                type="primary"
+                class="button-info"
+                size="small"
+                @click="handleStock"
+                id="warehousingOrderList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="warehousingOrderList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingOrderList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="warehousingOrderList-export">导出</a-button>
+<!--              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesOrderTotalExport')"
+                id="warehousingOrderList-export">导出</a-button>
+ -->            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              总数量:{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              总金额:{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? totalData.totalPutAmount : '--' }}
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { reportStockPutDetailList, reportStockPutDetailCount, reportStockPutDetailExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDateTime },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        salesBillNo: '',
+        dealerName: '',
+        dealerLevel: undefined,
+        creatorId: undefined,
+        subareaSn: undefined,
+        dealerProvinceSn: undefined
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择完成日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '入库单号', dataIndex: 'salesBillNo', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库开单日期', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'dealerName', width: '27%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '入库数量', dataIndex: 'totalQty', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库金额', dataIndex: 'totalRealSaleAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'operatorName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportStockPutDetailList(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
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  methods: {
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportStockPutDetailCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.salesBillNo = ''
+      this.queryParam.dealerName = ''
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.creatorId = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.dealerProvinceSn = undefined
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      this.spinning = true
+      hdExportExcel(reportStockPutDetailExport, params, '入库单报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    pageInit () {}
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 246 - 0
src/views/reportData/warehousingOrderDetail/list.vue

@@ -0,0 +1,246 @@
+<template>
+  <a-card size="small" :bordered="false" class="warehousingOrderDetailList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="warehousingOrderDetailList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="完成日期" prop="time">
+                <rangeDateTime ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库单号">
+                <a-input id="warehousingOrderDetailList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入退货单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-model-item label="入库类型">
+                <v-select
+                  v-model="queryParam.putBizType"
+                  ref="putBizType"
+                  id="warehousingOrderDetailList-putBizType"
+                  code="PUT_STOCK_TYPE"
+                  placeholder="请选择入库类型"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="7" :sm="24">
+                <a-form-model-item label="供应商">
+                  <a-input id="warehousingOrderDetailList-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="5" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="warehousingOrderDetailList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="5" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="warehousingOrderDetailList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+              <a-button
+                type="primary"
+                class="button-info"
+                size="small"
+                @click="handleStock"
+                id="warehousingOrderDetailList-stockDate">盘点区间日期</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="warehousingOrderDetailList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingOrderDetailList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_warehousingOrderDetailExport')"
+                id="warehousingOrderDetailList-export">导出</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>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="footer">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              总数量:{{ (totalData && (totalData.totalPutQty || totalData.totalPutQty==0)) ? totalData.totalPutQty : '--' }}
+            </a-col>
+            <a-col :md="4" :sm="24">
+              总金额:{{ (totalData && (totalData.totalPutAmount || totalData.totalPutAmount==0)) ? totalData.totalPutAmount : '--' }}
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDateTime from '@/views/common/rangeDateTime.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { reportStockPutDetailList, reportStockPutDetailCount, reportStockPutDetailExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDateTime },
+  data () {
+    return {
+      spinning: false,
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        stockPutNo: '',
+        putBizType: undefined,
+        supplierName: '',
+        productName: '',
+        productCode: ''
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择完成日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '入库单号', dataIndex: 'stockPutNo', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库开单日期', dataIndex: 'openBillTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'supplierName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: '9%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '进价', dataIndex: 'putCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库金额', dataIndex: 'putAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '完成日期', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        delete params.time
+        return reportStockPutDetailList(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
+          return data
+        })
+      },
+      totalData: null
+    }
+  },
+  methods: {
+    // 盘点库存日期
+    handleStock () {
+      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
+    },
+    // 总计
+    getCount (params) {
+      reportStockPutDetailCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.stockPutNo = ''
+      this.queryParam.putBizType = undefined
+      this.queryParam.supplierName = ''
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      this.spinning = true
+      hdExportExcel(reportStockPutDetailExport, params, '入库明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    pageInit () {}
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>