|
@@ -1,8 +1,276 @@
|
|
|
<template>
|
|
|
+ <div class="fundAcountDetail-wrap">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="fundAcountDetail-back" v-if="pageType=='pages'">
|
|
|
+ <!-- 自定义的二级文字标题 -->
|
|
|
+ <template slot="subTitle">
|
|
|
+ <a id="fundAcountDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
+ </template>
|
|
|
+ </a-page-header>
|
|
|
+ <a-card size="small" :bordered="false">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="单据类型">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.state"
|
|
|
+ ref="state"
|
|
|
+ id="fundAcountDetail-state"
|
|
|
+ code="EXPENSE_AUDIT_TYPE"
|
|
|
+ placeholder="请选择单据类型"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="关联单据号">
|
|
|
+ <a-input id="fundAcountDetail-accountExpensesNo" v-model.trim="queryParam.accountExpensesNo" allowClear placeholder="请输入关联单据号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="操作时间">
|
|
|
+ <rangeDate id="fundAcountDetail-accountExpensesNo" ref="rangeDate" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="往来单位">
|
|
|
+ <a-input id="fundAcountDetail-accountExpensesNo" v-model.trim="queryParam.accountExpensesNo" allowClear placeholder="请输入往来单位名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <span class="table-page-search-submitButtons">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="fundAcountDetail-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="fundAcountDetail-reset">重置</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+84.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 结算金额 -->
|
|
|
+ <template slot="accountExpensesNo" slot-scope="text, record">
|
|
|
+ {{ text }}
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ </a-spin>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import { settleExpenseQuery, delExpense, settleExpenseQuerySum, auditExpense } from '@/api/settleExpense'
|
|
|
+import { costTypeAllQuery } from '@/api/costType'
|
|
|
+export default {
|
|
|
+ name: 'ExpenseManagementList',
|
|
|
+ components: { STable, VSelect, rangeDate },
|
|
|
+ mixins: [commonMixin],
|
|
|
+ props: {
|
|
|
+ pageType: { // 页面表现形式,pages 新页签打开的页面,modal 弹框里的页面
|
|
|
+ type: String,
|
|
|
+ default: 'pages'
|
|
|
+ },
|
|
|
+ paramsData: {
|
|
|
+ type: Object,
|
|
|
+ default: function () {
|
|
|
+ return null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ saveing: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ advanced: true, // 高级搜索 展开/关闭
|
|
|
+ costTypeList: [], // 费用类型
|
|
|
+ costType: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ beginDate: '',
|
|
|
+ endDate: '',
|
|
|
+ accountExpensesNo: '',
|
|
|
+ expensesTypeSn1: '',
|
|
|
+ expensesTypeSn2: '',
|
|
|
+ expensesTypeSn3: '',
|
|
|
+ state: '',
|
|
|
+ settleState: ''
|
|
|
+ },
|
|
|
+ // 表头
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
+ { title: '单据类型', scopedSlots: { customRender: 'expensesType' }, width: '20%', align: 'center' },
|
|
|
+ { title: '关联单据号', dataIndex: 'accountExpensesNo', width: '20%', align: 'center' },
|
|
|
+ { title: '操作时间', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作人', dataIndex: 'czr', width: '20%', align: 'center' },
|
|
|
+ { title: '往来单位', dataIndex: 'accountExpensesNo', width: '20%', align: 'center' },
|
|
|
+ { title: '结算金额', scopedSlots: { customRender: 'accountExpensesNo' }, dataIndex: 'settleAmount', width: '10%', align: 'center' }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ return settleExpenseQuery(Object.assign(parameter, this.queryParam)).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
|
|
|
+ // 费用类型
|
|
|
+ if (this.costTypeList.length == 0) {
|
|
|
+ this.getCostTypeList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openModal: false, // 查看详情 弹框
|
|
|
+ itemId: '' // 当前id
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
+ },
|
|
|
+ // 递归函数
|
|
|
+ recursionFun (data) {
|
|
|
+ if (data) {
|
|
|
+ data.map((item, index) => {
|
|
|
+ if (item.children && item.children.length == 0) {
|
|
|
+ delete item.children
|
|
|
+ } else {
|
|
|
+ this.recursionFun(item.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取费用类型数据
|
|
|
+ getCostTypeList () {
|
|
|
+ costTypeAllQuery({}).then(res => {
|
|
|
+ // 递归去除空children
|
|
|
+ this.recursionFun(res.data)
|
|
|
+ this.costTypeList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 费用类型 change
|
|
|
+ changeCostType (val, opt) {
|
|
|
+ this.queryParam.expensesTypeSn1 = val[0] ? val[0] : ''
|
|
|
+ this.queryParam.expensesTypeSn2 = val[1] ? val[1] : ''
|
|
|
+ this.queryParam.expensesTypeSn3 = val[2] ? val[2] : ''
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ this.queryParam.accountExpensesNo = ''
|
|
|
+ this.queryParam.expensesTypeSn1 = ''
|
|
|
+ this.queryParam.expensesTypeSn2 = ''
|
|
|
+ this.queryParam.expensesTypeSn3 = ''
|
|
|
+ this.queryParam.state = ''
|
|
|
+ this.queryParam.settleState = ''
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ this.costType = []
|
|
|
+ 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 - 270
|
|
|
+ },
|
|
|
+ // 返回
|
|
|
+ handleBack () {
|
|
|
+ if (this.pageType == 'pages') {
|
|
|
+ this.$router.push({ name: 'fundAccountList' })
|
|
|
+ } else {
|
|
|
+ this.$emit('cansel')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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>
|
|
|
+<style lang="less">
|
|
|
+ .fundAcountDetail-wrap{
|
|
|
+ .fundAcountDetail-back{
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .sTable{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .active{
|
|
|
+ color: #ed1c24;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .common{
|
|
|
+ color: rgba(0, 0, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|