|
@@ -0,0 +1,420 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false" class="expenseReimbursementDetailList-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" ref="ruleForm">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="审核时间">
|
|
|
+ <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="费用单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <a-input id="expenseReimbursementDetailList-expenseAccountNo" v-model.trim="queryParam.expenseAccountNo" allowClear placeholder="请输入销售单号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="申请人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <employee style="width: 100%;" id="expenseReimbursementDetailList-applyPersonSn" @change="employeeChange" v-model="queryParam.applyPersonSn"></employee>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="申请部门" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <department style="width: 100%;" id="expenseReimbursementDetailList-applyDepartmentSn" @change="applyDepartmentChange" v-model="queryParam.applyDepartmentSn"></department>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="费用类型">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.expenseType"
|
|
|
+ ref="expenseType"
|
|
|
+ id="expenseReimbursementDetailList-expenseType"
|
|
|
+ code="EXPENSE_TYPE"
|
|
|
+ placeholder="请选择费用类型"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="费用发生月份">
|
|
|
+ <a-month-picker
|
|
|
+ placeholder="请选择月份"
|
|
|
+ v-model="queryParam.expenseDate"
|
|
|
+ @change="onChange"
|
|
|
+ locale="zh-cn"
|
|
|
+ :disabled-date="disabledDate"
|
|
|
+ style="width: 100%;"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="记账类型">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.accountType"
|
|
|
+ ref="accountType"
|
|
|
+ id="expenseReimbursementDetailList-accountType"
|
|
|
+ code="EXPENSE_ACCOUNT_TYPE"
|
|
|
+ placeholder="请选择状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="记账名称">
|
|
|
+ <!-- 部门 -->
|
|
|
+ <department v-show="queryParam.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
|
|
|
+ <!-- 经销商 -->
|
|
|
+ <custList v-show="queryParam.accountType=='CUSTOMER'" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
|
|
|
+ <!-- 供应商 -->
|
|
|
+ <supplier v-show="queryParam.accountType=='OUT_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
|
|
|
+ <a-select style="width: 100%" v-if="!queryParam.accountType" placeholder="请选择">
|
|
|
+ <a-select-option value="" :disabled="true">
|
|
|
+ 请先选择记账类型
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="所属区域">
|
|
|
+ <subarea id="expenseReimbursementDetailList-subarea" v-model="queryParam.subareaSn"></subarea>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="所属省份">
|
|
|
+ <Area id="expenseReimbursementDetailList-area" placeholder="请选择所属省份" v-model="queryParam.provinceSn"></Area>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="所属城市">
|
|
|
+ <Area id="expenseReimbursementDetailList-area" placeholder="请选择所属城市" leve="city" :parentId="queryParam.provinceSn" v-model="queryParam.citySn"></Area>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="费用承担方类型" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <v-select
|
|
|
+ code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
|
|
|
+ allowClear
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="queryParam.splitObjType"
|
|
|
+ @change="splitObjTypeChange"
|
|
|
+ placeholder="请选择承担方类型"
|
|
|
+ ></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="费用承担方" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <!-- 部门 -->
|
|
|
+ <department v-show="queryParam.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="queryParam.splitObjSn"></department>
|
|
|
+ <!-- 经销商 -->
|
|
|
+ <custList v-show="queryParam.splitObjType=='CUSTOMER'" @change="custChange" placeholder="请选择(输入名称搜索)"></custList>
|
|
|
+ <a-select style="width: 100%" v-if="!queryParam.splitObjType" placeholder="请选择">
|
|
|
+ <a-select-option value="" :disabled="true">
|
|
|
+ 请先选择承担方类型
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" v-show="queryParam.splitObjType=='DEPARTMENT'">
|
|
|
+ <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <employee style="width: 100%;" placeholder="请选择承担人员" v-model="queryParam.childSplitObjSn"></employee>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" v-show="queryParam.splitObjType==undefined">
|
|
|
+ <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
+ <a-select style="width: 100%" placeholder="请选择">
|
|
|
+ <a-select-option value="" :disabled="true">
|
|
|
+ 请先选择承担方类型
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <span class="table-page-search-submitButtons">
|
|
|
+ <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ style="margin-left: 10px"
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ id="actualSalesReportList-export">导出</a-button>
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+102.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight,x:1770 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
|
|
|
+import moment from 'moment'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import subarea from '@/views/common/subarea.js'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import Area from '@/views/common/area.js'
|
|
|
+import department from '../expenseReimbursement/department.js'
|
|
|
+import employee from '../expenseReimbursement/employee.js'
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
+import supplier from '@/views/common/supplier.js'
|
|
|
+import { expenseAccountDetailList, expenseAcctDetailReport } from '@/api/expenseManagement'
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
+export default {
|
|
|
+ name: 'TableList',
|
|
|
+ components: { STable, VSelect, department, employee, subarea, rangeDate, Area, custList, supplier },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ locale,
|
|
|
+ spinning: false,
|
|
|
+ advanced: false, // 高级搜索 展开/关闭
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ openModal: false, // 选择客户弹框是否显示
|
|
|
+ exportLoading: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ time: [
|
|
|
+ moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
|
|
|
+ moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
|
|
|
+ ],
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ expenseDate: '', // 月份
|
|
|
+ beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ expenseAccountNo: '', // 费用单号
|
|
|
+ applyPersonSn: undefined, // 申请人
|
|
|
+ applyDepartmentSn: undefined, // 申请部门
|
|
|
+ expenseType: undefined, // 费用类型
|
|
|
+ accountType: undefined, // 记账类型
|
|
|
+ accountNameSn: undefined, // 记账名称
|
|
|
+ splitObjType: undefined, // 费用承担方类型
|
|
|
+ splitObjSn: undefined, // 费用承担方
|
|
|
+ childSplitObjSn: undefined, // 费用承担人
|
|
|
+ subareaSn: undefined,
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ provinceSn: undefined,
|
|
|
+ citySn: undefined
|
|
|
+ },
|
|
|
+ addrProvinceList: [], // 省列表
|
|
|
+ addrCityList: [], // 城市列表数据
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ delete parameter.tableId
|
|
|
+ delete parameter.index
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
+ if (params.expenseDate) {
|
|
|
+ params.expenseDate = params.expenseDate + '-01'
|
|
|
+ }
|
|
|
+ return expenseAccountDetailList(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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ columns: [{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
|
+ { title: '审核时间', dataIndex: 'finishDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '费用单号', dataIndex: 'expenseAccountNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '申请人', dataIndex: 'applyPersonName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '申请部门', dataIndex: 'applyDepartmentName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '费用类型', dataIndex: 'expenseTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '费用发生月份', dataIndex: 'expenseDate', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '主题', dataIndex: 'title', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '记账类型', dataIndex: 'accountTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '记账名称', dataIndex: 'accountName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '所属区域', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '所属省份', dataIndex: 'provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '所属城市', dataIndex: 'cityName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '记账费用', dataIndex: 'expense', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '费用承担方', dataIndex: 'splitObjName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '费用承担金额', dataIndex: 'splitAmount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '费用承担人', dataIndex: 'childSplitObjName', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '人员平摊费用', dataIndex: 'childSplitAmount', width: 120, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
+ },
|
|
|
+ onChange (date, dateString) {
|
|
|
+ this.queryParam.expenseDate = dateString
|
|
|
+ },
|
|
|
+ custChange (val) {
|
|
|
+ this.queryParam.buyerSn = val.key
|
|
|
+ },
|
|
|
+ disabledDate (current) {
|
|
|
+ return current && current > moment().endOf('day')
|
|
|
+ },
|
|
|
+ employeeChange (v) {
|
|
|
+ this.queryParam.employeeSn = v.key
|
|
|
+ },
|
|
|
+ applyDepartmentChange (v) {
|
|
|
+ this.queryParam.applyDepartmentSn = v.key
|
|
|
+ },
|
|
|
+ // 记账名称变化时
|
|
|
+ accountNameSnChange (v, row) {
|
|
|
+ console.log(v, row)
|
|
|
+ this.form.accountNameSn = v.key
|
|
|
+ // if (this.form.accountType == 'CUSTOMER') {
|
|
|
+ // this.form.accountNameSn = v.key
|
|
|
+ // if (row) {
|
|
|
+ // this.form.provinceSn = row.provinceSn
|
|
|
+ // this.form.citySn = row.citySn
|
|
|
+ // this.form.provinceName = row.provinceName
|
|
|
+ // this.form.cityName = row.cityName
|
|
|
+ // if (row.subareaNameSet) {
|
|
|
+ // this.form.subareaName = row.subareaNameSet.join(',')
|
|
|
+ // this.form.subareaSn = this.$refs.subareaBox.getValByName(row.subareaNameSet)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.ruleForm.validateField('accountNameSn')
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 费用承担方类型
|
|
|
+ splitObjTypeChange (val) {
|
|
|
+ console.log(val)
|
|
|
+ // // 只有部门有承担人员
|
|
|
+ // this.$set(row, 'childDetailSplitList', row.splitObjType == 'DEPARTMENT' ? [{
|
|
|
+ // splitObjType: 'DEPARTMENT',
|
|
|
+ // splitObjSn: undefined,
|
|
|
+ // splitAmount: 0
|
|
|
+ // }] : [])
|
|
|
+ // if (row.splitObjType == 'CUSTOMER') {
|
|
|
+ // this.$set(row, 'splitObjSn', undefined)
|
|
|
+ // this.$refs['custList-' + row.no].dealerName = []
|
|
|
+ // }
|
|
|
+ // this.$emit('fyTotal', this.fyTotal())
|
|
|
+ },
|
|
|
+ // 导出
|
|
|
+ handleExport () {
|
|
|
+ const _this = this
|
|
|
+ const params = _this.queryParam
|
|
|
+ _this.exportLoading = true
|
|
|
+ _this.spinning = true
|
|
|
+ hdExportExcel(expenseAcctDetailReport, params, '费用报销明细统计报表', function () {
|
|
|
+ _this.exportLoading = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
+ this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
+ this.queryParam = {
|
|
|
+ queryParam: {
|
|
|
+ expenseDate: '', // 月份
|
|
|
+ beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ expenseAccountNo: '', // 费用单号
|
|
|
+ applyPersonSn: undefined, // 申请人
|
|
|
+ applyDepartmentSn: undefined, // 申请部门
|
|
|
+ expenseType: undefined, // 费用类型
|
|
|
+ accountType: undefined, // 记账类型
|
|
|
+ accountNameSn: undefined, // 记账名称
|
|
|
+ splitObjType: undefined, // 费用承担方类型
|
|
|
+ splitObjSn: undefined, // 费用承担方
|
|
|
+ childSplitObjSn: undefined, // 费用承担人
|
|
|
+ subareaSn: undefined,
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ provinceSn: undefined,
|
|
|
+ citySn: undefined
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 310
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ advanced (newValue, oldValue) {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ // 仅刷新列表,不重置页面
|
|
|
+ if (this.$store.state.app.updateList) {
|
|
|
+ this.pageInit()
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="less">
|
|
|
+ .expenseReimbursementDetailList-wrap{
|
|
|
+ .sTable{
|
|
|
+ margin-top: 10px;
|
|
|
+ .badge-con-t{
|
|
|
+ .ant-badge-count{
|
|
|
+ transform: scale(0.8);
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|