chenrui 2 rokov pred
rodič
commit
1b31d94a6b

+ 67 - 3
src/views/reportData/purchaseReturnReport/list.vue

@@ -1,8 +1,72 @@
 <template>
+  <a-card size="small" :bordered="false" class="purchaseReturnReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 标签页 -->
+      <a-tabs :default-active-key="nowKey" @change="handleTabChange" class="purchaseReturnReportList-tabs ">
+        <a-tab-pane v-for="item in tabPaneData" :key="item.val">
+          <span slot="tab">{{ item.name }}</span>
+        </a-tab-pane>
+      </a-tabs>
+      <purchaseReturnOrder v-show="nowKey=='1'" @spinning="spinningFun" />
+      <purchaseReturnDetail v-show="nowKey=='2'" @spinning="spinningFun" />
+    </a-spin>
+  </a-card>
 </template>
 
 <script>
+import { commonMixin } from '@/utils/mixin'
+import purchaseReturnOrder from './purchaseReturnOrder.vue'
+import purchaseReturnDetail from './purchaseReturnDetail.vue'
+export default {
+  components: { purchaseReturnOrder, purchaseReturnDetail },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tabPaneData: [
+        { name: '采购退货单报表', val: '1' },
+        { name: '采购退货明细报表', val: '2' }
+      ],
+      nowKey: '1'
+    }
+  },
+  methods: {
+    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>
-
-<style>
-</style>
+<style lang="less">
+	.purchaseReturnReportList-wrap{
+		.purchaseReturnReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
+      height: 30px!important;
+		}
+    .purchaseReturnReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
+      height: 30px!important;
+    }
+    .purchaseReturnReportList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
+      line-height: 26px!important;
+      height: 30px!important;
+    }
+	}
+</style>
+s

+ 262 - 0
src/views/reportData/purchaseReturnReport/purchaseReturnDetail.vue

@@ -0,0 +1,262 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="purchaseReceiptDetailList-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="产品品牌">
+              <ProductBrand id="purchaseReceiptDetailList-productBrandSn" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="产品分类">
+              <ProductType id="purchaseReceiptDetailList-productType" @change="changeProductType" v-model="productType"></ProductType>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="salesDetailReportList-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="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReceiptDetailList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseReceiptDetailList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_purchaseReceiptReportExport')"
+              id="purchaseReceiptDetailList-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>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        采购总数量:<strong>{{ (totalData && (totalData.qty || totalData.qty==0)) ? totalData.qty : '--' }}</strong>;
+        采购总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+        入库总数量:<strong>{{ (totalData && (totalData.putQty || totalData.putQty==0)) ? totalData.putQty : '--' }}</strong>;
+        入库总成本:<strong>{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? '¥'+totalData.putAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import { reportReceivingBillDetailList, reportReceivingBillDetailCount, reportReceivingBillDetailExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand },
+  mixins: [commonMixin],
+  data () {
+    return {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        productEntity: {
+          productBrandSn: undefined,
+          productTypeSn1: undefined,
+          productTypeSn2: undefined,
+          productTypeSn3: undefined,
+          code: '',
+          name: ''
+        }
+      },
+      productType: [],
+      rules: {
+        'time': [{ required: true, message: '请选择财务审核时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作11
+      advanced: true, // 高级搜索 展开/关闭
+      exportLoading: false,
+      columns: [
+        { title: '采购单号', dataIndex: 'purchaseBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购入库单号', dataIndex: 'receivingBillNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库数量', dataIndex: 'putQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '采购成本', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '入库成本', dataIndex: 'putAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '财务审核时间', dataIndex: 'auditTime', width: '12%', 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 reportReceivingBillDetailList(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.$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) {
+      reportReceivingBillDetailCount(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.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      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] : ''
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillDetailExport(params).then(res => {
+            downloadExcel(res, '采购入库明细报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  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>

+ 222 - 0
src/views/reportData/purchaseReturnReport/purchaseReturnOrder.vue

@@ -0,0 +1,222 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="purchaseReturnOrderList-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="7" :sm="24">
+            <a-form-model-item label="出库时间" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="7" :sm="24">
+            <a-form-model-item label="采购退货单号" prop="no">
+              <a-input v-model.trim="queryParam.no" allowClear placeholder="请输入采购退货单号"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="7" :sm="24">
+            <a-form-model-item label="供应商" prop="name">
+              <supplier
+                id="bulkReturnGoodsList-supplierSn"
+                placeholder="请选择供应商"
+                v-model="queryParam.supplierSn"
+              ></supplier>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="3" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="purchaseReturnOrderList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnOrderList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 5px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('B_purchaseReturnReportExport')"
+              id="purchaseReturnOrderList-export">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+    <!-- 合计 -->
+    <a-alert type="info" style="margin-bottom:10px">
+      <div class="ftext" slot="message">
+        总单数:<strong>{{ (totalData && (totalData.totalPutCategory || totalData.totalPutCategory==0)) ? totalData.totalPutCategory : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        退货总成本:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? '¥'+totalData.totalAmount : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.receivingBillSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import supplier from '@/views/common/supplier'
+import { reportReceivingBillList, reportReceivingBillCount, reportReceivingBillExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, supplier },
+  mixins: [commonMixin],
+  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: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'receivingBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'totalPutCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本', dataIndex: 'totalAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '出库时间', dataIndex: 'auditTime', width: '16%', 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 reportReceivingBillList(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.$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) {
+      reportReceivingBillCount(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.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          reportReceivingBillExport(params).then(res => {
+            downloadExcel(res, '采购入库单报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  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>