Explorar el Código

Merge branch 'deploy_0804' of jianguan-web/qpls-md-html into master

陈瑞 hace 3 años
padre
commit
c22a3652ce

+ 18 - 0
src/api/reportData.js

@@ -167,3 +167,21 @@ export const linkageGroupList = (params) => {
     method: 'post'
   })
 }
+// 销售报表  导出
+export const reportSalesBillExport = params => {
+  return axios.request({
+    url: `/report/reportSalesBill/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 销售明细报表  导出
+export const reportSalesBillDetailExport = params => {
+  return axios.request({
+    url: `/report/reportSalesBill/detailExport`,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

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

@@ -1593,6 +1593,56 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/chainStockIncomeReport',
+            redirect: '/reportData/chainStockIncomeReport/list',
+            name: 'chainStockIncomeReport',
+            component: BlankLayout,
+            meta: {
+              title: '连锁库存总入报表',
+              icon: 'profile',
+              permission: 'M_chainStockIncomeReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainStockIncomeReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainStockIncomeReport/list.vue'),
+                meta: {
+                  title: '连锁库存总入报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainStockIncomeReportList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/chainStockExpenditureReport',
+            redirect: '/reportData/chainStockExpenditureReport/list',
+            name: 'chainStockExpenditureReport',
+            component: BlankLayout,
+            meta: {
+              title: '连锁库存总出报表',
+              icon: 'profile',
+              permission: 'M_chainStockExpenditureReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'chainStockExpenditureReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/chainStockExpenditureReport/list.vue'),
+                meta: {
+                  title: '连锁库存总出报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_chainStockExpenditureReportList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/receivedSendStorageReport',
             redirect: '/reportData/receivedSendStorageReport/list',

+ 5 - 5
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -82,7 +82,7 @@
                     id="bulkWarehousingOrderEdit-putCost"
                     v-model="record.putCost"
                     :precision="2"
-                    :min="1"
+                    :min="0"
                     :max="999999"
                     placeholder="请输入"
                     style="width: 100%;" />
@@ -157,7 +157,7 @@
                     id="bulkWarehousingOrderEdit-choose-putCost"
                     v-model="record.putCost"
                     :precision="2"
-                    :min="1"
+                    :min="0"
                     :max="999999"
                     placeholder="请输入"
                     @blur="e => putCostBlur(e.target.value, record)"
@@ -387,7 +387,7 @@ export default {
     },
     //  添加/编辑
     handleAdd (row, isEdit) {
-      if (!isEdit && !row.putCost) {
+      if (!isEdit && !(row.putCost || row.putCost == 0)) {
         this.$message.warning('请输入成本价后再添加!')
         return
       }
@@ -420,7 +420,7 @@ export default {
       }
       if (isEdit) { // 编辑
         // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
-        if (!row.putCost) {
+        if (!(row.putCost || row.putCost == 0)) {
           row.putCost = row.putCostBackups
           return
         }
@@ -531,7 +531,7 @@ export default {
     // 已选产品 成本价  blur
     putCostBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
-      if (val != record.putCostBackups) {
+      if (val != record.putCostBackups || !val) {
         this.handleAdd(record, 'edit')
       }
     },

+ 352 - 0
src/views/reportData/chainStockExpenditureReport/list.vue

@@ -0,0 +1,352 @@
+<template>
+  <a-card size="small" :bordered="false" class="chainStockExpenditureReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainStockExpenditureReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handelSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="连锁店" prop="tenantId">
+                <a-select
+                  placeholder="请选择连锁店"
+                  id="chainStockExpenditureReportList-tenantId"
+                  allowClear
+                  v-model="queryParam.tenantId"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <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-button type="primary" @click="handelSearch" id="chainStockExpenditureReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" id="chainStockExpenditureReportList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-row :gutter="15" style="margin-top: 50px;">
+        <a-col :md="12" :sm="24">
+          <div class="chart-box">
+            <div class="chart-hj">
+              库存总出数量:{{ (totalData&&totalData.totalQty) ? totalData.totalQty : '--' }},
+              总成本:¥{{ (totalData&&totalData.totalCost) ? totalData.totalCost : '--' }}
+            </div>
+            <div id="con1" class="chart"></div>
+          </div>
+        </a-col>
+        <a-col :md="12" :sm="24" style="margin-top: 30px;">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.dataBizTypeDictValue"
+            :columns="columns"
+            :dataSource="tableData"
+            :loading="listLoading"
+            :pagination="false"
+            bordered>
+          </a-table>
+        </a-col>
+      </a-row>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import rangeDate from '@/views/common/rangeDate.vue'
+import echarts from 'echarts'
+import { linkageGroupList } from '@/api/reportData'
+import { reportStockOutList } from '@/api/reportStock'
+export default {
+  components: { rangeDate },
+  data () {
+    return {
+      spinning: false,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        tenantId: undefined
+      },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择出库完成时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '明细项', dataIndex: 'dataBizTypeDictValue', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量(件)', dataIndex: 'productQty', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本(元)', dataIndex: 'productCost', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价(元)', dataIndex: 'productPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 统计图
+      pieData: [],
+      pieColor: ['#00aaff', '#ffaa00', '#00aa00', '#ff55ff', '#1dc5d4', '#8465c7', '#00ffff'],
+      tableData: [], //  含总计数据
+      loadData: [], //  不含总计数据
+      listLoading: false,
+      chart1: null,
+      totalData: null,
+      linkageGroupData: []
+    }
+  },
+
+  methods: {
+    // 初始化饼图 title: 标题 data:数据 bit:单位
+    initPie (chart, title, data, bit) {
+      const legend = []
+      if (bit) {
+        data.map(item => {
+          const p = `${item.name}: ${item.value}${bit}`
+          legend.push(p)
+        })
+      }
+      const option = {
+        color: this.pieColor,
+        title: {
+          text: title,
+          top: 20,
+          left: 20,
+          textStyle: {
+            color: '#abd7ff'
+          },
+          textAlingn: 'left'
+        },
+        tooltip: {
+          trigger: 'item',
+          formatter: `{b} : {d}%`
+        },
+        legend: {
+          orient: 'horizontal',
+          left: 'center',
+          bottom: '5',
+          padding: 5,
+          textStyle: {
+            color: '#abd7ff',
+            fontSize: 10
+          },
+          show: !!bit,
+          formatter: function (name) {
+            if (bit) {
+              const p = data.find(item => item.name == name)
+              return name + (p ? (':' + p.value + bit) : '')
+            }
+          }
+        },
+        series: [{
+          type: 'pie',
+          radius: ['50%', '70%'],
+          startAngle: 75,
+          top: 50,
+          avoidLabelOverlap: true, // 在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠
+          label: {
+            normal: {
+              formatter: params => {
+                return (
+                  '{name|' + params.name + '}{value|' + params.percent + '%' + '}'
+                )
+              },
+              padding: [0, -70, 25, -70],
+              rich: {
+                name: {
+                  fontSize: 12,
+                  padding: [0, 4, 0, 4],
+                  color: '#999'
+                },
+                value: {
+                  fontSize: 12,
+                  color: '#999'
+                }
+              }
+            }
+          },
+          labelLine: {
+            normal: {
+              length: 20,
+              length2: 70,
+              lineStyle: {
+                color: '#e6e6e6'
+              }
+            }
+          },
+          data: data,
+          insideLabel: {
+            show: true
+          }
+        }]
+      }
+      return option
+    },
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    handelSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.getList()
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 查询列表
+    getList () {
+      const params = {
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate,
+        tenantId: this.queryParam.tenantId
+      }
+      // 开始查询
+      this.listLoading = true
+      this.spinning = true
+      reportStockOutList(params).then(res => {
+        this.listLoading = false
+        if (res.status == 200 && res.data) {
+          const reportStockOutVOList = (res.data && res.data.reportStockOutVOList) ? res.data.reportStockOutVOList : []
+          const totalQty = (res.data && (res.data.totalQty || res.data.totalQty == 0)) ? res.data.totalQty : '--'
+          const totalPrice = (res.data && (res.data.totalPrice || res.data.totalPrice == 0)) ? res.data.totalPrice : '--'
+          const totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? res.data.totalCost : '--'
+          this.totalData = {
+            totalQty: totalQty,
+            totalPrice: totalPrice,
+            totalCost: totalCost
+          }
+          if (reportStockOutVOList) {
+            this.loadData = res.data.reportStockOutVOList
+            this.tableData = res.data.reportStockOutVOList
+            const total = [{ dataBizTypeDictValue: '总出', productQty: totalQty, productCost: totalCost, productPrice: totalPrice }]
+            this.tableData = [...this.tableData, ...total]
+          } else {
+            this.loadData = []
+            this.tableData = []
+          }
+          this.chartInit()
+        } else {
+          this.loadData = []
+          this.tableData = []
+          this.totalData = null
+          this.chartInit()
+        }
+        this.spinning = false
+      })
+    },
+    chartInit () {
+      this.pieData = []
+      if (this.loadData.length < 1) {
+        this.pieData = [{ name: '总成本', value: 0 }]
+      } else {
+        this.loadData.map((item, index) => {
+          if (index != this.loadData.length) {
+            this.pieData.push({
+              name: item.dataBizTypeDictValue + '总成本',
+              value: item.productCost
+            })
+          }
+        })
+      }
+      const con1 = document.getElementById('con1')
+      const chart1 = echarts.init(con1)
+      const option = this.initPie(chart1, '', this.pieData)
+      chart1.setOption(option)
+      this.chart1 = chart1
+      this.chart1.resize()
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.tenantId = undefined
+      this.loadData = []
+      this.tableData = []
+      this.totalData = null
+      this.chartInit()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          const data = res.data || []
+          if (data.length > 0) {
+            this.linkageGroupData = data
+          } else {
+            this.linkageGroupData = []
+          }
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    },
+    pageInit () {
+      this.getLinkageGroup()
+      window.onresize = () => {
+        return (() => {
+          this.chart1.resize()
+        })()
+      }
+    }
+  },
+  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>
+<style lang="less">
+  .chainStockExpenditureReportList-wrap{
+    min-height: 700px;
+    .chart-box{
+      height: 400px;
+      .chart-hj{
+        font-size: 22px;
+        text-align: center;
+      }
+      .chart{
+        width: 100%;
+        height: 450px;
+        overflow: auto;
+      }
+    }
+  }
+</style>

+ 352 - 0
src/views/reportData/chainStockIncomeReport/list.vue

@@ -0,0 +1,352 @@
+<template>
+  <a-card size="small" :bordered="false" class="chainStockIncomeReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainStockIncomeReportList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handelSearch" >
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="连锁店" prop="tenantId">
+                <a-select
+                  placeholder="请选择连锁店"
+                  id="chainStockIncomeReportList-tenantId"
+                  allowClear
+                  v-model="queryParam.tenantId"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in linkageGroupData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="入库完成时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handelSearch" id="chainStockIncomeReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" id="chainStockIncomeReportList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-row :gutter="15" style="margin-top: 50px;">
+        <a-col :md="12" :sm="24">
+          <div class="chart-box">
+            <div class="chart-hj">
+              库存总入数量:{{ (totalData&&totalData.totalQty) ? totalData.totalQty : '--' }},
+              总成本:¥{{ (totalData&&totalData.totalCost) ? totalData.totalCost : '--' }}
+            </div>
+            <div id="con1" class="chart"></div>
+          </div>
+        </a-col>
+        <a-col :md="12" :sm="24" style="margin-top: 30px;">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.dataBizTypeDictValue"
+            :columns="columns"
+            :dataSource="tableData"
+            :loading="listLoading"
+            :pagination="false"
+            bordered>
+          </a-table>
+        </a-col>
+      </a-row>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import rangeDate from '@/views/common/rangeDate.vue'
+import echarts from 'echarts'
+import { reportStockPutList } from '@/api/reportStock'
+import { linkageGroupList } from '@/api/reportData'
+export default {
+  components: { rangeDate },
+  data () {
+    return {
+      spinning: false,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        tenantId: undefined
+      },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
+        'time': [{ required: true, message: '请选择入库完成时间', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      columns: [
+        { title: '明细项', dataIndex: 'dataBizTypeDictValue', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量(件)', dataIndex: 'productQty', width: '25%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本(元)', dataIndex: 'productCost', width: '25%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价(元)', dataIndex: 'productPrice', width: '25%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 统计图
+      pieData: [],
+      pieColor: ['#00aaff', '#ffaa00', '#00aa00', '#ff55ff', '#1dc5d4', '#8465c7', '#00ffff'],
+      tableData: [], //  含总计数据
+      loadData: [], //  不含总计数据
+      listLoading: false,
+      chart1: null,
+      totalData: null,
+      linkageGroupData: []
+    }
+  },
+
+  methods: {
+    // 初始化饼图 title: 标题 data:数据 bit:单位
+    initPie (chart, title, data, bit) {
+      const legend = []
+      if (bit) {
+        data.map(item => {
+          const p = `${item.name}: ${item.value}${bit}`
+          legend.push(p)
+        })
+      }
+      const option = {
+        color: this.pieColor,
+        title: {
+          text: title,
+          top: 20,
+          left: 20,
+          textStyle: {
+            color: '#abd7ff'
+          },
+          textAlingn: 'left'
+        },
+        tooltip: {
+          trigger: 'item',
+          formatter: `{b} : {d}%`
+        },
+        legend: {
+          orient: 'horizontal',
+          left: 'center',
+          bottom: '5',
+          padding: 5,
+          textStyle: {
+            color: '#abd7ff',
+            fontSize: 10
+          },
+          show: !!bit,
+          formatter: function (name) {
+            if (bit) {
+              const p = data.find(item => item.name == name)
+              return name + (p ? (':' + p.value + bit) : '')
+            }
+          }
+        },
+        series: [{
+          type: 'pie',
+          radius: ['50%', '70%'],
+          startAngle: 75,
+          top: 50,
+          avoidLabelOverlap: true, // 在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠
+          label: {
+            normal: {
+              formatter: params => {
+                return (
+                  '{name|' + params.name + '}{value|' + params.percent + '%' + '}'
+                )
+              },
+              padding: [0, -70, 25, -70],
+              rich: {
+                name: {
+                  fontSize: 12,
+                  padding: [0, 4, 0, 4],
+                  color: '#999'
+                },
+                value: {
+                  fontSize: 12,
+                  color: '#999'
+                }
+              }
+            }
+          },
+          labelLine: {
+            normal: {
+              length: 20,
+              length2: 70,
+              lineStyle: {
+                color: '#e6e6e6'
+              }
+            }
+          },
+          data: data,
+          insideLabel: {
+            show: true
+          }
+        }]
+      }
+      return option
+    },
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    handelSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.getList()
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 查询列表
+    getList () {
+      const params = {
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate,
+        tenantId: this.queryParam.tenantId
+      }
+      // 开始查询
+      this.listLoading = true
+      this.spinning = true
+      reportStockPutList(params).then(res => {
+        this.listLoading = false
+        if (res.status == 200 && res.data) {
+          const reportStockPutVOList = (res.data && res.data.reportStockPutVOList) ? res.data.reportStockPutVOList : []
+          const totalQty = (res.data && (res.data.totalQty || res.data.totalQty == 0)) ? res.data.totalQty : '--'
+          const totalPrice = (res.data && (res.data.totalPrice || res.data.totalPrice == 0)) ? res.data.totalPrice : '--'
+          const totalCost = (res.data && (res.data.totalCost || res.data.totalCost == 0)) ? res.data.totalCost : '--'
+          this.totalData = {
+            totalQty: totalQty,
+            totalPrice: totalPrice,
+            totalCost: totalCost
+          }
+          if (reportStockPutVOList) {
+            this.loadData = res.data.reportStockPutVOList
+            this.tableData = res.data.reportStockPutVOList
+            const total = [{ dataBizTypeDictValue: '总入', productQty: totalQty, productCost: totalCost, productPrice: totalPrice }]
+            this.tableData = [...this.tableData, ...total]
+          } else {
+            this.loadData = []
+            this.tableData = []
+          }
+          this.chartInit()
+        } else {
+          this.loadData = []
+          this.tableData = []
+          this.totalData = null
+          this.chartInit()
+        }
+        this.spinning = false
+      })
+    },
+    chartInit () {
+      this.pieData = []
+      if (this.loadData.length < 1) {
+        this.pieData = [{ name: '总成本', value: 0 }]
+      } else {
+        this.loadData.map((item, index) => {
+          if (index != this.loadData.length) {
+            this.pieData.push({
+              name: item.dataBizTypeDictValue + '总成本',
+              value: item.productCost
+            })
+          }
+        })
+      }
+      const con1 = document.getElementById('con1')
+      const chart1 = echarts.init(con1)
+      const option = this.initPie(chart1, '', this.pieData)
+      chart1.setOption(option)
+      this.chart1 = chart1
+      this.chart1.resize()
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.tenantId = undefined
+      this.loadData = []
+      this.tableData = []
+      this.totalData = null
+      this.chartInit()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 连锁店
+    getLinkageGroup () {
+      linkageGroupList({}).then(res => {
+        if (res.status == 200) {
+          const data = res.data || []
+          if (data.length > 0) {
+            this.linkageGroupData = data
+          } else {
+            this.linkageGroupData = []
+          }
+        } else {
+          this.linkageGroupData = []
+        }
+      })
+    },
+    pageInit () {
+      this.getLinkageGroup()
+      window.onresize = () => {
+        return (() => {
+          this.chart1.resize()
+        })()
+      }
+    }
+  },
+  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>
+<style lang="less">
+  .chainStockIncomeReportList-wrap{
+    min-height: 700px;
+    .chart-box{
+      height: 400px;
+      .chart-hj{
+        font-size: 22px;
+        text-align: center;
+      }
+      .chart{
+        width: 100%;
+        height: 450px;
+        overflow: auto;
+      }
+    }
+  }
+</style>

+ 42 - 15
src/views/reportData/salesDetailReport/list.vue

@@ -1,11 +1,11 @@
 <template>
-  <a-card size="small" :bordered="false" class="chainSalesDetailReportList-wrap">
+  <a-card size="small" :bordered="false" class="salesDetailReportList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-alert :show-icon="false" type="error" message="注:销售单报表包含急件销售数量、售价,销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper">
         <a-form-model
-          id="chainSalesDetailReportList-form"
+          id="salesDetailReportList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -22,12 +22,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称">
-                <a-input id="chainSalesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
+                <a-input id="salesDetailReportList-salesTargetName" v-model.trim="queryParam.salesTargetName" allowClear placeholder="请输入客户名称"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户类型">
-                <a-select id="chainSalesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
+                <a-select id="salesDetailReportList-customerType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型">
                   <a-select-option v-for="item in custTypeList" :value="item.customerTypeSn" :key="item.customerTypeSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
@@ -35,7 +35,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="收款方式">
-                  <a-select id="chainSalesDetailReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
+                  <a-select id="salesDetailReportList-settleStyleSn" v-model="queryParam.settleStyleSn" allowClear placeholder="请选择收款方式">
                     <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-model-item>
@@ -44,7 +44,7 @@
                 <a-form-item label="产品品牌">
                   <a-select
                     placeholder="请选择产品品牌"
-                    id="chainSalesDetailReportList-productBrandSn"
+                    id="salesDetailReportList-productBrandSn"
                     allowClear
                     v-model="queryParam.productEntity.productBrandSn"
                     :showSearch="true"
@@ -63,19 +63,19 @@
                     expand-trigger="hover"
                     :options="productTypeList"
                     :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                    id="chainSalesDetailReportList-productType"
+                    id="salesDetailReportList-productType"
                     placeholder="请选择产品分类"
                     allowClear />
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input id="chainSalesDetailReportList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+                  <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="chainSalesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="salesDetailReportList-name" v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -85,7 +85,7 @@
                     expand-trigger="hover"
                     :options="warehouseCascadeData"
                     :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-                    id="chainSalesDetailReportList-warehouseCascade"
+                    id="salesDetailReportList-warehouseCascade"
                     placeholder="请选择仓库仓位"
                     @change="warehouseCascadeChange"
                     allowClear
@@ -94,12 +94,12 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="单号">
-                  <a-input id="chainSalesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
+                  <a-input id="salesDetailReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入单号"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="业务员">
-                  <a-input id="chainSalesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
+                  <a-input id="salesDetailReportList-salesManName" v-model.trim="queryParam.salesManName" allowClear placeholder="请输入业务员"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="12" :sm="24">
@@ -131,8 +131,17 @@
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainSalesDetailReportList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainSalesDetailReportList-reset">重置</a-button>
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
+              <a-button
+                type="primary"
+                style="margin-left: 5px"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesDetailExport')"
+                class="button-warning"
+                id="salesDetailReportList-export-btn">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 8px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -168,13 +177,14 @@
 <script>
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import { hdPrint } from '@/libs/JGPrint'
 import { getArea } from '@/api/data'
 import { custTypeFindAllList } from '@/api/custType'
 import { settleStyleFindAllList } from '@/api/customer'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import { warehouseCascadeList } from '@/api/warehouse'
-import { reportSalesBillDetailList, reportSalesBillDetailCount } from '@/api/reportData'
+import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -317,6 +327,23 @@ export default {
       this.totalData = null
       this.$refs.table.clearTable()
     },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          _this.exportLoading = true
+          hdPrint('', 'export', reportSalesBillDetailExport, this.queryParam, '销售明细报表', function () {
+            _this.spinning = false
+            _this.exportLoading = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 29 - 2
src/views/reportData/salesReport/list.vue

@@ -81,7 +81,16 @@
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReportList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReportList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 8px">
+              <a-button
+                type="primary"
+                style="margin-left: 5px"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesReportExport')"
+                class="button-warning"
+                id="salesReportList-export-btn">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -117,10 +126,11 @@
 <script>
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import { hdPrint } from '@/libs/JGPrint'
 import { getArea } from '@/api/data'
 import { custTypeFindAllList } from '@/api/custType'
 import { settleStyleFindAllList } from '@/api/customer'
-import { reportSalesBillList, reportSalesBillCount } from '@/api/reportData'
+import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -236,6 +246,23 @@ export default {
       this.totalData = null
       this.$refs.table.clearTable()
     },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          _this.exportLoading = true
+          hdPrint('', 'export', reportSalesBillExport, this.queryParam, '销售报表', function () {
+            _this.spinning = false
+            _this.exportLoading = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 5 - 0
src/views/reportData/stockExpenditureReport/list.vue

@@ -225,6 +225,11 @@ export default {
             this.tableData = []
           }
           this.chartInit()
+        } else {
+          this.loadData = []
+          this.tableData = []
+          this.totalData = null
+          this.chartInit()
         }
         this.spinning = false
       })

+ 5 - 0
src/views/reportData/stockIncomeReport/list.vue

@@ -225,6 +225,11 @@ export default {
             this.tableData = []
           }
           this.chartInit()
+        } else {
+          this.loadData = []
+          this.tableData = []
+          this.totalData = null
+          this.chartInit()
         }
         this.spinning = false
       })