Browse Source

Merge branch 'develop' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop

lilei 3 năm trước cách đây
mục cha
commit
bd0844d6f8

+ 19 - 0
src/api/reportData.js

@@ -185,3 +185,22 @@ export const reportSalesBillDetailExport = params => {
     responseType: 'blob'
   })
 }
+// 盘点报表  盘点单报表 列表 分页
+export const reportCheckWarehouseList = (params) => {
+  const url = `/report/reportCheckWarehouse/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 盘点报表  盘点单报表 合计
+export const reportCheckWarehouseCount = (params) => {
+  return axios({
+    url: '/report/reportCheckWarehouse/reportCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 2 - 2
src/api/sales.js

@@ -127,7 +127,7 @@ export const salesCount = (params) => {
 // 车架号
 export const supperCodeByVin = (params) => {
   return axios({
-    url: `/supper/queryPartCodeByVin/${params.vin}`,
+    url: `/vinIdentify/queryPartCodeByVin/${params.vin}`,
     method: 'get'
   })
 }
@@ -163,7 +163,7 @@ export const salesExport = params => {
 // 车架号  识别图片内容
 export const vinCodeParse = params => {
   return axios.request({
-    url: `/vinCode/parse`,
+    url: `/vinIdentify/ocr`,
     method: 'post',
     data: params,
     responseType: 'blob'

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

@@ -1667,6 +1667,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/reportData/inventoryReport',
+            redirect: '/reportData/inventoryReport/list',
+            name: 'inventoryReport',
+            component: BlankLayout,
+            meta: {
+              title: '盘点报表',
+              icon: 'profile',
+              permission: 'M_inventoryReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'inventoryReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/inventoryReport/list.vue'),
+                meta: {
+                  title: '盘点报表列表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_inventoryReportList'
+                }
+              }
+            ]
           }
         ]
       },

+ 13 - 18
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -29,8 +29,8 @@
               </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 label="日期" prop="auditDate">
+                <a-month-picker v-model="queryParam.auditDate" :allowClear="false" @change="onChange" :defaultValue="moment()" style="width: 100%;" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -113,22 +113,21 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-import rangeDate from '@/views/common/rangeDate.vue'
 import { linkageReportPageList, linkageReportPageTotal, linkageGroupList } from '@/api/reportData'
 export default {
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect },
   data () {
     return {
+      moment,
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+        auditDate: moment().format('YYYY-MM'),
         tenantId: undefined,
         productEntity: {
           code: '', //  产品编码
@@ -143,7 +142,7 @@ export default {
       wrapperCol: { span: 16 },
       rules: {
         'tenantId': [{ required: true, message: '请选择连锁店', trigger: 'change' }],
-        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+        'auditDate': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
@@ -172,7 +171,8 @@ export default {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
-        if (this.queryParam.beginDate && this.queryParam.tenantId) {
+        if (this.queryParam.auditDate && this.queryParam.tenantId) {
+          params.auditDate = this.queryParam.auditDate + '-01'
           return linkageReportPageList(params).then(res => {
             // 总计
             this.getCount(params)
@@ -209,11 +209,9 @@ export default {
     }
   },
   methods: {
-    //  时间  change
-    dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+    // 月份  change
+    onChange (date, dateString) {
+      this.queryParam.auditDate = dateString || null
     },
     //  查询
     handleSearch () {
@@ -239,10 +237,7 @@ export default {
     //  重置
     resetSearchForm () {
       this.queryParam.tenantId = undefined
-      this.$refs.rangeDate.resetDate()
-      this.queryParam.time = []
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
+      this.queryParam.auditDate = moment().format('YYYY-MM')
       this.queryParam.productEntity.code = ''
       this.queryParam.productEntity.name = ''
       this.queryParam.productEntity.productBrandSn = undefined

+ 185 - 0
src/views/reportData/inventoryReport/inventoryOrder.vue

@@ -0,0 +1,185 @@
+<template>
+  <div>
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form-model
+        id="inventoryReportList-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" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="inventoryReportList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryReportList-reset">重置</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.totalStockQty || totalData.totalStockQty==0)) ? totalData.totalStockQty : '--' }}</strong>;
+        库存总成本:<strong>{{ (totalData && (totalData.totalStockCost || totalData.totalStockCost==0)) ? '¥'+totalData.totalStockCost : '--' }}</strong>;
+        盘盈总数量:<strong>{{ (totalData && (totalData.totalProfitQty || totalData.totalProfitQty==0)) ? totalData.totalProfitQty : '--' }}</strong>;
+        盘盈总成本:<strong>{{ (totalData && (totalData.totalProfitCost || totalData.totalProfitCost==0)) ? '¥'+totalData.totalProfitCost : '--' }}</strong>;
+        盘亏总数量:<strong>{{ (totalData && (totalData.totalLossQty || totalData.totalLossQty==0)) ? totalData.totalLossQty : '--' }}</strong>;
+        盘亏总成本:<strong>{{ (totalData && (totalData.totalLossCost || totalData.totalLossCost==0)) ? '¥'+totalData.totalLossCost : '--' }}</strong>;
+        盈亏总数量:<strong>{{ (totalData && (totalData.totalProfitLossQty || totalData.totalProfitLossQty==0)) ? totalData.totalProfitLossQty : '--' }}</strong>;
+        盈亏总成本:<strong>{{ (totalData && (totalData.totalProfitLossCost || totalData.totalProfitLossCost==0)) ? '¥'+totalData.totalProfitLossCost : '--' }}</strong>;
+      </div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.salesTargetSn"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+  import { STable, VSelect } from '@/components'
+  import rangeDate from '@/views/common/rangeDate.vue'
+  import { reportCheckWarehouseList, reportCheckWarehouseCount } from '@/api/reportData'
+  export default {
+    components: { STable, VSelect, rangeDate },
+    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: 'checkWarehouseNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '库存总数量', dataIndex: 'totalStockQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '库存总成本', dataIndex: 'totalStockCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盘盈总数量', dataIndex: 'totalProfitQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盘盈总成本', dataIndex: 'totalProfitCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盘亏总数量', dataIndex: 'totalLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盘亏总成本', dataIndex: 'totalLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盈亏总数量', dataIndex: 'totalProfitLossQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '盈亏总成本', dataIndex: 'totalProfitLossCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        ],
+        // 加载数据方法 必须为 Promise 对象
+        loadData: parameter => {
+          this.disabled = true
+          const params = Object.assign(parameter, this.queryParam)
+          // this.spinning = true
+          this.$emit('spinning', true)
+          delete params.time
+          if (params.beginDate) {
+            return reportCheckWarehouseList(params).then(res => {
+              // 总计
+              this.getCount(params)
+              const data = res.data
+              const no = (data.pageNo - 1) * data.pageSize
+              for (var i = 0; i < data.list.length; i++) {
+                data.list[i].no = no + i + 1
+              }
+              this.disabled = false
+              // this.spinning = false
+              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.spinning = false
+              _this.$emit('spinning', false)
+              _this.$message.info('请选择财务审核时间')
+              resolve(data)
+            })
+          }
+        },
+        totalData: null //  合计
+      }
+    },
+    methods: {
+      // 合计
+      getCount (params) {
+        reportCheckWarehouseCount(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()
+      }
+    },
+    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>

+ 24 - 0
src/views/reportData/inventoryReport/list.vue

@@ -0,0 +1,24 @@
+<template>
+  <a-card size="small" :bordered="false" class="inventoryReportList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <inventoryOrder @spinning="spinningFun" />
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+  import inventoryOrder from './inventoryOrder.vue'
+export default {
+  components: { inventoryOrder },
+  data () {
+    return {
+      spinning: false
+    }
+  },
+  methods: {
+    spinningFun(val){
+      this.spinning = val
+    }
+  }
+}
+</script>