Преглед на файлове

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh13

chenrui преди 2 години
родител
ревизия
0e53a95e59

+ 10 - 0
src/api/data.js

@@ -8,6 +8,16 @@ export function login (parameter) {
   })
 }
 
+// 默认参数 
+export const getDefaultCofig = (params) => {
+  const url = `/sysParamsConfig/findByCode/${params.code}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 export const listLookUp = params => {
   const url = `/lookup/queryLike`
   return axios({

+ 9 - 0
src/api/expenseManagement.js

@@ -28,6 +28,15 @@ export const expenseAccountList = (params) => {
     method: 'post'
   })
 }
+// 批量更新打印状态
+export const expenseAccountUpdateBatch = (params) => {
+  const url = `/expenseAccount/updateBatch`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 // 新增再次编辑
 export const expenseAccountAgainEdit = (params) => {
   const url = `/expenseAccount/againEdit/${params.expenseAccountSn} `

+ 16 - 1
src/api/financeBook.js

@@ -11,7 +11,14 @@ export const financeBookQueryPage = (params) => {
     method: 'post'
   })
 }
-
+// 获取最近一次审核信息
+export const queryLastFinish = (params) => {
+  return axios({
+    url: `/financeBook/queryLastFinish`,
+    data: params,
+    method: 'post'
+  })
+}
 // 统计
 export const financeBookQueryCount = (params) => {
   return axios({
@@ -20,6 +27,14 @@ export const financeBookQueryCount = (params) => {
     method: 'post'
   })
 }
+// 批量修改打印状态
+export const financeBookDetailUpdateBatch = (params) => {
+  return axios({
+    url: `/financeBook/detail/updateBatch`,
+    data: params,
+    method: 'post'
+  })
+}
 // 财务收款明细-分页列表
 export const financeBookDetailList = (params) => {
   const url = `/financeBook/detail/queryPage/${params.pageNo}/${params.pageSize}`

+ 41 - 0
src/api/reportData.js

@@ -646,3 +646,44 @@ export const sparePartsReturnReportExportDetail = (params) => {
     responseType: 'blob'
   })
 }
+
+// 返利报表
+export const rebateQueryList = (params) => {
+  const url = `/rebate/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 合计
+export const rebateQueryCount = (params) => {
+  const url = `/rebate/queryCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 返利明细报表
+export const rebateDetailQueryList = (params) => {
+  const url = `/rebate/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 返利明细报表统计
+export const rebateDetailQueryCount = (params) => {
+  const url = `/rebate/detail/queryCount`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 40 - 2
src/config/router.config.js

@@ -2334,14 +2334,52 @@ export const asyncRouterMap = [
           // }
         ]
       },
+      // 产品返利明细表
+      {
+        path: '/productRebateReport',
+        redirect: '/productRebateReport/index',
+        component: PageView,
+        meta: {
+          title: '产品返利表',
+          icon: 'profile',
+          permission: 'M_productRebateReport'
+        },
+        children:[
+          {
+            path: '/productRebateReport/index',
+            redirect: '/productRebateReport/index/list',
+            name: 'productRebateReportList',
+            component: BlankLayout,
+            meta: {
+              title: '产品返利明细表',
+              icon: 'profile',
+              permission: 'M_productRebateReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'productRebateReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/productRebateReport/index.vue'),
+                meta: {
+                  title: '产品返利明细表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_productRebateReportList'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 数据导出
       {
         path: '/dataExport',
-        redirect: '/dataExport/exportCheck',
+        redirect: '/dataExport/exportSales',
         component: PageView,
         meta: {
           title: '数据导出',
-          icon: 'money-collect',
+          icon: 'database',
           permission: 'M_dataExport'
         },
         children: [

+ 8 - 3
src/libs/JGPrint.js

@@ -168,10 +168,15 @@ export const jGPlPrint = function (data, type, callback, printLogParams, orginDa
   LODOP.On_Return = function (TaskID, Value) {
     console.log(TaskID, Value)
     // 已打印
-    if (Value && printLogParams) {
-      console.log('已打印,统计打印次数')
-      printLog(printLogParams, callback)
+    if (Value) {
+      if(printLogParams){
+        console.log('已打印,统计打印次数')
+        printLog(printLogParams, callback)
+      }else{
+        callback({status:200,message:'已打印'})
+      }
     } else {
+      // 取消打印
       callback()
     }
   }

+ 10 - 9
src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue

@@ -56,6 +56,7 @@
 
 <script>
 import dingDepartUser from '@/views/common/dingDepartUser.js'
+import { getDefaultCofig } from '@/api/data.js'
 export default {
   name: 'ChooseDepartUserModal',
   components: { dingDepartUser },
@@ -76,15 +77,8 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
-        approvers: [
-          {label: '李丽英', value: '043107382726069026'},
-          {label: '张丽添', value: '082029252224051326'},
-          {label: '张国秋', value: '5351215624123790'}
-        ], // 审批人
-        ccList: [
-          {label: '江月龙', value: '275842136127519536'},
-          {label: '谢玉英', value: '275844532735425322'}
-        ] // 抄送人
+        approvers: [], // 审批人
+        ccList: [] // 抄送人
       },
       rules: {
         approvers: [
@@ -135,6 +129,11 @@ export default {
         }
       })
     },
+    async getDefAudit(){
+      const data = getDefaultCofig({code:'EXPENSE_ACCOUNT_DING_USER'}).then(res => res.data)
+      console.log(data)
+      
+    },
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()
@@ -155,6 +154,8 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetForm()
+      }else{
+        this.getDefAudit()
       }
     }
   }

+ 21 - 6
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -49,7 +49,7 @@
                     v-model="queryParam.printStatus"
                     ref="printStatus"
                     id="pushOrder-printStatus"
-                    code="PRINT_STATUS"
+                    code="EXPENSE_ACCOUNT_PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear></v-select>
                 </a-form-item>
@@ -176,7 +176,7 @@ import verifyModal from './verifyModal.vue'
 import previewModal from './previewModal.vue'
 import expenseType from '@/views/common/expenseType.js'
 import { getBatchLastProcessInstance } from '@/api/financeBook'
-import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit, expenseAcctDetailFindList } from '@/api/expenseManagement'
+import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit, expenseAcctDetailFindList, expenseAccountUpdateBatch } from '@/api/expenseManagement'
 import baseDataModal from './baseDataModal.vue'
 export default {
   name: 'ExpenseReimbursementList',
@@ -252,10 +252,24 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    printOk(res){
-      this.spinning = false
-      if(res&&res.status == 200){
-        this.$refs.table.refresh()
+    printOk(data){
+      if(data&&data.status == 200){
+        const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const ret = []
+        rows.map(item => {
+          ret.push({
+            id: item.id,
+            printStatus:"PASS"
+          })
+        })
+        expenseAccountUpdateBatch(ret).then(res => {
+          if(res.status == 200){
+            this.$refs.table.refresh()
+          }
+          this.spinning = false
+        })
+      }else{
+        this.spinning = false
       }
     },
     // 批量打印
@@ -377,6 +391,7 @@ export default {
         expenseType: undefined, // 费用类型
         expenseType2: undefined, // 费用类型2
         state: undefined, // 状态
+        printStatus:undefined,
         applyPersonSn: undefined
       }
       this.expenseTypes = []

+ 0 - 8
src/views/expenseManagement/expenseReimbursement/previewModal.vue

@@ -137,14 +137,6 @@ export default {
   methods: {
     setData (list) {
       this.list = list
-      // list.map(item => {
-      //   this.printNums.push({
-      //     billType: 'FINANCE_BOOK_DETAIL',
-      //     billSn: item.bookDetailSn,
-      //     billNo: item.bookNo,
-      //     printType: '费用单打印'
-      //   })
-      // })
       setTimeout(()=>{
         this.prints()
       },100)

+ 4 - 4
src/views/financialManagement/collectionDetailStatic/invoiceModal.vue

@@ -148,16 +148,16 @@ export default {
       updateDetailInvoiceDate(ajax_form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.cancel()
+          _this.cancel(1)
           _this.spinning = false
         } else {
           _this.spinning = false
         }
       })
     },
-    cancel () {
+    cancel (flag) {
       this.opened = false
-      this.$emit('cancel')
+      this.$emit('cancel',flag)
       this.$refs.ruleForm.resetFields()
     }
   },
@@ -165,7 +165,7 @@ export default {
     show (newValue, oldValue) {
       this.opened = newValue
       if (!newValue) {
-        this.cancel()
+        this.$refs.ruleForm.resetFields()
       } else {
         this.form = this.info
       }

+ 83 - 28
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -15,6 +15,26 @@
                 <a-input id="collectionDetail-bookNo" v-model.trim="queryParam.bookNo" allowClear placeholder="请输入收款单号"/>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="收款打印状态">
+                <v-select
+                    v-model="queryParam.printStatus"
+                    code="PRINT_STATUS"
+                    placeholder="请选择收款打印状态"
+                    allowClear
+                  ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+                <a-form-item label="开票状态">
+                  <v-select
+                    v-model="queryParam.invoiceStatus"
+                    code="FINANCE_BOOK_INVOICE_STATUS"
+                    placeholder="请选择开票状态"
+                    allowClear
+                  ></v-select>
+                </a-form-item>
+              </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="申请人">
                 <employee style="width: 100%;" id="collectionDetail-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
@@ -78,18 +98,6 @@
                   </a-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="开票状态">
-                  <a-select v-model="queryParam.invoiceDateType" style="width: 100%" placeholder="请选择开票状态">
-                    <a-select-option value="1">
-                      已开票
-                    </a-select-option>
-                    <a-select-option value="0">
-                      未开票
-                    </a-select-option>
-                  </a-select>
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="开票日期">
                   <rangeDate ref="invoiceDate" :value="invoiceDate" @change="invoiceDateChange" />
@@ -182,6 +190,7 @@
       </a-spin>
       <!-- 开票日期弹窗 -->
       <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="cancel"></invoiceModal>
+      <plInvoiceModal v-drag :show="plinvoiceIsShow" @ok="plinvoiceOk" @cancel="cancel"></plInvoiceModal>
       <!-- 备注弹窗 -->
       <noteModal ref="remarksModal" v-drag :show="noteIsShow" @cancel="cancel"></noteModal>
       <!-- 收款打印状态 -->
@@ -202,17 +211,19 @@ import { hdExportExcel } from '@/libs/exportExcel'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import invoiceModal from './invoiceModal.vue'
+import plInvoiceModal from './plInvoiceModal.vue'
 import noteModal from './noteModal.vue'
 import printModal from './printModal.vue'
-import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount } from '@/api/financeBook.js'
+import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount, financeBookDetailUpdateBatch } from '@/api/financeBook.js'
 export default {
   name: 'CollectionDetailStaticList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area, invoiceModal, noteModal, printModal },
+  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area, invoiceModal, plInvoiceModal, noteModal, printModal },
   data () {
     return {
       spinning: false,
       exportLoading: false,
+      plinvoiceIsShow: false,
       tableHeight: 0,
       queryParam: { //  查询条件
         bookNo: '',
@@ -229,6 +240,8 @@ export default {
         bankName: undefined,
         subareaSn: undefined,
         provinceSn: undefined,
+        printStatus: undefined,
+        invoiceStatus: undefined,
         invoiceDateType: undefined,
         invoiceBeginDate: '',
         invoiceEndDate: '',
@@ -240,6 +253,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       receiptDate: [], //  收款时间
       invoiceDate: [], // 开票日期
+      plinvoiceInfo: null,
       auditDate: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -329,11 +343,15 @@ export default {
   },
   methods: {
     // 关闭弹窗刷新表格
-    cancel () {
+    cancel (flag) {
+      console.log(flag)
       this.invoiceIsShow = false
       this.noteIsShow = false
       this.printIsShow = false
-      this.searchForm()
+      this.plinvoiceIsShow = false
+      if(flag === 1){
+        this.searchForm()
+      }
     },
     getCount (params) {
       financeBookReportDetailCount(params).then(res => {
@@ -351,22 +369,55 @@ export default {
       }
 
       if(e.key == 1){ // 批量允许打印
-        const dataList = rows.filter(item => item.printStatus=='NO_PRINT' || item.printStatus=='PRINT')
-        this.$confirm({
-        title: '批量允许打印',
-        content: `已选有效数据 ${dataList.length} 条,确认将收款打印状态变更为允许打印吗?`,
-        okText: '确定',
-        centered: true,
-        cancelText: '取消',
-        onOk () {
-           // 批量允许打印接口
+        const dataList = rows.filter(item => !(item.printStatus=='NO_PRINT' || item.printStatus=='PRINT'))
+        if(dataList.length){
+          this.$confirm({
+            title: '批量允许打印',
+            content: `已选有效数据 ${dataList.length} 条,确认将收款打印状态变更为允许打印吗?`,
+            okText: '确定',
+            centered: true,
+            cancelText: '取消',
+            onOk () {
+              // 批量允许打印接口
+              const data = []
+              dataList.map(item => {
+                  data.push({id: item.id, printStatus: 'NO_PRINT' })
+              })
+              _this.plUpdateStatus(data)
+            }
+          })
+        }else{
+          _this.$message.warning('没有可操作的有效数据!')
         }
-      })
       }
+
       if(e.key == 2){ // 批量开票
-        
+        const data = []
+        rows.map(item => {
+          data.push({id: item.id, invoiceDate: '', remarks: '' })
+        })
+        _this.plinvoiceInfo = data
+        _this.plinvoiceIsShow = true
       }
     },
+    // 批量操作
+    plUpdateStatus(data){
+      this.spinning = true
+      financeBookDetailUpdateBatch(data).then(res => {
+        if(res.status == 200){
+          this.searchForm()
+        }
+        this.spinning = false
+      })
+    },
+    // 确定批量开票
+    plinvoiceOk(data){
+      this.plinvoiceInfo.map(item => {
+        item.invoiceDate = data.invoiceDate
+        item.remarks = data.remarks
+      })
+      this.plUpdateStatus(this.plinvoiceInfo)
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -437,6 +488,8 @@ export default {
       this.queryParam.provinceSn = undefined
       this.queryParam.invoiceDateType = undefined
       this.queryParam.invoiceDate = ''
+      this.queryParam.printStatus = undefined
+      this.queryParam.invoiceStatus = undefined
       this.queryParam.payerType = undefined
       this.searchForm()
     },
@@ -460,8 +513,9 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 205
+      this.tableHeight = window.innerHeight - tableSearchH - 310
     },
+    // 开票操作
     handleInvoice (con) {
       const obj = {
         no: con.bookNo,
@@ -487,6 +541,7 @@ export default {
         _this.$refs.remarksModal.setData(JSON.stringify(obj))
       })
     },
+    // 允许打印
     handlePrint (item) {
       const obj = {
         no: item.bookNo,

+ 4 - 4
src/views/financialManagement/collectionDetailStatic/noteModal.vue

@@ -81,7 +81,7 @@ export default {
       updateFinanceBookDetail(ajax_form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.cancel()
+          _this.cancel(1)
           _this.spinning = false
         } else {
           _this.spinning = false
@@ -89,9 +89,9 @@ export default {
         _this.confirmLoading = false
       })
     },
-    cancel () {
+    cancel (flag) {
       this.opened = false
-      this.$emit('cancel')
+      this.$emit('cancel', flag)
       this.$refs.ruleForm.resetFields()
     },
     setData (data) {
@@ -102,7 +102,7 @@ export default {
     show (newValue, oldValue) {
       this.opened = newValue
       if (!newValue) {
-        this.cancel()
+        this.$refs.ruleForm.resetFields()
       }
     }
   }

+ 158 - 0
src/views/financialManagement/collectionDetailStatic/plInvoiceModal.vue

@@ -0,0 +1,158 @@
+<template>
+    <a-modal
+      v-model="opened"
+      :title="title"
+      centered
+      :maskClosable="false"
+      :footer="null"
+      @cancel="cancel"
+      width="600px">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="chooseCustom-form"
+          ref="ruleForm"
+          :model="form"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol">
+          <a-form-model-item label="开票日期:" prop="invoiceDate">
+            <a-date-picker
+              id="noticeEdit-releaseDate"
+              format="YYYY-MM-DD"
+              placeholder="请选择开票日期"
+              v-model="form.invoiceDate"/>
+            <div style="color:#999">如果没有开票,则不填写即可</div>
+          </a-form-model-item>
+          <a-form-model-item label="备注:">
+            <a-textarea id="noticeEdit-remarks" rows="4" v-model="form.remarks" :maxlenght="100" placeholder="请输入备注(最多100字符)"></a-textarea>
+          </a-form-model-item>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
+            <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+            <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定
+            </a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-spin>
+    </a-modal>
+  </template>
+  
+  <script>
+  import moment from 'moment'
+  import {
+    updateDetailInvoiceDate
+  } from '@/api/financeBook.js'
+  export default {
+    name: 'InvoiceModal',
+    props: {
+      show: [Boolean],
+    },
+    data () {
+      return {
+        opened: this.show,
+        spinning: false,
+        title: '批量设置开票',
+        confirmLoading: false,
+        formItemLayout: {
+          labelCol: {
+            span: 6
+          },
+          wrapperCol: {
+            span: 14
+          }
+        },
+        form: {
+          invoiceDate: undefined,
+          remarks: ''
+        }
+      }
+    },
+    methods: {
+      disabledDate (current) {
+        return current && current < moment().startOf('day')
+      },
+      disabledDateTime (date) {
+        if (!date) {
+          date = moment()
+        }
+        return {
+          disabledHours: () => this.getDisabledHours(date.format('YYYY-MM-DD HH:mm:ss')),
+          disabledMinutes: () => this.getDisabledMinutes(date.format('YYYY-MM-DD HH:mm:ss')),
+          disabledSeconds: () => this.getDisabledSeconds(date.format('YYYY-MM-DD HH:mm:ss'))
+        }
+      },
+      // 禁用时间范围  时
+      getDisabledHours (nowTime) {
+        const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+        const time = nowTime.split(' ')
+        const times = todayDate.split(' ')
+        const timeArrs = times[1].split(':')
+        const hours = []
+        if (todayDate.split(' ')[0] == time[0]) {
+          for (var i = 0; i < parseInt(timeArrs[0]); i++) {
+            hours.push(i)
+          }
+        }
+        return hours
+      },
+      // 禁用时间范围  分
+      getDisabledMinutes (nowTime) {
+        const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+        const time = nowTime.split(' ')
+        const times = todayDate.split(' ')
+        const timeArr = time[1].split(':')
+        const timeArrs = times[1].split(':')
+        const minutes = []
+        if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0]) {
+          for (var i = 0; i < parseInt(timeArrs[1]); i++) {
+            minutes.push(i)
+          }
+        }
+        return minutes
+      },
+      // 禁用时间范围  秒
+      getDisabledSeconds (nowTime) {
+        const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+        const time = nowTime.split(' ')
+        const times = todayDate.split(' ')
+        const timeArr = time[1].split(':')
+        const timeArrs = times[1].split(':')
+        const second = []
+        if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0] && timeArrs[1] == timeArr[1]) {
+          for (var i = 0; i <= parseInt(timeArrs[2]); i++) {
+            second.push(i)
+          }
+        }
+        return second
+      },
+      //  保存
+      handleSubmit (e) {
+        const _this = this
+        const invoiceDate = moment(this.form.invoiceDate).format('YYYY-MM-DD')
+        const ajax_form = {
+          invoiceDate: this.form.invoiceDate ? invoiceDate : '',
+          remarks: this.form.remarks
+        }
+        this.$emit('ok', ajax_form)
+        this.$emit('cancel')
+      },
+      cancel () {
+        this.opened = false
+        this.$emit('cancel')
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    watch: {
+      show (newValue, oldValue) {
+        this.opened = newValue
+        if (!newValue) {
+          this.cancel()
+        }
+      }
+    }
+  }
+  </script>
+  <style lang="less" scoped>
+   .ant-form-item{
+     margin-bottom:0 !important;
+   }
+  </style>
+  

+ 5 - 4
src/views/financialManagement/collectionDetailStatic/printModal.vue

@@ -95,7 +95,7 @@ export default {
       updateFinanceBookDetail(ajax_form).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
-          _this.cancel()
+          _this.cancel(1)
           _this.spinning = false
         } else {
           _this.spinning = false
@@ -103,9 +103,9 @@ export default {
         _this.confirmLoading = false
       })
     },
-    cancel () {
+    cancel (flag) {
       this.opened = false
-      this.$emit('cancel')
+      this.$emit('cancel', flag)
       this.printStatus = ''
       this.$refs.ruleForm.resetFields()
     }
@@ -114,7 +114,8 @@ export default {
     show (newValue, oldValue) {
       this.opened = newValue
       if (!newValue) {
-        this.cancel()
+        this.printStatus = ''
+        this.$refs.ruleForm.resetFields()
       } else {
         this.form = this.info
       }

+ 11 - 3
src/views/financialManagement/financialCollection/baseModal.vue

@@ -68,7 +68,7 @@ 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 { financeBookSave, financeBookFindBySn } from '@/api/financeBook.js'
+import { financeBookSave, financeBookFindBySn, queryLastFinish } from '@/api/financeBook.js'
 export default {
   name: 'FcBaseModal',
   mixins: [commonMixin],
@@ -206,7 +206,7 @@ export default {
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
     },
-    pageInit () {
+   async pageInit () {
       this.$nextTick(() => {
         this.attachList = []
         this.$refs.attachList.setFileList('')
@@ -215,7 +215,7 @@ export default {
           this.$refs.settleClientName.resetForm()
         }
       })
-      
+
       this.form = {
         applyPersonSn: undefined,
         bookReason: '',
@@ -225,8 +225,16 @@ export default {
         remarks: '',
         attachmentList: ''
       }
+
       if (this.bookSn) { //  编辑页
         this.getDetail()
+      }else{
+        // 最近一次审核人
+        const lastAuditInfo = await queryLastFinish().then(res => res.data)
+        this.form.dealerSn = lastAuditInfo ? lastAuditInfo.applyPersonSn : undefined
+        this.$nextTick(() => {
+          this.$refs.settleClientName.getDetail(this.form.dealerSn)
+        })
       }
     }
   },

+ 1 - 3
src/views/productManagement/productPricing/list.vue

@@ -18,7 +18,6 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌">
                 <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
-                </a-select>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -86,7 +85,7 @@
         ref="table"
         :style="{ height: tableHeight+84.5+'px' }"
         size="small"
-        :row-selection="$hasPermissions('B_productPricing_audit') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.pricingState!='WAIT_PRICING_AUDIT' } })}: null"
+        :row-selection="$hasPermissions('B_productPricing_audit') ? { columnWidth: '4%', getCheckboxProps: record => ({ props: { disabled: record.pricingState!='WAIT_PRICING_AUDIT' } })}: null"
         @rowSelection="rowSelectionFun"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -222,7 +221,6 @@ export default {
         { title: '车主价', dataIndex: 'carOwnersPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-
       return arr
     }
   },

+ 337 - 0
src/views/reportData/productRebateReport/detailList.vue

@@ -0,0 +1,337 @@
+<template>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form-model
+        id="rebateDetailReport-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="日期" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="单号">
+              <a-input id="srebateReport-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单号"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="客户名称">
+              <dealerSearchList ref="dealer" id="srebateReport-buyerName" @change="dealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="直接绑定客户名称">
+              <dealerSearchList ref="directDealer" id="srebateReport-buyerName" @change="directDealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="间接绑定客户名称">
+              <dealerSearchList ref="indirectDealer" id="srebateReport-buyerName" @change="indirectDealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="类型">
+              <v-select
+                  v-model="queryParam.bizType"
+                  ref="bizType"
+                  id="srebateReport-bizType"
+                  code="REBATE_BILL_BIZ_TYPE"
+                  placeholder="请选择类型"
+                  allowClear></v-select>
+            </a-form-model-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="rebateDetailReport-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品分类">
+                <ProductType id="rebateDetailReport-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="queryParam.productType"></ProductType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="rebateDetailReport-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="rebateDetailReport-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateDetailReport-reset">重置</a-button>
+            <a-button
+              type="primary"
+              style="margin-left: 5px"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('M_salesReturnReportExport')"
+              class="button-warning"
+              id="rebateDetailReport-export-btn">导出</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>
+    
+    <!-- 列表 -->
+    <s-table
+      class="sTable fixPagination"
+      ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
+      size="small"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ y: tableHeight, x: 2000}"
+      :defaultLoadData="false"
+      bordered>·
+      <template slot="footer">
+        <a-row type="flex" justify="end" :gutter="10">
+          <a-col flex="10%" >分公司金额:{{ (totalData && (totalData.wholesalePrice1 || totalData.wholesalePrice1==0)) ? totalData.wholesalePrice1 : '--' }}</a-col>
+          <a-col flex="10%" >加盟商金额:{{ (totalData && (totalData.wholesalePrice2 || totalData.wholesalePrice2==0)) ? totalData.wholesalePrice2 : '--' }}</a-col>
+          <a-col flex="10%" >特约加盟店金额:{{ (totalData && (totalData.wholesalePrice3 || totalData.wholesalePrice3==0)) ? totalData.wholesalePrice3 : '--' }}</a-col>
+          <a-col flex="10%" >直接差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? totalData.directRebateAmount : '--' }}</a-col>
+          <a-col flex="10%" >间接差价金额:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? totalData.indirectRebateAmount : '--' }}</a-col>
+        </a-row>
+      </template>
+    </s-table>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import dealerSearchList from '@/views/common/dealerSearchList.vue'
+import { rebateDetailQueryList, rebateDetailQueryCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, ProductType, ProductBrand, dealerSearchList },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        buyerSn: undefined, // 客户sn
+        bizNo: '', // 单号
+        bizType: undefined,
+        directDealerSn: undefined, // 直接经销商SN
+        indirectDealerSn: undefined, // 间接经销商SN
+        productEntity: {
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
+          code: '', //  产品编码
+          name: '' //  产品名称
+        }
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        // 总计
+        this.getCount(params)
+        return rebateDetailQueryList(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
+              data.list[i].inStockQty = data.list[i].qty
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null //  合计
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
+        { title: '订单号', dataIndex: 'bizNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类型', dataIndex: 'rebateBill.bizTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户级别', dataIndex: 'rebateBill.buyerLevelDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'rebateBill.buyerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'rebateBill.directDealerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'rebateBill.indirectDealerName', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', width: '200px', align: 'center', customRender: function (text,record) { return record.productEntity.productTypeName1 + (record.productEntity.productTypeName2 ? '>' : '') + (record.productEntity.productTypeName2 || '') } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '数量', dataIndex: 'qty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '分公司金额', dataIndex: 'wholesalePrice1', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '直接差价', dataIndex: 'directRebateAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '间接差价', dataIndex: 'indirectRebateAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      rebateDetailQueryCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    dealerChange (val) {
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+      } else {
+        this.queryParam.buyerSn = undefined
+      }
+    },
+    directDealerChange (val) {
+      if (val.row) {
+        this.queryParam.directDealerSn = val.row.dealerSn
+      } else {
+        this.queryParam.directDealerSn = undefined
+      }
+    },
+    indirectDealerChange (val) {
+      if (val.row) {
+        this.queryParam.indirectDealerSn = val.row.dealerSn
+      } else {
+        this.queryParam.indirectDealerSn = undefined
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.bizNo = ''
+      this.queryParam.bizType = undefined
+      this.queryParam.buyerSn = undefined
+      this.queryParam.indirectDealerSn = undefined
+      this.queryParam.directDealerSn = undefined
+      this.$refs.dealer.resetForm()
+      this.$refs.indirectDealer.resetForm()
+      this.$refs.directDealer.resetForm()
+
+      this.queryParam.productEntity.productBrandSn = undefined
+      this.queryParam.productEntity.productTypeSn1 = ''
+      this.queryParam.productEntity.productTypeSn2 = ''
+      this.queryParam.productEntity.productTypeSn3 = ''
+      this.queryParam.productEntity.code = ''
+      this.queryParam.productEntity.name = ''
+      this.queryParam.productType = []
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+          _this.exportLoading = true
+          _this.spinning = true
+          reportSalesReturnDetailExport(params).then(res => {
+            downloadExcel(res, '销售退货明细报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productEntity.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    pageInit () {
+      this.disabled = false
+      this.spinning = false
+      this.setTableH()
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 340
+    }
+  },
+  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>

+ 46 - 0
src/views/reportData/productRebateReport/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <div class="tabsReportList-wrap">
+    <div style="background-color: #fff;margin-bottom: 5px;">
+      <a-tabs default-active-key="1" v-model="curTab">
+        <a-tab-pane key="1" tab="返利表"></a-tab-pane>
+        <a-tab-pane key="2" tab="返利明细报表" force-render></a-tab-pane>
+      </a-tabs>
+    </div>
+    <a-card size="small" :bordered="false">
+      <report v-show="curTab==1"></report>
+      <detailReport v-show="curTab==2"></detailReport>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import report from './list.vue'
+import detailReport from './detailList.vue'
+export default {
+  name: 'ProductRebateReportIndex',
+  components: {
+    report,
+    detailReport
+  },
+  data () {
+    return {
+      curTab: '1'
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .tabsReportList-wrap{
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    .ant-tabs-bar{
+      margin: 0;
+    }
+    .ant-card{
+      flex-grow: 1;
+      overflow: auto;
+    }
+  }
+</style>

+ 278 - 0
src/views/reportData/productRebateReport/list.vue

@@ -0,0 +1,278 @@
+<template>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form-model
+        id="srebateReport-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :rules="rules"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="日期" prop="time">
+              <rangeDate ref="rangeDate" @change="dateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="单号">
+              <a-input id="srebateReport-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单号"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="客户名称">
+              <dealerSearchList ref="dealer" id="srebateReport-buyerName" @change="dealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="直接绑定客户名称">
+              <dealerSearchList ref="directDealer" id="srebateReport-buyerName" @change="directDealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="间接绑定客户名称">
+              <dealerSearchList ref="indirectDealer" id="srebateReport-buyerName" @change="indirectDealerChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="类型">
+              <v-select
+                  v-model="queryParam.bizType"
+                  ref="bizType"
+                  id="srebateReport-bizType"
+                  code="REBATE_BILL_BIZ_TYPE"
+                  placeholder="请选择类型"
+                  allowClear></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="srebateReport-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="srebateReport-reset">重置</a-button>
+            <a-button
+              type="primary"
+              style="margin-left: 5px"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('M_salesReturnReportExport')"
+              class="button-warning"
+              id="srebateReport-export-btn">导出</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </div>
+  
+    <!-- 列表 -->
+    <s-table
+      class="sTable fixPagination"
+      ref="table"
+      :style="{ height: tableHeight+84.5+'px' }"
+      size="small"
+      :scroll="{ y: tableHeight }"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :defaultLoadData="false"
+      bordered>
+      <template slot="footer">
+          <a-row type="flex" justify="end" :gutter="10">
+            <a-col flex="10%">总售价金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
+            <a-col flex="10%">直接差价金额:{{ (totalData && (totalData.directRebate || totalData.directRebate==0)) ? totalData.directRebate : '--' }}</a-col>
+            <a-col flex="10%">间接差价金额:{{ (totalData && (totalData.indirectRebate || totalData.indirectRebate==0)) ? totalData.indirectRebate : '--' }}</a-col>
+            <a-col flex="10%">总实售价金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
+          </a-row>
+        </template>
+    </s-table>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import dealerSearchList from '@/views/common/dealerSearchList.vue'
+import { rebateQueryList, rebateQueryCount } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, dealerSearchList },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        time: [],
+        beginDate: '',
+        endDate: '',
+        buyerSn: undefined, // 客户sn
+        bizNo: '', // 单号
+        bizType: undefined,
+        directDealerSn: undefined, // 直接经销商SN
+        indirectDealerSn: undefined // 间接经销商SN
+      },
+      rules: {
+        'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        // 总计
+        this.getCount(params)
+        return rebateQueryList(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
+        })
+      },
+      totalData: null //  合计
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '订单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户级别', dataIndex: 'buyerLevelDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总售价', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '直接差价', dataIndex: 'directRebate', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '间接差价', dataIndex: 'indirectRebate', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总实售价', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 合计
+    getCount (params) {
+      rebateQueryCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          this.$refs.table.refresh(true)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    dealerChange (val) {
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+      } else {
+        this.queryParam.buyerSn = undefined
+      }
+    },
+    directDealerChange (val) {
+      if (val.row) {
+        this.queryParam.directDealerSn = val.row.dealerSn
+      } else {
+        this.queryParam.directDealerSn = undefined
+      }
+    },
+    indirectDealerChange (val) {
+      if (val.row) {
+        this.queryParam.indirectDealerSn = val.row.dealerSn
+      } else {
+        this.queryParam.indirectDealerSn = undefined
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.time = []
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.bizNo = ''
+      this.queryParam.bizType = undefined
+      this.queryParam.buyerSn = undefined
+      this.queryParam.indirectDealerSn = undefined
+      this.queryParam.directDealerSn = undefined
+      this.$refs.dealer.resetForm()
+      this.$refs.indirectDealer.resetForm()
+      this.$refs.directDealer.resetForm()
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      this.$refs.table.clearTable()
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+          _this.exportLoading = true
+          _this.spinning = true
+          reportSalesReturnExport(params).then(res => {
+            downloadExcel(res, '销售退货报表')
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 240
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.setTableH()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.setTableH()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 4 - 1
src/views/salesManagement/receiptPrint/list.vue

@@ -308,9 +308,12 @@ export default {
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
     custChange (val) {
+      console.log(val)
       if(val.row){
-        this.queryParam.payerName = val.row.dealerName
+        this.queryParam.dealerSn = val.row.dealerSn
+        this.queryParam.payerName = undefined
       }else{
+        this.queryParam.dealerSn = undefined
         this.queryParam.payerName = val.key
       }
     },

+ 1 - 1
vue.config.js

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