chenrui 3 years ago
parent
commit
c14575405d

+ 48 - 0
src/api/reportStock.js

@@ -0,0 +1,48 @@
+import { axios } from '@/utils/request'
+
+//  连锁库存总表  列表  有分页
+export const reportStockList = (params) => {
+  const url = `/report/reportStock/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁库存总表  列表  合计
+export const reportStockCount = (params) => {
+  return axios({
+    url: '/report/reportStock/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+//  连锁库存总表  详情  列表  有分页
+export const reportStockDetailList = (params) => {
+  const url = `/report/reportStock/reportDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  库存总入报表
+export const reportStockPutList = (params) => {
+  return axios({
+    url: '/report/reportStockPut/report',
+    data: params,
+    method: 'post'
+  })
+}
+//  库存总出报表
+export const reportStockOutList = (params) => {
+  return axios({
+    url: '/report/reportStockOut/report',
+    data: params,
+    method: 'post'
+  })
+}

File diff suppressed because it is too large
+ 526 - 471
src/config/router.config.js


+ 2 - 2
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -96,10 +96,10 @@
         <!-- 现有库存数量 -->
         <template slot="currentStockQty" slot-scope="text, record">
           {{ (record.currentStockQty + record.freezeQty) || 0 }}
-          <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
         </template>
         <template slot="currentStockCost" slot-scope="text, record">
-          {{ (Number(record.currentStockCost)*100 + Number(record.freezeCost)*100)/100 || 0 }}
+          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">

+ 24 - 48
src/views/reportData/chainStockReport/detailModal.vue

@@ -10,13 +10,10 @@
     :width="960">
     <!-- 合计 -->
     <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):
-        <strong>
-          <!-- {{ currentStock.currentQty || 0 }} -->207
-        </strong>;现有库存总成本(¥):
-        <strong>
-          <!-- {{ currentStock.putCost || 0 }} -->1550.5
-        </strong>。</div>
+      <div class="ftext" slot="message">
+        现有库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
+        现有库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+      </div>
     </a-alert>
     <!-- 详情 -->
     <s-table
@@ -31,8 +28,8 @@
       bordered>
       <!-- 库存数量 -->
       <template slot="currentQty" slot-scope="text, record">
-        {{ (record.currentQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
+        {{ (Number(record.currentQty) + Number(record.freezeQty)) || 0 }}
+        <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
       </template>
     </s-table>
     <div class="btn-cont">
@@ -43,7 +40,7 @@
 
 <script>
 import { STable } from '@/components'
-import { stockDetailList, stockDetailCount } from '@/api/stock'
+import { reportStockDetailList, reportStockCount } from '@/api/reportStock'
 export default {
   name: 'InventoryQueryDetailModal',
   components: { STable },
@@ -52,7 +49,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    productSn: {
       type: [Number, String],
       default: ''
     }
@@ -68,9 +65,9 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'putTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 140, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -81,51 +78,30 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return stockDetailList(Object.assign(parameter, { stockSn: this.itemId })).then(res => {
-        //   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.getTotal(Object.assign(parameter, { stockSn: this.itemId }))
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productCode: 'GA-11078N', productName: '冠牌空气滤清器 丰田新款佳美2.4 12款逸致1.8', productOrigCode: '17807-20040', putTime: '2021-01-28 14:56:11', warehouseName: '默认仓库', warehouseLocationName: '默认仓位', putBizTypeDictValue: '散件入库', currentQty: '207', freezeQty: '', putCost: '1550.50' }
-            ],
-            count: 10
-          }
+        const params = Object.assign(parameter, { productSn: this.productSn })
+        return reportStockDetailList(params).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
+            data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          // 总计
+          this.getCount(params)
+          return data
         })
       },
-      currentStock: { // 合计信息
-        currentQty: '',
-        putCost: ''
-      }
+      currentStock: null
     }
   },
   methods: {
     // 合计
-    getTotal (param) {
-      stockDetailCount(param).then(res => {
+    getCount (param) {
+      reportStockCount(param).then(res => {
         if (res.status == 200 && res.data) {
           this.currentStock = res.data
         } else {
-          this.currentStock = { // 合计信息
-            currentQty: '',
-            putCost: ''
-          }
+          this.currentStock = null
         }
       })
     }

+ 185 - 156
src/views/reportData/chainStockReport/list.vue

@@ -1,121 +1,121 @@
 <template>
   <a-card size="small" :bordered="false" class="chainStockReportList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form-model
-        id="chainStockReportList-form"
-        ref="ruleForm"
-        :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="targetName">
-              <a-select
-                placeholder="请选择连锁店"
-                id="chainStockReportList-targetName"
-                allowClear
-                v-model="queryParam.targetName"
-                :showSearch="true"
-                option-filter-prop="children"
-                :filter-option="filterOption">
-                <a-select-option v-for="item in allocateTypeList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
-              </a-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品编码">
-              <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品名称">
-              <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainStockReportList-form"
+          ref="ruleForm"
+          :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="原厂编码">
-                <a-input id="productInfoList-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品品牌">
+              <a-form-model-item label="连锁店" prop="targetName">
                 <a-select
-                  placeholder="请选择产品品牌"
-                  id="productInfoList-productBrandSn"
+                  placeholder="请选择连锁店"
+                  id="chainStockReportList-targetName"
                   allowClear
-                  v-model="queryParam.productBrandSn"
+                  v-model="queryParam.targetName"
                   :showSearch="true"
                   option-filter-prop="children"
                   :filter-option="filterOption">
-                  <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  <a-select-option v-for="item in allocateTypeList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
                 </a-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品分类">
-                <a-cascader
-                  @change="changeProductType"
-                  change-on-select
-                  v-model="productType"
-                  expand-trigger="hover"
-                  :options="productTypeList"
-                  :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
-                  id="productInfoList-productType"
-                  placeholder="请选择产品分类"
-                  allowClear />
+              <a-form-model-item label="产品编码">
+                <a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-top: 3px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
-            <a @click="advanced=!advanced" style="margin-left: 8px">
-              {{ advanced ? '收起' : '展开' }}
-              <a-icon :type="advanced ? 'up' : 'down'"/>
-            </a>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-    <!-- 合计 -->
-    <a-alert type="info" showIcon style="margin-bottom:15px">
-      <div class="ftext" slot="message">现有库存总数量(个):
-        <strong>
-          <!-- {{ currentStock.currentQty || 0 }} -->207
-        </strong>;现有库存总成本(¥):
-        <strong>
-          <!-- {{ currentStock.putCost || 0 }} -->1550.5
-        </strong>。</div>
-    </a-alert>
-    <!-- 列表 -->
-    <s-table
-      class="sTable"
-      ref="table"
-      size="small"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      :scroll="{ x: 1170 }"
-      bordered>
-      <!-- 现有库存数量 -->
-      <template slot="currentStockQty" slot-scope="text, record">
-        {{ (record.currentStockQty + record.freezeQty) || 0 }}
-        <span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
-      </template>
-      <template slot="currentStockCost" slot-scope="text, record">
-        {{ (Number(record.currentStockCost)*100 + Number(record.freezeCost)*100)/100 || 0 }}
-      </template>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="chainStockReportList-detail-btn">详情</a-button>
-      </template>
-    </s-table>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="productInfoList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="原厂编码">
+                  <a-input id="productInfoList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <a-select
+                    placeholder="请选择产品品牌"
+                    id="productInfoList-productBrandSn"
+                    allowClear
+                    v-model="queryParam.productBrandSn"
+                    :showSearch="true"
+                    option-filter-prop="children"
+                    :filter-option="filterOption">
+                    <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <a-cascader
+                    @change="changeProductType"
+                    change-on-select
+                    v-model="productType"
+                    expand-trigger="hover"
+                    :options="productTypeList"
+                    :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
+                    id="productInfoList-productType"
+                    placeholder="请选择产品分类"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-top: 3px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chainStockReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chainStockReportList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 合计 -->
+      <a-alert type="info" showIcon style="margin-bottom:15px">
+        <div class="ftext" slot="message">
+          现有库存总数量(个):<strong> {{ (currentStock && currentStock.totalQty) || 0 }} </strong>;
+          现有库存总成本(¥):<strong> {{ (currentStock && currentStock.totalCost) || 0 }} </strong>。
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.productSn + record.stockSn"
+        :columns="columns"
+        :dataSource="loadData"
+        :scroll="{ x: 1170 }"
+        :pagination="paginationProps"
+        bordered>
+        <!-- 现有库存数量 -->
+        <template slot="currentStockQty" slot-scope="text, record">
+          {{ (Number(record.currentStockQty) + Number(record.freezeQty)) || 0 }}
+          <span v-if="Number(record.freezeQty)">(冻结{{ record.freezeQty }})</span>
+        </template>
+        <template slot="currentStockCost" slot-scope="text, record">
+          {{ (Number(record.currentStockCost)*1000 + Number(record.freezeCost)*1000)/1000 || 0 }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-success" @click="goDetail(record)" id="chainStockReportList-detail-btn">详情</a-button>
+        </template>
+      </a-table>
+    </a-spin>
     <!-- 详情 -->
-    <chain-stock-report-detail-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
+    <chain-stock-report-detail-modal :openModal="openModal" :productSn="productSn" @close="closeModal" />
   </a-card>
 </template>
 
@@ -124,23 +124,23 @@ import { STable, VSelect } from '@/components'
 import chainStockReportDetailModal from './detailModal.vue'
 import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
+import { reportStockList, reportStockCount } from '@/api/reportStock'
 export default {
   components: { STable, VSelect, chainStockReportDetailModal },
   data () {
     return {
+      spinning: false,
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
         targetName: undefined,
-        code: '', //  产品编码
-        name: '', //  产品名称
-        origCode: '', //  原厂编码
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productOrigCode: '', //  原厂编码
         productBrandSn: undefined, //  产品品牌
-        productTypeSn1: '', //  产品一级分类
-        productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn1: '', //  产品分类1
+        productTypeSn2: '', //  产品分类2
+        productTypeSn3: '' //  产品分类3
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
@@ -151,83 +151,112 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
         { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', scopedSlots: { customRender: 'currentStockCost' }, width: 165, align: 'center', sorter: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return allocateBillList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   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
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', code: 'GA-11078N', name: '冠牌空气滤清器 丰田新款佳美2.4 12款逸致1.8', origCode: '17807-20040', currentStockQty: '207', freezeQty: '', currentStockCost: '1550.50', freezeCost: '' }
-            ],
-            count: 10
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-          }
-          _this.disabled = false
-          resolve(data)
-        })
+      loadData: [],
+      pageNo: 1, //  分页页码
+      pageSize: 10, //  分页 每页多少条
+      paginationProps: {
+        showSizeChanger: true, //  是否可以改变 pageSize
+        total: 0, //  分页总条数
+        current: 1,
+        onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
+        onChange: (current) => this.changePage(current)
       },
       productType: [],
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
       allocateTypeList: [], //  调拨类型
-      itemId: '', //  当前id
+      currentStock: null, //  合计
+      productSn: '',
       openModal: false //  弹框
     }
   },
   methods: {
-    //  查询
-    handleSearch () {
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          this.$refs.table.refresh(true)
+    // 列表数据
+    getList (pageNo) {
+      this.disabled = true
+      this.pageNo = pageNo || this.pageNo
+      const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
+      this.spinning = true
+      reportStockList(params).then(res => {
+        if (res.status == 200) {
+          this.getCount(params)
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = data.pageNo
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.loadData = data.list
+          this.disabled = false
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.loadData = []
+        }
+        this.spinning = false
+      })
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.pageNo = current
+      this.pageSize = pageSize
+      this.getList()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.pageNo = current
+      this.getList()
+    },
+    // 合计
+    getCount (params) {
+      reportStockCount(params).then(res => {
+        if (res.status == 200) {
+          this.currentStock = res.data
         } else {
-          console.log('error submit!!')
-          return false
+          this.currentStock = null
         }
       })
     },
+    //  查询
+    handleSearch () {
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (valid) {
+      this.getList(1)
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.targetName = undefined
-      this.queryParam.code = ''
-      this.queryParam.name = ''
-      this.queryParam.origCode = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
       this.queryParam.productBrandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.productType = []
-      this.$refs.table.refresh(true)
+      this.getList(1)
     },
     //  详情
     goDetail (row) {
-      this.itemId = row.stockSn
+      this.productSn = row.productSn
       this.openModal = true
     },
     //  关闭弹框
     closeModal () {
-      this.itemId = ''
+      this.productSn = ''
       this.openModal = false
     },
     //  产品分类  change

+ 103 - 99
src/views/reportData/stockIncomeReport/list.vue

@@ -1,68 +1,86 @@
 <template>
   <a-card size="small" :bordered="false" class="noticeList-wrap">
-    <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="handelSearch(1)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="入库完成时间">
-              <rangeDate ref="rangeDate" @change="dateChange" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="handelSearch(1)" id="noticeList-refresh">查询</a-button>
-            <a-button style="margin-left: 8px" @click="resetSearchForm" id="noticeList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <!-- 列表 -->
-    <a-row :gutter="15">
-      <a-col :md="12" :sm="24">
-        <div class="chart-box">
-          <div class="chart-hj">库存总入数量:28,总成本:¥189.50</div>
-          <div id="con1" class="chart"></div>
-        </div>
-      </a-col>
-      <a-col :md="12" :sm="24">
-        <a-table
-          class="sTable"
-          ref="table"
-          size="default"
-          :rowKey="(record) => record.id"
-          :columns="columns"
-          :dataSource="loadData"
-          :loading="listLoading"
-          :pagination="false"
-          bordered>
-        </a-table>
-      </a-col>
-    </a-row>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="chainStockReportList-form"
+          ref="ruleForm"
+          :model="queryParam"
+          :rules="rules"
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          @keyup.enter.native="handelSearch" >
+          <a-row :gutter="15">
+            <a-col :md="8" :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="noticeList-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" id="noticeList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <a-row :gutter="15">
+        <a-col :md="12" :sm="24">
+          <div class="chart-box">
+            <div class="chart-hj">库存总入数量:28,总成本:¥189.50</div>
+            <div id="con1" class="chart"></div>
+          </div>
+        </a-col>
+        <a-col :md="12" :sm="24">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="default"
+            :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'
 export default {
   components: { rangeDate },
   data () {
     return {
+      spinning: false,
       queryParam: { //  查询条件
+        time: [],
         beginDate: '',
         endDate: ''
       },
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      rules: {
+        'time': [{ required: true, message: '请选择入库完成时间', trigger: 'change' }]
+      },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
-        { title: '明细项', dataIndex: 'itemName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量(件)', dataIndex: 'qty', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本(元)', dataIndex: 'cost', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价(元)', dataIndex: 'price', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '明细项', dataIndex: 'dataBizTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '数量(件)', dataIndex: 'productQty', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本(元)', dataIndex: 'productCost', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '售价(元)', dataIndex: 'productPrice', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       // 统计图
       pieData: [],
       pieColor: ['#00aaff', '#ffaa00', '#00aa00', '#ff55ff', '#1dc5d4', '#8465c7', '#00ffff'],
-      loadData: [],
+      tableData: [], //  含总计数据
+      loadData: [], //  不含总计数据
       listLoading: false,
       chart1: null
     }
@@ -156,72 +174,56 @@ export default {
     },
     //  时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
-      this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
+      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
       }
       // 开始查询
       this.listLoading = true
-      setTimeout(() => {
+      this.spinning = true
+      reportStockPutList(params).then(res => {
         this.listLoading = false
-        this.loadData = [
-          {
-            itemName: '采购入库',
-            qty: '8',
-            cost: '52.00',
-            price: ''
-          },
-          {
-            itemName: '散件入库',
-            qty: '17',
-            cost: '115.00',
-            price: ''
-          },
-          {
-            itemName: '销售退货',
-            qty: '3',
-            cost: '22.50',
-            price: '30.00'
-          },
-          {
-            itemName: '盘盈入库',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '连锁调入',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '库存导入',
-            qty: '0',
-            cost: '00.00',
-            price: ''
-          },
-          {
-            itemName: '总入',
-            qty: '28',
-            cost: '189.50',
-            price: '30.00'
+        if (res.status == 200) {
+          const reportStockPutVOList = (res.data && res.data.reportStockPutVOList) ? res.data.reportStockPutVOList : []
+          const totalQty = (res.data && res.data.totalQty) ? res.data.totalQty : 0
+          const totalPrice = (res.data && res.data.totalPrice) ? res.data.totalPrice : 0
+          const totalCost = (res.data && res.data.totalCost) ? res.data.totalCost : 0
+          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()
-      }, 600)
+          this.chartInit()
+        }
+        this.spinning = false
+      })
     },
     chartInit () {
       this.loadData.map((item, index) => {
-        if (index != this.loadData.length - 1) {
+        if (index != this.loadData.length) {
           this.pieData.push({
-            name: item.itemName + '总成本',
-            value: item.cost
+            name: item.dataBizTypeDictValue + '总成本',
+            value: item.productCost
           })
         }
       })
@@ -235,7 +237,11 @@ export default {
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
-      this.handelSearch()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.loadData = []
+      this.tableData = []
     }
   },
   mounted () {
@@ -246,9 +252,7 @@ export default {
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.handelSearch()
-    })
+    next(vm => {})
   }
 }
 </script>

+ 2 - 2
src/views/salesManagement/salesQuery/list.vue

@@ -122,7 +122,7 @@
             size="small"
             type="link"
             class="button-warning"
-            v-if="(record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE') && $hasPermissions('B_salesAudit')"
+            v-if="record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')"
             @click="handleEexamine(record)"
           >审核</a-button>
           <a-button
@@ -169,7 +169,7 @@
             取消
           </a-button>
           <!-- <span v-if="record.billStatus == 'FINISH'">--</span> -->
-          <span v-if="(!(record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE') && !$hasPermissions('B_salesAudit')) &&!(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) &&(!((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && !$hasPermissions('B_salesEdit')) &&(!(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'SUPERIOR_CHANGE')) && !$hasPermissions('B_salesDel')) &&(!(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'SUPERIOR_CHANGE')) && !$hasPermissions('B_salesEdit') && !$hasPermissions('B_salesDel')) || record.billStatus == 'FINISH'">--</span>
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) &&!(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) &&(!((record.salesBillSource == 'SATELLITE' || record.salesBillSource == 'SALES') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && !$hasPermissions('B_salesEdit')) &&(!(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'SUPERIOR_CHANGE')) && !$hasPermissions('B_salesDel')) &&(!(record.salesBillSource == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'AUDIT_REJECT' || record.billStatus == 'SUPERIOR_CHANGE')) && !$hasPermissions('B_salesEdit') && !$hasPermissions('B_salesDel')) || record.billStatus == 'FINISH'">--</span>
         </template>
       </s-table>
     </a-spin>

Some files were not shown because too many files changed in this diff