chenrui 3 år sedan
förälder
incheckning
7e9368227f

+ 44 - 43
src/views/reportData/chainReceivedSendStorageReport/list.vue

@@ -106,8 +106,6 @@ import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
 import { dealerProductTypeList } from '@/api/dealerProductType'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { linkageReportPageList, linkageReportPageTotal } from '@/api/reportData.js'
-// import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
-// import { allocateTypeAllList } from '@/api/allocateType'
 export default {
   components: { STable, VSelect, rangeDate },
   data () {
@@ -155,7 +153,7 @@ export default {
         },
         { title: '产品名称',
           dataIndex: 'name',
-		  width: 220,
+          width: 220,
           align: 'center',
           customRender: function (value, row, index) {
             value = value || '--'
@@ -231,32 +229,38 @@ export default {
       loadData: async parameter => {
         if (this.queryParam.beginDate) {
           this.disabled = true
-		  const params = {
-			  beginDate: this.queryParam.beginDate,
-			  endDate: this.queryParam.endDate,
-			  targetName: this.queryParam.targetName,
-			  productEntity: {
-				 code: this.queryParam.code, //  产品编码
-				 name: this.queryParam.name, //  产品名称
-				 origCode: this.queryParam.origCode, //  原厂编码
-				 productBrandSn: this.queryParam.productBrandSn, //  产品品牌
-				 productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
-				 productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
-				 productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
-			  }
-		  }
+          const params = {
+            beginDate: this.queryParam.beginDate,
+            endDate: this.queryParam.endDate,
+            targetName: this.queryParam.targetName,
+            productEntity: {
+              code: this.queryParam.code, //  产品编码
+              name: this.queryParam.name, //  产品名称
+              origCode: this.queryParam.origCode, //  原厂编码
+              productBrandSn: this.queryParam.productBrandSn, //  产品品牌
+              productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
+              productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
+              productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
+            }
+          }
           return linkageReportPageList(Object.assign(parameter, 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 = no + i + 1
-			  }
-			  this.disabled = false
-			  return data
+            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
           })
         } else {
           return new Promise(function (resolve, reject) {
-            resolve([])
+            const data = {
+              pageNo: 1,
+              pageSize: 10,
+              list: [],
+              count: 10
+            }
+            resolve(data)
           })
         }
       },
@@ -264,7 +268,7 @@ export default {
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
       allocateTypeList: [], //  调拨类型
-	  totalData: {} // 合计
+      totalData: {} // 合计
     }
   },
   methods: {
@@ -276,7 +280,7 @@ export default {
     //  查询
     handleSearch () {
       if (!this.queryParam.beginDate) {
-		  return this.$message.error('请先选择日期')
+        return this.$message.error('请先选择日期')
       }
       this.$refs.table.refresh(true)
       this.getTotal()
@@ -286,7 +290,7 @@ export default {
     //         return this.$message.error('请先选择日期')
     //       }
     //       this.$refs.table.refresh(true)
-		  // this.getTotal()
+    // this.getTotal()
     //     } else {
     //       console.log('error submit!!')
     //       return false
@@ -296,22 +300,21 @@ export default {
     // 查询总计
     getTotal () {
       const params = {
-		  beginDate: this.queryParam.beginDate,
-		  endDate: this.queryParam.endDate,
-		  targetName: this.queryParam.targetName,
-		  productEntity: {
-			 code: this.queryParam.code, //  产品编码
-			 name: this.queryParam.name, //  产品名称
-			 origCode: this.queryParam.origCode, //  原厂编码
-			 productBrandSn: this.queryParam.productBrandSn, //  产品品牌
-			 productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
-			 productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
-			 productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
-		  }
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate,
+        targetName: this.queryParam.targetName,
+        productEntity: {
+          code: this.queryParam.code, //  产品编码
+          name: this.queryParam.name, //  产品名称
+          origCode: this.queryParam.origCode, //  原厂编码
+          productBrandSn: this.queryParam.productBrandSn, //  产品品牌
+          productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
+          productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
+          productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
+        }
       }
       linkageReportPageTotal(params).then(res => {
         if (res.status == 200 && res.data) {
-          console.log(res, 'rrrrrrrrr')
           this.totalData = res.data
         } else {
           this.totalData = {}
@@ -340,10 +343,8 @@ export default {
     //  产品品牌  列表
     getProductBrand () {
       dealerProductBrandQuery({}).then(res => {
-		  console.log(res, 'rrrrrr')
         if (res.status == 200) {
           this.productBrandList = res.data
-		  console.log(this.productBrandList, res, '--------pinpai--------')
         } else {
           this.productBrandList = []
         }

+ 37 - 64
src/views/reportData/chainStockReport/list.vue

@@ -85,20 +85,20 @@
       <!-- 合计 -->
       <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>。
+          现有库存总数量(个):<strong> {{ (currentStock && (currentStock.totalQty || currentStock.totalQty==0)) ? currentStock.totalQty : '--' }} </strong>;
+          现有库存总成本(¥):<strong> {{ (currentStock && (currentStock.totalCost || currentStock.totalCost==0)) ? currentStock.totalCost : '--' }} </strong>。
         </div>
       </a-alert>
       <!-- 列表 -->
-      <a-table
+      <s-table
         class="sTable"
         ref="table"
         size="small"
         :rowKey="(record) => record.productSn + record.stockSn"
         :columns="columns"
-        :dataSource="loadData"
+        :data="loadData"
+        :defaultLoadData="false"
         :scroll="{ x: 1170 }"
-        :pagination="paginationProps"
         bordered>
         <!-- 现有库存数量 -->
         <template slot="currentStockQty" slot-scope="text, record">
@@ -112,7 +112,7 @@
         <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>
+      </s-table>
     </a-spin>
     <!-- 详情 -->
     <chain-stock-report-detail-modal :openModal="openModal" :productSn="productSn" @close="closeModal" />
@@ -151,22 +151,30 @@ export default {
       exportLoading: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { 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' }
       ],
-      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)
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        return reportStockList(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
+          return data
+        })
       },
       productType: [],
       productBrandList: [], //  品牌下拉数据
@@ -178,43 +186,6 @@ export default {
     }
   },
   methods: {
-    // 列表数据
-    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 => {
@@ -227,14 +198,15 @@ export default {
     },
     //  查询
     handleSearch () {
-      // this.$refs.ruleForm.validate(valid => {
-      //   if (valid) {
-      this.getList(1)
-      //   } else {
-      //     console.log('error submit!!')
-      //     return false
-      //   }
-      // })
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
     },
     //  重置
     resetSearchForm () {
@@ -247,7 +219,8 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.productType = []
-      this.getList(1)
+      this.$refs.ruleForm.resetFields()
+      // this.$refs.table.refresh(true)
     },
     //  详情
     goDetail (row) {
@@ -267,7 +240,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      dealerProductBrandQuery({ 'sysFlag': '0' }).then(res => {
+      dealerProductBrandQuery({}).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -277,7 +250,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      dealerProductTypeList({ 'sysFlag': '0' }).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {

+ 46 - 47
src/views/reportData/receivedSendStorageReport/list.vue

@@ -144,7 +144,7 @@ export default {
         },
         { title: '产品名称',
           dataIndex: 'name',
-      		  width: 220,
+          width: 220,
           align: 'center',
           customRender: function (value, row, index) {
             value = value || '--'
@@ -220,27 +220,27 @@ export default {
       loadData: parameter => {
         if (this.queryParam.beginDate) {
           this.disabled = true
-		  const params = {
-			  beginDate: this.queryParam.beginDate,
-			  endDate: this.queryParam.endDate,
-			  productEntity: {
-				 code: this.queryParam.code, //  产品编码
-				 name: this.queryParam.name, //  产品名称
-				 origCode: this.queryParam.origCode, //  原厂编码
-				 productBrandSn: this.queryParam.productBrandSn, //  产品品牌
-				 productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
-				 productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
-				 productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
-			  }
-		  }
+          const params = {
+            beginDate: this.queryParam.beginDate,
+            endDate: this.queryParam.endDate,
+            productEntity: {
+              code: this.queryParam.code, //  产品编码
+              name: this.queryParam.name, //  产品名称
+              origCode: this.queryParam.origCode, //  原厂编码
+              productBrandSn: this.queryParam.productBrandSn, //  产品品牌
+              productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
+              productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
+              productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
+            }
+          }
           return reportPageList(Object.assign(parameter, 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 = no + i + 1
-        	  }
-        	  this.disabled = false
-        	  return data
+            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
           })
         } else {
           return new Promise(function (resolve, reject) {
@@ -251,21 +251,21 @@ export default {
       productType: [],
       productBrandList: [], //  品牌下拉数据
       productTypeList: [], //  分类下拉数据
-	  totalData: {} // 合计
+      totalData: {} // 合计
     }
   },
   methods: {
-	  //  时间  change
-	  dateChange (date) {
-	    this.queryParam.beginDate = date[0]
-	    this.queryParam.endDate = date[1]
-	  },
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     //  查询
     handleSearch () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           if (!this.queryParam.beginDate) {
-			  return this.$message.error('请先选择日期')
+            return this.$message.error('请先选择日期')
           }
           this.$refs.table.refresh(true)
           this.getTotal()
@@ -278,26 +278,25 @@ export default {
     // 查询总计
     getTotal () {
       const params = {
-		  beginDate: this.queryParam.beginDate,
-		  endDate: this.queryParam.endDate,
-		  productEntity: {
-			 code: this.queryParam.code, //  产品编码
-			 name: this.queryParam.name, //  产品名称
-			 origCode: this.queryParam.origCode, //  原厂编码
-			 productBrandSn: this.queryParam.productBrandSn, //  产品品牌
-			 productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
-			 productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
-			 productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
-		  }
+        beginDate: this.queryParam.beginDate,
+        endDate: this.queryParam.endDate,
+        productEntity: {
+          code: this.queryParam.code, //  产品编码
+          name: this.queryParam.name, //  产品名称
+          origCode: this.queryParam.origCode, //  原厂编码
+          productBrandSn: this.queryParam.productBrandSn, //  产品品牌
+          productTypeSn1: this.queryParam.productTypeSn1, //  产品一级分类
+          productTypeSn2: this.queryParam.productTypeSn2, //  产品二级分类
+          productTypeSn3: this.queryParam.productTypeSn3 //  产品三级分类
+        }
       }
-	  linkageReportTotal(params).then(res => {
-	    if (res.status == 200 && res.data) {
-	      // console.log(res, 'rrrrrrrrr')
-	      this.totalData = res.data
-	    } else {
-	      this.totalData = {}
-	    }
-	  })
+      linkageReportTotal(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = {}
+        }
+      })
     },
     //  重置
     resetSearchForm () {