Browse Source

新增报表

chenrui 1 year ago
parent
commit
cd5c34261b

+ 1 - 1
src/views/productManagement/productInfo/edit.vue

@@ -504,7 +504,7 @@ export default {
     height: 100%;
     height: 100%;
     >.ant-spin-nested-loading{
     >.ant-spin-nested-loading{
       height: 100%;
       height: 100%;
-	  overflow-y: auto;
+      overflow-y: auto;
       .ant-spin-container{
       .ant-spin-container{
         height: 90%;
         height: 90%;
       }
       }

+ 126 - 86
src/views/reportData/salesRankingReport/list.vue

@@ -1,64 +1,66 @@
 <template>
 <template>
   <div class="jg-page-wrap customerReportList-wrap">
   <div class="jg-page-wrap customerReportList-wrap">
     <a-card size="small" :bordered="false" class="table-page-search-wrapper">
     <a-card size="small" :bordered="false" class="table-page-search-wrapper">
-      <!-- 搜索条件 -->
-      <a-form-model
-        id="customerReportList-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">
-            <a-form-item label="产品品牌">
-              <ProductBrand id="salesDetailReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="产品分类">
-              <ProductType id="chainSalesReportList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-            </a-form-model-item>
-          </a-col>
-          <template v-if="advanced">
+      <div ref="tableSearch">
+        <!-- 搜索条件 -->
+        <a-form-model
+          id="customerReportList-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-col :md="6" :sm="24">
-              <a-form-model-item label="产品编码">
-                <a-input id="salesDetailReportList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+              <a-form-model-item label="查询时间" prop="time">
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
               </a-form-model-item>
             </a-col>
             </a-col>
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="产品名称">
-                <a-input id="salesDetailReportList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              <a-form-item label="产品品牌">
+                <ProductBrand id="salesDetailReportList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="chainSalesReportList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-model-item>
               </a-form-model-item>
             </a-col>
             </a-col>
-          </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-reset">重置</a-button>
-            <a-button
-              type="primary"
-              style="margin-left: 5px"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              v-if="$hasPermissions('M_salesReturnReportExport')"
-              class="button-warning"
-              id="salesDetailReportList-export-btn">导出</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>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="salesDetailReportList-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="salesDetailReportList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="customerReportList-reset">重置</a-button>
+              <a-button
+                type="primary"
+                style="margin-left: 5px"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('M_salesReturnReportExport')"
+                class="button-warning"
+                id="salesDetailReportList-export-btn">导出</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-card>
     </a-card>
     <a-card size="small" :bordered="false">
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
       <a-spin :spinning="spinning" tip="Loading...">
@@ -74,6 +76,19 @@
             合计销售数量:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}</strong>;
             合计销售数量:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}</strong>;
             合计销售金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}</strong>;
             合计销售金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? totalData.discountedAmount : '--' }}</strong>;
           </div>
           </div>
+          <div>
+            <span>显示:</span>
+            <a-tree-select
+              size="small"
+              v-model="showCols"
+              style="min-width: 200px"
+              dropdownMatchSelectWidth
+              :maxTagCount="3"
+              :tree-data="colsArr"
+              tree-checkable
+              placeholder="请选择要显示的列(多选)"
+            />
+          </div>
         </div>
         </div>
         <!-- 列表 -->
         <!-- 列表 -->
         <s-table
         <s-table
@@ -101,7 +116,7 @@
             </a-tooltip>
             </a-tooltip>
           </template>
           </template>
           <!-- 销售退货数量  标题 -->
           <!-- 销售退货数量  标题 -->
-          <template slot="salesNumTit">
+          <template slot="salesReturnNum">
             <a-tooltip placement="top">
             <a-tooltip placement="top">
               <template slot="title">
               <template slot="title">
                 <span>销售退货单完结后开始计算销售数量</span>
                 <span>销售退货单完结后开始计算销售数量</span>
@@ -111,7 +126,15 @@
                 <a-icon type="question-circle" />
                 <a-icon type="question-circle" />
               </div>
               </div>
             </a-tooltip>
             </a-tooltip>
-          </template>】
+          </template>
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              @click="handleEexamine(record)"
+            >加入购物车</a-button>
+          </template>
         </s-table>
         </s-table>
       </a-spin>
       </a-spin>
     </a-card>
     </a-card>
@@ -193,42 +216,48 @@ export default {
         }
         }
       },
       },
       totalData: null, //  合计
       totalData: null, //  合计
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      colsArr: [
+        {
+          title: '销售退货(明细)',
+          value: 'totalCancelQty',
+          key: 'totalCancelQty',
+          disabled: false,
+          checkedFlag: true
+        }],
+      showCols: ['totalCancelQty']
     }
     }
   },
   },
   computed: {
   computed: {
     columns () {
     columns () {
       const _this = this
       const _this = this
       const arr = [
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '品牌', dataIndex: 'salesTargetName', width: '35%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '分类', dataIndex: 'customerTypeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '产品名称', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '原厂编码', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '单位', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { slots: { title: 'salesNumTit' }, dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售折扣金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售折后金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售成本金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售退货数量', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售退货金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售退货折扣金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售退货折后金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售退货成本金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '合计销售数量', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '合计销售金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '当前库存数量', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '当前库存金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '品牌', dataIndex: 'salesTargetName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分类', dataIndex: 'customerTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'discountedAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '产品名称', dataIndex: 'discountedAmount', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'discountedAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '单位', dataIndex: 'discountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { slots: { title: 'salesNumTit' }, dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售折扣金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售折后金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售成本金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { slots: { title: 'salesReturnNum' }, dataIndex: 'discountedAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售退货金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售退货折扣金额', dataIndex: 'discountedAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售退货折后金额', dataIndex: 'discountedAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售退货成本金额', dataIndex: 'discountedAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '合计销售数量', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '合计销售金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '当前库存数量', dataIndex: 'discountedAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '当前库存金额', dataIndex: 'discountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 120, align: 'center', fixed: 'right' }
       ]
       ]
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(4, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(5, 0, { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'right', customRender: function (text) { return text || '--' } })
-      }
+      // if (this.$hasPermissions('M_ShowAllCost')) {
+      //   arr.splice(4, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      //   arr.splice(5, 0, { title: '毛利率', dataIndex: 'percentageUnit', width: '15%', align: 'right', customRender: function (text) { return text || '--' } })
+      // }
       return arr
       return arr
     }
     }
   },
   },
@@ -302,7 +331,7 @@ export default {
     },
     },
     setTableH () {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 267
+      this.tableHeight = window.innerHeight - tableSearchH - 255
     }
     }
   },
   },
   watch: {
   watch: {
@@ -316,14 +345,18 @@ export default {
   mounted () {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.resetSearchForm()
       this.resetSearchForm()
-      this.setTableH()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
     }
     }
   },
   },
   activated () {
   activated () {
     // 如果是新页签打开,则重置当前页面
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
     if (this.$store.state.app.isNewTab) {
       this.resetSearchForm()
       this.resetSearchForm()
-      this.setTableH()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        this.setTableH()
+      })
     }
     }
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
@@ -331,3 +364,10 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
+<style lang="less" scoped>
+  .table-operator{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+</style>