Selaa lähdekoodia

Merge commit 'ed33f40edaba4adce32ae70f970368d35920691a' into HEAD

gitadmin 3 vuotta sitten
vanhempi
commit
136fd5191a

+ 11 - 1
src/api/oos.js

@@ -19,7 +19,7 @@ export const oosDetail = (params) => {
     method: 'get'
   })
 }
-//  缺货 导出
+//  缺货 按客户导出
 export const oosDetailExport = (params) => {
   return axios({
     url: '/oos/detail/exportByBuyer',
@@ -28,6 +28,16 @@ export const oosDetailExport = (params) => {
     responseType: 'blob'
   })
 }
+//  缺货 按产品导出
+export const oosDetailExportByProduct = (params) => {
+  return axios({
+    url: '/oos/detail/exportByProduct',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
 //  缺货  详情  列表  分页
 export const oosDetailList = (params) => {
   const url = `/oos/detail/queryPage/${params.pageNo}/${params.pageSize}`

+ 10 - 1
src/api/reportData.js

@@ -123,6 +123,15 @@ export const headRebateDetailReportCount = (params) => {
     method: 'post'
   })
 }
+// 总部差价明细报表导出
+export const headRebateDetailReportExport = (params) => {
+  return axios({
+    url: '/report/headRebateDetailReport/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 //  差价明细报表
 export const reportRebateReportList = (params) => {
   const url = `/report/reportRebate/queryPage/${params.pageNo}/${params.pageSize}`
@@ -452,4 +461,4 @@ export const realReportSalesBySubAreaExport = (params) => {
     method: 'post',
     responseType: 'blob'
   })
-}
+}

+ 11 - 0
src/api/stockOut.js

@@ -48,3 +48,14 @@ export const stockOutDetailCount = (params) => {
     method: 'post'
   })
 }
+
+// 导出销售
+export const exportSalesOutProduct = (params) => {
+  const url = `/stockOutDetail/exportSalesOutProduct`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

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

@@ -1463,6 +1463,31 @@ export const asyncRouterMap = [
           permission: 'M_dataExport'
         },
         children: [
+          {
+            path: '/dataExport/exportSales',
+            redirect: '/dataExport/exportSales/list',
+            name: 'exportSales',
+            component: BlankLayout,
+            meta: {
+              title: '导出销售',
+              icon: 'gold',
+              permission: 'M_exportSales'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'exportSalesList',
+                component: () => import(/* webpackChunkName: "dataExport" */ '@/views/dataExport/exportSales/list.vue'),
+                meta: {
+                  title: '导出销售',
+                  icon: 'gold',
+                  hidden: true,
+                  permission: 'M_exportSales'
+                }
+              }
+            ]
+          },
           {
             path: '/dataExport/exportCheck',
             redirect: '/dataExport/exportCheck/list',

+ 9 - 1
src/views/common/productBrand.js

@@ -25,6 +25,10 @@ const ProductBrand = {
     sysFlag: {
       type: String,
       default: ''
+    },
+    brandType: {
+      type: String,
+      default: ''
     }
   },
   data() {
@@ -39,6 +43,10 @@ const ProductBrand = {
   watch: {
     value(newValue, oldValue) {
       this.defaultVal = newValue
+    },
+    brandType(newValue,oldValue){
+      this.handleChange(undefined)
+      this.getProductBrand()
     }
   },
   methods: {
@@ -54,7 +62,7 @@ const ProductBrand = {
     },
     //  产品品牌列表, sysFlag: 1 箭冠 0 自建
     getProductBrand () {
-      productBrandQuery({ 'sysFlag': this.sysFlag }).then(res => {
+      productBrandQuery({ 'sysFlag': this.sysFlag, 'brandType': this.brandType }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {

+ 3 - 0
src/views/dataExport/exportCheck/list.vue

@@ -132,5 +132,8 @@ export default {
 <style lang="less">
   .exportCheckList-wrap{
     height: 99%;
+    .form-model-con{
+      margin-top: 50px;
+    }
   }
 </style>

+ 143 - 0
src/views/dataExport/exportSales/list.vue

@@ -0,0 +1,143 @@
+<template>
+  <a-card size="small" :bordered="false" class="exportCheckList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="exportCheckList-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="10" :sm="24">
+              <a-form-model-item label="选择时间范围" prop="dateArr">
+                <a-select id="exportCheckList-print" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
+                  <a-select-option v-for="item in checkList" :value="item" :key="item">
+                    <span>{{ item }}</span>
+                  </a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="exportCheckList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { checkWarehouseExcelList } from '@/api/checkWarehouse'
+import { exportSalesOutProduct } from '@/api/stockOut.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      queryParam: { //  查询条件
+        dateArr: undefined
+      },
+      rules: {
+        'dateArr': [{ required: true, message: '请选择时间范围', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      checkList: []
+    }
+  },
+  methods: {
+    getList () {
+      checkWarehouseExcelList().then(res => {
+        if (res.status == 200) {
+          const arr = res.data.reverse()
+          for (let i = arr.length - 1; i > 0; i--) {
+            this.checkList.push([arr[i - 1].financeAuditTime, arr[i].financeAuditTime].join(' 至 '))
+          }
+        } else {
+          this.checkList = []
+        }
+      })
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam.dateArr.split(' 至 ')
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(exportSalesOutProduct, { 'beginDate': params[0], 'endDate': params[1] }, '导出销售', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.queryParam.dateArr = undefined
+      this.$refs.ruleForm.resetFields()
+      this.getList()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 238
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .exportCheckList-wrap{
+    height: 99%;
+    .form-model-con{
+      margin-top: 50px;
+    }
+  }
+</style>

+ 22 - 5
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -12,7 +12,7 @@
         <div ref="tableSearch" class="table-page-search-wrapper">
           <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="变动类型">
                   <v-select
                     v-model="queryParam.flowType"
@@ -23,7 +23,7 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="单据类型">
                   <v-select
                     v-model="queryParam.bizType"
@@ -34,17 +34,27 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="仓库">
                   <a-select id="inventoryQueryWarehouseDetail-warehouseSn" allowClear placeholder="请选择仓库" v-model="queryParam.warehouseSn" >
                     <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="单据审核时间">
+                  <rangeDate ref="rangeDate" @change="dateChange" />
+                </a-form-item>
+              </a-col>
               <template v-if="advanced">
                 <a-col :md="6" :sm="24">
-                  <a-form-item label="单据审核时间">
-                    <rangeDate ref="rangeDate" @change="dateChange" />
+                  <a-form-item label="关联单号">
+                    <a-input id="inventoryQueryWarehouseDetail-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="下推单号">
+                    <a-input id="inventoryQueryWarehouseDetail-bizSubNo" v-model.trim="queryParam.bizSubNo" allowClear placeholder="请输入下推单号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -88,6 +98,8 @@
         <a-alert type="info" style="margin-bottom:10px">
           <div class="ftext" slot="message">
             当前库存总数量(个):<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong>;
+            入库总数量(个):<strong>{{ (productTotal&&(productTotal.totalPutQty || productTotal.totalPutQty==0)) ? productTotal.totalPutQty : '--' }}</strong>;
+            出库总数量(个):<strong>{{ (productTotal&&(productTotal.totalOutQty || productTotal.totalOutQty==0)) ? productTotal.totalOutQty : '--' }}</strong>;
             <span v-if="$hasPermissions('B_isShowCost')">当前库存总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong>。</span>
           </div>
         </a-alert>
@@ -135,6 +147,8 @@ export default {
         bizType: undefined,
         flowType: undefined,
         unitName: '',
+        bizNo: '',
+        bizSubNo: '',
         warehouseSn: undefined,
         state: undefined
       },
@@ -179,6 +193,7 @@ export default {
         { title: '批次号', dataIndex: 'stockBatchNo', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '关联单号', dataIndex: 'bizNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推单号', dataIndex: 'bizSubNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位名称', dataIndex: 'unitName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓库', dataIndex: 'warehouseName', width: '4%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -223,6 +238,8 @@ export default {
       this.queryParam.bizType = undefined
       this.queryParam.flowType = undefined
       this.queryParam.unitName = ''
+      this.queryParam.bizSubNo = ''
+      this.queryParam.bizNo = ''
       this.queryParam.warehouseSn = undefined
       this.queryParam.state = undefined
       this.$refs.table.refresh(true)

+ 47 - 1
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -83,6 +83,14 @@
                 id="hPriceDifferenceDetailList-stockDate">盘点区间日期</a-button>
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="hPriceDifferenceDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="hPriceDifferenceDetailList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="shortageStatisticsCList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -117,6 +125,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -125,7 +134,7 @@ import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
-import { headRebateDetailReportList, headRebateDetailReportCount } from '@/api/reportData'
+import { headRebateDetailReportList, headRebateDetailReportCount, headRebateDetailReportExport } from '@/api/reportData'
 export default {
   components: { STable, VSelect, custList, subarea, rangeDate, ProductBrand, ProductType },
   data () {
@@ -139,6 +148,7 @@ export default {
         ],
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
+        exportLoading: false,
         bizNo: '',
         dealer: {
           dealerSn: undefined,
@@ -228,6 +238,42 @@ export default {
     }
   },
   methods: {
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      headRebateDetailReportExport(params).then(res => {
+        this.exportLoading = false
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDHHmmss')
+      const fname = '总部差价明细报表' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
     // 盘点库存日期
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')

+ 44 - 21
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -12,31 +12,36 @@
           :rules="rules"
           @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea v-model="queryParam.subareaSn"></subarea>
+              </a-form-model-item>
+            </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="日期" prop="month">
-                <a-month-picker v-model="queryParam.month" :allowClear="false" @change="onChange" :defaultValue="moment()" style="width: 100%;" />
+              <a-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="3" :sm="24">
               <a-form-model-item label="省份" prop="provinceSn">
                 <a-select v-model="queryParam.provinceSn" allowClear placeholder="请选择省">
                   <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="5" :sm="24">
               <a-form-model-item label="记账门店">
                 <custList id="priceDifferenceDetailList-rebateDealer" ref="rebateDealerList" @change="rebateDealerChange"></custList>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="5" :sm="24">
                 <a-form-model-item label="客户名称">
                   <custList id="priceDifferenceDetailList-custList" ref="custList" :itemSn="queryParam.dealerSn" @change="custChange"></custList>
                 </a-form-model-item>
               </a-col>
             </template>
-            <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
               <a-button
@@ -79,29 +84,36 @@
 </template>
 
 <script>
-import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import { getArea } from '@/api/data'
+import subarea from '@/views/common/subarea.js'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { reportRebateReportList, reportRebateCount, reportRebateExport } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, custList },
+  components: { STable, VSelect, custList, subarea, rangeDate },
   data () {
     return {
-      moment,
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       exportLoading: false,
       queryParam: { //  查询条件
-        month: moment().format('YYYY-MM'),
+        time: [
+          getDate.getCurrMonthDays().starttime,
+          getDate.getCurrMonthDays().endtime
+        ],
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         provinceSn: undefined,
         rebateDealerSn: undefined,
-        dealerSn: undefined
+        dealerSn: undefined,
+        subareaSn: undefined
       },
       rules: {
-        'month': [{ required: true, message: '请选择月份', trigger: 'change' }],
-        'provinceSn': [{ required: true, message: '请选择省份', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+        // 'provinceSn': [{ required: true, message: '请选择省份', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       addrProvinceList: [], //  省下拉
@@ -133,14 +145,12 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '月份', dataIndex: 'month', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'dealerSubareaNameSet', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '日期', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'provinceName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '记账门店', dataIndex: 'rebateDealerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户名称', dataIndex: 'dealerName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '直接差额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '类型', dataIndex: 'bizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
@@ -152,9 +162,15 @@ export default {
     }
   },
   methods: {
-    // 月份  change
-    onChange (date, dateString) {
-      this.queryParam.month = dateString || null
+    //  创建时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
     },
     // 合计
     getCount (params) {
@@ -214,10 +230,17 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.month = moment().format('YYYY-MM')
+      this.queryParam.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.provinceSn = undefined
       this.queryParam.rebateDealerSn = undefined
       this.queryParam.dealerSn = undefined
+      this.queryParam.subareaSn = undefined
       this.$refs.rebateDealerList.resetForm()
       this.totalData = null
       if (this.advanced) {

+ 1 - 13
src/views/reportData/salesDetails/list.vue

@@ -56,7 +56,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品品牌">
-                  <ProductBrand id="salesDetailsList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="salesDetailsList-productBrandSn" :brandType="queryParam.productBrandTypeSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -229,7 +229,6 @@ export default {
       addrProvinceList: [], //  省下拉
       addrCityList: [], //  市下拉
       addrDistrictList: [], //  区下拉
-      productBrandList: [], //  品牌下拉数据
       productTypeList: [] //  分类下拉数据
     }
   },
@@ -371,16 +370,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  产品品牌  列表
-    getProductBrand () {
-      productBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-        } else {
-          this.productBrandList = []
-        }
-      })
-    },
     //  产品分类  列表
     getProductType () {
       productTypeQuery({}).then(res => {
@@ -438,7 +427,6 @@ export default {
       })
     },
     pageInit () {
-      this.getProductBrand()
       this.getProductType()
       this.getArea('province')
     }

+ 47 - 1
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -30,6 +30,14 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsPList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsPList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="shortageStatisticsCList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -68,10 +76,11 @@
 </template>
 
 <script>
+import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { oosProductList, oosProductDetailCount, oosProductDetailPageCount } from '@/api/oos'
+import { oosProductList, oosProductDetailCount, oosProductDetailPageCount, oosDetailExportByProduct } from '@/api/oos'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -87,6 +96,7 @@ export default {
         origCode: ''
       },
       disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -163,6 +173,42 @@ export default {
         }
       })
     },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      oosDetailExportByProduct(params).then(res => {
+        this.exportLoading = false
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          this.download(res)
+        }
+      })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDHHmmss')
+      const fname = '缺货统计(按产品)' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.188:8602/ocs-admin',
+        target: 'http://192.168.16.155:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
-        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         // target: 'http://ocs-admin.360arrow.com/ocs-admin', //  Éú²ú
         ws: false,
         changeOrigin: true,