Browse Source

Merge branch 'develop_0216' of jianguan-web/jg-ocs-html into develop

李磊 3 năm trước cách đây
mục cha
commit
d3d42a9b74

+ 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',

+ 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)

+ 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) {