Browse Source

Merge branch 'develop_yh6' of jianguan-web/jg-ocs-html into pre-release

李磊 2 năm trước cách đây
mục cha
commit
a7fd31c669
1 tập tin đã thay đổi với 57 bổ sung46 xóa
  1. 57 46
      src/views/reportData/priceDifferenceDetailReport/list.vue

+ 57 - 46
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -13,14 +13,13 @@
           @keyup.enter.native="handleSearch">
           <a-row :gutter="15">
             <a-col :md="4" :sm="24">
-              <a-form-model-item label="月份" prop="month">
-                <a-month-picker
-                  placeholder="请选择月份"
-                  locale="zh-cn"
-                  v-model="queryParam.month"
-                  @change="onChange"
-                  :disabled-date="disabledDate"
-                  style="width: 100%;"/>
+              <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="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="3" :sm="24">
@@ -35,11 +34,13 @@
                 <custList id="priceDifferenceDetailList-rebateDealer" ref="rebateDealerList" @change="rebateDealerChange"></custList>
               </a-form-model-item>
             </a-col>
-            <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 v-if="advanced">
+              <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="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>
@@ -52,6 +53,10 @@
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_priceDifferenceDetail_Export')"
                 id="allocationDetailsList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
             </a-col>
           </a-row>
         </a-form-model>
@@ -67,21 +72,11 @@
         :defaultLoadData="false"
         bordered>
         <template slot="footer">
-          <table>
-            <tr>
-              <td width="51%" colspan="4"></td>
-              <td width="8%">
-                <div v-if="$hasPermissions('B_isShowPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</div>
-              </td>
-              <td width="8%">
-                <div v-if="$hasPermissions('B_isShowPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</div>
-              </td>
-              <td width="8%">
-                <div v-if="$hasPermissions('B_isShowPrice')">差价金额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</div>
-              </td>
-              <td width="25%" colspan="2"></td>
-            </tr>
-          </table>
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col :md="6" :sm="24" v-if="$hasPermissions('B_isShowPrice')">直接差额:{{ (totalData && (totalData.rebateAmount || totalData.rebateAmount==0)) ? totalData.rebateAmount : '--' }}</a-col>
+          </a-row>
         </template>
       </s-table>
     </a-spin>
@@ -92,7 +87,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-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'
@@ -112,14 +107,20 @@ export default {
       exportLoading: false,
       showExport: 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: [], //  省下拉
@@ -127,9 +128,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
-        if (params.month) {
-          params.month = params.month + '-01'
-        }
+        delete params.time
         this.spinning = true
         return reportRebateReportList(params).then(res => {
           let data
@@ -153,7 +152,8 @@ 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 },
@@ -161,19 +161,23 @@ export default {
         { title: '类型', dataIndex: 'bizType', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(6, 0, { title: '差价金额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(5, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '直接差额', dataIndex: 'rebateAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
   },
   methods: {
-    onChange (date, dateString) {
-      this.queryParam.month = dateString
-    },
-    disabledDate (current) {
-      return current && current > moment().endOf('day')
+    //  创建时间  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) {
@@ -233,10 +237,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) {