Bläddra i källkod

Merge commit '495a3786c6d9fb76bf7070bffa480976db448b3f' into HEAD

gitadmin 1 år sedan
förälder
incheckning
57333e9c90

+ 1 - 0
public/index.html

@@ -4,6 +4,7 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
     <link rel="icon" href="<%= BASE_URL %>logo.png">
     <title><%= VUE_APP_PRO_NAME %></title>
     <style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.39",
+    "version": "2.2.40",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 46 - 8
src/api/reportData.js

@@ -1231,8 +1231,22 @@ export const getWarrantyInfo = (params) => {
 */
 
 // 轮胎统计报表   列表
-export const queryTireList = (params) => {
-  const url = `/report/tire/queryTirePage/${params.pageNo}/${params.pageSize}`
+export const tireReportList = (params) => {
+  const url = `/report/tireRptDealerProductDay/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+// 轮胎明细报表  列表
+export const tireReportDetailList = (params) => {
+  const url = `/report/tireRptDealerProductDay/queryDetailPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -1244,19 +1258,44 @@ export const queryTireList = (params) => {
     }
   })
 }
-
 // 轮胎统计报表  统计
 export const queryTireCount = (params) => {
   return axios({
-    url: '/report/tire/queryTireCount',
+    url: '/report/tireRptDealerProductDay/queryCount',
     data: params,
     method: 'post'
   })
 }
-// 轮胎统计报表  导出
-export const excelTireOnlineExport = (params) => {
+// 轮胎明细报表  出入库明细列表
+export const outDetailList = (params) => {
+  const url = `/report/tireRptDealerDayOutStock/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: '/report/tire/excelTireOnlineList',
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+// 轮胎报表 导出
+export const tireListExport = (params) => {
+  return axios({
+    url: '/report/tireRptDealerProductDay/importExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}
+// 轮胎明细报表  出入库明细导出
+export const tireOutDetailListExport = (params) => {
+  return axios({
+    url: '/report/tireRptDealerDayOutStock/importExcel',
     data: params,
     method: 'post',
     responseType: 'blob',
@@ -1265,7 +1304,6 @@ export const excelTireOnlineExport = (params) => {
     }
   })
 }
-
 // 促销销售单报表(统计)
 export const brandTypeReportList = (params) => {
   const url = `/report/brandTypeReport/queryPage/${params.pageNo}/${params.pageSize}`

+ 1 - 1
src/components/Table/index.js

@@ -155,7 +155,7 @@ export default {
      */
     refresh (bool = false) {
       bool && (this.localPagination = Object.assign({}, {
-        current: 1, pageSize: this.pageSize
+        current: 1, pageSize: this.localPagination.pageSize
       }))
       this.loadData()
     },

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

@@ -1879,31 +1879,31 @@ export const asyncRouterMap = [
               }
             }]
           },
-          {
-            path: '/reportData/tireSalesReport',
-            redirect: '/reportData/tireSalesReport/list',
-            name: 'tireSalesReport',
-            component: BlankLayout,
-            meta: {
-              title: '轮胎统计报表',
-              icon: 'profile',
-              permission: 'M_tireSalesReportList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'tireSalesReportIndex',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/tireSalesReport/list.vue'),
-                meta: {
-                  title: '轮胎统计报表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_tireSalesReportList'
-                }
-              }
-            ]
-          },
+          // {
+          //   path: '/reportData/tireSalesReport',
+          //   redirect: '/reportData/tireSalesReport/index',
+          //   name: 'tireSalesReport',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '轮胎统计报表',
+          //     icon: 'profile',
+          //     permission: 'M_tireSalesReportList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'index',
+          //       name: 'tireSalesReportIndex',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/tireSalesReport/index.vue'),
+          //       meta: {
+          //         title: '轮胎统计报表',
+          //         icon: 'profile',
+          //         hidden: true,
+          //         permission: 'M_tireSalesReportList'
+          //       }
+          //     }
+          //   ]
+          // },
           {
             path: '/reportData/allocationOrderTotal',
             redirect: '/reportData/allocationOrderTotal/list',
@@ -3833,6 +3833,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/setting/erpAllotSettings',
+            redirect: '/setting/erpAllotSettings/list',
+            name: 'erpAllotSettings',
+            component: BlankLayout,
+            meta: {
+              title: 'ERP调拨配置',
+              icon: 'sketch',
+              permission: 'M_erpAllotMessage'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'M_erpAllotSettingsList',
+                component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/erpAllotSettings/list.vue'),
+                meta: {
+                  title: 'ERP调拨配置',
+                  icon: 'sketch',
+                  hidden: true,
+                  permission: 'M_erpAllotMessageList'
+                }
+              }
+            ]
+          },
           {
             path: '/setting/checkDingTask',
             redirect: '/setting/checkDingTask/list',

+ 2 - 2
src/libs/getDate.js

@@ -137,10 +137,10 @@ export default {
     return obj
   },
   // 获取某一年的开始和结束时间
-  getBeDateByYear(year){
+  getBeDateByYear (year) {
     return {
       	beginDate: moment(year.toString()).startOf('year').format('YYYY-MM-DD 00:00:00'),
       	endDate: moment(year.toString()).endOf('year').format('YYYY-MM-DD 23:59:59')
     }
   }
-}
+}

+ 1 - 0
src/store/modules/app.js

@@ -36,6 +36,7 @@ const app = {
     employeeList: [], // 申请人列表
     defectiveReturnReason: [], // 不良品申请退货列表
     goodReturnReason: [], // 良品申请退货列表
+    bookReason:[], // 收款事由
     tempBillOfData: null, // 临时存储收货单数据
     authMenusList: [], // 权限菜单数据
     priceAuthOptions: [], // 价格权限选项

+ 2 - 1
src/utils/util.js

@@ -286,7 +286,8 @@ export function getAuthPriceCode (config, router, store) {
     
     // 从所有的权限菜单中查找当前权限code对应的权限菜单数据
     const authNode = treeFind(authTree,(item)=>item.code == authCode)
-    // console.log(authNode)
+    // console.log(authNode,authCode)
+    if(!authNode){return []}
     if(!authNode.permission){return []}
     // 从找到的对应权限菜单数据中判断当前调用接口的url是否存在,这里和权限菜单中的后台权限code比较
     const hasReqUrl = authNode.permission.split(',').find(item => url.replace(/\//g,'_').indexOf(item)>=0)

+ 7 - 0
src/views/Home.vue

@@ -118,6 +118,13 @@ export default {
         key: 'defectiveReturnReason',
         isEnable: 1
       })
+      // 收款事由
+      vm.getLookUpDataByCode({
+        code: 'FINANCE_BOOK_REASON',
+        key: 'bookReason',
+        isEnable: 1
+      })
+
       // 菜单数据
       vm.getYyMenuList()
       vm.$store.state.app.priceAuthOptions = [

+ 71 - 0
src/views/common/bookReason.js

@@ -0,0 +1,71 @@
+const BookReason = {
+  template: `
+      <a-select
+        :placeholder="placeholder"
+        style="width:100%"
+        :size="size"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :dropdownMatchSelectWidth="false"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in list" :key="item.code" :value="item.code">
+          {{item.dispName}}
+        </a-select-option>
+      </a-select>
+    `,
+  props: {
+    value: {
+      type: String,
+      default: undefined
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder: {
+      type: String,
+      default: '请选择收款事由'
+    },
+    size: {
+      type: String,
+      default: 'default'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  created() {
+    this.list = this.$store.state.app.bookReason
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue || undefined
+    }
+  },
+  methods: {
+    filterOption(input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      );
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      const row = this.list.find(item => item.code == value)
+      this.$emit('change', value, row);
+      this.$emit('input', value);
+    },
+    getCodeByName(value){
+      const row = this.list.find(item => item.dispName == value)
+      return row? row.code : ''
+    }
+  },
+};
+
+export default BookReason

+ 1 - 1
src/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue

@@ -61,7 +61,7 @@
             :virtual-scroll-option="{enable: true}"
             :columns="columns"
             :table-data="dataSource"
-            row-key-field-name="id"
+            row-key-field-name="dealerScopeSn"
             :checkbox-option="checkboxOption"
           />
           <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>

+ 17 - 9
src/views/financialManagement/financialCollection/baseModal.vue

@@ -20,7 +20,7 @@
           <employee style="width: 100%;" @change="employeeChange" ref="applyPerson" v-model="form.applyPersonSn"></employee>
         </a-form-model-item>
         <a-form-model-item label="收款事由" prop="bookReason">
-          <a-input :maxLength="100" placeholder="请输入收款事由(最多100个字符)" v-model="form.bookReason"></a-input>
+          <bookReason ref="bookReason" v-model="bookReasonCode" @change="updateReason"></bookReason>
         </a-form-model-item>
         <a-form-model-item label="付款方类型" prop="payerType">
           <v-select
@@ -68,11 +68,12 @@ import { commonMixin } from '@/utils/mixin'
 import { VSelect, Upload } from '@/components'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import bookReason from '@/views/common/bookReason'
 import { financeBookSave, financeBookFindBySn, queryLastFinishDingUser } from '@/api/financeBook.js'
 export default {
   name: 'FcBaseModal',
   mixins: [commonMixin],
-  components: { VSelect, Upload, employee, dealerSubareaScopeList },
+  components: { VSelect, Upload, employee, dealerSubareaScopeList, bookReason },
   props: {
     show: [Boolean],
     bookSn: {
@@ -95,16 +96,17 @@ export default {
       attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
       form: {
         applyPersonSn: undefined,
-        bookReason: '',
+        bookReason: undefined,
         payerType: 'DEALER',
         dealerSn: undefined,
         payerName: undefined,
         remarks: '',
         attachmentList: ''
       },
+      bookReasonCode: undefined,
       rules: {
         applyPersonSn: [ { required: true, message: '请选择申请人', trigger: ['change', 'blur'] } ],
-        bookReason: [ { required: true, message: '请输入收款事由', trigger: ['change', 'blur'] } ],
+        bookReason: [ { required: true, message: '请选择收款事由', trigger: ['change', 'blur'] } ],
         payerType: [ { required: true, message: '请选择付款方类型', trigger: ['change', 'blur'] } ],
         dealerSn: [ { required: true, message: '请选择付款方', trigger: ['change', 'blur'] } ],
         payerName: [ { required: true, message: '请输入付款方名称', trigger: ['change', 'blur'] } ]
@@ -124,9 +126,11 @@ export default {
       this.form.dealerSn = ''
       this.form.payerName = ''
     },
+    updateReason (val, record) {
+      this.form.bookReason = record.dispName
+    },
     // 客户
     custChange (v) {
-      console.log(v)
       if (v && v.key) {
         this.form.dealerSn = v.key
         this.form.payerName = v.row ? v.row.dealerName : ''
@@ -194,6 +198,10 @@ export default {
               this.$refs.settleClientName.getDetail(this.form.dealerSn)
             })
           }
+          // 回显收款事由
+          this.$nextTick(() => {
+            this.bookReasonCode = this.$refs.bookReason.getCodeByName(this.form.bookReason)
+          })
         } else {
           this.$refs.ruleForm.resetFields()
         }
@@ -206,7 +214,7 @@ export default {
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
     },
-   async pageInit () {
+    async pageInit () {
       this.$nextTick(() => {
         this.attachList = []
         this.$refs.attachList.setFileList('')
@@ -215,10 +223,10 @@ export default {
           this.$refs.settleClientName.resetForm()
         }
       })
-
+      this.bookReasonCode = undefined
       this.form = {
         applyPersonSn: undefined,
-        bookReason: '',
+        bookReason: undefined,
         payerType: 'DEALER',
         dealerSn: undefined,
         payerName: undefined,
@@ -228,7 +236,7 @@ export default {
 
       if (this.bookSn) { //  编辑页
         this.getDetail()
-      }else{
+      } else {
         // 最近一次审核人
         const lastAuditInfo = await queryLastFinishDingUser().then(res => res.data)
         this.form.applyPersonSn = lastAuditInfo ? lastAuditInfo.applyPersonSn : undefined

+ 2 - 0
src/views/reportData/salesDetails/list.vue

@@ -179,6 +179,8 @@
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_costPrice')">成本金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">优惠金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24">毛利率(减促销费用):{{ (totalData && (totalData.realGrossMargin || totalData.realGrossMargin==0)) ? (totalData.realGrossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
+              <a-col :md="4" :sm="24">实际毛利率:{{ (totalData && (totalData.grossMargin || totalData.grossMargin==0)) ? (totalData.grossMargin*100).toFixed(2)+'%' : '--' }}</a-col>
             <!--  <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折后金额:{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</a-col>
             <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesDetailsList_salesPrice')">折扣金额:{{ (totalData && (totalData.discountAmount || totalData.discountAmount==0)) ? toThousands(totalData.discountAmount) : '--' }}</a-col> -->
             </a-row>

+ 453 - 0
src/views/reportData/tireSalesReport/detailList.vue

@@ -0,0 +1,453 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="tireSalesDealerList-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div class="table-page-search-wrapper" ref="tableSearch">
+        <a-form-model
+          id="tireSalesDealerList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="地区">
+                <AreaList id="tireSalesDealerList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="区域/分区">
+                <subarea id="tireSalesDealerList-subarea" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户级别">
+                  <v-select
+                    v-model="queryParam.dealerLevel"
+                    ref="dealerLevel"
+                    id="tireSalesDealerList-dealerLevel"
+                    code="DEALER_LEVEL"
+                    placeholder="请选择客户级别"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="区域负责人">
+                  <BizUser v-model="queryParam.bizUserSn"></BizUser>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品编码/原厂编码">
+                  <a-input id="tireSalesDealerList-productWord" v-model.trim="queryParam.productWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="tireSalesDealerList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="24" :sm="24" style="text-align:center;margin-bottom:10px;">
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                @click="handleSearch"
+                :disabled="disabled"
+                id="tireSalesDealerList-refresh">查询</a-button>
+              <a-button
+                style="margin-left: 8px"
+                @click="resetSearchForm"
+                :disabled="disabled"
+                id="tireSalesDealerList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport(0)"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_tireReportExport')"
+                id="tireSalesDealerList-export">导出</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport(1)"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_tireDetailExport')"
+                id="tireSalesDealerList-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>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :style="{ height: tableHeight+70+'px' }"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x:2500,y: tableHeight-120}"
+          :defaultLoadData="false"
+          bordered>
+          <template slot="addressInfo" slot-scope="text, record">
+            {{ record.dealerEntity.provinceName }}{{ '/'+record.dealerEntity.cityName }}{{ '/'+record.dealerEntity.districtName }}
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              v-if="$hasPermissions('B_outDetailShow')"
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleOutDetail(record)"
+              id="transferReturnConfirmation-audit-btn">出库明细</a-button>
+            <span>--</span>
+          </template>
+          <template slot="footer">
+            <a-row :gutter="15">
+              <a-col :md="4" :sm="24">总部订货数量:{{ (totalData && (totalData.sysOrderQty || totalData.sysOrderQty==0)) ? totalData.sysOrderQty : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">总部订货金额:{{ (totalData && (totalData.sysOrderAmount || totalData.sysOrderAmount==0)) ? toThousands(totalData.sysOrderAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">上级订货数量:{{ (totalData && (totalData.upOrderQty || totalData.upOrderQty==0)) ?totalData.upOrderQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">上级订货金额:{{ (totalData && (totalData.upOrderAmount || totalData.upOrderAmount==0)) ? toThousands(totalData.upOrderAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">跨地区订货数量:{{ (totalData && (totalData.crossRegionQty || totalData.crossRegionQty==0)) ?totalData.crossRegionQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">跨地区订货金额:{{ (totalData && (totalData.crossRegionAmount || totalData.crossRegionAmount==0)) ? toThousands(totalData.crossRegionAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">累计入库数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计入库金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.returnQty || totalData.returnQty==0)) ?totalData.returnQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">退货金额:{{ (totalData && (totalData.returnAmount || totalData.returnAmount==0)) ? toThousands(totalData.returnAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">客户现有库存数量:{{ (totalData &&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.stockQty || totalData.rptDealerStockVO.stockQty==0)) ?totalData.rptDealerStockVO.stockQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">客户现有库存金额:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.stockAmount || totalData.rptDealerStockVO.stockAmount==0)) ? toThousands(totalData.rptDealerStockVO.stockAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">出库加盟商数量:{{ (totalData && (totalData.outQtyDealer || totalData.outQtyDealer==0)) ?totalData.outQtyDealer: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库加盟商金额:{{ (totalData && (totalData.outAmountDealer || totalData.outAmountDealer==0)) ? toThousands(totalData.outAmountDealer): '--' }}</a-col>
+              <a-col :md="4" :sm="24">出库终端数量:{{ (totalData && (totalData.outQtyTerminal || totalData.outQtyTerminal==0)) ?totalData.outQtyTerminal: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库终端金额:{{ (totalData && (totalData.outAmountTerminal || totalData.outAmountTerminal==0)) ? toThousands(totalData.outAmountTerminal): '--' }}</a-col>
+              <a-col :md="4" :sm="24">累计出库数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ?totalData.outQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计出库金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.warrantyQty || totalData.rptDealerStockVO.warrantyQty==0)) ?totalData.rptDealerStockVO.warrantyQty: '--' }}</a-col>
+            </a-row>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    <!-- 出库明细弹窗 -->
+    <outDetailModal ref="outDetail" :openModal="showOutDetail" @close="showOutDetail=false"></outDetailModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import subarea from '@/views/common/subarea.js'
+import AreaList from '@/views/common/areaList.js'
+import BizUser from '@/views/common/bizUser.js'
+import reportModal from '@/views/common/reportModal.vue'
+import outDetailModal from './outDetailModal'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { queryTireCount, tireListExport, tireReportDetailList, tireOutDetailListExport } from '@/api/reportData'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+export default {
+  name: 'TireSalesDealerList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, outDetailModal, rangeDate, subarea, AreaList, BizUser, dealerSubareaScopeList, reportModal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        bizBeginDate: '',
+        bizEndDate: '',
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerLevel: undefined,
+        dealerName: undefined,
+        dealerSn: undefined,
+        subareaArea: {// 区域分区
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        bizUserSn: undefined, // 区域负责人
+        productWord: '', // 产品编码/原厂编码
+        productName: '' // 产品名称
+      },
+      exportLoading: false,
+      showExport: false,
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const oldParams = Object.assign(parameter, this.queryParam)
+        const params = JSON.parse(JSON.stringify(oldParams))
+        delete params.time
+        return tireReportDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            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.getCount(params)
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null,
+      showOutDetail: false
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '12%', align: 'center' },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品尺寸', dataIndex: 'productEntity.size', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总部订货数量', dataIndex: 'sysOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '上级订货数量', dataIndex: 'upOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '跨地区订货数量', dataIndex: 'crossRegionQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '累计入库数量', dataIndex: 'putQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'returnQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户现有库存数量', dataIndex: 'rptDealerStockVO.stockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '客户现有库存金额', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库加盟商数量', dataIndex: 'outQtyDealer', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库终端数量', dataIndex: 'outQtyTerminal', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '累计出库数量', dataIndex: 'outQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>已绑质保单<div>数量</div></div>, dataIndex: 'rptDealerStockVO.warrantyQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_tireSalesReportList_salesPrice')) {
+        arr.splice(12, 0, { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(14, 0, { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(16, 0, { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(18, 0, { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(20, 0, { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(22, 0, { title: '客户现有库存金额', dataIndex: 'rptDealerStockVO.stockAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(24, 0, { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(26, 0, { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(28, 0, { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择日期')
+          return false
+        }
+      })
+    },
+    custChange (val) {
+      this.queryParam.dealerName = val.name
+      this.queryParam.dealerSn = val.key
+    },
+    // 统计
+    getCount (params) {
+      queryTireCount(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    // 出库明细
+    handleOutDetail (row) {
+      const params = {
+        bizBeginDate: this.queryParam.bizBeginDate,
+        bizEndDate: this.queryParam.bizEndDate,
+        dealerSn: row.dealerSn,
+        productSn: row.productSn
+      }
+      this.showOutDetail = true
+      const titObj = {
+        tit: row.dealerEntity.dealerName,
+        code: row.productEntity.code
+      }
+      this.$nextTick(() => {
+        this.$refs.outDetail.getAjaxData(params, titObj)
+      })
+    },
+    // 地区
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.districtSn = val[2] ? val[2] : undefined
+    },
+    //  日期选择  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
+      this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
+    },
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.bizBeginDate = ''
+      this.queryParam.bizEndDate = ''
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.districtSn = undefined
+      this.queryParam.dealerName = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
+      this.queryParam.dealerLevel = undefined
+      this.queryParam.bizUserSn = undefined
+      this.queryParam.productWord = undefined
+      this.queryParam.productName = undefined
+      this.$refs.subarea.clearData()
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.totalData = null
+      this.$refs.areaList.clearData()
+      this.$refs.table.clearTable()
+      this.$refs.ruleForm.resetFields()
+    },
+    //  导出
+    handleExport (pos) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          if (pos == 0) {
+            _this.exportList()
+          } else {
+            _this.exportOutDetailList()
+          }
+        } else {
+          _this.$message.error('请选择日期')
+          return false
+        }
+      })
+    },
+    exportList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.showExport = true
+      _this.$store.state.app.curActionPermission = 'B_tireReportExport'
+      params.exportFlag = 1
+      delete params.time
+      hdExportExcel(tireListExport, params, '轮胎明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
+    exportOutDetailList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.exportLoading = true
+      _this.spinning = true
+      _this.showExport = true
+      _this.$store.state.app.curActionPermission = 'B_tireReportExport'
+      delete params.time
+      hdExportExcel(tireOutDetailListExport, params, '轮胎出库明细报表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 276
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 65 - 0
src/views/reportData/tireSalesReport/index.vue

@@ -0,0 +1,65 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false">
+      <a-tabs default-active-key="1" @change="handleChange">
+        <a-tab-pane key="1" tab="轮胎统计报表">
+          <!-- 列表 -->
+          <tireList ref="tireStatisticsList"></tireList>
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="轮胎明细报表" force-render>
+          <detailList ref="tireDetailList"></detailList>
+        </a-tab-pane>
+      </a-tabs>
+    </a-card>
+  </div>
+</template>
+<script>
+import { commonMixin } from '@/utils/mixin'
+import tireList from './list'
+import detailList from './detailList'
+export default {
+  name: 'TireSalesReportIndex',
+  mixins: [commonMixin],
+  components: { tireList, detailList },
+  data () {
+    return {
+      tabVal: 1
+    }
+  },
+  methods: {
+    handleChange (val) {
+      this.tabVal = val
+    },
+    pageInit () {
+      if (this.tabVal == 1) {
+        this.$refs.tireStatisticsList.pageInit()
+      } else {
+        this.$refs.tireDetailList.pageInit()
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  }
+}
+
+</script>
+
+<style lang="less" scoped>
+  .monthBox{
+    /deep/.ant-calendar-picker-icon{
+      display:none !important;
+    }
+    /deep/.ant-calendar-picker input{
+      text-align:center;
+    }
+  }
+</style>

+ 136 - 87
src/views/reportData/tireSalesReport/list.vue

@@ -8,11 +8,12 @@
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
+          :rules="rules"
           :model="queryParam">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="出库时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+              <a-form-model-item label="日期" prop="time">
+                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -25,12 +26,12 @@
                 <subarea id="tireSalesDealerList-subarea" ref="subarea" @change="subareaChange"></subarea>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="客户名称">
-                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
-              </a-form-model-item>
-            </a-col>
             <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户名称">
+                  <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
+                </a-form-model-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客户级别">
                   <v-select
@@ -47,22 +48,12 @@
                   <BizUser v-model="queryParam.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品编码/原厂编码">
-                  <a-input id="tireSalesDealerList-productWord" v-model.trim="queryParam.productWord" allowClear placeholder="请输入产品编码/原厂编码"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="产品名称">
-                  <a-input id="tireSalesDealerList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-                </a-form-model-item>
-              </a-col>
             </template>
-            <a-col :md="24" :sm="24" style="text-align:center;margin-bottom:10px;">
+            <a-col :md="6" :sm="24">
               <a-button
                 style="margin-left: 5px"
                 type="primary"
-                @click="$refs.table.refresh(true)"
+                @click="handleSearch"
                 :disabled="disabled"
                 id="tireSalesDealerList-refresh">查询</a-button>
               <a-button
@@ -77,7 +68,7 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                v-if="$hasPermissions('B_tireSalesReportExport')"
+                v-if="$hasPermissions('B_tireReportExport')"
                 id="tireSalesDealerList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
@@ -100,18 +91,33 @@
           rowKeyName="no"
           :columns="columns"
           :data="loadData"
-          :scroll="{ y: tableHeight-30 }"
+          :scroll="{x:2200, y: tableHeight-110 }"
           :defaultLoadData="false"
           bordered>
           <template slot="addressInfo" slot-scope="text, record">
-            {{ record.provinceName }}{{ '/'+record.cityName }}{{ '/'+record.districtName }}
+            {{ record.dealerEntity.provinceName }}{{ '/'+record.dealerEntity.cityName }}{{ '/'+record.dealerEntity.districtName }}
           </template>
           <template slot="footer">
             <a-row :gutter="15">
-              <a-col :md="4" :sm="24">订货数量:{{ (totalData && (totalData.totalbuyAmount || totalData.totalbuyAmount==0)) ? totalData.totalbuyAmount : '--' }}</a-col>
-              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">订货金额:{{ (totalData && (totalData.totalbuyPriceAmount || totalData.totalbuyPriceAmount==0)) ? toThousands(totalData.totalbuyPriceAmount): '--' }}</a-col>
-              <a-col :md="4" :sm="24">客户现有库存数量:{{ (totalData && (totalData.totalstoreAmount || totalData.totalstoreAmount==0)) ?totalData.totalstoreAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData && (totalData.totalwarrantyAmount || totalData.totalwarrantyAmount==0)) ?totalData.totalwarrantyAmount: '--' }}</a-col>
+              <a-col :md="4" :sm="24">总部订货数量:{{ (totalData && (totalData.sysOrderQty || totalData.sysOrderQty==0)) ? totalData.sysOrderQty : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">总部订货金额:{{ (totalData && (totalData.sysOrderAmount || totalData.sysOrderAmount==0)) ? toThousands(totalData.sysOrderAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">上级订货数量:{{ (totalData && (totalData.upOrderQty || totalData.upOrderQty==0)) ?totalData.upOrderQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">上级订货金额:{{ (totalData && (totalData.upOrderAmount || totalData.upOrderAmount==0)) ? toThousands(totalData.upOrderAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">跨地区订货数量:{{ (totalData && (totalData.crossRegionQty || totalData.crossRegionQty==0)) ?totalData.crossRegionQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">跨地区订货金额:{{ (totalData && (totalData.crossRegionAmount || totalData.crossRegionAmount==0)) ? toThousands(totalData.crossRegionAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">累计入库数量:{{ (totalData && (totalData.putQty || totalData.putQty==0)) ?totalData.putQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计入库金额:{{ (totalData && (totalData.putAmount || totalData.putAmount==0)) ? toThousands(totalData.putAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">退货数量:{{ (totalData && (totalData.returnQty || totalData.returnQty==0)) ?totalData.returnQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">退货金额:{{ (totalData && (totalData.returnAmount || totalData.returnAmount==0)) ? toThousands(totalData.returnAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">客户现有库存数量:{{ (totalData &&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.stockQty || totalData.rptDealerStockVO.stockQty==0)) ?totalData.rptDealerStockVO.stockQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">客户现有库存金额:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.stockAmount || totalData.rptDealerStockVO.stockAmount==0)) ? toThousands(totalData.rptDealerStockVO.stockAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">出库加盟商数量:{{ (totalData && (totalData.outQtyDealer || totalData.outQtyDealer==0)) ?totalData.outQtyDealer: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库加盟商金额:{{ (totalData && (totalData.outAmountDealer || totalData.outAmountDealer==0)) ? toThousands(totalData.outAmountDealer): '--' }}</a-col>
+              <a-col :md="4" :sm="24">出库终端数量:{{ (totalData && (totalData.outQtyTerminal || totalData.outQtyTerminal==0)) ?totalData.outQtyTerminal: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">出库终端金额:{{ (totalData && (totalData.outAmountTerminal || totalData.outAmountTerminal==0)) ? toThousands(totalData.outAmountTerminal): '--' }}</a-col>
+              <a-col :md="4" :sm="24">累计出库数量:{{ (totalData && (totalData.outQty || totalData.outQty==0)) ?totalData.outQty: '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_tireSalesReportList_salesPrice')">累计出库金额:{{ (totalData && (totalData.outAmount || totalData.outAmount==0)) ? toThousands(totalData.outAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData&&totalData.rptDealerStockVO && (totalData.rptDealerStockVO.warrantyQty || totalData.rptDealerStockVO.warrantyQty==0)) ?totalData.rptDealerStockVO.warrantyQty: '--' }}</a-col>
             </a-row>
           </template>
         </s-table>
@@ -124,7 +130,6 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
@@ -132,7 +137,7 @@ import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import reportModal from '@/views/common/reportModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { queryTireList, queryTireCount, excelTireOnlineExport } from '@/api/reportData'
+import { tireReportList, queryTireCount, tireListExport } from '@/api/reportData'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
   name: 'TireSalesDealerList',
@@ -143,36 +148,38 @@ export default {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
-      time: [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ],
       queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        time: [],
+        bizBeginDate: '',
+        bizEndDate: '',
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        dealerName: '',
-        dealerSn: '',
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
-        bizUserSn: undefined,
-        productWord: '', // 产品编码/原厂编码
-        productName: '', // 产品名称
-        dealerLevel: undefined
+        dealerLevel: undefined,
+        dealerName: undefined,
+        dealerSn: undefined,
+        subareaArea: {// 区域分区
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        bizUserSn: undefined // 区域负责人
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       showExport: false,
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+      },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const params = Object.assign(parameter, this.queryParam)
-        return queryTireList(params).then(res => {
+        const oldParams = Object.assign(parameter, this.queryParam)
+        const params = JSON.parse(JSON.stringify(oldParams))
+        delete params.time
+        return tireReportList(params).then(res => {
           let data
-          if (res.status == 200) {
+          if (res.status == 200 && res.data) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
@@ -205,25 +212,58 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '12%', align: 'center' },
-        { title: '区域', dataIndex: 'subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'userNameQyfzrs', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrgiCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '订货数量', dataIndex: 'buyAmount', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: <div>客户现有<div>库存数量</div></div>, dataIndex: 'storeAmount', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: <div>已绑质保单<div>数量</div></div>, dataIndex: 'warrantyAmount', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '总部订货数量', dataIndex: 'sysOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '上级订货数量', dataIndex: 'upOrderQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '跨地区订货数量', dataIndex: 'crossRegionQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '累计入库数量', dataIndex: 'putQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货数量', dataIndex: 'returnQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户现有库存数量', dataIndex: 'rptDealerStockVO.stockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '客户现有库存金额', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库加盟商数量', dataIndex: 'outQtyDealer', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '出库终端数量', dataIndex: 'outQtyTerminal', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '累计出库数量', dataIndex: 'outQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>已绑质保单<div>数量</div></div>, dataIndex: 'rptDealerStockVO.warrantyQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_tireSalesReportList_salesPrice')) {
-        arr.splice(11, 0, { title: '订货金额', dataIndex: 'buyPriceAmount', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '总部订货金额', dataIndex: 'sysOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(10, 0, { title: '上级订货金额', dataIndex: 'upOrderAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '跨地区订货金额', dataIndex: 'crossRegionAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(14, 0, { title: '累计入库金额', dataIndex: 'putAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(16, 0, { title: '退货金额', dataIndex: 'returnAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(18, 0, { title: '客户现有库存金额', dataIndex: 'rptDealerStockVO.stockAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(20, 0, { title: '出库加盟商金额', dataIndex: 'outAmountDealer', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(22, 0, { title: '出库终端金额', dataIndex: 'outAmountTerminal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(24, 0, { title: '累计出库金额', dataIndex: 'outAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
   },
   methods: {
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          _this.$message.error('请选择日期')
+          return false
+        }
+      })
+    },
     custChange (val) {
       this.queryParam.dealerName = val.name
       this.queryParam.dealerSn = val.key
@@ -240,61 +280,71 @@ export default {
     },
     // 地区
     areaChange (val) {
-      this.queryParam.provinceSn = val[0] ? val[0] : ''
-      this.queryParam.citySn = val[1] ? val[1] : ''
-      this.queryParam.districtSn = val[2] ? val[2] : ''
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.districtSn = val[2] ? val[2] : undefined
     },
-    //  下推时间  change
+    //  日期选择  change
     dateChange (date) {
       if (date[0] && date[1]) {
-        this.time = date
+        this.queryParam.time = date
       } else {
-        this.time = []
+        this.queryParam.time = []
       }
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
+      this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
     },
     subareaChange (val) {
-      this.queryParam.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
     //  重置
     resetSearchForm () {
-      this.time = [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ]
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.bizBeginDate = ''
+      this.queryParam.bizEndDate = ''
       this.queryParam.provinceSn = undefined
       this.queryParam.citySn = undefined
       this.queryParam.districtSn = undefined
-      this.queryParam.dealerName = ''
-      this.queryParam.dealerSn = ''
-      this.queryParam.subareaSn = undefined
-      this.queryParam.subareaAreaSn = undefined
+      this.queryParam.dealerName = undefined
+      this.queryParam.dealerSn = undefined
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.bizUserSn = undefined
-      this.queryParam.productWord = undefined
-      this.queryParam.productName = undefined
       this.queryParam.dealerLevel = undefined
       this.totalData = null
       this.$refs.areaList.clearData()
       if (this.advanced) {
         this.$refs.dealerSubareaScopeList.resetForm()
-        this.$refs.subarea.clearData()
       }
+
+      this.$refs.subarea.clearData()
       this.$refs.table.clearTable()
     },
     //  导出
     handleExport () {
       const _this = this
-      const params = _this.queryParam
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.exportList()
+        } else {
+          _this.$message.error('请选择日期')
+          return false
+        }
+      })
+    },
+    //  导出
+    exportList () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
       _this.exportLoading = true
       _this.spinning = true
       _this.showExport = true
-      _this.$store.state.app.curActionPermission = 'B_tireSalesReportExport'
-      hdExportExcel(excelTireOnlineExport, params, '轮胎统计报表', function () {
+      _this.$store.state.app.curActionPermission = 'B_tireReportExport'
+      params.exportFlag = 0
+      delete params.time
+      hdExportExcel(tireListExport, params, '轮胎统计报表', function () {
         _this.exportLoading = false
         _this.spinning = false
         _this.$store.state.app.curActionPermission = ''
@@ -305,11 +355,10 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
-      this.resetSearchForm()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 198
+      this.tableHeight = window.innerHeight - tableSearchH - 276
     }
   },
   mounted () {
@@ -327,4 +376,4 @@ export default {
     next(vm => {})
   }
 }
-</script>
+</script>

+ 105 - 0
src/views/reportData/tireSalesReport/outDetailModal.vue

@@ -0,0 +1,105 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :title="titleInfo"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :style="{height: '400px' }"
+        :scroll="{ y: 600 }"
+        :showPagination="true"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { outDetailList } from '@/api/reportData'
+export default {
+  name: 'VerifyModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      titleInfo: '出库明细',
+      queryParam: {},
+      columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '类型', width: '15%', dataIndex: 'customTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '加盟商/终端', dataIndex: 'customName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', dataIndex: 'outQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '金额', dataIndex: 'outAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return outDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            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
+        })
+      }
+    }
+  },
+  methods: {
+    getAjaxData (obj, titObj) {
+      this.queryParam = obj
+      if (titObj && Object.keys(titObj).length != 0) {
+        this.titleInfo = titObj.tit + '(产品编码:' + titObj.code + ')'
+      } else {
+        this.titleInfo = '出库明细'
+      }
+      this.$nextTick(() => {
+        this.$refs.table.refresh()
+      })
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 0 - 231
src/views/reportData/tireSalesReport/subareaList.vue

@@ -1,231 +0,0 @@
-<template>
-  <div>
-    <a-card size="small" :bordered="false" class="tireSalesReportList-wrap searchBoxNormal">
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper" ref="tableSearch">
-        <a-form-model
-          id="tireSalesReportList-form"
-          ref="ruleForm"
-          class="form-model-con"
-          layout="inline"
-          :model="queryParam"
-          @keyup.enter.native="handleSearch">
-          <a-row :gutter="15">
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="下推时间" prop="time">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区域/分区">
-                <subarea id="allocateBillList-subarea" ref="subarea" @change="subareaChange"></subarea>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="区域负责人">
-                <BizUser v-model="queryParam.bizUserSn"></BizUser>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button
-                style="margin-left: 5px"
-                type="primary"
-                @click="handleSearch"
-                :disabled="disabled"
-                id="salesOrderTotalList-refresh">查询</a-button>
-              <a-button
-                style="margin-left: 8px"
-                @click="resetSearchForm"
-                :disabled="disabled"
-                id="salesOrderTotalList-reset">重置</a-button>
-              <a-button
-                style="margin-left: 10px"
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('B_tireSalesAreaReportExport')"
-                id="salesOrderTotalList-export">导出</a-button>
-            </a-col>
-          </a-row>
-        </a-form-model>
-      </div>
-    </a-card>
-    <a-card size="small" :bordered="false">
-      <a-spin :spinning="spinning" tip="Loading...">
-        <!-- 列表 -->
-        <s-table
-          class="sTable fixPagination"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.salesBillNo"
-          :style="{ height: tableHeight+70+'px' }"
-          rowKeyName="salesBillNo"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ y: tableHeight-30 }"
-          :pageSize="30"
-          :defaultLoadData="false"
-          bordered>
-          <template slot="footer">
-            <a-row :gutter="15">
-              <a-col :md="4" :sm="24">采购数量:{{ (totalData && (totalData.totalbuyAmount || totalData.totalbuyAmount==0)) ? totalData.totalbuyAmount : '--' }}</a-col>
-              <a-col :md="4" :sm="24">库存数量:{{ (totalData && (totalData.totalstoreAmount || totalData.totalsellAmount==0)) ? totalData.totalsellAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">售出数量:{{ (totalData && (totalData.totalsellAmount || totalData.totalsellAmount==0)) ?totalData.totalsellAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData && (totalData.totalwarrantyAmount || totalData.totalwarrantyAmount==0)) ?totalData.totalwarrantyAmount: '--' }}</a-col>
-            </a-row>
-          </template>
-        </s-table>
-      </a-spin>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import getDate from '@/libs/getDate.js'
-import { STable } from '@/components'
-import rangeDate from '@/views/common/rangeDate.vue'
-import subarea from '@/views/common/subarea.js'
-import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { querySaleAreaCount, excelSaleAreaOnlineExport, querySaleAreaPage } from '@/api/reportData'
-export default {
-  name: 'TireSalesSubareaList',
-  mixins: [commonMixin],
-  components: { STable, rangeDate, subarea, BizUser },
-  data () {
-    return {
-      spinning: false,
-      tableHeight: 0,
-      time: [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
-        bizUserSn: undefined
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const params = Object.assign(parameter, this.queryParam)
-        return querySaleAreaPage(params).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            this.getCount(params)
-            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
-        })
-      },
-      totalData: null,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '区域', dataIndex: 'subareaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaAreaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'userNameQyfzrs', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购数量', dataIndex: 'buyAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'storeAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售出数量', dataIndex: 'sellAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已绑质保单数量', dataIndex: 'warrantyAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ]
-    }
-  },
-  methods: {
-    // 统计
-    getCount (params) {
-      querySaleAreaCount(params).then(res => {
-        if (res.status == 200 && res.data) {
-          this.totalData = res.data
-        } else {
-          this.totalData = null
-        }
-      })
-    },
-    handleSearch () {
-      this.$refs.table.refresh(true)
-    },
-    //  下推时间  change
-    dateChange (date) {
-      if (date[0] && date[1]) {
-        this.time = date
-      } else {
-        this.time = []
-      }
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
-    },
-    subareaChange (val) {
-      this.queryParam.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
-    },
-    //  重置
-    resetSearchForm () {
-      this.time = [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ]
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.subareaSn = undefined
-      this.queryParam.subareaAreaSn = undefined
-      this.queryParam.bizUserSn = undefined
-      this.totalData = null
-      this.$refs.subarea.clearData()
-      this.$refs.table.clearTable()
-    },
-    //  导出
-    handleExport () {
-      const _this = this
-      const params = _this.queryParam
-      _this.exportLoading = true
-      _this.spinning = true
-      hdExportExcel(excelSaleAreaOnlineExport, params, '轮胎销售报表(区域/分区)', function () {
-        _this.exportLoading = false
-        _this.spinning = false
-      })
-    },
-    pageInit () {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 245
-    }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-      this.resetSearchForm()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-      this.resetSearchForm()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
-  }
-}
-</script>

+ 2 - 3
src/views/salesManagement/receiptPrint/list.vue

@@ -321,14 +321,13 @@ export default {
         const auditStr = auditInfo ? this.getAuditInfo(auditInfo[item]) : ''
         retArr.push({ audit: auditStr, detail: detailItemUseStr, payDetail: detailPayUseStr, subList: rs })
       })
-      console.log(retArr, '------------')
       this.handlePrint(retArr, 1, rows, bookSns)
     },
     // 获取授信西悉尼
     getUseDetailInfo (list) {
       let ret = ''
       list.map((k, i) => {
-        ret = ret + k.itemName + '(' + k.itemAmount + ')' + (i == list.length - 1 ? '' : ',')
+        ret = ret + k.itemName + '(' + k.itemAmount + ')' + (i == list.length - 1 ? '' : ',')
       })
       return ret
     },
@@ -338,7 +337,7 @@ export default {
       if (auditList && auditList.taskVOList) {
         const auditLists = auditList.taskVOList.filter(item => item.userType == '审批人')
         auditLists.map((a, i) => {
-          auditStr = auditStr + a.userName + '(' + a.state + ')' + (i == auditLists.length - 1 ? '' : ',')
+          auditStr = auditStr + a.userName + '(' + a.state + ')' + (i == auditLists.length - 1 ? '' : ',')
         })
       }
       return auditStr

+ 34 - 29
src/views/salesManagement/receiptPrint/printModel.vue

@@ -11,63 +11,66 @@
           ref="printBox"
           cellspacing="0"
           cellpadding="0"
-          style="border-collapse: collapse;width: 564pt;font-size:14px;">
+          style="border-collapse: collapse;width: 564pt;font-size:14px;line-height: normal;">
           <tr>
             <td>
               <div class="print-box" style="width: 564pt;margin-left:1.5pt;">
-                <div style="text-align:center;margin:5pt 0;font-size:22px;font-weight: bold;">收款通知单</div>
+                <div style="text-align:center;margin:5pt 0;font-size:20px;font-weight: bold;">收款通知单</div>
                 <div>
                   <div>
                     <table border="1" style="width: 564pt;border-collapse: collapse;text-align: center;">
                       <tr>
-                        <th style="width: 56pt;background:#f6f6f6;">日期</th>
-                        <th style="width: 62pt;background:#f6f6f6;">客户名称</th>
-                        <th style="width: 62pt;background:#f6f6f6;">营业执照名称</th>
-                        <th style="width: 54pt;background:#f6f6f6;">订单金额</th>
-                        <th style="width: 54pt;background:#f6f6f6;">收款金额</th>
-                        <th style="width: 54pt;background:#f6f6f6;">使用授信</th>
-                        <th style="width: 54pt;background:#f6f6f6;">余款抵扣</th>
-                        <th style="width: 54pt;background:#f6f6f6;">汇入银行</th>
-                        <th style="width: 54pt;background:#f6f6f6;">足额打款</th>
-                        <th style="width: 60pt;background:#f6f6f6;">说明</th>
+                        <th style="width: 36pt;background:#f6f6f6;">日期</th>
+                        <th style="background:#f6f6f6;width: 82pt;">客户名称</th>
+                        <th style="background:#f6f6f6;width: 82pt;">营业执照<br>名称</th>
+                        <th style="width: 53pt;background:#f6f6f6;">订单金额</th>
+                        <th style="width: 53pt;background:#f6f6f6;">收款金额</th>
+                        <th style="width: 53pt;background:#f6f6f6;">使用授信</th>
+                        <th style="width: 53pt;background:#f6f6f6;">余款抵扣</th>
+                        <th style="width: 53pt;background:#f6f6f6;">汇入银行</th>
+                        <th style="width: 37pt;background:#f6f6f6;">足额<br>打款</th>
+                        <th style="width: 64pt;background:#f6f6f6;">说明</th>
                       </tr>
                       <tr v-for="item in fcItem.subList" :key="item.bookDetailSn">
-                        <td style="padding:3pt 1pt;width: 50pt;">{{ moment(item.receiptDate).format('YYYY/MM/DD') }}</td>
-                        <td style="padding:3pt 1pt;width: 56pt;text-align:left;">
+                        <td style="padding:3pt 1pt;width: 34pt;">{{ item.receiptDate.split('-')[0] }}<br>{{ item.receiptDate.split('-')[1]+'/'+item.receiptDate.split('-')[2] }}</td>
+                        <td style="padding:3pt 1pt;width: 80pt;word-break:break-all;">
                           {{ item.payerName }}
                           <div>
                             {{ item.dealerEntity ? item.dealerEntity.kdMidCustomerFnumber : '' }}
                           </div>
                         </td>
-                        <td style="padding:3pt 1pt;width: 56pt;text-align:left;word-break:break-all;">
+                        <td style="padding:3pt 1pt;width: 80pt;word-break:break-all;">
                           {{ item.payerAccountInfo }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;text-align:center;">
+                        <td style="padding:3pt 1pt;width: 51pt;text-align:center;">
                           {{ item.orderAmount?item.orderAmount.toFixed(2):'0.00' }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;text-align:center;">
+                        <td style="padding:3pt 1pt;width: 51pt;text-align:center;">
                           {{ item.receiptAmount?item.receiptAmount.toFixed(2):'0.00' }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;text-align:center;">
+                        <td style="padding:3pt 1pt;width: 51pt;text-align:center;">
                           {{ getTotal(item.detailItemUseList||[]) }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;text-align:center;">
+                        <td style="padding:3pt 1pt;width: 51pt;text-align:center;">
                           {{ item.balanceAmount?item.balanceAmount.toFixed(2):'0.00' }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;">
+                        <td style="padding:3pt 1pt;width: 51pt;">
                           {{ item.bankAccount }}<br>
                           {{ item.bankName }}
                         </td>
-                        <td style="padding:3pt 1pt;width: 48pt;">{{ item.fullPaymentFlagDictValue }}</td>
-                        <td style="padding:3pt 1pt;width: 54pt;word-break:break-all;">{{ item.explainInfo }}</td>
+                        <td style="padding:3pt 1pt;width: 35pt;">{{ item.fullPaymentFlagDictValue }}</td>
+                        <td style="padding:3pt 1pt;width: 62pt;word-break:break-all;">{{ item.explainInfo }}</td>
                       </tr>
                     </table>
-                    <div style="padding:5pt 0;border-bottom: 1px solid #333;">
-                      <div style="width:48%;display:inline-block;">使用授信明细:{{ fcItem.detail||'暂无。' }}</div>
-                      <div style="width:48%;display:inline-block;marign-left:1%;">授信还款明细: {{ fcItem.payDetail||'暂无。' }}</div>
+                    <div style="padding:5pt 0;border-bottom: 1px solid #999;overflow:hidden;">
+                      <div style="width:49%;display:flex;float:left;">使用授信明细:<div>{{ fcItem.detail||'暂无' }}</div></div>
+                      <div style="width:49%;display:flex;float:right;">授信还款明细:<div>{{ fcItem.payDetail||'暂无' }}</div></div>
+                    </div>
+                    <div style="padding:5pt 0;border-bottom: 1px solid #999;overflow:hidden;" v-if="!hideBookReson">
+                      收款事由:{{ fcItem.subList[0]['bookReason']||'暂无' }}
                     </div>
                     <div style="padding:5pt 0;">
-                      审批人员:{{ fcItem.audit||'暂无。' }}
+                      审批人员:{{ fcItem.audit||'暂无' }}
                     </div>
                   </div>
                 </div>
@@ -93,7 +96,8 @@ export default {
       spinning: false,
       detail: null,
       financeBookList: [],
-      printNums: []
+      printNums: [],
+      hideBookReson: false
     }
   },
   methods: {
@@ -114,15 +118,16 @@ export default {
       // html, type, callback, printLogParams
       this.spinning = true
       jGPlPrint(result, 'print', function (res) {
-        if(res){
+        if (res) {
           _this.handleCommonCancel()
         }
         _this.$emit('printOk', res)
         _this.spinning = false
       }, this.printNums, '收款单')
     },
-    getData (data, list) {
+    getData (data, list, hideBookReson) {
       console.log(data, list)
+      this.hideBookReson = hideBookReson
       this.financeBookList = data
       list.map(item => {
         this.printNums.push({

+ 4 - 4
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -232,10 +232,10 @@ export default {
         retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
       })
       console.log(retArr, '------------')
-      if(retArr.length){
+      if (retArr.length) {
         this.handlePrint(retArr, rows)
-      }else{
-        this.$message.info("此收款单明细为空或没有相关数据权限")
+      } else {
+        this.$message.info('此收款单明细为空或没有相关数据权限')
         this.spinning = false
       }
     },
@@ -245,7 +245,7 @@ export default {
       this.showTipModal = true
       this.$nextTick(() => {
         // 审核信息
-        this.$refs.printModel.getData(row, list)
+        this.$refs.printModel.getData(row, list, true)
       })
     },
     canselPrintView () {

+ 12 - 12
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -57,7 +57,7 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="户类型">
+                <a-form-item label="户类型">
                   <dealerType
                     id="shortageStatisticsCList-dealerType"
                     changeOnSelect
@@ -241,23 +241,23 @@ export default {
       const arr = [
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 110, align: 'center' },
-        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 100, align: 'center' },
+        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 60, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: 140, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户类型', dataIndex: 'dealerTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '二级分类', dataIndex: 'productEntity.productTypeName2', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '客户类型', dataIndex: 'dealerTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productEntity.productTypeName2', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 180, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'left', scopedSlots: { customRender: 'productCode' } },
+        { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', scopedSlots: { customRender: 'productCode' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品状态', dataIndex: 'productEntity.stateDictValue', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品状态', dataIndex: 'productEntity.stateDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货数量', dataIndex: 'qty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '缺货成本金额', dataIndex: 'totalCostAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '缺货实售金额', dataIndex: 'totalSalesAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '缺货开单金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作员', dataIndex: 'operatorName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '缺货说明', dataIndex: 'productEntity.offlineReasonType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '通用编码', dataIndex: 'productEntity.commonCode', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]

+ 4 - 1
src/views/salesReturnManagement/billOfLading/detail.vue

@@ -121,7 +121,7 @@
               <a-form-model-item style="margin-bottom:10px" label="附件" :label-col="{span:2}" :wrapper-col="{span:22}">
                 <div style="line-height:26px;">
                   <div v-for="item in form.attachmentList" :key="item.id">
-                    <a :href="item.filePath">{{ item.fileName }}</a>
+                    <a href="javascript:;" @click="openLink(item.filePath)">{{ item.fileName }}</a>
                   </div>
                 </div>
               </a-form-model-item>
@@ -242,6 +242,9 @@ export default {
     }
   },
   methods: {
+    openLink (url) {
+      window.open(url)
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       const _this = this

+ 141 - 0
src/views/setting/erpAllotSettings/list.vue

@@ -0,0 +1,141 @@
+<template>
+  <a-card size="small" :bordered="false" class="erpAllotSettings-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+70+'px'}"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        childrenColumnName="sonList"
+        bordered>
+        <template slot="titles" slot-scope="text, record">
+          {{ record.name }}
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <v-select
+            v-if="record.root==1"
+            size="small"
+            style="width:30%;"
+            code="ERP_PRICE_TYPE"
+            id="erpAllotSettings-erpPriceType"
+            v-model="record.erpPriceType"
+            placeholder="请选择"
+            @change="e=>handleType(record,e)"></v-select>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import { allocateTypeTreeList, allocateTypeSave } from '@/api/allocateType.js'
+export default {
+  name: 'ErpAllotSettings',
+  mixins: [commonMixin],
+  components: { STable, VSelect },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      columns: [
+        { title: '费用/调拨类型', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
+        { title: '同步ERP价格类型', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return allocateTypeTreeList(parameter).then(res => {
+          let data
+          if (res.status == 200) {
+            const newData = this.findChild(res.data)
+            data = newData
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      itemId: null,
+      parentData: null
+    }
+  },
+  methods: {
+    // 查找树的子节点
+    findChild (treeList) {
+      treeList.forEach(item => {
+        if (item.sonList && item.sonList.length > 0) {
+          this.findChild(item.sonList)
+        } else {
+          item.root = this.$hasPermissions('B_erpAllotSettings_erpPriceType') ? 1 : 0
+        }
+      })
+      return treeList
+    },
+    // 价格类型选择
+    handleType (row, val) {
+      const params = {
+        allocateTypeSn: row.allocateTypeSn,
+        erpPriceType: val,
+        name: row.name,
+        allocateCategory: row.allocateCategory,
+        treeLevel: row.treeLevel
+      }
+      allocateTypeSave(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('操作成功')
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 230
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .erpAllotSettings-wrap{
+    height: 100%;
+  }
+</style>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.117/ocs-admin',
+        // target: 'http://192.168.2.113:8660/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,